From b501b7059d6c6341768d57bf90ec0a34409a5566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E6=B0=94=E6=BB=A1=E6=BB=A1=28jgy=29?= Date: Fri, 20 Sep 2024 15:12:54 +0800 Subject: [PATCH] =?UTF-8?q?2024-09-20=20=E8=AE=BE=E5=A4=87-=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E6=94=B9=E5=8A=A8=20=E6=89=8B=E6=8C=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3+=E5=BF=AB=E8=AF=BB=E5=B7=A5=E5=8D=95=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DevicePDAController.java | 125 ++++-------------- .../EquRepairWorkOrderController.java | 5 + .../mapper/EquRepairWorkOrderMapper.java | 5 +- .../service/IEquRepairWorkOrderService.java | 2 + .../impl/EquRepairWorkOrderServiceImpl.java | 16 ++- .../device/EquRepairWorkOrderMapper.xml | 8 ++ 6 files changed, 58 insertions(+), 103 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java index 560cd756..0d3d4d72 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java @@ -38,110 +38,62 @@ public class DevicePDAController extends BaseController { @Autowired private IEquRepairWorkOrderService equRepairWorkOrderService; - - /** - * 获取今日任务工单list - * - * @param pdadto - * @return - */ + //获取今日任务工单 巡检 保养 点检 @GetMapping("/getTodayTask") public AjaxResult getTodayTask(PDADTO pdadto) { return devicePDAService.getTodayTask(pdadto); } - /** - * 获取记录列表 - * - * @param pdadto - * @return - */ + //获取 巡检 保养 点检 记录列表 @GetMapping("/getTaskRecord") public AjaxResult getTaskRecord(PDADTO pdadto) { return devicePDAService.getTaskRecord(pdadto); } - /** - * 获取任务详情 - * - * @param equOrder - * @return - */ + //获取 巡检 点检 保养 任务详情 @PostMapping("/getInspectionOrderInfo") public AjaxResult getInspectionOrderInfo(@RequestBody EquOrder equOrder) { return devicePDAService.getInspectionOrderInfo(equOrder); } - /** - * 填写巡检、点检、保养记录 - * - * @param equOrder - * @return - */ + //填写 巡检、点检、保养记录 @PostMapping("/updateInspectionRecord") public AjaxResult updateInspectionRecord(@RequestBody EquOrder equOrder) { return devicePDAService.updateInspectionRecord(equOrder); } - //////////报修 - - /** - * 新增手持报修记录 - * - * @param equRepairOrder - * @return - */ + //新增手持报修记录 @PostMapping("/addRepairRecord") public AjaxResult addRepairRecord(@RequestBody EquRepairOrder equRepairOrder) { return devicePDAService.addRepairRecord(equRepairOrder); } - //////////维修 - - /** - * 获取维修记录(待处理) - * - * @param equRepairWorkOrder - * @return - */ + //获取待处理的维修记录 + //todo 应该改了改成一个接口写 @GetMapping("/getMaintenancePendRecords") public AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder) { return devicePDAService.getMaintenancePendRecords(equRepairWorkOrder); } - /** - * 获取维修记录(除了待维修的) - * - * @param equRepairWorkOrder - * @return - */ + //todo 应该改了改成一个接口写 @GetMapping("/getMaintenanceRecords") public AjaxResult getMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) { return devicePDAService.getMaintenanceRecords(equRepairWorkOrder); } - /** - * 是否停机维修 - * - * @param equRepairWorkOrder - * @return - */ + //是否停机维修 @PutMapping("/updateDowntime") public AjaxResult updateDowntime(@RequestBody EquRepairWorkOrder equRepairWorkOrder) { return devicePDAService.updateDowntime(equRepairWorkOrder); } - /** - * 获取设备管理详细信息 - */ + //获取设备详细信息 @GetMapping(value = "/queryEquipment/{equipmentCode}") public AjaxResult queryEquipment(@PathVariable("equipmentCode") String equipmentCode) { return devicePDAService.selectEquEquipmentByEquEquipmentCode(equipmentCode); } - /** - * 查询设备列表 - */ + //查询设备列表 @GetMapping("/getEquipmentList") public TableDataInfo getEquipmentList(EquEquipment equEquipment) { startPage(); @@ -149,20 +101,13 @@ public class DevicePDAController extends BaseController { return getDataTable(list); } - /** - * 获取维修详情 - */ + //获取维修详情 @GetMapping(value = "/selectPdaRepairWorkOrderDetails/{workId}") public AjaxResult selectPdaRepairWorkOrderDetails(@PathVariable("workId") String workId) { return devicePDAService.selectPdaRepairWorkOrderDetails(workId); } - /** - * 填写维修记录 - * - * @param equRepairWorkOrder - * @return - */ + //填写维修记录 @PutMapping("/updateMaintenanceRecords") public AjaxResult updateMaintenanceRecords(@RequestBody EquRepairWorkOrder equRepairWorkOrder) { return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder); @@ -174,45 +119,34 @@ public class DevicePDAController extends BaseController { return devicePDAService.queryEquFaultTypeTree(equRepairWorkOrder); } - /** - * 开始保养任务 - * - * @param pdadto - * @return - */ + //开始保养任务 @GetMapping("/startMaintenanceTask") public AjaxResult startMaintenanceTask(PDADTO pdadto) { return devicePDAService.startMaintenanceTask(pdadto); } - /** - * 查询故障描述列表手持 - */ + //查询故障描述 @GetMapping("/getFaultDescriptionList") public AjaxResult getFaultDescriptionList(EquFaultDescription equFaultDescription) { return devicePDAService.selectEquFaultDescriptionList(equFaultDescription); } - /** - * 查询故障维修措施列表手持 - */ + //查询故障维修措施 @GetMapping("/getFaultMeasuresList") public AjaxResult getFaultMeasuresList(EquFaultMeasures equFaultMeasures) { return devicePDAService.selectEquFaultMeasuresList(equFaultMeasures); } - /** - * 查询故障原因列表 - */ + //查询故障原因列表 @GetMapping("/getFaultReasonList") public AjaxResult getFaultReasonList(EquFaultReason equFaultReason) { return devicePDAService.selectEquFaultReasonList(equFaultReason); } //备品备件查询接口 - @GetMapping(value = "/querySpareDetailBySpareCode/{spareCode}") - public AjaxResult querySpareDetailBySpareCode(@PathVariable("spareCode") String spareCode) { - return devicePDAService.selectSpareDetailBySpareCode(spareCode); + @PostMapping(value = "/querySpareDetailBySpareCode") + public AjaxResult querySpareDetailBySpareCode(@RequestBody SparePartsLedger sparePartsLedger) { + return devicePDAService.selectSpareDetailBySpareCode(sparePartsLedger.getMaterialCode()); } //备品备件出入库 @@ -221,40 +155,31 @@ public class DevicePDAController extends BaseController { return equSparepartsInOutService.insertEquSparepartsInOut(equSparepartsInOut); } - //报修页面查询 + //报修审核页面查询 @GetMapping("/getBXList") public AjaxResult getBXList(EquRepairOrder equRepairOrder) { return devicePDAService.getBXList(equRepairOrder); } - /** - * 获取故障报修详细信息 - */ + //获取故障报修的详细信息 @GetMapping(value = "/getBXDetail/{orderId}") public AjaxResult getBXDetail(@PathVariable("orderId") String orderId) { return success(equRepairOrderService.selectEquRepairOrderByOrderId(orderId)); } - /** - * 审核报修单 - */ + //审核报修单 @PutMapping("/checkBX") public AjaxResult checkEquRepairOrder(@RequestBody EquRepairOrder equRepairOrder) { return toAjax(equRepairOrderService.checkEquRepairOrder(equRepairOrder)); } - /** - * 维修工单审核 传参数用保养的对象 - * - * @param upKeepOrderDTO - * @return - */ + //维修工单审核 传参数用保养的对象 @PostMapping("/checkWX") public AjaxResult checkWX(@RequestBody UpKeepOrderDTO upKeepOrderDTO) { return equRepairWorkOrderService.checkRepairWorkOrder(upKeepOrderDTO); } - //维修页面查询 + //维修审核页面查询 @GetMapping("/getWXList") public AjaxResult getWXList(EquRepairWorkOrder equRepairWorkOrder) { return devicePDAService.getWXList(equRepairWorkOrder); diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairWorkOrderController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairWorkOrderController.java index 2bb5f525..7164719b 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairWorkOrderController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairWorkOrderController.java @@ -85,6 +85,11 @@ public class EquRepairWorkOrderController extends BaseController { @Log(title = "维修工单", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody EquRepairWorkOrder equRepairWorkOrder) { + +// if (equRepairWorkOrderService.checkWorkCodeUnique(equRepairWorkOrder)) { +// return AjaxResult.error("库区编码已存在!"); +// } + return toAjax(equRepairWorkOrderService.insertEquRepairWorkOrder(equRepairWorkOrder)); } 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 b62b76e3..92f6368c 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 @@ -73,7 +73,7 @@ public interface EquRepairWorkOrderMapper { public int deleteEquRepairWorkOrderByWorkIds(String[] workIds); //获取流水号 - public int selectWorkCodeSerialNumber(); + public int selectWorkCodeSerialNumber(EquRepairWorkOrder equRepairWorkOrder); //转委外 void updateWorkOutsource(EquRepairWorkOrder equRepairWorkOrder); @@ -121,4 +121,7 @@ public interface EquRepairWorkOrderMapper { //回退维修工单 void returnRepairWorkOrder(EquRepairWorkOrder dto); + + //是否存在 +// String checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairWorkOrderService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairWorkOrderService.java index 35d41f86..c0ff71de 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairWorkOrderService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairWorkOrderService.java @@ -73,4 +73,6 @@ public interface IEquRepairWorkOrderService { //维修故障检验 AjaxResult checkRepairWorkOrder(UpKeepOrderDTO upKeepOrderDTO); + //是否存在 +// boolean checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder); } 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 3846277f..073b2205 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 @@ -166,7 +166,8 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) { equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID()); // 获取流水号 - String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber()); + equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); + String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber(equRepairWorkOrder)); String equipmentCode = equRepairWorkOrder.getEquipmentCode(); //维修单号 equRepairWorkOrder.setOrderCode("无"); @@ -174,7 +175,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService equRepairWorkOrder.setWorkCode("WX" + DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); equRepairWorkOrder.setWorkHandle("1"); equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername()); - equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); + //工厂号 HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); String key = "#header.poolName"; @@ -780,4 +781,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService } return success(msg); } + +// @Override +// @DS("#header.poolName") +// public boolean checkWorkCodeUnique(EquRepairWorkOrder equRepairWorkOrder) { +// String code = equRepairWorkOrderMapper.checkWorkCodeUnique(equRepairWorkOrder); +// if (code == null) { +// return false; +// } else { +// return true; +// } +// } } 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 27adb3c1..5d480a86 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 @@ -507,6 +507,7 @@ + select work_code + from equ_repair_work_order + where work_code = #{workCode} + and del_flag = '0' + +