From e6c00560514116161a352d6736088473719696b7 Mon Sep 17 00:00:00 2001 From: zj <1376702416@qq.com> Date: Sat, 24 Jul 2021 18:05:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=8F=91=E8=B5=B7=E7=94=9F=E6=88=90=E5=85=AC=E5=BC=80?= =?UTF-8?q?=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81=EF=BC=9B=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E5=BE=81=E6=B1=82=E6=84=8F=E8=A7=81=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E9=A9=B3=E5=9B=9Ebug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_auth/LawsUserInfoService.java | 6 +- .../business_slrs/dao/SarPublicIdea.java | 27 +++ .../MinisterAndDockerSignAfter.java | 15 ++ .../ResponUserSignAfter.java | 2 +- .../StartSurveyAfter.java | 22 +++ .../SummarySurveyBefore.java | 4 +- .../ydw/bat/wkflow/util/http/PageInfo.java | 168 ++++++++++++++++++ .../bat/wkflow/util/http/ResponseMessage.java | 58 ++++++ .../util/http/ResponseMessageCodeEnum.java | 20 +++ .../com/ydw/bat/wkflow/util/http/Result.java | 42 +++++ 10 files changed, 360 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/ydw/bat/wkflow/business_slrs/dao/SarPublicIdea.java create mode 100644 src/main/java/com/ydw/bat/wkflow/util/http/PageInfo.java create mode 100644 src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessage.java create mode 100644 src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessageCodeEnum.java create mode 100644 src/main/java/com/ydw/bat/wkflow/util/http/Result.java diff --git a/src/main/java/com/ydw/bat/wkflow/business_auth/LawsUserInfoService.java b/src/main/java/com/ydw/bat/wkflow/business_auth/LawsUserInfoService.java index aeafdc97..e3680dcc 100644 --- a/src/main/java/com/ydw/bat/wkflow/business_auth/LawsUserInfoService.java +++ b/src/main/java/com/ydw/bat/wkflow/business_auth/LawsUserInfoService.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; import com.tmsps.fk.common.wrapper.Wrapper; import com.ydw.bat.wkflow.business_main.datas.dto.*; import com.ydw.bat.wkflow.business_main.datas.entity.*; +import com.ydw.bat.wkflow.business_slrs.dao.SarPublicIdea; import feign.Headers; import org.apache.ibatis.annotations.Param; import org.springframework.cloud.openfeign.FeignClient; @@ -17,7 +18,7 @@ import java.util.Map; import java.util.Set; @Component -@FeignClient(value = "FotonLAWSSystem454",path="/api",url="") +@FeignClient(value = "FotonLAWSSystem-zj",path="/api",url="") @RequestMapping("/") public interface LawsUserInfoService { @@ -101,6 +102,9 @@ public interface LawsUserInfoService { @RequestMapping(value = "sarLawsDetailedList/sar-laws-detailed-list/getStandById",method = RequestMethod.POST) public SarLawsDetailedList getStandById(@RequestParam("id") String id); + @PostMapping("/slrs/sar-public-idea/addSarPublicIdea") + public com.ydw.bat.wkflow.util.http.ResponseMessage addSarPublicIdea(@RequestBody SarPublicIdea sarPublicIdea); + diff --git a/src/main/java/com/ydw/bat/wkflow/business_slrs/dao/SarPublicIdea.java b/src/main/java/com/ydw/bat/wkflow/business_slrs/dao/SarPublicIdea.java new file mode 100644 index 00000000..22705aa0 --- /dev/null +++ b/src/main/java/com/ydw/bat/wkflow/business_slrs/dao/SarPublicIdea.java @@ -0,0 +1,27 @@ +package com.ydw.bat.wkflow.business_slrs.dao; + +import lombok.Builder; +import lombok.Data; + +import java.util.Date; + +@Data +@Builder +public class SarPublicIdea{ + + private String id; + + private String category; + + private String cid; + + private String cname; + + private Date startTime; + + private Date endTime; + + private String categoryFlag; + + +} diff --git a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/MinisterAndDockerSignAfter.java b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/MinisterAndDockerSignAfter.java index a69a84bf..658f6e3a 100644 --- a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/MinisterAndDockerSignAfter.java +++ b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/MinisterAndDockerSignAfter.java @@ -36,6 +36,21 @@ public class MinisterAndDockerSignAfter implements TaskListener { if(delegateTask.getVariable("actionFlag",Integer.class)==0){ if("1".equals(object.getString("actionFlag"))){ delegateTask.setVariable("actionFlag",1); + + BusProcessNew busProcessNewNext = new BusProcessNew(); + busProcessNewNext.setMsgType("clause"); + busProcessNewNext.setPId(delegateTask.getProcessInstanceId()); + busProcessNewNext.setMesg(object.toJSONString()); + busProcessNewNext.setFinishFlag("0"); + busProcessNewNext.setTaskInfo("标准法规工程师汇总填写处理意见"); + busProcessNewNext.setUserId(delegateTask.getVariable("startUser", String.class)); + + QueryWrapper qw = new QueryWrapper(); + qw.isNull("task_id"); + List list = busBean.list(qw); + if(list == null || list.isEmpty()){ + busBean.save(busProcessNewNext); + } } } diff --git a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/ResponUserSignAfter.java b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/ResponUserSignAfter.java index 8636fe24..f7d7776b 100644 --- a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/ResponUserSignAfter.java +++ b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/ResponUserSignAfter.java @@ -115,7 +115,7 @@ public class ResponUserSignAfter implements TaskListener { busProcessNewNext.setPId(delegateTask.getProcessInstanceId()); busProcessNewNext.setMesg(object.toJSONString()); busProcessNewNext.setFinishFlag("0"); - busProcessNewNext.setTaskInfo("标准法规工程师调研汇总"); + busProcessNewNext.setTaskInfo("标准法规工程师汇总填写处理意见"); busProcessNewNext.setUserId(delegateTask.getVariable("startUser", String.class)); busBean.save(busProcessNewNext); } diff --git a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/StartSurveyAfter.java b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/StartSurveyAfter.java index 4ed6bed6..ebdc7ecc 100644 --- a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/StartSurveyAfter.java +++ b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/StartSurveyAfter.java @@ -2,13 +2,17 @@ package com.ydw.bat.wkflow.listener.StandardCommentProcess; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ydw.bat.wkflow.business_auth.LawsUserInfoService; import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessName; import com.ydw.bat.wkflow.business_main.datas.entity.BusProcessNew; import com.ydw.bat.wkflow.business_main.datas.entity.Datas; import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNameService; import com.ydw.bat.wkflow.business_main.datas.service.IBusProcessNewService; import com.ydw.bat.wkflow.business_main.datas.service.IDatasService; +import com.ydw.bat.wkflow.business_slrs.dao.SarPublicIdea; import com.ydw.bat.wkflow.util.SpringContextUtil; +import com.ydw.bat.wkflow.util.http.ResponseMessage; +import org.activiti.engine.ActivitiException; import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.TaskListener; @@ -16,8 +20,12 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.UUID; public class StartSurveyAfter implements TaskListener { + + LawsUserInfoService lawsUserInfoService = SpringContextUtil.getBean(LawsUserInfoService.class); + @Override public void notify(DelegateTask delegateTask) { IDatasService datasService = SpringContextUtil.getBean(IDatasService.class); @@ -113,5 +121,19 @@ public class StartSurveyAfter implements TaskListener { busProcessNewNext.setUserId(delegateTask.getVariable("dockUser",String.class)); busBean.save(busProcessNewNext); } + + //发起公开征求意见 + SarPublicIdea sarPublicIdea = SarPublicIdea.builder() + .id(UUID.randomUUID().toString()) + .category("标准") + .cid(object.getString("cid")) + .cname(object.getString("cname")) + .startTime(new Date()) + .endTime(new Date()) + .build(); + ResponseMessage result = lawsUserInfoService.addSarPublicIdea(sarPublicIdea); + if(!result.isOk()){ + throw new ActivitiException("发起公开征求意见失败"); + } } } diff --git a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/SummarySurveyBefore.java b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/SummarySurveyBefore.java index 2a601fc4..d2715bed 100644 --- a/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/SummarySurveyBefore.java +++ b/src/main/java/com/ydw/bat/wkflow/listener/StandardCommentProcess/SummarySurveyBefore.java @@ -23,7 +23,7 @@ public class SummarySurveyBefore implements TaskListener { if(!list.isEmpty()){ BusProcessNew one1 = list.get(0); - JSONObject obj= JSON.parseObject(one1.getMesg()); + /*JSONObject obj= JSON.parseObject(one1.getMesg()); //看全局变量里有没有存Summary,有的话就直接走,没的话就就初始化 JSONArray summaryList=JSON.parseArray(delegateTask.getVariable("summaryList",String.class)); @@ -57,7 +57,7 @@ public class SummarySurveyBefore implements TaskListener { obj.put("summaryList",summaryList); delegateTask.setVariable("summaryList",summaryList.toJSONString()); - one1.setMesg(obj.toJSONString()); + one1.setMesg(obj.toJSONString());*/ one1.setTaskId(delegateTask.getId()); one1.setTaskInfo(delegateTask.getName()); busBean.saveOrUpdate(one1); diff --git a/src/main/java/com/ydw/bat/wkflow/util/http/PageInfo.java b/src/main/java/com/ydw/bat/wkflow/util/http/PageInfo.java new file mode 100644 index 00000000..0dbd9f38 --- /dev/null +++ b/src/main/java/com/ydw/bat/wkflow/util/http/PageInfo.java @@ -0,0 +1,168 @@ +package com.ydw.bat.wkflow.util.http; + +import org.apache.commons.lang3.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PageInfo { + private Integer pageNo; + private Integer pageSize; + private Long count; + private Long pageCount; + private List list; + private List> title; + private Map ext; + private String orderBy; + + public PageInfo() { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + this.pageSize = 1; + } + + public PageInfo(HttpServletRequest request) { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + String no = request.getParameter("pageNo"); + if (StringUtils.isEmpty(no)) { + this.setPageNo(1); + } else if (StringUtils.isNumeric(no)) { + this.setPageNo(Integer.parseInt(no)); + } + + String size = request.getParameter("pageSize"); + if (StringUtils.isEmpty(size)) { + this.setPageSize(10); + } + + if (StringUtils.isNumeric(size)) { + this.setPageSize(Integer.parseInt(size)); + } + + String orderByParam = request.getParameter("orderBy"); + if (StringUtils.isNotBlank(orderByParam)) { + this.setOrderBy(orderByParam); + } + + } + + public PageInfo(Integer pageNo, Integer pageSize) { + this(pageNo, pageSize, 0L); + } + + public PageInfo(Integer pageNo, Integer pageSize, Long count) { + this(pageNo, pageSize, count, new ArrayList()); + } + + public PageInfo(Integer pageNo, Integer pageSize, Long count, List list) { + this.pageNo = 1; + this.pageSize = 10; + this.list = new ArrayList(); + this.title = new ArrayList(); + this.ext = new HashMap(); + this.orderBy = ""; + if (pageNo == null) { + pageNo = 1; + } + + if (pageSize == null) { + pageSize = 10; + } + + this.setCount(count); + this.setPageNo(Math.abs(pageNo)); + this.setPageSize(Math.abs(pageSize)); + this.setList(list); + } + + public Long getCount() { + return this.count; + } + + public void setCount(Long count) { + this.count = count; + if ((long) this.pageSize >= count) { + this.pageNo = 1; + } + + } + + public Integer getPageNo() { + return this.pageNo; + } + + public void setPageNo(Integer pageNo) { + this.pageNo = pageNo; + } + + public Integer getPageSize() { + return this.pageSize; + } + + public void setPageSize(Integer pageSize) { + this.pageSize = pageSize <= 0 ? 10 : pageSize; + } + + public List getList() { + return this.list; + } + + public PageInfo setList(List list) { + this.list = list; + return this; + } + + public String getOrderBy() { + return this.orderBy; + } + + public void setOrderBy(String orderBy) { + this.orderBy = orderBy; + } + + public Map getExt() { + return this.ext; + } + + public void setExt(Map ext) { + this.ext = ext; + } + + public Long getPageCount() { + if (this.count % (long) this.pageSize != 0L) { + this.pageCount = this.count / (long) this.pageSize + 1L; + } else { + this.pageCount = this.count / (long) this.pageSize; + } + + if (this.pageCount < 1L) { + this.pageCount = 1L; + } + + return this.pageCount; + } + + public void setPageCount(Long pageCount) { + this.pageCount = pageCount; + } + + public List> getTitle() { + return this.title; + } + + public void setTitle(List> title) { + this.title = title; + } +} \ No newline at end of file diff --git a/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessage.java b/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessage.java new file mode 100644 index 00000000..5227ece8 --- /dev/null +++ b/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessage.java @@ -0,0 +1,58 @@ +package com.ydw.bat.wkflow.util.http; + +public class ResponseMessage { + private String respCode; + private String respMsg; + private T data; + private boolean ok; + + public ResponseMessage() { + } + + public ResponseMessage(String respCode, String message) { + this.respCode = respCode; + this.respMsg = message; + } + + public ResponseMessage(String respCode, String message, boolean ok) { + this.respCode = respCode; + this.respMsg = message; + this.ok = ok; + } + + public ResponseMessage(String respCode, String message, boolean ok, T data) { + this.respCode = respCode; + this.respMsg = message; + this.ok = ok; + this.data = data; + } + + public String getRespCode() { + return this.respCode; + } + + public void setRespCode(String respCode) { + this.respCode = respCode; + } + + public String getMessage() { + return this.respMsg; + } + + public void setMessage(String message) { + this.respMsg = message; + } + + public T getData() { + return this.data; + } + + public void setData(T data) { + this.data = data; + } + + public boolean isOk() { + return this.ok; + } +} + diff --git a/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessageCodeEnum.java b/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessageCodeEnum.java new file mode 100644 index 00000000..3e9f5b73 --- /dev/null +++ b/src/main/java/com/ydw/bat/wkflow/util/http/ResponseMessageCodeEnum.java @@ -0,0 +1,20 @@ +package com.ydw.bat.wkflow.util.http; + +public enum ResponseMessageCodeEnum { + SUCCESS("0"), + ERROR("-1"), + VALID_ERROR("1000"), + SAVE_SUCCESS("r0001"), + UPDATE_SUCCESS("r0002"), + REMOVE_SUCCESS("r0003"); + + private String code; + + private ResponseMessageCodeEnum(String code) { + this.code = code; + } + + public String getCode() { + return this.code; + } +} diff --git a/src/main/java/com/ydw/bat/wkflow/util/http/Result.java b/src/main/java/com/ydw/bat/wkflow/util/http/Result.java new file mode 100644 index 00000000..b0851e47 --- /dev/null +++ b/src/main/java/com/ydw/bat/wkflow/util/http/Result.java @@ -0,0 +1,42 @@ +package com.ydw.bat.wkflow.util.http; + +public class Result { + public Result() { + } + + public static ResponseMessage success() { + return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true); + } + + public static ResponseMessage success(String code, T t) { + return new ResponseMessage(code, "", true, t); + } + + public static ResponseMessage success(String code, String message) { + return new ResponseMessage(code, message); + } + + public static ResponseMessage success(String code, String message, T t) { + return new ResponseMessage(code, message, true, t); + } + + public static ResponseMessage success(T t) { + return new ResponseMessage(ResponseMessageCodeEnum.SUCCESS.getCode(), "", true, t); + } + + public static ResponseMessage error() { + return error(""); + } + + public static ResponseMessage error(String message) { + return error(ResponseMessageCodeEnum.ERROR.getCode(), message); + } + + public static ResponseMessage error(String code, String message) { + return error(code, message, (Object)null); + } + + public static ResponseMessage error(String code, String message, T t) { + return new ResponseMessage(code, message, false, t); + } +}