Commit f40903dfa2359807bd017c8a482b9da4933f14d7
1 parent
9a768976
优化
Showing
4 changed files
with
11 additions
and
8 deletions
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/convert/AppGardenWorkOrderConvert.java
| ... | ... | @@ -4,14 +4,16 @@ import com.zteits.urbanops.module.garden.controller.app.inspectionplan.vo.AppIns |
| 4 | 4 | import com.zteits.urbanops.module.garden.dal.dataobject.inspectionplan.InspectionPlanDO; |
| 5 | 5 | import com.zteits.urbanops.module.garden.dal.dataobject.road.RoadDO; |
| 6 | 6 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; |
| 7 | +import org.mapstruct.Mapper; | |
| 7 | 8 | import org.mapstruct.factory.Mappers; |
| 8 | 9 | |
| 9 | 10 | import java.math.BigDecimal; |
| 10 | 11 | import java.time.LocalDateTime; |
| 11 | 12 | |
| 13 | +@Mapper | |
| 12 | 14 | public interface AppGardenWorkOrderConvert { |
| 13 | 15 | |
| 14 | - AppGardenWorkOrderConvert INSTANCE = Mappers.getMapper(AppGardenWorkOrderConvert.class); | |
| 16 | + public static final AppGardenWorkOrderConvert INSTANCE = Mappers.getMapper(AppGardenWorkOrderConvert.class); | |
| 15 | 17 | |
| 16 | 18 | default AppGardenWorkOrderReqVO buildAppGardenWorkOrderReqVO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO, RoadDO roadDO, String planNo ) { |
| 17 | 19 | AppGardenWorkOrderReqVO orderReqVO = new AppGardenWorkOrderReqVO(); | ... | ... |
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/inspectionplan/InspectionPlanCommitServiceImpl.java
| ... | ... | @@ -28,6 +28,7 @@ import com.zteits.urbanops.module.system.api.dept.DeptApi; |
| 28 | 28 | import com.zteits.urbanops.module.system.api.dept.dto.DeptRespDTO; |
| 29 | 29 | import com.zteits.urbanops.module.system.api.permission.RoleApi; |
| 30 | 30 | import com.zteits.urbanops.module.workorder.api.WorkOrderApi; |
| 31 | +import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderReqVO; | |
| 31 | 32 | import com.zteits.urbanops.module.workorder.dto.AppGardenWorkOrderRespVO; |
| 32 | 33 | import jakarta.annotation.Resource; |
| 33 | 34 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -98,10 +99,10 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 98 | 99 | throw exception(INSPECTION_PLAN_NOT_EXISTS); |
| 99 | 100 | } |
| 100 | 101 | /*3.转工单*/ |
| 101 | - String taskId = addWorkOrder(createReqVO, inspectionPlanDO); | |
| 102 | + String orderNO = addWorkOrder(createReqVO, inspectionPlanDO); | |
| 102 | 103 | |
| 103 | 104 | InspectionPlanCommitDO inspectionPlanCommit = getInspectionPlanCommitDO(createReqVO, inspectionPlanDO); |
| 104 | - inspectionPlanCommit.setTransWorkNo(taskId); | |
| 105 | + inspectionPlanCommit.setTransWorkNo(orderNO); | |
| 105 | 106 | /*4.查询计划明细最大次数*/ |
| 106 | 107 | Long countNum = inspectionPlanCommitMapper.selectCount(new QueryWrapper<InspectionPlanCommitDO>().lambda() |
| 107 | 108 | .eq(InspectionPlanCommitDO::getPlanNo, createReqVO.getPlanNo())); |
| ... | ... | @@ -150,9 +151,10 @@ public class InspectionPlanCommitServiceImpl implements InspectionPlanCommitServ |
| 150 | 151 | } |
| 151 | 152 | //查询道路信息 |
| 152 | 153 | RoadDO roadDO = roadMapper.selectOne(RoadDO::getId, inspectionPlanDO.getRoadId()); |
| 153 | - AppGardenWorkOrderRespVO workOrder = workOrderApi.createWorkOrder(AppGardenWorkOrderConvert.INSTANCE.buildAppGardenWorkOrderReqVO(createReqVO, inspectionPlanDO, roadDO, createReqVO.getPlanNo())); | |
| 154 | + AppGardenWorkOrderReqVO appGardenWorkOrderReqVO = AppGardenWorkOrderConvert.INSTANCE.buildAppGardenWorkOrderReqVO(createReqVO, inspectionPlanDO, roadDO, createReqVO.getPlanNo()); | |
| 155 | + AppGardenWorkOrderRespVO workOrder = workOrderApi.createWorkOrder(appGardenWorkOrderReqVO); | |
| 154 | 156 | log.info("创建工单结果:{}", JSONObject.toJSONString(workOrder)); |
| 155 | - return workOrder.getTaskId(); | |
| 157 | + return workOrder.getOrderNo(); | |
| 156 | 158 | } |
| 157 | 159 | |
| 158 | 160 | private static InspectionPlanCommitDO getInspectionPlanCommitDO(AppInspectionPlanCommitSaveReqVO createReqVO, InspectionPlanDO inspectionPlanDO) { | ... | ... |
urbanops-module-garden/src/main/resources/mapper/inspectionplan/InspectionPlanMapper.xml
urbanops-module-garden/src/main/resources/mapper/maintainplan/MaintainPlanMapper.xml