liweidong
liweidong-hj 5 days ago
commit ec13ac5b5f
  1. 2
      blade-service-api/blade-desk-api/src/main/java/org/springblade/desk/basic/pojo/vo/PlatingVO.java
  2. 14
      blade-service/blade-desk/src/main/java/org/springblade/desk/basic/controller/PlatingController.java
  3. 10
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsDosingRecEntity.java
  4. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsEpciuPatrolInspectionEntity.java
  5. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/pojo/entity/BsSafePatrolInspectionEntity.java
  6. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsDosingRecServiceImpl.java
  7. 4
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsSafePatrolInspectionServiceImpl.java
  8. 12
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/controller/PdaLoadController.java
  9. 29
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/controller/PdaSaveController.java
  10. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/PdaLoadServiceImpl.java
  11. 76
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/PdaSaveServiceImpl.java
  12. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/quality/controller/InspectionTaskController.java

@ -26,7 +26,7 @@ public class PlatingVO extends Plating {
* [镀种分类]Name * [镀种分类]Name
*/ */
@Schema(description = "[镀种分类]Name") @Schema(description = "[镀种分类]Name")
private Long bcName; private String bcName;
/** /**
* [镀种小类]Name * [镀种小类]Name
*/ */

@ -48,6 +48,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -104,9 +105,20 @@ public class PlatingController extends BladeController {
qw.orderByAsc(BaseCol.ID); qw.orderByAsc(BaseCol.ID);
IPage<Plating> pages = service.page(Condition.getPage(query), qw); IPage<Plating> pages = service.page(Condition.getPage(query), qw);
IPage<PlatingVO> pagesVO = PlatingWrapper.build().pageVO(pages); IPage<PlatingVO> pagesVO = PlatingWrapper.build().pageVO(pages);
//bcId
//镀种ID , 镀种名称
Set<Long> bcIds = pagesVO.getRecords().stream().map(PlatingVO::getBcId).collect(Collectors.toSet());
Map<Long, String> bcIdAndName = basicClazzService
.listByIds(bcIds)
.stream()
.collect(Collectors.toMap(BasicClazz::getId, BasicClazz::getName));
//basicClazzService
pagesVO.getRecords() pagesVO.getRecords()
.stream() .stream()
.peek(service::setVOValue) .peek( s -> {
s.setBcName(bcIdAndName.getOrDefault(s.getBcId(), "-1"));
service.setVOValue(s);
})
.collect(Collectors.toList()); .collect(Collectors.toList());
return R.data(pagesVO); return R.data(pagesVO);
} }

@ -25,6 +25,7 @@
*/ */
package org.springblade.desk.energy.pojo.entity; package org.springblade.desk.energy.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -91,18 +92,18 @@ public class BsDosingRecEntity extends BaseEntity {
/** /**
* 处理类型 * 处理类型
*/ */
//@Schema(description = "处理类型") @Schema(description = "处理类型")
private Long handleResult; private Long handleResult;
/** /**
* 类型1废气加药2废水加药 * 类型1废气加药2废水加药
*/ */
//@Schema(description = "类型:1、废气加药;2、废水加药") @Schema(description = "类型:1、废气加药;2、废水加药")
private String dorType; private String dorType;
/** /**
* 酸雾塔 * 酸雾塔
*/ */
//@Schema(description = "酸雾塔") @Schema(description = "酸雾塔")
private Long btId; private Long btId;
@ -138,4 +139,7 @@ public class BsDosingRecEntity extends BaseEntity {
handleResultMap.put(HANDLE_RESULT_WAIT, "待处理"); handleResultMap.put(HANDLE_RESULT_WAIT, "待处理");
handleResultMap.put(HANDLE_RESULT_PDA, "PDA已处理"); handleResultMap.put(HANDLE_RESULT_PDA, "PDA已处理");
} }
@TableField(exist = false)
private String btCode;
} }

