liweidong
张乾翔 1 day ago
parent 416f6857d9
commit 3bc68018a8
  1. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/IBsEpciuPatrolInspectionService.java
  2. 18
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsDosingRecServiceImpl.java
  3. 16
      blade-service/blade-desk/src/main/java/org/springblade/desk/energy/service/impl/BsEpciuPatrolInspectionServiceImpl.java
  4. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/controller/PdaSaveController.java
  5. 2
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/PdaLoadServiceImpl.java

@ -62,7 +62,7 @@ public interface IBsEpciuPatrolInspectionService extends BaseService<BsEpciuPatr
void epInspectionTasks(boolean b);
List<BsEpciuPatrolInspectionEntity> ListPi(String code,Short eipType);
BsEpciuPatrolInspectionEntity ListPi(String code,Short eipType);
void savePatrolIns(BsEpciuPatrolInspectionEntity epPatrolInspection);

@ -25,6 +25,7 @@
*/
package org.springblade.desk.energy.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import jakarta.annotation.Resource;
@ -119,11 +120,18 @@ public class BsDosingRecServiceImpl extends BaseServiceImpl<BsDosingRecMapper, B
* */
List<BsTowerEntity> bsTowers = iBsTowerService.list(code);
List<Long> towerIds = bsTowers.stream().map(BsTowerEntity::getId).toList();
return list(Wrappers.lambdaQuery(BsDosingRecEntity.class)
.in(BsDosingRecEntity::getBtId,towerIds)
.orderByDesc(BsDosingRecEntity::getDosingTime)
.last("limit 1"));
if (CollUtil.isEmpty(towerIds)){
throw new RuntimeException("未查询到有酸雾塔报警点配置");
}
List<BsDosingRecEntity> bsDosingRecEntities = list(Wrappers.lambdaQuery(BsDosingRecEntity.class)
.in(BsDosingRecEntity::getBtId, towerIds)
.eq(BsDosingRecEntity::getHandleResult, HANDLE_RESULT_WAIT)
.orderByDesc(BsDosingRecEntity::getDosingTime));
if (bsDosingRecEntities.size() > 0) {
return bsDosingRecEntities.get(0);
} else {
throw new RuntimeException("未查询到有效数据");
}
}
}

@ -155,7 +155,7 @@ public class BsEpciuPatrolInspectionServiceImpl extends BaseServiceImpl<BsEpciuP
}
@Override
public List<BsEpciuPatrolInspectionEntity> ListPi(String code, Short eipType) {
public BsEpciuPatrolInspectionEntity ListPi(String code, Short eipType) {
//String sql = "select*from(SELECT a.* FROM EP_PATROL_INSPECTION a INNER join " +
// "EP_INSPECTION_POINT b ON a.ip_id = b.eip_id WHERE b.patrol_register =:code AND a.task_status =:taskStatus AND b.eip_type =:eipType " +
// "ORDER BY a.launch_time DESC )where rownum<2 ";
@ -167,13 +167,21 @@ public class BsEpciuPatrolInspectionServiceImpl extends BaseServiceImpl<BsEpciuP
List<BsEpciuInspectionPointEntity> safeInspectionPointList = bsEpciuInspectionPointService.listByCode(code);
List<Long> safeInspectionPointIdList = safeInspectionPointList.stream().map(BsEpciuInspectionPointEntity::getId).toList();
return list(Wrappers.lambdaQuery(BsEpciuPatrolInspectionEntity.class)
if (safeInspectionPointIdList.isEmpty()) {
throw new RuntimeException("未查询到有效的巡检点数据");
}
List<BsEpciuPatrolInspectionEntity> list = list(Wrappers.lambdaQuery(BsEpciuPatrolInspectionEntity.class)
.in(BsEpciuPatrolInspectionEntity::getEpcId, safeInspectionPointIdList)
.eq(BsEpciuPatrolInspectionEntity::getInsType, eipType)
//旧mes中查询待检状态任务
.eq(BsEpciuPatrolInspectionEntity::getTaskStatus, BsEpciuPatrolInspectionEntity.PREPARE_TEXT.toString())
.orderByDesc(BsEpciuPatrolInspectionEntity::getLaunchTime)
.last("rownum<2"));
.orderByDesc(BsEpciuPatrolInspectionEntity::getLaunchTime));
if (list.size() > 0) {
return list.get(0);
} else {
throw new RuntimeException("未查询到有效数据");
}
}
@Override

@ -137,8 +137,7 @@ public class PdaSaveController {
@Operation(summary = "安全巡检处理,修改安全巡检任务", description = "")
@PostMapping(value = "/saveByInspection")
public ResultInfo saveSafetyInspection(HttpServletRequest request) throws Exception {
JSONObject params = (JSONObject) request.getAttribute(Constant.WEBAPI_REQUEST_PARAMETERS);
public ResultInfo saveSafetyInspection(@RequestBody JSONObject params) throws Exception {
if (params == null || params.size() == 0) {
throw new BusinessException("参数传递异常!");
}
@ -157,7 +156,7 @@ public class PdaSaveController {
@Operation(summary = "环保巡检检验", description = "")
@RequestMapping(value = "/savePatrolIns", method = RequestMethod.POST)
public ResultInfo savePatrolIns(@RequestBody BsEpciuPatrolInspectionEntity epPatrolInspection, HttpServletRequest request) {
public ResultInfo savePatrolIns(@RequestBody BsEpciuPatrolInspectionEntity epPatrolInspection) {
pdaSaveService.savePatrolIns(epPatrolInspection);

@ -455,7 +455,7 @@ public class PdaLoadServiceImpl extends BaseServiceImpl<WorkPlanMapper, WorkPlan
new TreeSet<>(Comparator.comparing(BsSafePatrolInspectionEntity::getIpId))), ArrayList::new));
if (piList == null || piList.size() == 0) {
if (flag) {
throw new RuntimeException("product.noPatrolCheckTask", null);
throw new RuntimeException("未查询到安全巡检任务,product.noPatrolCheckTask");
}
}
return piList;

Loading…
Cancel
Save