From 5d684066275f2c114c93c2696dc76174829b9ca3 Mon Sep 17 00:00:00 2001 From: "maxw@mesnac.com" Date: Wed, 27 Nov 2024 10:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=BA=93=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DmsBillsInspectInstanceMapper.java | 4 ++++ .../DmsBillsInspectInstanceServiceImpl.java | 20 ++++++++++++++----- .../impl/DmsKnowledgeMaintServiceImpl.java | 4 +++- .../impl/DmsKnowledgeRepairServiceImpl.java | 2 ++ .../mapper/dms/BaseAttachInfoMapper.xml | 4 ++-- .../mapper/dms/DmsBaseMaintStandardMapper.xml | 4 ++-- .../dms/DmsBillsInspectInstanceMapper.xml | 17 ++++++++++++++++ 7 files changed, 45 insertions(+), 10 deletions(-) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsInspectInstanceMapper.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsInspectInstanceMapper.java index 55ea2c95..bda18461 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsInspectInstanceMapper.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/mapper/DmsBillsInspectInstanceMapper.java @@ -79,4 +79,8 @@ public interface DmsBillsInspectInstanceMapper int insertRecord(DmsRecordInspect dmsRecordInspect); List selectRecordByInstainceId(@Param("inspectInstanceId") Long inspectInstanceId); + + int selectUnCompletedInstance(@Param("inspectInstanceId") Long inspectInstanceId); + + int selectAllInstance(@Param("inspectInstanceId")Long inspectInstanceId); } 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 3e521b85..3aefe490 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 @@ -256,8 +256,10 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProjects); DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); + dmsBillsInspectInstance.setInspectInstanceId(dmsBillsInspectInstanceScanVo.getInspectInstanceId()); dmsBillsInspectInstance.setRealBeginTime(new Date()); +// dmsBillsInspectInstance.setInspectStatus("2"); int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance); return dmsInspectInstanceDetail; @@ -276,13 +278,21 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta DmsRecordInspect dmsRecordInspect = dmsBillsInspectInstanceMapper.selectRecord(dmsInspectInstanceDetail.getInstanceDetailId()); List recordInspect = dmsBillsInspectInstanceMapper.selectRecordByInstainceId(dmsRecordInspect.getInspectInstanceId()); - if (recordInspect!=null&&recordInspect.size()>0){ - dmsRecordInspect.setInspectStatus(2l); - }else { - dmsRecordInspect.setInspectStatus(3l); - } +// if (recordInspect!=null&&recordInspect.size()>0){ +// dmsRecordInspect.setInspectStatus(2l); +// }else { +// dmsRecordInspect.setInspectStatus(3l); +// } + dmsRecordInspect.setInspectStatus(3l); int i1 = dmsBillsInspectInstanceMapper.insertRecord(dmsRecordInspect); + int count = dmsBillsInspectInstanceMapper.selectUnCompletedInstance(dmsRecordInspect.getInspectInstanceId()); +// int count1 = dmsBillsInspectInstanceMapper.selectAllInstance(dmsRecordInspect.getInspectInstanceId()); DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); + if (count==0||count==1){ + dmsBillsInspectInstance.setInspectStatus("3"); + }else{ + dmsBillsInspectInstance.setInspectStatus("2"); + } dmsBillsInspectInstance.setInspectInstanceId(dmsInspectInstanceDetail.getInspectInstanceId()); dmsBillsInspectInstance.setRealEndTime(new Date()); int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java index a1e88c97..47b92bac 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeMaintServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.ArrayList; +import java.util.Date; import java.util.List; import com.hw.common.core.constant.DmsConstants; @@ -147,8 +148,9 @@ public class DmsKnowledgeMaintServiceImpl implements IDmsKnowledgeMaintService for (String fileUrl : fileUrls){ BaseAttachInfo baseAttachInfo = new BaseAttachInfo(); baseAttachInfo.setAttachType(DmsConstants.MES_BASE_ATTACH_INFO_KNOWLEDGEMAINT); - baseAttachInfo.setAttachName("name"); + baseAttachInfo.setAttachName("设备保养"); baseAttachInfo.setAttachPath(fileUrl); + baseAttachInfo.setCreateTime(new Date()); baseAttachInfo.setProcessId(knowledgeLubeId); baseAttachInfos.add(baseAttachInfo); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java index 78fd4610..4d7d022b 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsKnowledgeRepairServiceImpl.java @@ -1,6 +1,7 @@ package com.hw.dms.service.impl; import java.util.ArrayList; +import java.util.Date; import java.util.List; import com.hw.common.core.constant.DmsConstants; @@ -151,6 +152,7 @@ public class DmsKnowledgeRepairServiceImpl implements IDmsKnowledgeRepairService baseAttachInfo.setAttachName("name"); baseAttachInfo.setAttachPath(fileUrl); baseAttachInfo.setProcessId(knowledgeLubeId); + baseAttachInfo.setCreateTime(new Date()); baseAttachInfos.add(baseAttachInfo); } baseAttachInfoMapper.batchDmsKnowLedgeLubeFile(baseAttachInfos); diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/BaseAttachInfoMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/BaseAttachInfoMapper.xml index 3cd28992..fc551b3b 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/BaseAttachInfoMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/BaseAttachInfoMapper.xml @@ -19,9 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into mes_base_attach_info( attach_type, attach_name, attach_path, process_id) values + insert into mes_base_attach_info( attach_type, attach_name, attach_path, process_id,create_time) values - ( #{item.attachType}, #{item.attachName}, #{item.attachPath}, #{item.processId}) + ( #{item.attachType}, #{item.attachName}, #{item.attachPath}, #{item.processId},#{item.createTime}) diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseMaintStandardMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseMaintStandardMapper.xml index c48b9ce2..094eab1c 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseMaintStandardMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBaseMaintStandardMapper.xml @@ -26,9 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select a.maint_standard_id, a.maint_standard_code, a.device_type_id, a.maint_protocol, a.operation_description, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time from dms_base_maint_standard a left join dms_base_device_type b on a.device_type_id = b.device_type_id - and a.maint_standard_code = #{maintStandardCode} + and a.maint_standard_code like concat('%',#{maintStandardCode},'%') and a.device_type_id = #{deviceTypeId} - and a.maint_protocol = #{maintProtocol} + and a.maint_protocol like concat('%',#{maintProtocol},'%') and a.operation_description = #{operationDescription} and a.is_flag = #{isFlag} and b.type_name like concat('%', #{TypeName},'%') diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml index 429ca333..0d660938 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsInspectInstanceMapper.xml @@ -259,5 +259,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parameterType="java.lang.Long"> select * from dms_record_inspect where inspect_instance_id = #{inspectInstanceId} and inspect_status != 3 + +