@ -116,6 +116,9 @@ public class BsEpciuPatrolInspectionEntity extends BaseEntity {
@Schema(description = "巡检点类型") @Schema(description = "巡检点类型")
private String insType; private String insType;
@Schema(description = "图片地址")
private String path;
/** /**
* 待检 * 待检
*/ */

@ -111,6 +111,8 @@ public class BsSafePatrolInspectionEntity extends BaseEntity {
*/ */
@Schema(description = "任务状态:1、已检,2、待检,3、未准时完成") @Schema(description = "任务状态:1、已检,2、待检,3、未准时完成")
private String taskStatus; private String taskStatus;
@Schema(description = "图片地址")
private String path;
///** ///**
// * 待检 // * 待检

@ -128,7 +128,9 @@ public class BsDosingRecServiceImpl extends BaseServiceImpl<BsDosingRecMapper, B
.eq(BsDosingRecEntity::getHandleResult, HANDLE_RESULT_WAIT) .eq(BsDosingRecEntity::getHandleResult, HANDLE_RESULT_WAIT)
.orderByDesc(BsDosingRecEntity::getDosingTime)); .orderByDesc(BsDosingRecEntity::getDosingTime));
if (bsDosingRecEntities.size() > 0) { if (bsDosingRecEntities.size() > 0) {
return bsDosingRecEntities.get(0); BsDosingRecEntity bsDosingRecEntity = bsDosingRecEntities.get(0);
bsDosingRecEntity.setBtCode(code);
return bsDosingRecEntity;
} else { } else {
throw new RuntimeException("未查询到有效数据"); throw new RuntimeException("未查询到有效数据");
} }

