From 9c88db4ef79a070dc98fdefc42d3195d9bd3fd8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Wed, 6 Nov 2024 10:20:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E8=AE=BE=E5=A4=87=E4=BF=9D?= =?UTF-8?q?=E5=85=BB=E5=92=8C=E8=AE=BE=E5=A4=87=E5=B7=A1=E6=A3=80=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DmsBillsInspectInstanceController.java | 2 +- .../dms/mapper/DmsBillsMaintDetailMapper.java | 8 ++++++ .../mapper/DmsBillsMaintInstanceMapper.java | 5 ++++ .../DmsInspectInstanceDetailMapper.java | 1 + ...DmsInspectInstanceDetailProjectMapper.java | 1 + .../hw/dms/mapper/DmsPlanInspectMapper.java | 1 + .../dms/mapper/DmsPlanMaintDetailMapper.java | 2 ++ .../dms/service/IDmsPlanInspectService.java | 1 + .../DmsBillsInspectInstanceServiceImpl.java | 12 ++++---- .../DmsBillsMaintInstanceServiceImpl.java | 18 ++++++++++++ .../impl/DmsPlanInspectServiceImpl.java | 15 ++++++++++ .../impl/DmsPlanMaintDetailServiceImpl.java | 4 +++ .../mapper/dms/DmsBillsMaintDetailMapper.xml | 12 ++++++++ .../dms/DmsBillsMaintInstanceMapper.xml | 6 ++++ .../dms/DmsInspectInstanceDetailMapper.xml | 3 ++ .../DmsInspectInstanceDetailProjectMapper.xml | 28 +++++++++++-------- .../mapper/dms/DmsPlanInspectMapper.xml | 8 ++++++ .../mapper/dms/DmsPlanMaintDetailMapper.xml | 12 ++++++-- 18 files changed, 118 insertions(+), 21 deletions(-) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java index ba89edb..0be0d45 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsInspectInstanceController.java @@ -109,7 +109,7 @@ public class DmsBillsInspectInstanceController extends BaseController // 使用 replaceAll 方法将双引号替换为空字符串 String result = dmsBillsInstanceId.replaceAll("\"", ""); - DmsPlanInspect dmsPlanInspect = dmsPlanInspectService.selectDmsPlanInspectByPlanInspectId(Long.valueOf(result)); + DmsPlanInspect dmsPlanInspect = dmsPlanInspectService.selectDmsPlanInspectByPlanInspectId1(dmsBillsInstanceId); DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintDetailMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintDetailMapper.java index 74c647e..052d097 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintDetailMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintDetailMapper.java @@ -1,6 +1,9 @@ package com.hw.dms.mapper; import java.util.List; + +import com.hw.dms.domain.DmsBaseMaintProject; +import com.hw.dms.domain.DmsBaseMaintStation; import com.hw.dms.domain.DmsBillsMaintDetail; /** @@ -75,4 +78,9 @@ public interface DmsBillsMaintDetailMapper */ public List selectDmsBillsMaintDetailJoinList(DmsBillsMaintDetail dmsBillsMaintDetail); + List selectDetailList(Long maintInstanceId); + + DmsBaseMaintStation selectMainStation(Long stationId); + + List selectPrjectIds(Long stationId); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintInstanceMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintInstanceMapper.java index 36b1350..4adb7ac 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintInstanceMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsMaintInstanceMapper.java @@ -1,8 +1,10 @@ package com.hw.dms.mapper; +import java.util.ArrayList; import java.util.List; import com.hw.dms.domain.DmsBillsMaintDetail; +import com.hw.dms.domain.DmsBillsMaintDetailProject; import com.hw.dms.domain.DmsBillsMaintInstance; /** @@ -78,4 +80,7 @@ public interface DmsBillsMaintInstanceMapper { * @return 保养工单 */ public DmsBillsMaintInstance selectNewestDmsBillsMaintInstance(DmsBillsMaintInstance dmsBillsMaintInstance); + + int batchDmsProject(List list); + } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailMapper.java index 7f4a77f..4e79ca7 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailMapper.java @@ -80,4 +80,5 @@ public interface DmsInspectInstanceDetailMapper public DmsInspectInstanceDetail selectDmsInspectInstanceDetailByUI(@Param("inspectInstanceId") Long inspectInstanceId, @Param("deviceCode") String deviceCode); + Long selectProjectId(String inspectStandard); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java index a0f5d67..bd4c0c7 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsInspectInstanceDetailProjectMapper.java @@ -80,4 +80,5 @@ public interface DmsInspectInstanceDetailProjectMapper * */ List selectDmsInspectInstanceDetailProjectByInspectInstanceId(@Param("inspectInstanceId") Long inspectInstanceId, @Param("lineStep") Long lineStep); + Long selectProjectByStandardId(String inspectStandard); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanInspectMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanInspectMapper.java index 95e4e1f..c979913 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanInspectMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanInspectMapper.java @@ -60,5 +60,6 @@ public interface DmsPlanInspectMapper public int deleteDmsPlanInspectByPlanInspectIds(Long[] planInspectIds); DmsPlanInspect selectPlanInspectJoinJobByInspectId(Long planInspectId); + DmsPlanInspect selectPlanInspectJoinJobByInspectId1(String planInspectId); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java index a0429c1..0db79c2 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsPlanMaintDetailMapper.java @@ -19,6 +19,8 @@ public interface DmsPlanMaintDetailMapper */ public DmsPlanMaintDetail selectDmsPlanMaintDetailByPlanMaintDetailId(Long planMaintDetailId); + public Long selectStationIdByCode(String maintStationCode); + /** * 查询保养计划明细列表 * diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsPlanInspectService.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsPlanInspectService.java index 734580b..c05642e 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsPlanInspectService.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/IDmsPlanInspectService.java @@ -20,6 +20,7 @@ public interface IDmsPlanInspectService * @return 巡检计划信息 */ public DmsPlanInspect selectDmsPlanInspectByPlanInspectId(Long planInspectId); + public DmsPlanInspect selectDmsPlanInspectByPlanInspectId1(String planInspectId); /** * 查询巡检计划信息列表 diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java index 52a7b35..6a466fe 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsInspectInstanceServiceImpl.java @@ -128,18 +128,18 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta dmsInspectInstanceDetail.setInstanceDetailStatus("1"); dmsInspectInstanceDetail.setInspectStandard(dmsInspectRouteDetail.getInspectStandard()); dmsInspectInstanceDetailMapper.insertDmsInspectInstanceDetail(dmsInspectInstanceDetail); - + Long projectId = dmsInspectInstanceDetailMapper.selectProjectId(dmsInspectRouteDetail.getInspectStandard()); DmsInspectProjectDevice queryInspectProjectDevice = new DmsInspectProjectDevice(); queryInspectProjectDevice.setTargetType("2"); queryInspectProjectDevice.setTargetId(deviceId); List dmsInspectProjectDevices = dmsInspectProjectDeviceMapper.selectDmsInspectProjectDeviceList(queryInspectProjectDevice); - for(DmsInspectProjectDevice dmsInspectProjectDevice:dmsInspectProjectDevices){ +// for(DmsInspectProjectDevice dmsInspectProjectDevice:dmsInspectProjectDevices){ DmsInspectInstanceDetailProject dmsInspectInstanceDetailProject = new DmsInspectInstanceDetailProject(); dmsInspectInstanceDetailProject.setInstanceDetailId(dmsInspectInstanceDetail.getInstanceDetailId()); - dmsInspectInstanceDetailProject.setInspectProjectId(dmsInspectProjectDevice.getInspectProjectId()); + dmsInspectInstanceDetailProject.setInspectProjectId(projectId); dmsInspectInstanceDetailProject.setCreateTime(new Date()); dmsInspectInstanceDetailProjectMapper.insertDmsInspectInstanceDetailProject(dmsInspectInstanceDetailProject); - } +// } } @@ -245,10 +245,12 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta if (dmsInspectInstanceDetail == null) { throw new ServiceException("无此设备的检查工单"); } - Long deviceId = dmsInspectInstanceDetail.getDeviceId(); DmsInspectInstanceDetailProject queryInspectInstanceDetailProject = new DmsInspectInstanceDetailProject(); queryInspectInstanceDetailProject.setDeviceId(deviceId); + Long projectId = dmsInspectInstanceDetailPrjectMapper.selectProjectByStandardId(dmsInspectInstanceDetail.getInspectStandard()); + queryInspectInstanceDetailProject.setInspectProjectId(projectId); + queryInspectInstanceDetailProject.setInstanceDetailId(dmsInspectInstanceDetail.getInstanceDetailId()); List dmsInspectInstanceDetailProjects = dmsInspectInstanceDetailPrjectMapper.selectDmsInspectInstanceDetailProjectJoinList(queryInspectInstanceDetailProject); dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProjects); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsMaintInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsMaintInstanceServiceImpl.java index 9fd6774..7194a78 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsMaintInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsMaintInstanceServiceImpl.java @@ -113,10 +113,28 @@ public class DmsBillsMaintInstanceServiceImpl implements IDmsBillsMaintInstanceS dmsBillsMaintDetail.setStationId(planMaintDetail.getMaintStationId()); dmsBillsMaintDetail.setMaintStandardId(planMaintDetail.getMaintStandardId()); dmsBillsMaintDetail.setIsFlag(1L); + dmsBillsMaintDetail.setMaintStatus(1L); billsMaintDetails.add(dmsBillsMaintDetail); }); dmsBillsMaintInstanceMapper.batchDmsBillsMaintDetail(billsMaintDetails); + ArrayList list1 = new ArrayList<>(); + List list = dmsBillsMaintDetailMapper.selectDetailList(maintInstanceId); + for (DmsBillsMaintDetail detail : list) { + List projects = dmsBillsMaintDetailMapper.selectPrjectIds(detail.getStationId()); + for (DmsBaseMaintProject project : projects) { + DmsBillsMaintDetailProject project1 = new DmsBillsMaintDetailProject(); + project1.setBillsMaintDetailId(detail.getBillsMaintDetailId()); +// DmsBaseMaintStation station = dmsBillsMaintDetailMapper.selectMainStation(detail.getStationId()); + project1.setMaintProjectId(project.getMaintProjectId()); + project1.setMaintProjectName(project.getMaintProjectName()); + project1.setMaintProjectDesc(project.getMaintProjectDesc()); + project1.setMaintProjectStatus("2"); + list1.add(project1); + } + + } + dmsBillsMaintInstanceMapper.batchDmsProject(list1); } @Override diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java index 2b5a857..0e35967 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanInspectServiceImpl.java @@ -53,6 +53,21 @@ public class DmsPlanInspectServiceImpl implements IDmsPlanInspectService Long days = timeLimit / (24 * 60 * 60l); Long hours = timeLimit % (24 * 60 * 60l); // System.out.println(days); +// System.out.println(hours); + dmsPlanInspect.setTimeLimitDays(days); + dmsPlanInspect.setTimeLimitHours(hours / (60 * 60l)); + } + return dmsPlanInspect; + } + @Override + public DmsPlanInspect selectDmsPlanInspectByPlanInspectId1(String planInspectId) + { + DmsPlanInspect dmsPlanInspect = dmsPlanInspectMapper.selectPlanInspectJoinJobByInspectId1(planInspectId); + Long timeLimit = dmsPlanInspect.getTimeLimit(); + if (timeLimit != null) { + Long days = timeLimit / (24 * 60 * 60l); + Long hours = timeLimit % (24 * 60 * 60l); +// System.out.println(days); // System.out.println(hours); dmsPlanInspect.setTimeLimitDays(days); dmsPlanInspect.setTimeLimitHours(hours / (60 * 60l)); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java index e1f1471..3bdda42 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsPlanMaintDetailServiceImpl.java @@ -60,6 +60,8 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService dmsPlanMaintDetail.setCreateBy(SecurityUtils.getUsername()); dmsPlanMaintDetail.setCreateTime(DateUtils.getNowDate()); dmsPlanMaintDetail.setIsFlag(1l); + Long stationId = dmsPlanMaintDetailMapper.selectStationIdByCode(dmsPlanMaintDetail.getMaintStationCode()); + dmsPlanMaintDetail.setMaintStationId(stationId); return dmsPlanMaintDetailMapper.insertDmsPlanMaintDetail(dmsPlanMaintDetail); } @@ -74,6 +76,8 @@ public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService { dmsPlanMaintDetail.setUpdateBy(SecurityUtils.getUsername()); dmsPlanMaintDetail.setUpdateTime(DateUtils.getNowDate()); + Long stationId = dmsPlanMaintDetailMapper.selectStationIdByCode(dmsPlanMaintDetail.getMaintStationCode()); + dmsPlanMaintDetail.setMaintStationId(stationId); return dmsPlanMaintDetailMapper.updateDmsPlanMaintDetail(dmsPlanMaintDetail); } diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintDetailMapper.xml index 4c58f68..c8c3709 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintDetailMapper.xml @@ -148,5 +148,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and dbmd.maint_status = #{maintStatus} + + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml index 0e65977..c6d2999 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml @@ -137,6 +137,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ( #{item.billsMaintDetailId}, #{item.maintInstanceId}, #{item.deviceId}, #{item.stationId}, #{item.maintStandardId}, #{item.operationDescription}, #{item.maintStatus}, #{item.isFlag}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + insert into dms_bills_maint_detail_project( bills_maint_detail_id, maint_project_id, maint_project_name, maint_project_desc, maint_project_status, remark, create_by, create_time, update_by, update_time) values + + ( #{item.billsMaintDetailId}, #{item.maintProjectId}, #{item.maintProjectName}, #{item.maintProjectDesc}, #{item.maintProjectStatus}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}) + + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml index 36acba6..4cc9609 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsInspectInstanceDetailProjectMapper.xml @@ -130,18 +130,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -150,5 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where instance_detail_id =( select instance_detail_id from dms_inspect_instance_detail where inspect_instance_id = #{inspectInstanceId} and line_step = #{lineStep}) + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanInspectMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanInspectMapper.xml index b4d2fae..6540d89 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanInspectMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanInspectMapper.xml @@ -135,5 +135,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml index 7f51581..7b86ae4 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsPlanMaintDetailMapper.xml @@ -41,8 +41,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -117,7 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select dpmd.plan_maint_detail_id, dpmd.plan_maint_id, dpmd.device_id, dpmd.maint_station_id, dpmd.maint_standard_id, dpmd.operation_description, dpmd.is_flag, dpmd.remark, dbmsd.maint_protocol, - dbms.maint_station_name + dbms.maint_station_name, + dbms.maint_station_code from dms_plan_maint_detail dpmd left join dms_base_maint_standard dbmsd on dpmd.maint_standard_id=dbmsd.maint_standard_id left join dms_base_maint_station dbms on dpmd.maint_station_id=dbms.maint_station_id @@ -143,5 +146,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join dms_base_maint_standard d on a.maint_station_id = d.maint_standard_id where a.plan_maint_id = #{planMaintId} +