From a25ee545117a2cb0e03511fe19858d7302237a14 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Mon, 5 Aug 2024 15:14:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E6=B5=81=E7=A8=8B=E5=85=A5=E5=BA=93=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strategy/abstracts/ProcessAbstractService.java | 1 + .../defect/service/impl/DefectCheckServiceImpl.java | 4 +++- hzims-service/ticket/src/main/resources/db/3.0.0.sql | 11 ++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java index cf363e4..9952839 100644 --- a/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java +++ b/hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java @@ -48,6 +48,7 @@ public abstract class ProcessAbstractService implements ProcessService { R r = new R(); try { R result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); + r.setSuccess(result.isSuccess()); r.setCode(result.getCode()); r.setMsg(result.getMsg()); // 更新任务流程Id diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java index 859f999..f0355a4 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java @@ -373,7 +373,9 @@ public class DefectCheckServiceImpl extends ServiceImpl Date: Mon, 5 Aug 2024 19:19:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E8=AF=8A=E6=96=AD=E9=A1=B5=E9=9D=A2=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fdp/service/impl/FdpListTableDataServiceImpl.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java index 31765d8..79864ea 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java @@ -14,10 +14,14 @@ import com.hnac.hzims.operational.station.entity.StationEntity; import com.hnac.hzims.operational.station.feign.IStationClient; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; +import org.springblade.system.entity.Dept; +import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -40,6 +44,8 @@ import java.util.Map; public class FdpListTableDataServiceImpl implements IFdpListTableDataService { @Resource private IStationClient stationClient; + @Resource + private ISysClient sysClient; @Value("${url.getNeoFaultPropertyList}") private String getNeoFaultPropertyList; @Value("${url.getNeoFaultTableData}") @@ -57,17 +63,19 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService { List list = new ArrayList<>(); R> res = JSONObject.parseObject(result, new TypeReference>>() { }); + StationEntity condition = new StationEntity(); + R> stationR = stationClient.list(condition); + if (!stationR.isSuccess()||CollectionUtil.isEmpty(stationR.getData())){ + return R.data(list); + } if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) { - R> listAll = stationClient.getListAll(); - if (listAll.isSuccess() && ObjectUtil.isNotEmpty(listAll.getData())) { for (String s : res.getData()) { - for (StationEntity station : listAll.getData()) { + for (StationEntity station : stationR.getData()) { if (station.getCode().equals(s)) { list.add(station); } } } - } } log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms"); return R.data(list); From c048f619a255818266c939afa10c197ae689b93e Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Mon, 5 Aug 2024 20:21:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E9=9A=90?= =?UTF-8?q?=E6=82=A3=E6=B5=81=E7=A8=8B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InnerDangerFlowServiceImpl.java | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java index b7a69b8..513b05c 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java @@ -69,24 +69,18 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl() {{ - eq(InnerDangerEntity::getCode, innerDangerEntity.getCode()); - last("limit 1"); - }}); - BeanUtil.copy(saveEntity,hiddenDangerVo); - R r = this.startProcess(JSONObject.toJSONString(hiddenDangerVo), HIDDEN_DANGER_CHECK); + String saved = saveEntity(JSONObject.toJSONString(hiddenDangerVo)); + R r = this.startProcess(saved, HIDDEN_DANGER_CHECK); return r; } @Override - @Transactional public String saveEntity(String entity) { - InnerDangerEntity innerDangerEntity= JSONObject.parseObject(entity, InnerDangerEntity.class); + InnerDangerVo hiddenDangerVo= JSONObject.parseObject(entity, InnerDangerVo.class); + InnerDangerEntity innerDangerEntity = new InnerDangerEntity(); + BeanUtil.copy(hiddenDangerVo, innerDangerEntity); if (Func.isEmpty(innerDangerEntity.getCode())) { innerDangerEntity.setCode(UUID.randomUUID().toString()); } @@ -114,7 +108,8 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl" + innerDangerVo.getHiddenDangerName(); + String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerEntity.getHiddenDangerName(); // 开启新的隐患处理流程 Map variable = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(innerDangerVo, DateUtil.PATTERN_DATETIME), Map.class); - R result = processClient.startProcessInstanceContainNameByKey(HIDDEN_DANGER_CHECK, innerDangerVo.getId().toString(), processName, variable); + R result = processClient.startProcessInstanceContainNameByKey(dictValue, innerDangerVo.getId().toString(), processName, variable); // 流程开启失败 if (!result.isSuccess()) { innerDangerEntity.setIsNormal(false); innerDangerEntity.setRemark(JSONObject.toJSONString(variable)); - this.baseMapper.updateById(innerDangerEntity); + this.baseMapper.updateById(innerDangerVo); log.error("隐患处理流程开启失败,错误描述 : {}", result); R r=new R(); r.setCode(result.getCode());