@ -25,6 +25,7 @@
*/ */
package org.springblade.desk.energy.service.impl; package org.springblade.desk.energy.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@ -120,6 +121,9 @@ public class BsSafePatrolInspectionServiceImpl extends BaseServiceImpl<BsSafePat
List<BsSafeInspectionPointEntity> bsSafeInspectionPointEntities = bsSafeInspectionPointService.listByCode(code); List<BsSafeInspectionPointEntity> bsSafeInspectionPointEntities = bsSafeInspectionPointService.listByCode(code);
List<Long> ipIds = bsSafeInspectionPointEntities.stream().map(BsSafeInspectionPointEntity::getId).toList(); List<Long> ipIds = bsSafeInspectionPointEntities.stream().map(BsSafeInspectionPointEntity::getId).toList();
if (CollUtil.isEmpty(ipIds)){
return CollUtil.newArrayList();
}
return list(Wrappers.lambdaQuery(BsSafePatrolInspectionEntity.class) return list(Wrappers.lambdaQuery(BsSafePatrolInspectionEntity.class)
.in(BsSafePatrolInspectionEntity::getIpId, ipIds) .in(BsSafePatrolInspectionEntity::getIpId, ipIds)
.eq(BsSafePatrolInspectionEntity::getTaskStatus, BsSafePatrolInspectionEntity.PREPARE_TEXT) .eq(BsSafePatrolInspectionEntity::getTaskStatus, BsSafePatrolInspectionEntity.PREPARE_TEXT)

@ -116,26 +116,26 @@ public class PdaLoadController {
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
@Operation(summary = "根据巡检器编码查询数据,查询安全巡检任务", description = "") @Operation(summary = "根据巡检器编码查询数据,查询安全巡检任务", description = "")
@GetMapping("/getInspectionByEcCode/{code}") @GetMapping("/getInspectionByEcCode/{code}")
public ResultInfo getInspectionByEcCode(@PathVariable String code, HttpServletRequest request) throws Exception { public R getInspectionByEcCode(@PathVariable String code, HttpServletRequest request) throws Exception {
return ResultInfo.ok(pdaLoadService.getInspectionByEcCode(code, true,request)); return R.data(pdaLoadService.getInspectionByEcCode(code, true,request));
} }
@Operation(summary = "根据巡检器编码查询环保巡检数据", description = "") @Operation(summary = "根据巡检器编码查询环保巡检数据", description = "")
@PostMapping("/getInspectionBySan") @PostMapping("/getInspectionBySan")
public ResultInfo getInspectionBySan(@RequestBody JSONObject data) throws Exception { public R getInspectionBySan(@RequestBody JSONObject data) throws Exception {
Short eipType = data.getShort("eipType"); Short eipType = data.getShort("eipType");
String code = data.getString("code"); String code = data.getString("code");
return ResultInfo.ok(pdaLoadService.getInspectionBySan(code, eipType)); return R.data(pdaLoadService.getInspectionBySan(code, eipType));
} }
@Operation(summary = "根据酸雾塔编码查询数据", description = "") @Operation(summary = "根据酸雾塔编码查询数据", description = "")
@GetMapping("/epDosingRecByCode/{code}") @GetMapping("/epDosingRecByCode/{code}")
public ResultInfo epDosingRecByCode(@PathVariable String code) throws Exception { public R epDosingRecByCode(@PathVariable String code) throws Exception {
return ResultInfo.ok(pdaLoadService.epDosingRecByCode(code)); return R.data(pdaLoadService.epDosingRecByCode(code));
} }
} }

@ -1,5 +1,6 @@
package org.springblade.desk.produce.controller; package org.springblade.desk.produce.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -24,6 +25,7 @@ import org.springblade.desk.produce.service.IPdaSaveService;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @ClassName PdaLoadController * @ClassName PdaLoadController
@ -137,36 +139,43 @@ public class PdaSaveController {
@Operation(summary = "安全巡检处理,修改安全巡检任务", description = "") @Operation(summary = "安全巡检处理,修改安全巡检任务", description = "")
@PostMapping(value = "/saveByInspection") @PostMapping(value = "/saveByInspection")
public ResultInfo saveSafetyInspection(@RequestBody JSONObject params) throws Exception { public R saveSafetyInspection(@RequestBody JSONObject params) throws Exception {
if (params == null || params.size() == 0) { if (params == null || params.size() == 0) {
throw new BusinessException("参数传递异常!"); throw new BusinessException("参数传递异常!");
} }
String code = params.getString("code"); String code = params.getString("code");
String man = params.getString("reviewMan"); //String man = params.getString("reviewMan");
String memo = params.getString("memo"); String memo = params.getString("memo");
JSONArray path = params.getJSONArray("path");
String pathStr = null;
if (path != null && path.size() > 0) {
pathStr = path.stream().map(Object::toString).collect(Collectors.joining(","));
}
if (code == null || man == null) { if (code == null
//|| man == null
) {
throw new BusinessException("参数传递异常!"); throw new BusinessException("参数传递异常!");
} }
log.info("安全巡检处理传递参数---编码:" + code + " 人员:" + man + " 备注:" + memo); log.info("安全巡检处理传递参数---编码:" + code + " 备注:" + memo);
pdaSaveService.saveSafetyInspection(code, man, memo); pdaSaveService.saveSafetyInspection(code, memo,pathStr);
return ResultInfo.ok(); return R.success();
} }
@Operation(summary = "环保巡检检验", description = "") @Operation(summary = "环保巡检检验", description = "")
@RequestMapping(value = "/savePatrolIns", method = RequestMethod.POST) @RequestMapping(value = "/savePatrolIns", method = RequestMethod.POST)
public ResultInfo savePatrolIns(@RequestBody BsEpciuPatrolInspectionEntity epPatrolInspection) { public R savePatrolIns(@RequestBody BsEpciuPatrolInspectionEntity epPatrolInspection) {
pdaSaveService.savePatrolIns(epPatrolInspection); pdaSaveService.savePatrolIns(epPatrolInspection);
return ResultInfo.ok(); return R.success();
} }
@Operation(summary = "酸雾塔报警处理", description = "") @Operation(summary = "酸雾塔报警处理", description = "")
@PostMapping("/saveEpDosingRec") @PostMapping("/saveEpDosingRec")
public ResultInfo saveEpDosingRec(@RequestBody BsDosingRecEntity epDosingRec, HttpServletRequest request) throws Exception { public R saveEpDosingRec(@RequestBody BsDosingRecEntity epDosingRec, HttpServletRequest request) throws Exception {
pdaSaveService.saveEpDosingRec(epDosingRec); pdaSaveService.saveEpDosingRec(epDosingRec);
return ResultInfo.ok(); return R.success();
} }
} }

