From 26045b19ebab859c07789fa536e765160b3e6c68 Mon Sep 17 00:00:00 2001 From: ty <1577900710@qq.com> Date: Mon, 5 Aug 2024 08:41:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E6=B5=81=E7=A8=8BinitResult=E5=8E=BB=E9=99=A4=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strategy/abstracts/ProcessAbstractService.java | 33 +++++++++++++--------- .../service/impl/DefectCheckServiceImpl.java | 5 ++++ .../safeproduct/feign/DangerSourceClient.java | 2 +- 3 files changed, 25 insertions(+), 15 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 b39b9f9..cf363e4 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 @@ -45,22 +45,27 @@ public abstract class ProcessAbstractService implements ProcessService { @Override public R startFlow(String userId, String dictValue, String taskId, String processName, Map variables) { log.info("开启流程....."); - R result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); R r = new R(); - r.setCode(result.getCode()); - r.setMsg(result.getMsg()); - // 更新任务流程Id - if (result.isSuccess()) { - log.info("开启流程成功:{}",variables); - BladeFlow flow = result.getData(); - r.setData(flow.getProcessInstanceId()); - } else { - log.error("开启流程失败:{}",result); - log.error("流程信息为{}",variables); - r.setData(variables); - pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg()); + try { + R result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); + r.setCode(result.getCode()); + r.setMsg(result.getMsg()); + // 更新任务流程Id + if (result.isSuccess()) { + log.info("开启流程成功:{}",variables); + BladeFlow flow = result.getData(); + r.setData(flow.getProcessInstanceId()); + } else { + log.error("开启流程失败:{}",result); + log.error("流程信息为{}",variables); + r.setData(variables); + pushStartFailMessage(dictValue,Long.valueOf(taskId),userId,processName,result.getMsg()); + } + return r; + }catch (Exception e){ + log.error(e.toString()) ; } - return r; + return R.fail("开启流程失败"); } // public R compensateFlow(String userId,String dictValue,String taskId,String processName,Map variables) { // R result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); 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 f9f93c9..859f999 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 @@ -112,6 +112,11 @@ public class DefectCheckServiceImpl extends ServiceImpl","")); + entity.setInitResult( entity.getInitResult().replaceAll("

","")); + } R r=new R(); //加锁 Boolean lock = redisTemplate.opsForValue().setIfAbsent("SysUserLock" + entity.getCreateDept(), entity.getCreateDept(), 30, TimeUnit.SECONDS); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java index 35e26dd..80d0831 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/feign/DangerSourceClient.java @@ -31,7 +31,7 @@ public class DangerSourceClient implements IDangerSourceClient { @Override @GetMapping(DETAILS) - public List details(@RequestParam String[] ids) { + public List details(@RequestParam("ids") String[] ids) { List resp = service.listByIds(Arrays.asList(ids)); //未查到数据返回空集合 if (CollectionUtils.isEmpty(resp)) {