From 87738f71aa991948defd8da55cb95f34feb3823e Mon Sep 17 00:00:00 2001 From: sunchenliang <2532527871@qq.com> Date: Wed, 8 May 2024 20:09:25 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=B0=8F?= =?UTF-8?q?=E7=BB=93=E6=9F=A5=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FlowTaskController.java | 127 +++++++++- .../flowable/service/IFlowTaskService.java | 2 +- .../service/impl/FlowTaskServiceImpl.java | 23 +- .../oa/from/dataDao/FlowableccMybatisDao.java | 2 +- .../resources/mapper/oa/FlowableccMapper.xml | 230 ++++++++++++++++++ 5 files changed, 363 insertions(+), 21 deletions(-) diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java index d96a82e8..89217351 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/controller/FlowTaskController.java @@ -501,7 +501,7 @@ public class FlowTaskController extends BaseController { Map query = searchQuery.getQuery(); - flowTaskService.getFinalProcessInstances(query, pageUtils,user); + flowTaskService.getFinalProcessInstances(query, pageUtils, user); return ResultVoUtil.success(pageUtils); } @@ -682,9 +682,120 @@ public class FlowTaskController extends BaseController { @GetMapping("/repetitionTask") @ResponseBody public ResultVo repetitionTask(HttpServletRequest request, - @RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { + @RequestParam(value = "type", required = false, defaultValue = "0") Integer type, + @RequestParam(name = "izupuser", defaultValue = "", required = false) String izupuser, + @RequestParam(name = "taskName", defaultValue = "", required = false) String taskName, + @RequestParam(name = "izproject", defaultValue = "", required = false) String izproject, + @RequestParam(name = "izplan", defaultValue = "", required = false) String izplan, + @RequestParam(name = "izstatus", defaultValue = "", required = false) String izstatus, + @RequestParam(name = "iztaskrrom", defaultValue = "", required = false) String iztaskrrom, + @RequestParam(name = "izuptime", defaultValue = "", required = false) String izuptime, + @RequestParam(name = "isFail", defaultValue = "false", required = false) String isFail) { + SearchQuery searchQuery = new SearchQuery(); + if (org.springframework.util.StringUtils.hasText(izupuser)) { + if (izupuser.contains(",")) { + String[] userIds = izupuser.split(","); + List arrayData = Arrays.asList(userIds); + searchQuery.addIn("fromuserid", arrayData); + } else { + searchQuery.addEqual("fromuserid", izupuser); + } + } + if (StringUtils.isNotBlank(taskName)) { + searchQuery.addLike("fromtaskname", taskName); + } + if (org.springframework.util.StringUtils.hasText(izproject)) { + if (izproject.contains(",")) { + String[] projectIds = izproject.split(","); // 以逗号拆分字符串 + List arrayData = Arrays.asList(projectIds); + SearchQueryForm searchQueryForm = new SearchQueryForm(); + searchQuery.addIn("fromprojectname", arrayData); + } else { + searchQuery.addEqual("fromprojectname", izproject); + } + } + if (org.springframework.util.StringUtils.hasText(izplan)) { + if (izplan.contains(",")) { + String[] planIds = izplan.split(","); // 以逗号拆分字符串 + List arrayData = Arrays.asList(planIds); + SearchQueryForm searchQueryForm = new SearchQueryForm(); + searchQuery.addIn("fromplanid", arrayData); + } else { + searchQuery.addEqual("fromplanid", izplan); + } + } + if (org.springframework.util.StringUtils.hasText(izstatus)) { + if (izstatus.contains(",")) { + String[] statusIds = izstatus.split(","); // 以逗号拆分字符串 + List arrayData = Arrays.asList(statusIds); + searchQuery.addIn("states", arrayData); + } else { + searchQuery.addEqual("states", izstatus); + } + } + if (Boolean.parseBoolean(isFail)) { + searchQuery.addEqual("isFail", "1"); + } + if (org.springframework.util.StringUtils.hasText(iztaskrrom)) { + if (iztaskrrom.contains(",")) { + String[] taskrromIds = iztaskrrom.split(","); // 以逗号拆分字符串 + List arrayData = Arrays.asList(taskrromIds); + searchQuery.addIn("fromsourceid", arrayData); + } else { + searchQuery.addEqual("fromsourceid", iztaskrrom); + } + } + + if (org.springframework.util.StringUtils.hasText(izuptime)) { + String[] dateRange = izuptime.split("-"); + if (dateRange.length == 2) { + try { + SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + + // 解析开始时间 + Long startTimeStamp = sdfInput.parse(dateRange[0].trim() + " 00:00:00").getTime(); + + // 解析结束时间 + Long endTimeStamp = sdfInput.parse(dateRange[1].trim() + " 23:59:59").getTime(); + + // 如果开始时间不为空,则将其放入查询条件中 + if (startTimeStamp != null) { + searchQuery.addGreater("fromuptimeStart", startTimeStamp); + } + // 如果结束时间不为空,则将其放入查询条件中 + if (endTimeStamp != null) { + searchQuery.addLess("fromuptimeEnd", endTimeStamp); + } + } catch (ParseException e) { + // 处理日期解析异常 + e.printStackTrace(); + } + } + } + //租户主键,由前端页面传送 String tenantId = request.getHeader("X-Tenant-Id"); - return flowTaskService.repetitionTask(type,tenantId); + + if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) { + return ResultVoUtil.error("租户主键不能为空"); + } + User user = this.userService.getSessionUser(request); + if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) { + } else { + searchQuery.addEqual("thisLoginUserid", user.getLoginname()); + } + searchQuery.addEqual("tenantid", tenantId); + String searchId = request.getParameter("searchId"); + + if (StringUtils.isNotBlank(searchId)) { + List list = usersearchchildService.list(new LambdaQueryWrapper().eq(OcrUsersearchchild::getUsersearchid, searchId).orderByAsc(OcrUsersearchchild::getOrderNum)); + for (OcrUsersearchchild userSearch : list) { + disSearchQuery(searchQuery, userSearch); + } + } + + Map query = searchQuery.getQuery(); + + return flowTaskService.repetitionTask(type, tenantId,query); } /** @@ -701,9 +812,9 @@ public class FlowTaskController extends BaseController { public ResultVo repetitionTaskList(HttpServletRequest request, @RequestParam(name = "pageNo") Integer pageNo, @RequestParam(name = "pageSize") Integer pageSize, - @RequestParam(value = "type",required = false,defaultValue = "1") Integer type) { + @RequestParam(value = "type", required = false, defaultValue = "1") Integer type) { String tenantId = request.getHeader("X-Tenant-Id"); - Page result = flowTaskService.repetitionTaskList(pageNo, pageSize,type,tenantId); + Page result = flowTaskService.repetitionTaskList(pageNo, pageSize, type, tenantId); return ResultVoUtil.success(result); } @@ -719,14 +830,14 @@ public class FlowTaskController extends BaseController { @GetMapping("/retryPrevailCloud") @ResponseBody public ResultVo retryPrevailCloud(HttpServletRequest request, - @RequestParam(name = "formId") String formId) { + @RequestParam(name = "formId") String formId) { String tenantId = request.getHeader("X-Tenant-Id"); Boolean result = null; try { - result = flowTaskService.retryPrevailCloud(tenantId,formId); + result = flowTaskService.retryPrevailCloud(tenantId, formId); } catch (Exception e) { log.error(e.getMessage()); - result =false; + result = false; } return ResultVoUtil.success(result); } diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java index 49d61f23..ce565ab3 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/IFlowTaskService.java @@ -193,7 +193,7 @@ public interface IFlowTaskService { * * @return */ - ResultVo repetitionTask(Integer type, String tenantId); + ResultVo repetitionTask(Integer type, String tenantId, Map query); Page repetitionTaskList(Integer pageNo, Integer pageSize, Integer type, String tenantId); diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java index 422cb95d..30ae4e81 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/flowable/service/impl/FlowTaskServiceImpl.java @@ -40,7 +40,6 @@ import cn.jyjz.xiaoyao.ocr.dataobject.*; import cn.jyjz.xiaoyao.ocr.service.*; import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting; import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -1963,8 +1962,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask } @Override - public ResultVo repetitionTask(Integer type, String tenantId) { - List repeatedContentVoList = flowableccMybatisDao.repetitionTask(type, tenantId); + public ResultVo repetitionTask(Integer type, String tenantId, Map query) { + query.put("type",type); + List repeatedContentVoList = flowableccMybatisDao.repetitionTaskNew(query); List formIdsToUpdate = new ArrayList<>(); if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) { List checkDescribeHis = new ArrayList<>(); @@ -1998,15 +1998,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask } } - ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis); - UpdateWrapper updateWrapper = new UpdateWrapper<>(); - updateWrapper.in("PICTUREID", formIdsToUpdate) - .eq("is_repeated_nodules", 0); - OcrTaskchildPicture updateEntity = new OcrTaskchildPicture(); - updateEntity.setIsRepeatedNodules(1); - ocrTaskchildPictureService.update(updateEntity, updateWrapper); - + if(!CollectionUtils.isEmpty(checkDescribeHis)){ + ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis); + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.in("PICTUREID", formIdsToUpdate) + .eq("is_repeated_nodules", 0); + OcrTaskchildPicture updateEntity = new OcrTaskchildPicture(); + updateEntity.setIsRepeatedNodules(1); + ocrTaskchildPictureService.update(updateEntity, updateWrapper); + } } return ResultVoUtil.success(repeatedContentVoList); } diff --git a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java index 7b2ef3c1..7bf22f24 100644 --- a/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java +++ b/jyjz-system/jyjz-system-oa/src/main/java/cn/jyjz/xiaoyao/oa/from/dataDao/FlowableccMybatisDao.java @@ -40,7 +40,7 @@ public interface FlowableccMybatisDao extends BaseMapper { */ List selectUserByFromid(String fromid); - List repetitionTask(@Param("type") Integer type, @Param("tenantId") String tenantId); + List repetitionTaskNew(Map query); Page repetitionTaskList(Page page, @Param("type") Integer type, @Param("tenantId") String tenantId); } diff --git a/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/FlowableccMapper.xml b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/FlowableccMapper.xml index 8811ff5e..8c49724d 100644 --- a/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/FlowableccMapper.xml +++ b/jyjz-system/jyjz-system-oa/src/main/resources/mapper/oa/FlowableccMapper.xml @@ -158,6 +158,187 @@ + + + + + and tcp.ID ${id.dataOp} ${id.likestar}#{id.value}${id.likeend} + + + + and tcp.OCPICTUREID ${ocpictureid.dataOp} ${ocpictureid.likestar}#{ocpictureid.value}${ocpictureid.likeend} + + + and tcp.PICTURERESULT ${pictureresult.dataOp} ${pictureresult.likestar}#{pictureresult.value}${pictureresult.likeend} + + + and tcp.PICTURECOMPARE ${picturecompare.dataOp} ${picturecompare.likestar}#{picturecompare.value}${picturecompare.likeend} + + + and tcp.DEPTID ${deptid.dataOp} ${deptid.likestar}#{deptid.value}${deptid.likeend} + + + and tcp.TENANTID ${tenantid.dataOp} ${tenantid.likestar}#{tenantid.value}${tenantid.likeend} + + + and tcp.PACKAGEID ${packageid.dataOp} ${packageid.likestar}#{packageid.value}${packageid.likeend} + + + and tcp.PICTUREID ${pictureid.dataOp} ${pictureid.likestar}#{pictureid.value}${pictureid.likeend} + + + and tcp.CATEGORY ${category.dataOp} ${category.likestar}#{category.value}${category.likeend} + + + and tcp.CATEGORYID ${categoryid.dataOp} ${categoryid.likestar}#{categoryid.value}${categoryid.likeend} + + + and tcp.SPECIFICATION ${specification.dataOp} ${specification.likestar}#{specification.value}${specification.likeend} + + + and tcp.BUESSINESSNO ${buessinessno.dataOp} ${buessinessno.likestar}#{buessinessno.value}${buessinessno.likeend} + + + + and tcp.PROCESSINSTANCEID ${processinstanceid.dataOp} ${processinstanceid.likestar}#{processinstanceid.value}${processinstanceid.likeend} + + + and tcp.PROCESSDEFINITIONID ${processdefinitionid.dataOp} ${processdefinitionid.likestar}#{processdefinitionid.value}${processdefinitionid.likeend} + + + and tcp.DEPLOYMENTID ${deploymentid.dataOp} ${deploymentid.likestar}#{deploymentid.value}${deploymentid.likeend} + + + and tcp.ASSIGNEENAME ${assigneename.dataOp} ${assigneename.likestar}#{assigneename.value}${assigneename.likeend} + + + and tcp.ASSIGNEE ${assignee.dataOp} ${assignee.likestar}#{assignee.value}${assignee.likeend} + + + and tcp.UPDATEUSER ${updateuser.dataOp} ${updateuser.likestar}#{updateuser.value}${updateuser.likeend} + + + and tcp.UPDATETIME ${updatetime.dataOp} ${updatetime.likestar}#{updatetime.value}${updatetime.likeend} + + + and tcp.FILEANNEX ${fileannex.dataOp} ${fileannex.likestar}#{fileannex.value}${fileannex.likeend} + + + and tcp.GUIDANG ${guidang.dataOp} ${guidang.likestar}#{guidang.value}${guidang.likeend} + + + and tcp.CREATEUSER ${createuser.dataOp} ${createuser.likestar}#{createuser.value}${createuser.likeend} + + + and tcp.CREATEUSERNAME ${createusername.dataOp} ${createusername.likestar}#{createusername.value}${createusername.likeend} + + + and tcp.CREATEDATE ${createdate.dataOp} ${createdate.likestar}#{createdate.value}${createdate.likeend} + + + and tcp.CREATEDATE ${createdateStart.dataOp} ${createdateStart.likestar}#{createdateStart.value}${createdateStart.likeend} + + + and tcp.CREATEDATE ${createdateEnd.dataOp} ${createdateEnd.likestar}#{createdateEnd.value}${createdateEnd.likeend} + + + and tcp.USERNAME ${username.dataOp} ${username.likestar}#{username.value}${username.likeend} + + + and tcp.FROMTASKID ${fromtaskid.dataOp} ${fromtaskid.likestar}#{fromtaskid.value}${fromtaskid.likeend} + + + and tcp.FROMTASKNAME ${fromtaskname.dataOp} ${fromtaskname.likestar}#{fromtaskname.value}${fromtaskname.likeend} + + + + + + and tcp.FROMUPTIME ${fromuptime.dataOp} ${fromuptime.likestar}#{fromuptime.value}${fromuptime.likeend} + + + and tcp.FROMUSERID ${fromuserid.dataOp} ${fromuserid.likestar} + + + + #{item} + + + + #{fromuserid.value} + + ${fromuserid.likeend} + + + and tcp.FROMPROJECTID ${fromprojectid.dataOp} ${fromprojectid.likestar} + + + + #{item} + + + + #{fromprojectid.value} + + ${fromprojectid.likeend} + + + and tcp.FROMPLANID ${fromplanid.dataOp} ${fromplanid.likestar} + + + + #{item} + + + + #{fromplanid.value} + + ${fromplanid.likeend} + + + and tcp.STATES ${states.dataOp} ${states.likestar} + + + + #{item} + + + + #{states.value} + + ${states.likeend} + + + and tcp.FROMSOURCEID ${fromsourceid.dataOp} ${fromsourceid.likestar} + + + + #{item} + + + + #{fromsourceid.value} + + ${fromsourceid.likeend} + + + + + + + + + and tcp.HAVEPOINTS ${havepoints.dataOp} ${havepoints.likestar}#{havepoints.value}${havepoints.likeend} + + + and tcp.TASKNAME ${taskname.dataOp} ${taskname.likestar}#{taskname.value}${taskname.likeend} + + + and tcp.USERID ${userid.dataOp} ${userid.likestar}#{userid.value}${userid.likeend} + + + + + +