lxzn-module-dnc/src/main/java/org/jeecg/modules/dncFlow/service/impl/AssignFileStreamServiceImpl.java
@@ -1,6 +1,7 @@ package org.jeecg.modules.dncFlow.service.impl; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -8,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.SecurityUtils; import org.flowable.engine.TaskService; @@ -36,6 +36,7 @@ import org.jeecg.modules.dncFlow.service.IToEquipmentTaskService; import org.jeecg.modules.dncFlow.vo.AssignFlowTaskVo; import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService; import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; import org.jeecg.modules.flowable.apithird.service.FlowCommonService; import org.jeecg.modules.flowable.domain.vo.FlowTaskVo; @@ -105,6 +106,8 @@ private IFlowTaskService flowTaskService; @Autowired private IDeviceTypeService deviceTypeService; @Autowired private IFlowMyBusinessService flowMyBusinessService; @Value("${securedoc.whether}") private String whether; @@ -289,6 +292,30 @@ //flowable处理 FlowTaskVo flowTaskVo = new FlowTaskVo(); BeanUtils.copyProperties(assignFlowTaskVo, flowTaskVo); List<FlowMyBusiness> businessList = flowMyBusinessService.list( new QueryWrapper<FlowMyBusiness>() .eq("process_instance_id", assignFlowTaskVo.getInstanceId()) ); if (businessList.isEmpty()) { return false; } FlowMyBusiness flowMyBusiness = businessList.get(0); List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); if (todoUsers == null || !todoUsers.contains(user.getUsername())) { return false; } // 4. 认领任务(处理已被认领的情况) String taskId = flowMyBusiness.getTaskId(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); if (task == null) { return false; } if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { return false; } taskService.claim(taskId, user.getUsername()); Map<String, Object> values=new HashMap<>(); values.put("dataId", assignFlowTaskVo.getDataId()); flowTaskVo.setTaskId(assignFlowTaskVo.getTaskId()); @@ -407,14 +434,6 @@ List<TaskRequest> list = approveBatchRequest.getTaskArr(); if(list == null || list.isEmpty()) ExceptionCast.cast(CommonCode.INVALID_PARAM); // list.forEach(item -> { // AssignFileStream stream = new AssignFileStream(); // stream.setApproveContent(approveBatchRequest.getApproveContent()); // stream.setStatus(approveBatchRequest.getStatus()); // boolean b = approveAssignFile(item.getId(), item.getBusinessKey(), stream); // if(!b) // ExceptionCast.cast(ActivitiCode.ACT_APPROVE_ERROR); // }); return synchronizedFlagService.updateFlag(1); } @@ -651,19 +670,6 @@ } } //开始工作流 // private ProcessInstance startProcessInstance(AssignFileStream stream, List<String> userIdList) { // String approveUsers = String.join(",", userIdList); // Map<String, Object> avariableMap = new HashMap<>(); // avariableMap.put(APPLY_VARIABLE, stream.getApplyUserId()); // avariableMap.put(APPROVE_VARIABLE, approveUsers); // ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(PROCESS_KEY, stream.getStreamId(), avariableMap); // if (processInstance == null) { // ExceptionCast.cast(ActivitiCode.ACT_APPROVE_USERS_NONE); // } // return processInstance; // } //拾取任务 private void completeTask(ProcessInstance processInstance, String userId) { Task task = taskService.createTaskQuery().processDefinitionKey(PROCESS_KEY).taskAssignee(userId) @@ -771,6 +777,6 @@ @Override public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) { return Lists.newArrayList("jeecg"); return null; } } lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamInspectionOrder.java
@@ -16,6 +16,7 @@ import java.io.Serializable; import java.util.Date; import java.util.List; /** * @Description: 点检工单 @@ -133,4 +134,16 @@ /**设备编号*/ @ApiModelProperty(value = "设备编号") private transient String equipmentCode; /**列表 保养项明细*/ @ApiModelProperty(value = "列表 保养项明细") private transient List<EamInspectionOrderDetail> tableDetailList; /**处理类型*/ @ApiModelProperty(value = "处理类型") private transient String dealType; /**处理意见*/ @ApiModelProperty(value = "处理意见") private transient String dealSuggestion; } lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamInspectionOrderDetail.java
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/request/EamInspectionOrderRequest.java
@@ -123,4 +123,12 @@ /**列表 保养项明细*/ @ApiModelProperty(value = "列表 保养项明细") private List<EamInspectionOrderDetail> tableDetailList; /**处理类型*/ @ApiModelProperty(value = "处理类型") private String dealType; /**处理意见*/ @ApiModelProperty(value = "处理意见") private String dealSuggestion; } lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -9,16 +9,14 @@ import org.flowable.engine.TaskService; import org.flowable.task.api.Task; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.eam.constant.InspectionStatus; import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamInspectionOrder; import org.jeecg.modules.eam.entity.EamInspectionOrderDetail; import org.jeecg.modules.eam.constant.ReportRepairEnum; import org.jeecg.modules.eam.entity.*; import org.jeecg.modules.eam.mapper.EamInspectionOrderMapper; import org.jeecg.modules.eam.request.EamInspectionOrderRequest; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.service.IEamInspectionOrderDetailService; import org.jeecg.modules.eam.service.IEamInspectionOrderService; import org.jeecg.modules.eam.service.*; import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl; import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI; @@ -62,6 +60,11 @@ private IEamEquipmentService iEamEquipmentService; @Autowired private IMdcUserProductionService mdcUserProductionService; @Autowired private IEamReportRepairService eamReportRepairService; @Autowired private IEamEquipmentFaultReasonService eamEquipmentFaultReasonService; @Override @Transactional(rollbackFor = Exception.class) public boolean addInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) { @@ -125,6 +128,9 @@ public boolean editInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) { EamInspectionOrder eamInspectionOrder = new EamInspectionOrder(); BeanUtils.copyProperties(eamInspectionOrderRequest, eamInspectionOrder); if (StrUtil.isNotEmpty(eamInspectionOrder.getOperator())){ eamInspectionOrder.setInspectionStatus(InspectionStatus.IN_PROGRESS.getCode()); } updateById(eamInspectionOrder); //处理明细数据 if (CollectionUtil.isNotEmpty(eamInspectionOrderRequest.getTableDetailList())) { @@ -181,100 +187,57 @@ * @return */ @Override @Transactional public Result<?> inspectionProcess(EamInspectionOrderRequest eamInspectionOrderRequest){ try { // 参数校验 if (!StrUtil.isNotBlank(eamInspectionOrderRequest.getTaskId()) || !StrUtil.isNotBlank(eamInspectionOrderRequest.getDataId())) { // 检查请求参数 if (!isValidRequest(eamInspectionOrderRequest)) { return Result.error("非法参数"); } LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String userId = user.getId(); eamInspectionOrderRequest.setAssignee(user.getUsername()); if (!StrUtil.isNotBlank(userId)) { // 获取当前登录用户 LoginUser user = getCurrentUser(); if (user == null || StrUtil.isBlank(user.getId())) { return Result.error("账号不存在"); } eamInspectionOrderRequest.setAssignee(user.getUsername()); // 数据查询 EamInspectionOrder eamInspectionOrder = this.getById(eamInspectionOrderRequest.getDataId()); // 获取点检工单信息 EamInspectionOrder eamInspectionOrder = getEamInspectionOrder(eamInspectionOrderRequest.getDataId()); if (eamInspectionOrder == null) { return Result.error("未找到对应数据"); } // 2. 查询流程业务记录(处理空结果) List<FlowMyBusiness> businessList = flowMyBusinessService.list( new QueryWrapper<FlowMyBusiness>() .eq("process_instance_id", eamInspectionOrderRequest.getInstanceId()) ); if (businessList.isEmpty()) { // 获取流程业务记录 FlowMyBusiness flowMyBusiness = getFlowMyBusiness(eamInspectionOrderRequest.getInstanceId()); if (flowMyBusiness == null) { return Result.error("流程记录不存在"); } FlowMyBusiness flowMyBusiness = businessList.get(0); // 3. 校验用户是否为候选处理人 List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); if (todoUsers == null || !todoUsers.contains(user.getUsername())) { // 检查用户是否有权限操作任务 if (!isUserAuthorized(flowMyBusiness, user)) { return Result.error("用户无权操作此任务"); } // 4. 认领任务(处理已被认领的情况) String taskId = flowMyBusiness.getTaskId(); Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); if (task == null) { return Result.error("任务不存在或已完成"); // 认领任务 if (!claimTask(flowMyBusiness.getTaskId(), user)) { return Result.error("任务不存在、已完成或已被他人认领"); } if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { return Result.error("任务已被他人认领"); } taskService.claim(taskId, user.getUsername()); Map<String, Object> values = new HashMap<>(); if ((InspectionStatus.IN_PROGRESS.getCode()).equals(eamInspectionOrder.getInspectionStatus())) { //点检人点检结束 //查询对应班组长,作为下一节点处理人,存在多个处理人 String orgId=iEamEquipmentService.getById(eamInspectionOrder.getEquipmentId()).getOrgId(); //筛选出班组长岗位,post为PCR0003 List<SysUser> sysUserList= mdcUserProductionService.queryByPostAndProId("PCR0003",orgId); List<String> usernameList; if (sysUserList.isEmpty()){ return Result.error("未找到该设备对应车间的班组长,请联系管理员处理"); }else { usernameList = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList()); } // 设置流程变量 values.put("dataId", eamInspectionOrder.getId()); values.put("organization", "点检人点检结束"); values.put("comment","点检人点检结束" ); values.put("NextAssignee", usernameList); eamInspectionOrderRequest.setComment("点检人点检结束"); }else { //班组长确认 values.put("dataId", eamInspectionOrder.getId()); values.put("organization", "班组长确认"); values.put("comment","班组长确认" ); eamInspectionOrderRequest.setComment("班组长确认"); } eamInspectionOrderRequest.setValues(values); // 设置流程变量 setupProcessVariables(eamInspectionOrderRequest, eamInspectionOrder, user); // 完成流程任务 Result result = flowTaskService.complete(eamInspectionOrderRequest); if (result.isSuccess()) { // 更新状态 if ((InspectionStatus.IN_PROGRESS.getCode()).equals(eamInspectionOrder.getInspectionStatus())) { //点检完成 eamInspectionOrder.setInspectionStatus("3"); eamInspectionOrder.setInspectionDate(new Date()); eamInspectionOrderDetailService.remove(new QueryWrapper<EamInspectionOrderDetail>().eq("order_id", eamInspectionOrder.getId())); eamInspectionOrderDetailService.saveBatch(eamInspectionOrderRequest.getTableDetailList()); this.updateById(eamInspectionOrder); } } else if ((InspectionStatus.COMPLETED.getCode()).equals(eamInspectionOrder.getInspectionStatus())){ // 班组长确认任务 eamInspectionOrder.setInspectionStatus("4"); eamInspectionOrder.setConfirmUser(user.getUsername()); eamInspectionOrder.setConfirmTime(new Date()); this.updateById(eamInspectionOrder); //处理异常数据进入维修单 return result; // 根据任务完成结果更新工单状态 updateOrderStatus(result, eamInspectionOrderRequest, eamInspectionOrder, user); // 更新工单信息 updateEamInspectionOrder(eamInspectionOrder); //查询数据,进行设备维修处理 if (eamInspectionOrder.getInspectionStatus().equals(InspectionStatus.CONFIRMED.getCode())){ updateEamInspectionOrderDetail(eamInspectionOrder); } return Result.OK("操作成功"); @@ -283,6 +246,134 @@ } } private boolean isValidRequest(EamInspectionOrderRequest request) { return StrUtil.isNotBlank(request.getTaskId()) && StrUtil.isNotBlank(request.getDataId()); } private LoginUser getCurrentUser() { try { return (LoginUser) SecurityUtils.getSubject().getPrincipal(); } catch (Exception e) { return null; } } private EamInspectionOrder getEamInspectionOrder(String dataId) { return this.getById(dataId); } private FlowMyBusiness getFlowMyBusiness(String instanceId) { List<FlowMyBusiness> businessList = flowMyBusinessService.list( new QueryWrapper<FlowMyBusiness>().eq("process_instance_id", instanceId)); return businessList.isEmpty() ? null : businessList.get(0); } private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) { List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class); return todoUsers != null && todoUsers.contains(user.getUsername()); } private boolean claimTask(String taskId, LoginUser user) { Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); if (task == null) { return false; } if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) { return false; } taskService.claim(taskId, user.getUsername()); return true; } private void setupProcessVariables(EamInspectionOrderRequest request, EamInspectionOrder order, LoginUser user) { Map<String, Object> values = new HashMap<>(); if (InspectionStatus.IN_PROGRESS.getCode().equals(order.getInspectionStatus()) && user.getUsername().equals(order.getOperator())) { // 点检人点检结束 String orgId = Optional.ofNullable(iEamEquipmentService.getById(order.getEquipmentId())) .map(equipment -> equipment.getOrgId()) .orElse(null); if (orgId == null) { throw new IllegalArgumentException("未找到设备的组织 ID"); } List<SysUser> sysUserList = mdcUserProductionService.queryByPostAndProId("PCR0003", orgId); List<String> usernameList = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList()); if (usernameList.isEmpty()) { throw new IllegalArgumentException("未找到该设备对应车间的班组长,请联系管理员处理"); } values.put("dataId", order.getId()); values.put("organization", "点检人点检结束"); values.put("comment", "点检人点检结束"); values.put("NextAssignee", usernameList); request.setComment("点检人点检结束"); } else { // 班组长确认 values.put("dataId", order.getId()); values.put("organization", request.getDealSuggestion()); values.put("comment", request.getDealSuggestion()); values.put("confirmation", request.getDealType()); request.setComment(request.getDealSuggestion()); if ("2".equals(request.getDealType())) { // 班组长驳回 List<String> usernames = new ArrayList<>(); usernames.add(order.getOperator()); order.setInspectionStatus("2"); values.put("NextAssignee", usernames); } } request.setValues(values); } private void updateOrderStatus(Result result, EamInspectionOrderRequest request, EamInspectionOrder order, LoginUser user) { if (result.isSuccess()) { if (InspectionStatus.IN_PROGRESS.getCode().equals(order.getInspectionStatus()) && StrUtil.isEmpty(request.getDealType())) { // 点检完成 order.setInspectionStatus("3"); order.setOperateTime(new Date()); eamInspectionOrderDetailService.remove(new QueryWrapper<EamInspectionOrderDetail>().eq("order_id", order.getId())); eamInspectionOrderDetailService.saveBatch(request.getTableDetailList()); } else if (InspectionStatus.COMPLETED.getCode().equals(order.getInspectionStatus()) && StrUtil.isNotEmpty(request.getDealType())) { // 班组长确认任务 order.setInspectionStatus("4"); order.setConfirmUser(user.getUsername()); order.setConfirmTime(new Date()); } } } private void updateEamInspectionOrder(EamInspectionOrder eamInspectionOrder) { this.updateById(eamInspectionOrder); } /** * 设备是否存在异常,并进行设备维修 * @param eamInspectionOrder */ private void updateEamInspectionOrderDetail(EamInspectionOrder eamInspectionOrder) { EamEquipmentFaultReason eamEquipmentFaultReason=eamEquipmentFaultReasonService. getOne(new QueryWrapper<EamEquipmentFaultReason>().eq("fault_code","EFR20250003")); List<EamInspectionOrderDetail> eamInspectionOrderDetails = eamInspectionOrderDetailService .list(new QueryWrapper<EamInspectionOrderDetail>() .eq("order_id", eamInspectionOrder.getId()).eq("report_flag","1")); List<EamReportRepair> eamReportRepairs = new ArrayList<>(); if (!eamInspectionOrderDetails.isEmpty()) { eamInspectionOrderDetails.forEach(item->{ EamReportRepair eamReportRepair=new EamReportRepair(); eamReportRepair.setEquipmentId(eamInspectionOrder.getEquipmentId()); eamReportRepair.setFaultName(eamEquipmentFaultReason.getFaultName()); eamReportRepair.setFaultType(eamEquipmentFaultReason.getFaultCategory()); eamReportRepair.setFaultDescription(eamEquipmentFaultReason.getFaultDescription()); eamReportRepair.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name()); eamReportRepair.setDelFlag(CommonConstant.DEL_FLAG_0); eamReportRepair.setFaultStartTime(new Date()); eamReportRepair.setRemark(item.getExceptionDescription()); eamReportRepairs.add(eamReportRepair); }); } if (!eamReportRepairs.isEmpty()) { eamReportRepairService.saveBatch(eamReportRepairs); } } /** * 批量作废与领取 * @param ids lxzn-module-flowable/pom.xml
@@ -56,11 +56,6 @@ <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> </dependencies> </project> lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/mapper/FlowMyBusinessMapper.java
@@ -8,6 +8,8 @@ import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness; import org.jeecg.modules.flowable.domain.dto.FlowTaskDto; import java.util.List; /** * @Description: 流程业务扩展表 * @Author: jeecg-boot @@ -17,11 +19,10 @@ public interface FlowMyBusinessMapper extends BaseMapper<FlowMyBusiness> { /** * 流程-我的已办 * @param flowMyBusinessDto * @param page * @param dto * @return */ IPage<FlowTaskDto> PageListMyBusiness(@Param("page")Page page, @Param("flowMyBusinessDto") FlowMyBusinessDto flowMyBusinessDto); List<FlowTaskDto> ListMyBusiness(@Param("dto") FlowMyBusinessDto dto); /** * 流程总台账 lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/mapper/xml/FlowMyBusinessMapper.xml
@@ -43,50 +43,59 @@ ORDER BY flow_my_business.create_time desc </select> <select id="PageListMyBusiness" resultType="org.jeecg.modules.flowable.domain.dto.FlowTaskDto"> <select id="ListMyBusiness" resultType="org.jeecg.modules.flowable.domain.dto.FlowTaskDto"> SELECT task.ID_ AS 'taskId', TASK.PROC_INST_ID_ AS 'procInsId', fmb.task_id AS 'taskId', fmb.process_instance_id AS 'procInsId', ACT_RE_PROCDEF.CATEGORY_ AS 'category', ACT_RE_PROCDEF.NAME_ 'procDefName', flow_my_business.title AS 'Description', flow_my_business.data_id AS 'dataId', flow_my_business.process_definition_key AS 'processDefinitionKey', flow_my_business.process_definition_id AS 'processDefinitionId', ACT_HI_PROCINST.START_TIME_ AS createTime, ACT_RU_TASK.ASSIGNEE_ as todoUsers, task.END_TIME_ AS 'finishTime', TASK.EXECUTION_ID_ AS 'executionId', task.NAME_ AS 'taskName', task.DURATION_ 'duration', task.TASK_DEF_KEY_ AS 'TaskDefKey' ACT_RE_PROCDEF.NAME_ AS 'procDefName', fmb.title AS 'Description', fmb.data_id AS 'dataId', fmb.process_definition_key AS 'processDefinitionKey', fmb.process_definition_id AS 'processDefinitionId', fmb.proposer, fmb.task_name, latest_task.NAME_ AS taskName, fmb.create_time AS createTime, latest_task.END_TIME_ AS finishTime FROM ACT_HI_TASKINST TASK LEFT JOIN flow_my_business ON flow_my_business.process_instance_id = TASK.PROC_INST_ID_ LEFT JOIN ACT_RE_PROCDEF ON flow_my_business.process_definition_id = ACT_RE_PROCDEF.ID_ LEFT JOIN ACT_HI_PROCINST ON TASK.PROC_INST_ID_ = ACT_HI_PROCINST.ID_ left join ACT_RU_TASK on flow_my_business.task_id = ACT_RU_TASK.ID_ flow_my_business fmb LEFT JOIN ACT_RE_PROCDEF ON fmb.process_definition_id = ACT_RE_PROCDEF.ID_ LEFT JOIN ACT_HI_PROCINST ON fmb.process_instance_id = ACT_HI_PROCINST.ID_ LEFT JOIN ( SELECT *, ROW_NUMBER() OVER ( PARTITION BY PROC_INST_ID_ ORDER BY END_TIME_ DESC ) AS rn FROM ACT_HI_TASKINST WHERE ASSIGNEE_ = #{dto.currentUser} <!-- 统一别名 --> <if test="dto.startTime != null"> AND START_TIME_ >= #{dto.startTime} </if> <if test="dto.endTime != null"> AND END_TIME_ <= #{dto.endTime} </if> ) latest_task ON fmb.process_instance_id = latest_task.PROC_INST_ID_ AND latest_task.rn = 1 WHERE TASK.END_TIME_ IS NOT NULL <if test="flowMyBusinessDto.currentUser != null and flowMyBusinessDto.currentUser != ''"> AND TASK.ASSIGNEE_ = #{flowMyBusinessDto.currentUser} <!-- 动态条件统一使用 dto --> <if test="dto.currentUser != null and dto.currentUser != ''"> fmb.done_users like concat('%',#{dto.currentUser},'%') </if> <if test="flowMyBusinessDto.category != null and flowMyBusinessDto.category != ''"> and ACT_RE_PROCDEF.CATEGORY_ = #{flowMyBusinessDto.category} <if test="dto.category != null and dto.category != ''"> AND ACT_RE_PROCDEF.CATEGORY_ = #{dto.category} </if> <if test="flowMyBusinessDto.flowName!= null and flowMyBusinessDto.flowName!= ''"> AND ACT_RE_PROCDEF.name_ LIKE CONCAT('%',#{flowMyBusinessDto.flowName},'%') <if test="dto.flowName != null and dto.flowName != ''"> AND ACT_RE_PROCDEF.NAME_ LIKE CONCAT('%', #{dto.flowName}, '%') </if> <if test="flowMyBusinessDto.title != null and flowMyBusinessDto.title != ''"> AND flow_my_business.title LIKE CONCAT('%',#{flowMyBusinessDto.title},'%') </if> <if test="flowMyBusinessDto.startTime!= null and flowMyBusinessDto.startTime!= ''"> AND TASK.START_TIME_ >= #{flowMyBusinessDto.startTime} </if> <if test="flowMyBusinessDto.endTime!= null and flowMyBusinessDto.endTime!= ''"> AND TASK.END_TIME_ <= #{flowMyBusinessDto.endTime} <if test="dto.title != null and dto.title != ''"> AND fmb.title LIKE CONCAT('%', #{dto.title}, '%') </if> ORDER BY TASK.END_TIME_ DESC latest_task.END_TIME_ DESC </select> </mapper> lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/apithird/business/service/impl/FlowMyBusinessServiceImpl.java
@@ -81,11 +81,10 @@ /** * 流程-我的已办 * @param flowMyBusinessDto * @param page * @return */ public IPage<FlowTaskDto> getPageListMyBusiness(Page page, FlowMyBusinessDto flowMyBusinessDto){ return flowMyBusinessMapper.PageListMyBusiness(page,flowMyBusinessDto); public List<FlowTaskDto> ListMyBusiness(FlowMyBusinessDto flowMyBusinessDto){ return flowMyBusinessMapper.ListMyBusiness(flowMyBusinessDto); } /** lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/domain/dto/FlowTaskDto.java
@@ -94,11 +94,11 @@ private String dataId; @ApiModelProperty("任务创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @ApiModelProperty("任务完成时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") private Date finishTime; /**流程定义key 一个key会有多个版本的id*/ lxzn-module-flowable/src/main/java/org/jeecg/modules/flowable/service/impl/FlowTaskServiceImpl.java
@@ -1039,8 +1039,8 @@ Page page = new Page(pageNum, pageSize); String username = iFlowThirdService.getLoginUser().getUsername(); flowMyBusinessDto.setCurrentUser(username); IPage<FlowTaskDto> flowTaskDtoIPage = flowMyBusinessService.getPageListMyBusiness(page,flowMyBusinessDto); flowTaskDtoIPage.getRecords().forEach(flowTaskDto -> { List<FlowTaskDto> list = flowMyBusinessService.ListMyBusiness(flowMyBusinessDto); list.forEach(flowTaskDto -> { // 流程发起人信息 HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery() .processInstanceId(flowTaskDto.getProcInsId()) @@ -1051,6 +1051,9 @@ List<String> departNamesByUsername = iFlowThirdService.getDepartNamesByUsername(historicProcessInstance.getStartUserId()); flowTaskDto.setStartDeptName(CollUtil.join(departNamesByUsername,",")); }); IPage<FlowTaskDto> flowTaskDtoIPage = new Page<>(); flowTaskDtoIPage.setRecords(list); flowTaskDtoIPage.setTotal(page.getTotal()); return Result.OK(flowTaskDtoIPage); }