diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java index 96723c52..163c8516 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/controller/AftersalesWarehouseOutController.java @@ -263,6 +263,7 @@ public class AftersalesWarehouseOutController extends BaseController List list = warehouseOutOrderService.selectOutOrderDetailListByCode(warehouseOutOrder); return getDataTable(list); } + /** * 展示售后第一次维护设备料号相关出货设备信息 */ @@ -276,6 +277,41 @@ public class AftersalesWarehouseOutController extends BaseController return getDataTable(list); } + + + + /** + * 售后第一次维护设备 添加出货设备信息 + */ + @GetMapping("/addShippingDevicesOne/{outOrderDetailId}") + public String addShippingDevicesOne(@PathVariable("outOrderDetailId") Long outOrderDetailId, ModelMap mmap) + { + WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId); + mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail); + return prefix + "/addShippingDevicesOne"; + } + + + + + + /** + * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 + */ + @PostMapping("/getEquipMaterialDetailByMaterialNo") + @ResponseBody + public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail) + { + + startPage(); + List list = warehouseOutOrderService.selectAftersalesShippingDeviceListByMaterialNo(warehouseOutOrderDetail); + return getDataTable(list); + } + + + + + /** * 第一次维护设备删除物料信息出货设备信息 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java index 2e1a3a3b..2fd79a99 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/mapper/AfterSalesShippingDeviceMapper.java @@ -102,4 +102,9 @@ public interface AfterSalesShippingDeviceMapper * 根据生产单号和关联销售单号查询出货设备履历信息 * */ List selectAfterSalesShippingDeviceByNoAndCode(AfterSalesShippingDevice afterSalesShippingDevice); + + /* + * 根据物料号查询出货设备信息列表 + * */ + List selectShippingDeviceListByMaterialNo(AfterSalesShippingDevice afterSalesShippingDevice); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java index 77a7c7d0..2e95ce8b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/IAftersalesWarehouseOutService.java @@ -114,4 +114,9 @@ public interface IAftersalesWarehouseOutService * 展示售后第一次维护设备物料相关信息 * */ List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); + + /** + * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 + * */ + List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java index 5b4614a2..1291ad81 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesWarehouseOutServiceImpl.java @@ -184,6 +184,33 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu return warehouseOutOrderDetails; } + /** + * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 + * */ + @Override + public List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail) { + + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); + List afterSalesShippingDevices = shippingDeviceMapper.selectShippingDeviceListByMaterialNo(afterSalesShippingDevice); + if (!StringUtils.isNotEmpty(afterSalesShippingDevices)) { + // 记录日志 + log.warn("未查找到与物料号关联的出库设备数据, 物料号: {}",warehouseOutOrderDetail.getMaterialNo()); + } + + for (AfterSalesShippingDevice tempAfterSalesShippingDevice : afterSalesShippingDevices) { + SelectShippingDeviceVO shippingDeviceVO = new SelectShippingDeviceVO(); + shippingDeviceVO.setShippingDeviceId(tempAfterSalesShippingDevice.getShippingDeviceId()); + shippingDeviceVO.setDeviceModelCode(tempAfterSalesShippingDevice.getDeviceModelCode()); + shippingDeviceVO.setDeviceRunningNumber(tempAfterSalesShippingDevice.getDeviceRunningNumber()); + shippingDeviceVO.setMakePhotoUrl(tempAfterSalesShippingDevice.getMakePhotourl()); + shippingDeviceVO.setQuoteId(tempAfterSalesShippingDevice.getSalesOrderCode()); + selectShippingDeviceVOs.add(shippingDeviceVO); + } + return selectShippingDeviceVOs; + } + /* * 售后第一次维护设备信息根据设备ID删除出货设备信息 * */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java index e227446b..444e367f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java @@ -257,6 +257,7 @@ public class SysMakeOrderController extends BaseController AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); afterSalesShippingDevice.setMakeNo(makeNo); afterSalesShippingDevice.setSalesOrderCode(salesOrderCode); + afterSalesShippingDevice.setMaterialNo(equipMaterialDto.getMaterialCode()); List equipDetailDtos = salesShippingDeviceService.selectAfterSalesShippingDeviceByNoAndCode(afterSalesShippingDevice); return getDataTable(equipDetailDtos); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java index e1a7d6ba..f554a845 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java @@ -170,20 +170,27 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService String loginName = ShiroUtils.getLoginName(); warehouseOutOrder.setUpdateBy(loginName); warehouseOutOrder.setUpdateTime(new Date()); - warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + + //更改出库状态为 第一次维护设备信息 + warehouseOutOrder.setWarehouseOutStatus("1"); List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ log.warn("保存销售单-准备物料,物料列表信息为空:{}",warehouseOutOrder); } - int updateRows = 0; for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { warehouseOutOrderDetail.setUpdateBy(loginName); warehouseOutOrderDetail.setUpdateTime(new Date()); warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark()); //更新数据库记录 - updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + int updateOutOrderDetail = outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + if (updateOutOrderDetail <= 0){ + throw new BusinessException("更新出库单详情数据失败"); + } } - return updateRows; + //出库单点击准备物料后生成售后单 + + int updateWarehouseOutOrderResult = warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + return updateWarehouseOutOrderResult; } diff --git a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml index 33997e27..d5a9f599 100644 --- a/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/aftersales/AfterSalesShippingDeviceMapper.xml @@ -98,6 +98,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where make_no = #{makeNo} and sales_order_code = #{salesOrderCode} + and material_no = #{materialNo} + + + + diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html deleted file mode 100644 index 316a5184..00000000 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevices.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - -
-
- - -
-

物料信息

-
-
-
-

出货设备

-
-
-
-
- - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html new file mode 100644 index 00000000..af49b115 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html @@ -0,0 +1,273 @@ + + + + + + + +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + +
+
+ +
+ +
+

出货设备

+
+
+
+
+ + +
+ + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html index d35431fa..304c596e 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html @@ -124,13 +124,20 @@ columns: [{ checkbox: true }, + { title:'销售订单号', field:'quoteId', visible: false }, + { + title:'出库单详情Id', + field:'outOrderDetailId', + visible: false + + }, { title: '料号', - field: 'materialCode', + field: 'materialNo', }, { title: '图片', @@ -156,12 +163,28 @@ title: '描述', field: 'describe', }, + { + title: '订单数量', + field: 'makeNum', + }, + { + title: '已出库数', + field: 'hasOutOrderSum', + }, + { + title: '申请出库数', + field: 'applyOutOrderSum', + }, + { + title: '准备出库数', + field: 'prepareOutOrderSum', + }, { title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('添加出货设备'); + actions.push('添加出货设备'); return actions.join(''); } } @@ -255,12 +278,18 @@ /*添加出货设备*/ - function addShippingDevices(quoteId, materialCode) { - // 确保URL编码,特别是如果materialCode中可能含有特殊字符 - var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevices/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); + // function addShippingDevicesOne(quoteId, materialCode) { + // // 确保URL编码,特别是如果materialCode中可能含有特殊字符 + // var url = ctx + 'aftersales/warehouseOutOrder/addShippingDevicesOne/' + encodeURIComponent(quoteId) + '/' + encodeURIComponent(materialCode); + // $.modal.open("添加出货设备", url); + // } + + function addShippingDevicesOne(outOrderDetailId) { + var url = prefix + '/addShippingDevicesOne/' + outOrderDetailId $.modal.open("添加出货设备", url); } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html b/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html index 6756d2b3..b00778cf 100644 --- a/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html +++ b/ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html @@ -207,7 +207,8 @@ var curParams = { // 传递参数查询参数 makeNo: equipMaterial.makeNo, - quoteId: equipMaterial.quoteId + quoteId: equipMaterial.quoteId, + materialCode: equipMaterial.materialCode }; return curParams; } diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html index 5b0bc67b..367571f2 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html @@ -117,7 +117,17 @@ "outOrderDetailId":item.outOrderDetailId, "outOrderCode":item.outOrderCode, "materialNo": item.materialNo, // 假设id对应materialId - "prepareOutOrderSum":item.prepareOutOrderSum, + "materialName": item.materialName, + "materialType": item.materialType, + "materialPhotourl": item.materialPhotourl, + "materialDescribe": item.materialDescribe, + "materialBrand": item.materialBrand, + "materialUnit": item.materialUnit, + "materialProcessMethod": item.materialProcessMethod, + "makeNum": item.makeNum, + "hasOutOrderSum": item.hasOutOrderSum, + "applyOutOrderSum": item.applyOutOrderSum, + "prepareOutOrderSum": item.prepareOutOrderSum, // ...其他字段 }; });