@ -453,12 +453,13 @@ public class PdaLoadServiceImpl extends BaseServiceImpl<WorkPlanMapper, WorkPlan
List<BsSafePatrolInspectionEntity> piList = inspectionService.getByCode(code); List<BsSafePatrolInspectionEntity> piList = inspectionService.getByCode(code);
piList = piList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> piList = piList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() ->
new TreeSet<>(Comparator.comparing(BsSafePatrolInspectionEntity::getIpId))), ArrayList::new)); new TreeSet<>(Comparator.comparing(BsSafePatrolInspectionEntity::getIpId))), ArrayList::new));
if (piList == null || piList.size() == 0) { if (null == piList || piList.size() == 0) {
if (flag) { if (flag) {
throw new RuntimeException("未查询到安全巡检任务,product.noPatrolCheckTask"); throw new RuntimeException("未查询到安全巡检任务,product.noPatrolCheckTask");
} }
} }
return piList; //配合前端显示
return List.of(piList.get(0));
} }

@ -14,6 +14,7 @@ import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.desk.dashboard.pojo.entity.*; import org.springblade.desk.dashboard.pojo.entity.*;
@ -826,22 +827,71 @@ public class PdaSaveServiceImpl extends BaseServiceImpl<WorkPlanMapper, WorkPlan
} }
} }
/**
* TODO: 2026/4/23 参考旧mes 接口 /webapi/saveSafetyInspection
* {
* // 根据编码去拿未检验的数据
*
* List<SafePatrolInspection> spiList = safePatrolInspectionDao.getByCode(code);
*
* if (spiList == null || spiList.size() == 0) {
* throw new BusinessException("根据编码未找到需要处理数据");
* }
*
* PfUserInfo userByLdapName = epDosingRecDao.getUserByLdapName(man);
*
* if (userByLdapName == null || userByLdapName.getUserId() == null) {
* throw new BusinessException("根据域账号未找到对应的处理人");
* }
*
* Date date = new Date();
* for (SafePatrolInspection safePatrolInspection : spiList) {
* // 如果在一个小时内将生成的任务处理掉那么算准时完成,在一个小时以后并且下个任务未生成之前处理 算未准时完成,如果在下个任务生成时还未处理算缺卡,并将任务改为缺卡,7点生成的任务除外特殊算(8点查询有任务改为缺卡)
*
* // 不超过一个小时算正常检验
* if (new Date().getTime() - safePatrolInspection.getLaunchTime().getTime() <= 60 * 60 * 1000) {
* safePatrolInspection.setTaskStatus(SafePatrolInspection.CHECKED);
* }else {
* // 超过一个小时但是下个任务并没有触发
* int hours = safePatrolInspection.getLaunchTime().getHours();
* int hours1 = new Date().getHours();
* if (hours == 0 && hours1 < 2) {
* safePatrolInspection.setTaskStatus(SafePatrolInspection.NOT_ON_TIME);
* } else if (hours == 2 && hours1 < 5) {
* safePatrolInspection.setTaskStatus(SafePatrolInspection.NOT_ON_TIME);
* } else if (hours == 5 && hours1 < 7) {
* safePatrolInspection.setTaskStatus(SafePatrolInspection.NOT_ON_TIME);
* } else if (hours == 7 && hours1 < 8) {
* safePatrolInspection.setTaskStatus(SafePatrolInspection.NOT_ON_TIME);
* } else {
* // 超过一个小时但是下个任务已触发
* safePatrolInspection.setTaskStatus(SafePatrolInspection.NO_CHECK);
* }
* }
* safePatrolInspection.setTestTime(date);
* safePatrolInspection.setInsMan(userByLdapName);
* safePatrolInspection.setParMemo(memo);
* SafeInspectionPoint safeInspectionPoint = safeInspectionPointService.getByKey(safePatrolInspection.getIpId());
* safeInspectionPoint.setLastInsCycle(date);
* this.updateOldPatrol(safePatrolInspection.getIpId(), safePatrolInspection.getLaunchTime(), userByLdapName.getUserId());
* }
* }
* */
@Override @Override
public void saveSafetyInspection(String code, String man, String memo) { public void saveSafetyInspection(String code, String memo,String pathStr) {
// 根据编码去拿未检验的数据 // 根据编码去拿未检验的数据
List<BsSafePatrolInspectionEntity> spiList = inspectionService.getByCode(code); List<BsSafePatrolInspectionEntity> spiList = inspectionService.getByCode(code);
if (spiList == null || spiList.size() == 0) { if (spiList == null || spiList.size() == 0) {
throw new RuntimeException("根据编码未找到需要处理数据"); throw new RuntimeException("根据编码未找到需要处理数据");
} }
List<User> users = userClient.listByNameNolike(man); //List<User> users = userClient.listByNameNolike(man);
//
if (CollUtil.isEmpty(users)) { //if (CollUtil.isEmpty(users)) {
throw new RuntimeException("根据域账号未找到对应的处理人"); // throw new RuntimeException("根据域账号未找到对应的处理人");
} //}
User user = users.get(0); //User user = users.get(0);
BladeUser user = AuthUtil.getUser();
Date date = new Date(); Date date = new Date();
for (BsSafePatrolInspectionEntity safePatrolInspection : spiList) { for (BsSafePatrolInspectionEntity safePatrolInspection : spiList) {
@ -866,11 +916,15 @@ public class PdaSaveServiceImpl extends BaseServiceImpl<WorkPlanMapper, WorkPlan
} }
} }
safePatrolInspection.setTestTime(date); safePatrolInspection.setTestTime(date);
safePatrolInspection.setInsMan(man); safePatrolInspection.setInsMan(user.getUserName());
safePatrolInspection.setParMemo(memo); safePatrolInspection.setParMemo(memo);
safePatrolInspection.setPath(pathStr);
// // TODO: 区别旧mes 显示修改 inspectionService.updateById(safePatrolInspection);bsSafeInspectionPointService.updateById(safeInspectionPoint);
inspectionService.updateById(safePatrolInspection);
BsSafeInspectionPointEntity safeInspectionPoint = bsSafeInspectionPointService.getByKey(safePatrolInspection.getIpId()); BsSafeInspectionPointEntity safeInspectionPoint = bsSafeInspectionPointService.getByKey(safePatrolInspection.getIpId());
safeInspectionPoint.setLastInsCycle(date); safeInspectionPoint.setLastInsCycle(date);
inspectionService.updateOldPatrol(safePatrolInspection.getIpId(), safePatrolInspection.getLaunchTime(), user.getId()); bsSafeInspectionPointService.updateById(safeInspectionPoint);
inspectionService.updateOldPatrol(safePatrolInspection.getIpId(), safePatrolInspection.getLaunchTime(), user.getUserId());
} }
} }

