From dd1bc05ee4ac28e8843ec657212fd959f039041f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Sat, 23 Nov 2024 11:13:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86=E7=82=B9?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95=E9=A1=B5=E9=9D=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E8=AE=BE=E5=A4=87=E7=BB=B4=E4=BF=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DmsBillsFaultInstanceController.java | 9 ++- .../DmsBillsInspectInstanceController.java | 2 + .../dms/controller/DmsMobileController.java | 14 +++- .../hw/dms/domain/DmsBillsFaultInstance.java | 1 + .../dms/domain/DmsFaultInstanceActivity.java | 2 + .../com/hw/dms/domain/DmsRecordInspect.java | 9 +++ .../mapper/DmsBillsInspectInstanceMapper.java | 7 ++ .../DmsBillsFaultInstanceServiceImpl.java | 25 ++++++- .../DmsBillsInspectInstanceServiceImpl.java | 19 +++++- .../dms/DmsBillsFaultInstanceMapper.xml | 6 +- .../dms/DmsBillsInspectInstanceMapper.xml | 66 +++++++++++++++++++ .../dms/DmsFaultInstanceActivityMapper.xml | 8 ++- 12 files changed, 158 insertions(+), 10 deletions(-) diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsFaultInstanceController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsFaultInstanceController.java index b315563..ff776d6 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsFaultInstanceController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsBillsFaultInstanceController.java @@ -117,6 +117,7 @@ public class DmsBillsFaultInstanceController extends BaseController beanParams.put("applyTime",format.format(faulsts.getApplyTime())); beanParams.put("deviceName",faulsts.getDeviceName()); beanParams.put("deviceLocation",faulsts.getDeviceLocation()); + beanParams.put("deviceCode",faulsts.getDeviceCode()); if (faulsts.getRealBeginTime()!=null){ beanParams.put("realEndTime",format.format(faulsts.getRealEndTime())); @@ -133,7 +134,13 @@ public class DmsBillsFaultInstanceController extends BaseController beanParams.put("repairContent",faulsts.getRepairContent()); beanParams.put("protectedMethod",faulsts.getProtectedMethod()); beanParams.put("repairer",faulsts.getRepairer()); - beanParams.put("repairConfirm",faulsts.getRepairConfirm()); + String repairConfirm; + if (faulsts.getRepairConfirm()==2){ + repairConfirm = "确认完成"; + }else { + repairConfirm = "未完成"; + } + beanParams.put("repairConfirm",repairConfirm); beanParams.put("list",faulsts.getParts()); TemplateExcelUtils.downLoadExcel("维修记录","",beanParams, response); 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 0be0d45..0a98e06 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 @@ -1,5 +1,6 @@ package com.hw.dms.controller; +import java.util.Date; import java.util.List; import java.io.IOException; import javax.servlet.http.HttpServletResponse; @@ -120,6 +121,7 @@ public class DmsBillsInspectInstanceController extends BaseController dmsBillsInspectInstance.setWfProcessId(105l); dmsBillsInspectInstance.setInspectType(dmsPlanInspect.getInspectType()); dmsBillsInspectInstance.setPlanBeginTime(dmsPlanInspect.getPlanTime()); + dmsBillsInspectInstance.setPlanEndTime(new Date(dmsPlanInspect.getPlanTime().getTime()+dmsPlanInspect.getTimeLimit()*1000l)); dmsBillsInspectInstance.setInspectRouteId(dmsPlanInspect.getInspectRouteId()); dmsBillsInspectInstance.setDeviceAmount(dmsPlanInspect.getDeviceAmount()); dmsBillsInspectInstance.setPerformer(dmsPlanInspect.getPerformer()); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java index 31d91ba..cdf06b0 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/controller/DmsMobileController.java @@ -1,5 +1,8 @@ package com.hw.dms.controller; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import com.hw.common.core.constant.DmsConstants; import com.hw.common.core.domain.R; import com.hw.common.core.web.controller.BaseController; @@ -21,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -200,8 +204,14 @@ public class DmsMobileController extends BaseController { // @RequiresPermissions("qms:checkresultdetail:add") @Log(title = "故障报修工单", businessType = BusinessType.COMPLETE) @PostMapping("/completeRepair") - public AjaxResult completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity,@RequestParam(value = "files") List files) { - List fileUrls = new ArrayList<>(); + public AjaxResult completeRepair(DmsFaultInstanceActivity dmsFaultInstanceActivity,@RequestParam(value = "files") List files) throws JsonProcessingException { + dmsFaultInstanceActivity.setRepairConfirm(2); + dmsFaultInstanceActivity.setConfirmTime(new Date()); + String parts1 = dmsFaultInstanceActivity.getParts1(); + ObjectMapper objectMapper = new ObjectMapper(); + List parts2 = objectMapper.readValue(parts1, new TypeReference>() {}); + dmsFaultInstanceActivity.setParts(parts2); + List < String > fileUrls = new ArrayList<>(); for (MultipartFile file : files) { R sysFileR = remoteFileService.upload(file); SysFile sysFile = sysFileR.getData(); diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java index f73c9ae..e851019 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsBillsFaultInstance.java @@ -108,6 +108,7 @@ public class DmsBillsFaultInstance extends BaseEntity private List sysFiles; private List dmsInstanceFiles; + private List dmsInstanceFiles1; private String checkedFault; private String repairContent; private String protectedMethod; diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java index bce97b1..70c2723 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsFaultInstanceActivity.java @@ -111,9 +111,11 @@ public class DmsFaultInstanceActivity extends BaseEntity private Integer repairConfirm; private Date confirmTime; private Long componentsPartsId; + private String parts1; private List parts; private String deviceName; private String deviceLocation; + private String deviceCode; private String applyUser; private Date applyTime; private Date realBeginTime; diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordInspect.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordInspect.java index d68497f..df39f22 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordInspect.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/domain/DmsRecordInspect.java @@ -72,7 +72,16 @@ public class DmsRecordInspect extends BaseEntity /** 是否标识:1-是;0-否 */ @Excel(name = "是否标识:1-是;0-否") private String isFlag; + private Long inspectInstanceId; + public void setInspectInstanceId(Long inspectInstanceId) + { + this.inspectInstanceId = inspectInstanceId; + } + public Long getInspectInstanceId() + { + return inspectInstanceId; + } public void setRecordInspectId(Long recordInspectId) { this.recordInspectId = recordInspectId; 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 8a0a6a7..55ea2c9 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 @@ -2,6 +2,8 @@ package com.hw.dms.mapper; import java.util.List; import com.hw.dms.domain.DmsBillsInspectInstance; +import com.hw.dms.domain.DmsRecordInspect; +import org.apache.ibatis.annotations.Param; /** * 巡检工单Mapper接口 @@ -72,4 +74,9 @@ public interface DmsBillsInspectInstanceMapper public DmsBillsInspectInstance selectNewestDmsBillsInspectInstance(DmsBillsInspectInstance dmsBillsInspectInstance); + DmsRecordInspect selectRecord(@Param("instanceDetailId") Long instanceDetailId); + + int insertRecord(DmsRecordInspect dmsRecordInspect); + + List selectRecordByInstainceId(@Param("inspectInstanceId") Long inspectInstanceId); } diff --git a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java index 72431ba..acb4661 100644 --- a/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java +++ b/hw-modules/hw-dms/src/main/java/com/hw/dms/service/impl/DmsBillsFaultInstanceServiceImpl.java @@ -19,6 +19,7 @@ import com.hw.dms.domain.vo.DmsBillsFaultInstanceScanVo; import com.hw.dms.mapper.DmsFaultInstanceActivityMapper; import com.hw.dms.mapper.DmsInstanceFileMapper; import com.hw.system.api.domain.SysFile; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.hw.dms.mapper.DmsBillsFaultInstanceMapper; @@ -228,6 +229,18 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS dmsFaultInstanceActivity = dmsBillsFaultInstanceActivityList.get(1); dmsBillsFaultInstance.setInstanceActivityId(dmsFaultInstanceActivity.getInstanceActivityId()); } + for (DmsFaultInstanceActivity activity : dmsBillsFaultInstanceActivityList) { + DmsFaultInstanceActivity instanceActivity = dmsFaultInstanceActivityMapper.selectDmsFaultInstanceActivityByInstanceActivityId(activity.getInstanceActivityId()); + if (instanceActivity.getProcessActivityId()==1021l){ + dmsBillsFaultInstance.setCheckedFault(instanceActivity.getCheckedFault()); + }else { + dmsBillsFaultInstance.setConfirmTime(instanceActivity.getConfirmTime()); + dmsBillsFaultInstance.setRepairContent(instanceActivity.getRepairContent()); + dmsBillsFaultInstance.setProtectedMethod(instanceActivity.getProtectedMethod()); + dmsBillsFaultInstance.setRepairer(instanceActivity.getRepairer()); + dmsBillsFaultInstance.setRepairConfirm(instanceActivity.getRepairConfirm()); + } + } dmsBillsFaultInstance.setFaultType(dmsFaultInstanceActivity.getFaultType()); dmsBillsFaultInstance.setFaultDescription(firstStepActivity.getFaultDescription()); dmsBillsFaultInstance.setDesignOperations(dmsFaultInstanceActivity.getDesignOperations()); @@ -241,9 +254,12 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS DmsInstanceFile queryInstanceFile = new DmsInstanceFile(); // queryInstanceFile.setTargetType(DmsConstants.DMS_INSTANCE_FILE_TARGET_TYPE_FAULT_INSTANCE_ACTIVITY); queryInstanceFile.setTargetId(firstStepActivity.getInstanceActivityId()); + queryInstanceFile.setTargetType("1"); List dmsInstanceFiles = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile); + queryInstanceFile.setTargetType("2"); + List dmsInstanceFiles1 = dmsInstanceFileMapper.selectDmsInstanceFileList(queryInstanceFile); dmsBillsFaultInstance.setDmsInstanceFiles(dmsInstanceFiles); - + dmsBillsFaultInstance.setDmsInstanceFiles1(dmsInstanceFiles1); return dmsBillsFaultInstance; } @@ -346,8 +362,11 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS public DmsFaultInstanceActivity selectFaults(Long repairInstanceId) { List list = dmsBillsFaultInstanceMapper.selectFaults(repairInstanceId); List parts = dmsBillsFaultInstanceMapper.selectParts(repairInstanceId); - list.get(0).setParts(parts); - return list.get(0); + DmsFaultInstanceActivity activity = new DmsFaultInstanceActivity(); + BeanUtils.copyProperties(list.get(1),activity); + activity.setCheckedFault(list.get(0).getCheckedFault()); + activity.setParts(parts); + return activity; } /** 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 0a356d1..3e521b8 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 @@ -255,7 +255,10 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta List dmsInspectInstanceDetailProjects = dmsInspectInstanceDetailPrjectMapper.selectDmsInspectInstanceDetailProjectJoinList(queryInspectInstanceDetailProject); dmsInspectInstanceDetail.setDmsInspectInstanceDetailProjectList(dmsInspectInstanceDetailProjects); - + DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); + dmsBillsInspectInstance.setInspectInstanceId(dmsBillsInspectInstanceScanVo.getInspectInstanceId()); + dmsBillsInspectInstance.setRealBeginTime(new Date()); + int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance); return dmsInspectInstanceDetail; } @@ -270,6 +273,19 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta @Transactional @Override public int updateDmsInspectInstanceDetail(DmsInspectInstanceDetail dmsInspectInstanceDetail) { + 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); + } + int i1 = dmsBillsInspectInstanceMapper.insertRecord(dmsRecordInspect); + DmsBillsInspectInstance dmsBillsInspectInstance = new DmsBillsInspectInstance(); + dmsBillsInspectInstance.setInspectInstanceId(dmsInspectInstanceDetail.getInspectInstanceId()); + dmsBillsInspectInstance.setRealEndTime(new Date()); + int i = dmsBillsInspectInstanceMapper.updateDmsBillsInspectInstance(dmsBillsInspectInstance); String userName = SecurityUtils.getUsername(); Date currentDate = new Date(); dmsInspectInstanceDetail.setUpdateTime(currentDate); @@ -283,6 +299,7 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta batchUpdateDmsInspectInstanceDetailProject(dmsInspectInstanceDetail); } + return dmsInspectInstanceDetailMapper.updateDmsInspectInstanceDetail(dmsInspectInstanceDetail); } diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml index ed6d143..c7f9d9a 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsBillsFaultInstanceMapper.xml @@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -237,7 +238,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select - x.*,a.device_name ,a.device_location ,b.apply_user ,b.apply_time ,b.real_begin_time ,b.real_end_time + x.*,a.device_name ,a.device_code,a.device_location ,b.apply_user ,b.apply_time ,b.real_begin_time ,b.real_end_time from `hwjy-cloud`.dms_fault_instance_activity x left join dms_base_device_ledger a on x.device_id = a.device_id left join dms_bills_fault_instance b on x.repair_instance_id = b.repair_instance_id where x.repair_instance_id = #{repairInstanceId} 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 9f35d05..429ca33 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 @@ -118,6 +118,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, + + insert into dms_record_inspect + + plan_inspect_id, + bills_inspect_code, + plan_begin_time, + plan_end_time, + real_begin_time, + real_end_time, + inspect_status, + inspect_type, + inspect_route_id, + device_amount, + performer, + remark, + inspect_duration, + is_flag, + inspect_instance_id, + + + #{planInspectId}, + #{billsInspectCode}, + #{planBeginTime}, + #{planEndTime}, + #{realBeginTime}, + #{realEndTime}, + #{inspectStatus}, + #{inspectType}, + #{inspectRouteId}, + #{deviceAmount}, + #{performer}, + #{remark}, + #{inspectDuration}, + #{isFlag}, + #{inspectInstanceId}, + + update dms_bills_inspect_instance @@ -193,5 +230,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by dbii.create_time desc limit 1 + + diff --git a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceActivityMapper.xml b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceActivityMapper.xml index 7551e95..dd37b5f 100644 --- a/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceActivityMapper.xml +++ b/hw-modules/hw-dms/src/main/resources/mapper/dms/DmsFaultInstanceActivityMapper.xml @@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -58,7 +59,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"