Commit 4018829fb12cf4df8775a692b720619a670de92d
1 parent
d586265e
工单来源修改,重新发起时业务线不一致时删除旧的附件
Showing
7 changed files
with
81 additions
and
4 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/app/garden/aop/InspectorBuzStatusUpdateAspect.java
| ... | ... | @@ -117,6 +117,14 @@ public class InspectorBuzStatusUpdateAspect { |
| 117 | 117 | targeVO.setRoadId(reqVO.getRoadId()); |
| 118 | 118 | targeVO.setPressingType(reqVO.getPressingType()); |
| 119 | 119 | targeVO.setExpectedFinishDate(reqVO.getExpectedFinishDate()); |
| 120 | + if(!dbData.getBusiLine().equals(reqVO.getBusiLine())){//如果前端业务线和数据库不一致 | |
| 121 | + //删除原来的 | |
| 122 | + gardenService.deleteAttachement(BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO.getOrderNo(),dbData.getBusiLine()); | |
| 123 | + } | |
| 124 | + List<String> problemsImgs = reqVO.getProblemsImgs(); | |
| 125 | + if(ObjectUtils.isNotAllEmpty(problemsImgs) && problemsImgs.size()>0){ | |
| 126 | + gardenService.attachmentInsertOrUpdate(problemsImgs,BpmCommonConstant.PROBLEM_IMG_GROUP,targeVO); | |
| 127 | + } | |
| 120 | 128 | } |
| 121 | 129 | |
| 122 | 130 | //大区经理退回 |
| ... | ... | @@ -152,7 +160,7 @@ public class InspectorBuzStatusUpdateAspect { |
| 152 | 160 | targeVO.setWoSourceName(roleList.get(0).getName()); |
| 153 | 161 | String busiLine = reqVO.getBusiLine(); |
| 154 | 162 | if(StringUtil.isEmpty(busiLine)){ |
| 155 | - busiLine = SecurityFrameworkUtils.getBusiLine(); | |
| 163 | + busiLine = dbData.getBusiLine(); | |
| 156 | 164 | } |
| 157 | 165 | targeVO.setBusiLine(busiLine); |
| 158 | 166 | targeVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmAIServiceImpl.java
| ... | ... | @@ -147,8 +147,17 @@ public class BpmAIServiceImpl implements BpmAIService{ |
| 147 | 147 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 148 | 148 | |
| 149 | 149 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 150 | - workOrder.setSourceId(EventSourceEnum.AI.getCode()); | |
| 151 | - workOrder.setSourceName(EventSourceEnum.AI.getDesc()); | |
| 150 | + | |
| 151 | + Integer sourceId = createRequestVo.getSourceId(); | |
| 152 | + String sourceName = createRequestVo.getSourceName(); | |
| 153 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | |
| 154 | + sourceId = EventSourceEnum.AI.getCode(); | |
| 155 | + } | |
| 156 | + if(StringUtil.isEmpty(sourceName)){ | |
| 157 | + sourceName = EventSourceEnum.AI.getDesc(); | |
| 158 | + } | |
| 159 | + workOrder.setSourceId(sourceId); | |
| 160 | + workOrder.setSourceName(sourceName); | |
| 152 | 161 | String wsourceId = createRequestVo.getWoSourceId(); |
| 153 | 162 | String wsourceName = createRequestVo.getWoSourceName(); |
| 154 | 163 | if(StringUtil.isEmpty(wsourceId)){ | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenService.java
| ... | ... | @@ -218,4 +218,11 @@ public interface BpmGardenService { |
| 218 | 218 | */ |
| 219 | 219 | public void attachmentInsertOrUpdate(List<String> imgList, String type, MainInfoDO workOrder); |
| 220 | 220 | |
| 221 | + /** | |
| 222 | + * 删除附件表 | |
| 223 | + * @param type | |
| 224 | + * @param orderNo | |
| 225 | + * @param busiLine | |
| 226 | + */ | |
| 227 | + public void deleteAttachement(String type,String orderNo,String busiLine); | |
| 221 | 228 | } | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| ... | ... | @@ -52,6 +52,7 @@ import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 52 | 52 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; |
| 53 | 53 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 54 | 54 | import com.zteits.urbanops.module.workorder.enums.BusiLineWorkerRoleCodeEnum; |
| 55 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | |
| 55 | 56 | import com.zteits.urbanops.module.workorder.util.TaskNodeUtils; |
| 56 | 57 | import jakarta.annotation.Resource; |
| 57 | 58 | import jodd.util.StringUtil; |
| ... | ... | @@ -596,6 +597,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 596 | 597 | if(null == roleList || roleList.size()==0){ |
| 597 | 598 | throw exception(APP_USER_ROLE_NOT_EXISTS); |
| 598 | 599 | } |
| 600 | + Integer sourceId = createRequestVo.getSourceId(); | |
| 601 | + String sourceName = createRequestVo.getSourceName(); | |
| 602 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | |
| 603 | + sourceId = EventSourceEnum.PATROL.getCode(); | |
| 604 | + } | |
| 605 | + if(StringUtil.isEmpty(sourceName)){ | |
| 606 | + sourceName = EventSourceEnum.PATROL.getDesc(); | |
| 607 | + } | |
| 608 | + workOrder.setSourceId(sourceId); | |
| 609 | + workOrder.setSourceName(sourceName); | |
| 599 | 610 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 600 | 611 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 601 | 612 | String busiLine = createRequestVo.getBusiLine(); |
| ... | ... | @@ -678,6 +689,16 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 678 | 689 | } |
| 679 | 690 | } |
| 680 | 691 | |
| 692 | + public void deleteAttachement(String type,String orderNo,String busiLine){ | |
| 693 | + LambdaQueryWrapper<AttachmentDO> deleteWrapper = new LambdaQueryWrapper<AttachmentDO>() | |
| 694 | + .eq(AttachmentDO::getBusiType, type) | |
| 695 | + .eq(AttachmentDO::getOrderNo, orderNo); | |
| 696 | + if(StringUtil.isNotEmpty(busiLine)){// 全域巡查员 发起的工单 业务线有可能为空 | |
| 697 | + deleteWrapper.eq(AttachmentDO::getBusiLine, busiLine); | |
| 698 | + } | |
| 699 | + attachmentMapper.delete(deleteWrapper); | |
| 700 | + } | |
| 701 | + | |
| 681 | 702 | |
| 682 | 703 | @Override |
| 683 | 704 | public void updateWorkOrderStatus(Long id, Integer status) { | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmInspectorServiceImpl.java
| ... | ... | @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 31 | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderInspectorReqVO; |
| 32 | 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; |
| 33 | 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 34 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | |
| 34 | 35 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 35 | 36 | import jakarta.annotation.Resource; |
| 36 | 37 | import jodd.util.StringUtil; |
| ... | ... | @@ -147,6 +148,16 @@ public class BpmInspectorServiceImpl implements BpmInspectorService{ |
| 147 | 148 | workOrder.setCompanyId(SecurityFrameworkUtils.getCompanyId()); |
| 148 | 149 | |
| 149 | 150 | workOrder.setDeptId(SecurityFrameworkUtils.getDeptId()); |
| 151 | + Integer sourceId = createRequestVo.getSourceId(); | |
| 152 | + String sourceName = createRequestVo.getSourceName(); | |
| 153 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | |
| 154 | + sourceId = EventSourceEnum.PATROL.getCode(); | |
| 155 | + } | |
| 156 | + if(StringUtil.isEmpty(sourceName)){ | |
| 157 | + sourceName = EventSourceEnum.PATROL.getDesc(); | |
| 158 | + } | |
| 159 | + workOrder.setSourceId(sourceId); | |
| 160 | + workOrder.setSourceName(sourceName); | |
| 150 | 161 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 151 | 162 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 152 | 163 | String busiLine = createRequestVo.getBusiLine(); | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmRegionMgrServiceImpl.java
| ... | ... | @@ -25,6 +25,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoExtMapper |
| 25 | 25 | import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 26 | 26 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 27 | 27 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 28 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | |
| 28 | 29 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 29 | 30 | import jakarta.annotation.Resource; |
| 30 | 31 | import jodd.util.StringUtil; |
| ... | ... | @@ -137,6 +138,16 @@ public class BpmRegionMgrServiceImpl implements BpmRegionMgrService{ |
| 137 | 138 | if(!RoleListUtils.containsCode(roleList,REGIONAL_MANAGER)){ |
| 138 | 139 | throw exception(APP_REGIONMGR_USER_ROLE_ERROR); |
| 139 | 140 | } |
| 141 | + Integer sourceId = createRequestVo.getSourceId(); | |
| 142 | + String sourceName = createRequestVo.getSourceName(); | |
| 143 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | |
| 144 | + sourceId = EventSourceEnum.REGION.getCode(); | |
| 145 | + } | |
| 146 | + if(StringUtil.isEmpty(sourceName)){ | |
| 147 | + sourceName = EventSourceEnum.REGION.getDesc(); | |
| 148 | + } | |
| 149 | + workOrder.setSourceId(sourceId); | |
| 150 | + workOrder.setSourceName(sourceName); | |
| 140 | 151 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 141 | 152 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 142 | 153 | String busiLine = createRequestVo.getBusiLine(); | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmUniversalServiceImpl.java
| ... | ... | @@ -31,6 +31,7 @@ import com.zteits.urbanops.module.workorder.dal.mysql.maininfo.MainInfoMapper; |
| 31 | 31 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 32 | 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderUniversalReqVO; |
| 33 | 33 | import com.zteits.urbanops.module.workorder.enums.BusiLineTeamLeaderRoleCodeEnum; |
| 34 | +import com.zteits.urbanops.module.workorder.enums.EventSourceEnum; | |
| 34 | 35 | import com.zteits.urbanops.module.workorder.util.RoleListUtils; |
| 35 | 36 | import jakarta.annotation.Resource; |
| 36 | 37 | import jodd.util.StringUtil; |
| ... | ... | @@ -135,7 +136,16 @@ public class BpmUniversalServiceImpl implements BpmUniversalService{ |
| 135 | 136 | if(RoleListUtils.containsBothCodes(roleList, REGIONAL_MANAGER, PARTROL_GLOBAL)){ |
| 136 | 137 | throw exception(APP_WORK_ORADER_ROLE_ILLEGLE); |
| 137 | 138 | } |
| 138 | - | |
| 139 | + Integer sourceId = createRequestVo.getSourceId(); | |
| 140 | + String sourceName = createRequestVo.getSourceName(); | |
| 141 | + if(!ObjectUtils.isNotAllEmpty(sourceId)){ | |
| 142 | + sourceId = EventSourceEnum.PATROL.getCode(); | |
| 143 | + } | |
| 144 | + if(StringUtil.isEmpty(sourceName)){ | |
| 145 | + sourceName = EventSourceEnum.PATROL.getDesc(); | |
| 146 | + } | |
| 147 | + workOrder.setSourceId(sourceId); | |
| 148 | + workOrder.setSourceName(sourceName); | |
| 139 | 149 | workOrder.setWoSourceId(roleList.get(0).getCode()); |
| 140 | 150 | workOrder.setWoSourceName(roleList.get(0).getName()); |
| 141 | 151 | workOrder.setUserId(SecurityFrameworkUtils.getLoginUserId()); | ... | ... |