@ -503,7 +503,6 @@ public class InspectionTaskController extends BladeController {
List<MesRbFilePreserveSlotEntity> preserveSlotList = new ArrayList<>(); List<MesRbFilePreserveSlotEntity> preserveSlotList = new ArrayList<>();
QueryWrapper<MesRbFilePreserveSlotEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<MesRbFilePreserveSlotEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("RFP_ID", rfpId); queryWrapper.eq("RFP_ID", rfpId);
queryWrapper.orderByDesc("create_time");
preserveSlotList = mesRbFilePreserveSlotService.list(queryWrapper); preserveSlotList = mesRbFilePreserveSlotService.list(queryWrapper);
// QueryWrapper<WorkPlan> queryWrapper = new QueryWrapper<>(); // QueryWrapper<WorkPlan> queryWrapper = new QueryWrapper<>();
@ -546,7 +545,9 @@ public class InspectionTaskController extends BladeController {
dsRbFilePreserveSlot.setChildrenList(childrenListNew); dsRbFilePreserveSlot.setChildrenList(childrenListNew);
} }
} }
preserveSlotList.sort(Comparator.comparing(MesRbFilePreserveSlotEntity::getSlotIndex)); preserveSlotList.sort(Comparator.comparing(
e -> Integer.parseInt(e.getSlotIndex())
));
obj.put("preserveSlotList",preserveSlotList); obj.put("preserveSlotList",preserveSlotList);
obj.put("insertIndex",insertIndex); obj.put("insertIndex",insertIndex);
return R.data(obj); return R.data(obj);

Loading…
Cancel
Save