From a72bdf80687b24f117705fbfa36c1de7c4e03e7b Mon Sep 17 00:00:00 2001 From: A0010407 Date: Thu, 23 Nov 2023 07:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../op/device/domain/EquRepairWorkOrder.java | 21 ++++++--- .../com/op/device/domain/EquSpareApply.java | 22 +++++++++ .../device/mapper/EquOrderStandardMapper.java | 6 ++- .../device/mapper/EquOutsourceWorkMapper.java | 3 ++ .../device/mapper/EquRepairOrderMapper.java | 2 +- .../mapper/EquRepairWorkOrderMapper.java | 3 ++ .../service/impl/DevicePDAServiceImpl.java | 45 ++++++++++++++----- .../impl/EquOutsourceWorkServiceImpl.java | 8 ++++ .../impl/EquRepairWorkOrderServiceImpl.java | 17 ++++--- .../mapper/device/EquOrderStandardMapper.xml | 15 ++++++- .../mapper/device/EquOutsourceWorkMapper.xml | 5 +++ .../device/EquRepairWorkOrderMapper.xml | 13 ++++-- 12 files changed, 132 insertions(+), 28 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java index 0ad69d53..e55546bf 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java @@ -1,5 +1,6 @@ package com.op.device.domain; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -135,6 +136,9 @@ public class EquRepairWorkOrder extends BaseEntity { //维修停机真正结束时间 private Date actualDownEndTime; + /** 联系方式 */ + private String workConnection; + // 设备 /** 设备名称 */ @Excel(name = "设备名称") @@ -214,7 +218,7 @@ public class EquRepairWorkOrder extends BaseEntity { /** 委外单位 */ private String workOutsourcingUnit; /** 联系方式 */ - private String workConnection; + private String outSourceConnection; //手持 //用户id @@ -559,6 +563,13 @@ public class EquRepairWorkOrder extends BaseEntity { return workEndTime; } + public void setWorkConnection(String workConnection) { + this.workConnection = workConnection; + } + public String getWorkConnection() { + return workConnection; + } + //班组 public void setTeamName(String teamName) { this.teamName = teamName; @@ -639,11 +650,11 @@ public class EquRepairWorkOrder extends BaseEntity { return workOutsourcingUnit; } - public void setWorkConnection(String workConnection) { - this.workConnection = workConnection; + public void setOutSourceConnection(String outSourceConnection) { + this.outSourceConnection = outSourceConnection; } - public String getWorkConnection() { - return workConnection; + public String getOutSourceConnection() { + return outSourceConnection; } //手持 用户userId diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java index a18de76a..76bba57d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquSpareApply.java @@ -106,6 +106,28 @@ public class EquSpareApply extends BaseEntity { /** 总数量 */ private BigDecimal amount; + /** 物料号 */ + @Excel(name = "物料号") + private String materialCode; + + /** 物料描述 */ + @Excel(name = "物料描述") + private String materialDesc; + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialDesc(String materialDesc) { + this.materialDesc = materialDesc; + } + public String getMaterialDesc() { + return materialDesc; + } + public List getApplyTimeArray() { return applyTimeArray; } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java index a05d2f8a..41308b97 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java @@ -74,7 +74,7 @@ public interface EquOrderStandardMapper { * 图片数据绑定 * @param files */ - void insertBaseFileBatch(List files); + void insertBaseFileBatch(@Param("baseFiles")List files); /** * 删除图片 @@ -102,4 +102,8 @@ public interface EquOrderStandardMapper { * @param orderIds */ void delEquOrderStandardByorderIds(String[] orderIds); + + + //更新标准 + void updateActualValues(EquOrderStandard standardList); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOutsourceWorkMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOutsourceWorkMapper.java index 532c5feb..9a7581e2 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOutsourceWorkMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOutsourceWorkMapper.java @@ -62,4 +62,7 @@ public interface EquOutsourceWorkMapper { //流水号 public int selectWorkCodeSerialNumber(); + + //通过repairCode删除存在的委外记录 + public void deleteEquOutsourceWorkByRepairCode(String workCode); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java index 6e5f38d5..0a2b6fc4 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java @@ -91,7 +91,7 @@ public interface EquRepairOrderMapper { /** * 批量新增报修图片 */ - Boolean insertBaseFileBatch(@Param("baseFiles") List baseFiles); + Boolean insertBaseFileBatch(List baseFiles); /** * 删除报修图片 diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairWorkOrderMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairWorkOrderMapper.java index b38575b0..c8eb3aed 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairWorkOrderMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairWorkOrderMapper.java @@ -94,4 +94,7 @@ public interface EquRepairWorkOrderMapper { * 批量新增报修图片 */ Boolean insertBaseFileBatch(@Param("baseFiles") List baseFiles); + + //更新维修工单状态 + void updateWorkStatus(String repairCode); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 93bc62b7..b475a362 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -351,9 +351,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService { @DS("#header.poolName") public AjaxResult addRepairRecord(EquRepairOrder equRepairOrder) { try { +// equRepairOrder + //自动填入联系人 联系方式!!!!! String id = IdUtils.fastSimpleUUID(); equRepairOrder.setOrderId(id); - // 获取故障报修流水号 + // 新增 是需要获取故障报修流水号 String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber()); String equipmentCode = equRepairOrder.getEquipmentCode(); //报修单号 @@ -368,6 +370,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equRepairOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); equRepairOrderMapper.insertEquRepairOrder(equRepairOrder); + //删除照片 不需要清照片 因为是新增 //新增文件 if (StringUtils.isNotEmpty(equRepairOrder.getFileList())) { String[] ids1 = equRepairOrder.getFileList().split(","); @@ -485,7 +488,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { } } /** - * 获取维修记录 + * 获取维修人员 * * @param equTeamUser * @return @@ -573,6 +576,8 @@ public class DevicePDAServiceImpl implements IDevicePDAService { if (!CollectionUtils.isEmpty(files)) { standardList.setPicturePaths(files); } + standardList.setDetailReach(standardList.getRepairReach()); + standardList.setActualValue(standardList.getRepairValue()); } equOrder1.setStandardList(standardLists); } @@ -604,17 +609,13 @@ public class DevicePDAServiceImpl implements IDevicePDAService { @Override @DS("#header.poolName") public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) { - try { //判断是否停机 EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId()); if(list.getWorkDownMachine().equals("1")){ //维修结束时间、维修真正停机时间 equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate()); - equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate()); - //维修完成 - equRepairWorkOrder.setWorkStatus("1"); } - + equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate()); //更新每一项点检/巡检检查项信息 List checkLists = equRepairWorkOrder.getDetailList(); for(EquOrder checkList:checkLists){ @@ -643,7 +644,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService { } equOrderStandardMapper.insertBaseFileBatch(files); } - equOrderStandardMapper.updateEquOrderStandard(standardList); + standardList.setRepairReach(standardList.getDetailReach()); + standardList.setRepairValue(standardList.getActualValue()); + standardList.setUpdateTime(DateUtils.getNowDate()); + standardList.setUpdateBy(SecurityUtils.getUsername()); + equOrderStandardMapper.updateActualValues(standardList); } equOrderMapper.updateEquOrder(checkList); } @@ -651,11 +656,27 @@ public class DevicePDAServiceImpl implements IDevicePDAService { //新建申领单 缺少code List equSpareApplies = equRepairWorkOrder.getApplyList(); for(EquSpareApply equSpareApply:equSpareApplies){ + //生成领料单code + String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10); + equSpareApply.setApplyCode("A" + code ); equSpareApply.setApplyId(IdUtils.fastSimpleUUID()); + //备品备件规格型号!!!!! + //equSpareApply.setSpareModel(equSpareApply.getS); + equSpareApply.setSpareCode(equSpareApply.getMaterialCode()); + equSpareApply.setSpareName(equSpareApply.getMaterialDesc()); + equSpareApply.setApplyPeople(SecurityUtils.getUsername()); equSpareApply.setCreateBy(SecurityUtils.getUsername()); equSpareApply.setCreateTime(DateUtils.getNowDate()); equSpareApply.setApplyTime(DateUtils.getNowDate()); + equSpareApply.setSpareUseEquipment(equRepairWorkOrder.getEquipmentCode()); + equSpareApply.setWorkCode(equRepairWorkOrder.getWorkCode()); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + equSpareApply.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); equSpareApplyMapper.insertEquSpareApply(equSpareApply); + +// SparePartsLedger sparePartsLedger = new SparePartsLedger(); +// sparePartsLedger. } //图片 @@ -679,14 +700,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService { } equRepairWorkOrderMapper.insertBaseFileBatch(files); } + //维修人:当前登录人 + //维修状态 + equRepairWorkOrder.setWorkStatus("1"); + //维修结束时间 + equRepairWorkOrder.setWorkPerson(SecurityUtils.getUsername()); equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate()); equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder); //需要更新设备状态????这里没做 return success("提交成功,维修完成!"); - } catch (Exception e) { - return error(); - } } /** diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOutsourceWorkServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOutsourceWorkServiceImpl.java index 0c2d537e..e0755894 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOutsourceWorkServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOutsourceWorkServiceImpl.java @@ -29,6 +29,9 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService { @Autowired private EquOutsourceWorkMapper equOutsourceWorkMapper; + @Autowired + private EquRepairWorkOrderMapper equRepairWorkOrderMapper; + /** * 查询委外工单 @@ -88,6 +91,11 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService { @Override @DS("#header.poolName") public int updateEquOutsourceWork(EquOutsourceWork equOutsourceWork) { + //1完成委外 + if(equOutsourceWork.getWorkStatus().equals("1")){ + //更新维修工单状态 + equRepairWorkOrderMapper.updateWorkStatus(equOutsourceWork.getRepairCode()); + } equOutsourceWork.setUpdateTime(DateUtils.getNowDate()); equOutsourceWork.setUpdateBy(SecurityUtils.getUsername()); return equOutsourceWorkMapper.updateEquOutsourceWork(equOutsourceWork); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java index 4e9302b7..58746268 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java @@ -56,7 +56,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(workId); List beforeFiles = equRepairWorkOrderMapper.getBaseFileBatch(list.getOrderId()); if (!CollectionUtils.isEmpty(beforeFiles)) { - list.setBeforeRepairFiles(beforeFiles); + list.setBeforeRepairFiles(beforeFiles); } //查询维修后图片 List afterFiles = equRepairWorkOrderMapper.getBaseFileBatch(workId); @@ -222,15 +222,18 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService @Override @DS("#header.poolName") public int applyEquOutsourceWork(EquRepairWorkOrder equRepairWorkOrder) { + //如果存在之前的删掉重新增加,物理删除 + equOutsourceWorkMapper.deleteEquOutsourceWorkByRepairCode(equRepairWorkOrder.getWorkCode()); //转委外 EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); //委外工单号 - String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber()); - String equipmentCode = equRepairWorkOrder.getEquipmentCode(); + //String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber()); + //改了,不生成流水号,从第十位开始切割 + String code = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equRepairWorkOrder.getWorkCode().substring(10); + equOutsourceWork.setWorkCode("WW"+ code); equOutsourceWork.setOrderCode("无"); - equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); - equOutsourceWork.setEquipmentCode(equipmentCode); + equOutsourceWork.setEquipmentCode(equRepairWorkOrder.getEquipmentCode()); equOutsourceWork.setRepairCode(equRepairWorkOrder.getWorkCode()); equOutsourceWork.setWorkReason(equRepairWorkOrder.getOutSourceReason()); equOutsourceWork.setWorkPerson(equRepairWorkOrder.getOutSourcePerson()); @@ -245,6 +248,10 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode()); equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder); } + //工厂号 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + equOutsourceWork.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); } } diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml index cb2aa019..6ce4fe55 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml @@ -209,6 +209,17 @@ where id = #{id} and del_flag = '0' + + update equ_order_standard + + repair_reach = #{repairReach}, + repair_value = #{repairValue}, + repair_picture = #{repairPicture}, + + where id = #{id} + and del_flag = '0' + + delete from equ_order_standard where id = #{id} @@ -231,7 +242,9 @@ eos.detail_unit, eos.detail_reach, eos.actual_value, - eos.standard_type + eos.standard_type, + eos.repair_reach, + eos.repair_value from equ_order_standard eos where parent_code = #{parentCode} and order_code = #{orderCode} diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml index 19c22bd1..405463bd 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml @@ -185,6 +185,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where work_id = #{workId} + + delete from equ_outsource_work + where repair_code = #{workCode} + + update equ_outsource_work set del_flag = '1' diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml index 3a44cbfa..82886724 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquRepairWorkOrderMapper.xml @@ -21,14 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - @@ -266,7 +263,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ero.order_connection, eow.work_person AS outSourcePerson, eow.work_outsourcing_unit AS workOutsourcingUnit, - eow.work_connection AS workConnection, + eow.work_connection AS outSourceConnection, eow.work_reason AS outSourceReason from equ_repair_work_order erwo left join base_equipment be on erwo.equipment_code = be.equipment_code @@ -467,4 +464,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + update equ_repair_work_order + set + work_status = '1' + where work_code = #{repairCode} + and del_flag = '0' + + \ No newline at end of file