From ba05f52c005fb4a480e43b2c1bd91323bef4e3db Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Thu, 23 Jun 2022 14:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=84=8F=E8=A7=81=E6=94=B6?= =?UTF-8?q?=E9=9B=86=E6=B5=81=E7=A8=8B=E7=9B=B8=E5=85=B3=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawsOpinionGatherEOController.java | 16 +++++++- .../LawsProcessHistoryEOController.java | 18 ++++++++- .../service/ILawsOpinionGatherEOService.java | 9 +++++ .../service/ILawsProcessHistoryEOService.java | 9 +++++ .../impl/LawsOpinionGatherEOServiceImpl.java | 38 +++++++++++++++++++ .../impl/LawsProcessHistoryEOServiceImpl.java | 37 ++++++++++++++++++ .../project/enums/OperatorTypeEnum.java | 3 ++ .../wkflow/controller/workFlowController.java | 3 ++ .../modules/wkflow/enums/FlowTypeEnum.java | 1 + 9 files changed, 131 insertions(+), 3 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java index d14d4172a..922d15e25 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsOpinionGatherEOController.java @@ -4,6 +4,8 @@ import java.util.Arrays; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; import com.jero.common.system.query.QueryGenerator; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; @@ -35,7 +37,7 @@ import com.jero.common.aspect.annotation.AutoLog; public class LawsOpinionGatherEOController extends JeroController { @Autowired private ILawsOpinionGatherEOService lawsOpinionGatherEOService; - + /** * 分页列表查询 * @@ -167,4 +169,16 @@ public class LawsOpinionGatherEOController extends JeroController processCall(@RequestBody JSONObject jsonObject){ + return this.lawsOpinionGatherEOService.processCall(jsonObject); + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsProcessHistoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsProcessHistoryEOController.java index 876aa1187..15ec36e61 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsProcessHistoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/controller/LawsProcessHistoryEOController.java @@ -4,6 +4,8 @@ import java.util.Arrays; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.alibaba.fastjson.JSONObject; import com.jero.common.api.vo.Result; import com.jero.common.system.query.QueryGenerator; import com.jero.modules.lawsOpinionGather.entity.LawsProcessHistoryEO; @@ -35,7 +37,7 @@ import com.jero.common.aspect.annotation.AutoLog; public class LawsProcessHistoryEOController extends JeroController { @Autowired private ILawsProcessHistoryEOService lawsProcessHistoryEOService; - + /** * 分页列表查询 * @@ -167,4 +169,16 @@ public class LawsProcessHistoryEOController extends JeroController processCall(@RequestBody JSONObject jsonObject){ + return this.lawsProcessHistoryEOService.processCall(jsonObject); + } + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsOpinionGatherEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsOpinionGatherEOService.java index cf33efa76..e1a0cbe59 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsOpinionGatherEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsOpinionGatherEOService.java @@ -1,5 +1,7 @@ package com.jero.modules.lawsOpinionGather.service; +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; @@ -58,4 +60,11 @@ public interface ILawsOpinionGatherEOService extends IService queryList(); + + /** + * 流程调用 + * @param jsonObject + * @return + */ + Result processCall(JSONObject jsonObject); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsProcessHistoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsProcessHistoryEOService.java index a0a598e2c..7d52e881e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsProcessHistoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/ILawsProcessHistoryEOService.java @@ -1,5 +1,7 @@ package com.jero.modules.lawsOpinionGather.service; +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; import com.jero.modules.lawsOpinionGather.entity.LawsProcessHistoryEO; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; @@ -58,4 +60,11 @@ public interface ILawsProcessHistoryEOService extends IService queryList(); + + /** + * 流程调用 + * @param jsonObject + * @return + */ + Result processCall(JSONObject jsonObject); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java index 5ff7975ad..f1b8735fd 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsOpinionGatherEOServiceImpl.java @@ -1,8 +1,14 @@ package com.jero.modules.lawsOpinionGather.service.impl; +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.common.exception.JeroBootException; import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO; import com.jero.modules.lawsOpinionGather.mapper.LawsOpinionGatherEOMapper; import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService; +import com.jero.modules.project.enums.OperatorTypeEnum; +import com.jero.modules.project.enums.RequestSourceEnum; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.List; import java.util.Date; @@ -86,4 +92,36 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl queryList() { return list(); } + + @Override + public Result processCall(JSONObject jsonObject) { + String requestSource = jsonObject.getString("requestSource"); + if(StringUtils.isEmpty(requestSource)){ + throw new JeroBootException("请求来源不能为空!"); + } + if(!StringUtils.equals(requestSource, RequestSourceEnum.WORK_FLOW.getValue())){ + throw new JeroBootException("来源有误,没有权限调用该接口!"); + } + + String operatorType = jsonObject.getString("operatorType"); + if(StringUtils.isEmpty(operatorType)){ + throw new JeroBootException("操作类型不能为空!"); + } + + if(StringUtils.equals(operatorType, OperatorTypeEnum.ADD_LAWS_OPINION_GATHER.getValue())){ + Object lawsOpinionGatherInfoJson = jsonObject.get("lawsOpinionGatherInfo"); + LawsOpinionGatherEO lawsOpinionGatherEO = JSONObject.parseObject( + JSONObject.toJSONString(lawsOpinionGatherInfoJson),LawsOpinionGatherEO.class + ); + this.baseMapper.insert(lawsOpinionGatherEO); + } + + if(StringUtils.equals(operatorType, OperatorTypeEnum.UPDATE_LAWS_OPINION_GATHER_GATHER_RESULT.getValue())){ + LawsOpinionGatherEO lawsOpinionGatherEO = new LawsOpinionGatherEO(); + lawsOpinionGatherEO.setId(jsonObject.getString("id")); + lawsOpinionGatherEO.setGatherResult(jsonObject.getString("gatherResult")); + this.baseMapper.updateById(lawsOpinionGatherEO); + } + return new Result<>().success("调用成功!"); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java index 8cfb57597..77599194d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java @@ -1,9 +1,18 @@ package com.jero.modules.lawsOpinionGather.service.impl; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.jero.common.api.vo.Result; +import com.jero.common.exception.JeroBootException; import com.jero.modules.lawsOpinionGather.entity.LawsProcessHistoryEO; import com.jero.modules.lawsOpinionGather.mapper.LawsProcessHistoryEOMapper; import com.jero.modules.lawsOpinionGather.service.ILawsProcessHistoryEOService; +import com.jero.modules.project.enums.OperatorTypeEnum; +import com.jero.modules.project.enums.RequestSourceEnum; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; + +import java.util.ArrayList; import java.util.List; import java.util.Date; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -86,4 +95,32 @@ public class LawsProcessHistoryEOServiceImpl extends ServiceImpl queryList() { return list(); } + + @Override + public Result processCall(JSONObject jsonObject) { + String requestSource = jsonObject.getString("requestSource"); + if(StringUtils.isEmpty(requestSource)){ + throw new JeroBootException("请求来源不能为空!"); + } + if(!StringUtils.equals(requestSource, RequestSourceEnum.WORK_FLOW.getValue())){ + throw new JeroBootException("来源有误,没有权限调用该接口!"); + } + + String operatorType = jsonObject.getString("operatorType"); + if(StringUtils.isEmpty(operatorType)){ + throw new JeroBootException("操作类型不能为空!"); + } + if(StringUtils.equals(operatorType, OperatorTypeEnum.ADD.getValue())){ + JSONArray lawsProcessHistoryEOArray = jsonObject.getJSONArray("lawsProcessHistoryEOList"); + List lawsProcessHistoryEOList = new ArrayList<>(); + LawsProcessHistoryEO lawsProcessHistoryEO = null; + for (Object lawsProcessHistory : lawsProcessHistoryEOArray) { + lawsProcessHistoryEO = JSONObject.parseObject(JSONObject.toJSONString(lawsProcessHistory),LawsProcessHistoryEO.class); + lawsProcessHistoryEOList.add(lawsProcessHistoryEO); + } + this.saveBatch(lawsProcessHistoryEOList); + } + + return new Result<>().success("调用成功!"); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java index 7ec3d757c..145dfceda 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java @@ -36,6 +36,9 @@ public enum OperatorTypeEnum { QUERY_PREHOMO_STATISTICS("查询prehomo统计","queryPrehomoStatistics"), QUERY_VERIFY_STATISTICS("查询验证符合性统计","queryVerifyStatistics"), QUERY_CERTIFICATION_PROGRESS_STATISTICS("查询认证进度统计","queryCertificationProgressStatistics"), + + ADD_LAWS_OPINION_GATHER("添加法规意见收集数据","addLawsOpinionGather"), + UPDATE_LAWS_OPINION_GATHER_GATHER_RESULT("更新法规意见收集数据收集结果","updateLawsOpinionGatherGatherResult"), ; String name; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java index 704ac4a14..bf3b4ca11 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/controller/workFlowController.java @@ -68,6 +68,9 @@ public class workFlowController { jsonObject.put("id", FlowTypeEnum.YZFHXSCLC.getProcessDefinitionKey()); initConditionAssessmentEO(jsonObject); return this.activiti_define_start(jsonObject); + }else if(StringUtils.equals(type,FlowTypeEnum.FGYJSJLC.getValue())){ + jsonObject.put("id", FlowTypeEnum.FGYJSJLC.getProcessDefinitionKey()); + return this.activiti_define_start(jsonObject); }else{ return null; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java index 321b10971..159c3a27b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/enums/FlowTypeEnum.java @@ -9,6 +9,7 @@ public enum FlowTypeEnum { SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxlc"), PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc"), YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc"), + FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc"), ; private String value;