From 2988017af31134cf880832d74e855f528806c67d Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 11 Nov 2024 10:24:10 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E5=94=AE=E5=90=8E=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=87=BA=E5=BA=93=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E9=A1=B5=E9=9D=A2=EF=BC=9A=E8=AE=BE=E7=BD=AE=E8=AE=BE?= =?UTF-8?q?=E5=A4=87SN=E5=8F=B7=E4=B8=8D=E8=83=BD=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=A0=A1=E9=AA=8C=20=E6=8C=89=E7=85=A7=E4=B8=87?= =?UTF-8?q?=E6=9D=90=E9=9C=80=E6=B1=82=EF=BC=9A=E6=96=B0=E5=A2=9E=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=AC=AC=E4=BA=8C=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=87=BA=E5=BA=93=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=872=E6=8C=89=E9=92=AE=E5=92=8C=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=B7=BB=E5=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BC=8C=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=A1=A8=E7=9A=84=E6=93=8D=E4=BD=9C=E9=83=BD?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=20=E6=96=B0=E5=A2=9E=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=9D=E5=AD=98=E5=94=AE=E5=90=8E=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=96=B9=E6=B3=95=EF=BC=9A=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E8=AE=BE=E5=A4=87=E7=9A=84=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=92=8C=E5=90=8C=E6=97=B6=E6=9B=B4=E6=96=B0=20=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=87=BA=E5=BA=93=E8=A1=A8=E3=80=81=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E3=80=81=E5=94=AE=E5=90=8E=E7=BB=B4=E6=8A=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=87=BA=E5=BA=93=E8=A1=A8=E7=9A=84=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA=E5=BE=85=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AftersalesOutOrderController.java | 25 + .../domain/vo/SelectShippingDeviceVO.java | 5 + .../service/IAftersalesOutOrderService.java | 7 + .../impl/AftersalesOutOrderServiceImpl.java | 116 ++++- .../aftersalesOutOrder.html | 8 + .../maintenanceEquipmentOne.html | 2 +- .../maintenanceEquipmentTwo.html | 486 ++++++++++++++++++ 7 files changed, 646 insertions(+), 3 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java index 3bb4f992..55713336 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesOutOrderController.java @@ -359,4 +359,29 @@ public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOr + /** + * 售后第二次维护设备 + */ + @GetMapping("/maintenanceEquipmentTwo/{outOrderId}") + public String maintenanceEquipmentTwo(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) + { + AftersalesOutOrder aftersalesOutOrder = aftersalesOutOrderService.selectAftersalesOutOrderById(outOrderId); + mmap.put("aftersalesOutOrder", aftersalesOutOrder); + return prefix + "/maintenanceEquipmentTwo"; + } + + /** + * 修改保存售后第二次维护设备 + */ + @RequiresPermissions("aftersales:aftersalesOutOrder:maintenanceEquipmentTwo") + @Log(title = "售后维护设备出库", businessType = BusinessType.UPDATE) + @PostMapping("/maintenanceEquipmentTwo") + @ResponseBody + public AjaxResult maintenanceEquipmentTwoSave(@RequestBody AftersalesOutOrder aftersalesOutOrder) + { + return toAjax(aftersalesOutOrderService.updateMaintenanceEquipmentTwo(aftersalesOutOrder)); + } + + + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java index 2faee83a..dacdb514 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/domain/vo/SelectShippingDeviceVO.java @@ -26,24 +26,29 @@ public class SelectShippingDeviceVO { private String snCode; /** 出厂日期 */ + @JsonFormat(pattern = "yyyy-MM-dd") private Date factoryDate; /** 保修期 */ private String guaranteePeriod; /** 锁机时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") private Date lockDate; /** 是否有锁机时间 */ private String lockDateFlag; /** 损耗品到期时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") private Date wastageExpireDate; /** 二次维修后部件质保时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") private Date componentGuaranteeDate; /** 是否添加出货设备(0代表是 1代表否)*/ + private String addShippingDeviceFlag; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java index e5f18c68..5aed959c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesOutOrderService.java @@ -121,4 +121,11 @@ public interface IAftersalesOutOrderService * 逻辑删除出货设备(也就是取消关联) * */ int deleteAftersalesShippingDeviceById(String shippingDeviceId); + + /** + * 修改保存售后第二次维护设备出库 + * @param aftersalesOutOrder + * @return + */ + int updateMaintenanceEquipmentTwo(AftersalesOutOrder aftersalesOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java index 3e42771e..8014dcd3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java @@ -162,7 +162,7 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService public int updateMaintenanceEquipmentOne(AftersalesOutOrder aftersalesOutOrder) { String outOrderCode = aftersalesOutOrder.getOutOrderCode(); - + String loginName = ShiroUtils.getLoginName(); // 定义一个StringBuilder来收集所有缺少SN号的设备ID StringBuilder missingSnIds = new StringBuilder(); //物料信息主表的数据 @@ -204,7 +204,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService AfterSalesShippingDevice tempShippingDevice = new AfterSalesShippingDevice(); tempShippingDevice.setShippingDeviceId(shippingDeviceId); tempShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); - + tempShippingDevice.setUpdateBy(loginName); + tempShippingDevice.setUpdateTime(new Date()); int updateShippingDeviceResult = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice); if (updateShippingDeviceResult <= 0){ throw new BusinessException("更新设备数据失败"); @@ -217,6 +218,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService //更改状态未待确认发货 warehouseOutOrder.setOutOrderCode(outOrderCode); warehouseOutOrder.setWarehouseOutStatus("2"); + warehouseOutOrder.setUpdateBy(loginName); + warehouseOutOrder.setUpdateTime(new Date()); int updateWarehouseResult = warehouseOutOrderMapper.updateWarehouseOutOrderByCode(warehouseOutOrder); if (updateWarehouseResult <= 0){ throw new BusinessException("更新销售售后通知单数据失败"); @@ -226,6 +229,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); sysSalesShippingInform.setOutOrderCode(outOrderCode); sysSalesShippingInform.setWarehouseOutStatus("2"); + sysSalesShippingInform.setUpdateBy(loginName); + sysSalesShippingInform.setUpdateTime(new Date()); int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); if (updateShippingInformResult <= 0){ throw new BusinessException("更新销售出货通知单数据失败"); @@ -234,6 +239,8 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService //更新售后维护设备出库单 aftersalesOutOrder.setWarehouseOutStatus("2"); + aftersalesOutOrder.setUpdateBy(loginName); + aftersalesOutOrder.setUpdateTime(new Date()); int result = aftersalesOutOrderMapper.updateAftersalesOutOrder(aftersalesOutOrder); return result; @@ -412,4 +419,109 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService int updateAfterSalesShippingDevice = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice); return updateAfterSalesShippingDevice; } + + + /** + * 修改保存售后第二次维护设备出库 + * @param aftersalesOutOrder + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public int updateMaintenanceEquipmentTwo(AftersalesOutOrder aftersalesOutOrder) { + + String outOrderCode = aftersalesOutOrder.getOutOrderCode(); + String loginName = ShiroUtils.getLoginName(); + //物料信息主表的数据 + List needShippingDeviceMaterialsOne = this.getNeedShippingDeviceMaterialsOne(aftersalesOutOrder); + if (!CollectionUtils.isEmpty(needShippingDeviceMaterialsOne)){ + List selectShippingDeviceVOList = aftersalesOutOrder.getSelectShippingDeviceVOList(); + if (CollectionUtils.isEmpty(selectShippingDeviceVOList)){ + throw new BusinessException("请展开物料详情并维护要出货的设备"); + } + + boolean anyNullFactoryDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getFactoryDate() == null); + if (anyNullFactoryDate){ + throw new BusinessException("请展开物料详情并填写每个设备的出库日期"); + } + + boolean anyNullGuaranteePeriod = selectShippingDeviceVOList.stream().anyMatch(item -> item.getGuaranteePeriod() == null); + if (anyNullGuaranteePeriod){ + throw new BusinessException("请展开物料详情并填写每个设备的保修期"); + } + + boolean anyNullLockDateFlag = selectShippingDeviceVOList.stream().anyMatch(item -> item.getLockDateFlag() == null); + if (anyNullLockDateFlag){ + throw new BusinessException("请展开物料详情并填写每个设备的是否有锁机时间"); + } + + boolean anyNullWastageExpireDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getWastageExpireDate() == null); + if (anyNullWastageExpireDate){ + throw new BusinessException("请展开物料详情并填写每个设备的是否有损耗品到期时间"); + } + + boolean anyNullComponentGuaranteeDate = selectShippingDeviceVOList.stream().anyMatch(item -> item.getComponentGuaranteeDate() == null); + if (anyNullComponentGuaranteeDate){ + throw new BusinessException("请展开物料详情并填写每个设备的是否有二次维护部件质保时间"); + } + + /* 缺少校验规则,后续补充 + * 2.1、已选出货设备,是否可用(状态:可用,即未被其他出库单添加或报损),若不可用,则弹窗提示“CHSB20240808004、CHSB20240808005.不可用,请重新添加 + * */ + + for (SelectShippingDeviceVO selectShippingDeviceVO : selectShippingDeviceVOList) { + String shippingDeviceId = selectShippingDeviceVO.getShippingDeviceId(); + AfterSalesShippingDevice tempShippingDevice = new AfterSalesShippingDevice(); + tempShippingDevice.setShippingDeviceId(shippingDeviceId); + tempShippingDevice.setSnCode(selectShippingDeviceVO.getSnCode()); + tempShippingDevice.setFactoryDate(selectShippingDeviceVO.getFactoryDate()); + tempShippingDevice.setGuaranteePeriod(selectShippingDeviceVO.getGuaranteePeriod()); + tempShippingDevice.setLockDateFlag(selectShippingDeviceVO.getLockDateFlag()); + if ("0".equals(selectShippingDeviceVO.getLockDateFlag())){ + tempShippingDevice.setLockDate(selectShippingDeviceVO.getLockDate()); + } + tempShippingDevice.setWastageExpireDate(selectShippingDeviceVO.getWastageExpireDate()); + tempShippingDevice.setComponentGuaranteeDate(selectShippingDeviceVO.getComponentGuaranteeDate()); + tempShippingDevice.setUpdateBy(loginName); + tempShippingDevice.setUpdateTime(new Date()); + int updateShippingDeviceResult = afterSalesShippingDeviceMapper.updateAfterSalesShippingDevice(tempShippingDevice); + if (updateShippingDeviceResult <= 0){ + throw new BusinessException("更新设备数据失败"); + } + } + + } + //更新出库单 + WarehouseOutOrder warehouseOutOrder = new WarehouseOutOrder(); + //更改状态未待确认发货 + warehouseOutOrder.setOutOrderCode(outOrderCode); + warehouseOutOrder.setWarehouseOutStatus("4");//为待出库 + warehouseOutOrder.setUpdateBy(loginName); + warehouseOutOrder.setUpdateTime(new Date()); + int updateWarehouseResult = warehouseOutOrderMapper.updateWarehouseOutOrderByCode(warehouseOutOrder); + if (updateWarehouseResult <= 0){ + throw new BusinessException("更新销售售后通知单数据失败"); + } + + //更新销售出货通知单 + SysSalesShippingInform sysSalesShippingInform = new SysSalesShippingInform(); + sysSalesShippingInform.setOutOrderCode(outOrderCode); + sysSalesShippingInform.setWarehouseOutStatus("4");//为待出库 + sysSalesShippingInform.setUpdateTime(new Date()); + sysSalesShippingInform.setUpdateBy(loginName); + int updateShippingInformResult = shippingInformMapper.updateSysSalesShippingInformByOutOrderCode(sysSalesShippingInform); + if (updateShippingInformResult <= 0){ + throw new BusinessException("更新销售出货通知单数据失败"); + } + + + //更新售后维护设备出库单 为待出库 + aftersalesOutOrder.setWarehouseOutStatus("4"); + aftersalesOutOrder.setUpdateBy(loginName); + aftersalesOutOrder.setUpdateTime(new Date()); + int result = aftersalesOutOrderMapper.updateAftersalesOutOrder(aftersalesOutOrder); + + return result; + + } } diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html index 80bf0888..4d5ad8a5 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/aftersalesOutOrder.html @@ -219,6 +219,14 @@ $.modal.open("售后第一次维护设备",url); } + + /*售后第二次维护设备*/ + function maintenanceEquipmentTwo(outOrderId) { + var url = ctx + 'aftersales/aftersalesOutOrder/maintenanceEquipmentTwo/'+outOrderId; + $.modal.open("售后第二次维护设备",url); + } + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html index d3702299..9a048b3a 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentOne.html @@ -294,7 +294,7 @@ editable: { validate: function(value) { if ($.trim(value) === '') { - return '本次收货数不能为空'; + return '设备SN号不能为空'; } }, }, diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html new file mode 100644 index 00000000..0302b451 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/aftersales/aftersalesOutOrder/maintenanceEquipmentTwo.html @@ -0,0 +1,486 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+

需要维护出货设备信息

+
+
+
+
+
+
+
+ + +
+
+

无需维护出货设备信息

+
+
+
+
+
+
+
+ + + +
+
+ + + + + + + \ No newline at end of file