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 c056b967..c7c006b1 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 @@ -274,10 +274,15 @@ public class AftersalesWarehouseOutController extends BaseController /** * 售后第一次维护设备 添加出货设备信息 */ - @GetMapping("/addShippingDevicesOne/{outOrderDetailId}") - public String addShippingDevicesOne(@PathVariable("outOrderDetailId") Long outOrderDetailId, ModelMap mmap) + @GetMapping("/addShippingDevicesOne") + public String addShippingDevicesOne(@RequestParam("outOrderDetailId") Long outOrderDetailId, + @RequestParam("salesOrderCode") String salesOrderCode, + @RequestParam("makeNo") String makeNo, + ModelMap mmap) { WarehouseOutOrderDetail warehouseOutOrderDetail = outOrderDetailService.selectWarehouseOutOrderDetailById(outOrderDetailId); + mmap.put("salesOrderCode",salesOrderCode); + mmap.put("makeNo",makeNo); mmap.put("warehouseOutOrderDetail", warehouseOutOrderDetail); return prefix + "/addShippingDevicesOne"; } @@ -298,13 +303,13 @@ public class AftersalesWarehouseOutController extends BaseController /** * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 */ - @PostMapping("/getEquipMaterialDetailByMaterialNo") + @PostMapping("/getAllMaterialShippingDevices") @ResponseBody public TableDataInfo showAftersalesShippingDevicelist(WarehouseOutOrderDetail warehouseOutOrderDetail) { startPage(); - List list = warehouseOutOrderService.selectAftersalesShippingDeviceListByMaterialNo(warehouseOutOrderDetail); + List list = warehouseOutOrderService.selectAftersalesShippingDeviceList(warehouseOutOrderDetail); return getDataTable(list); } 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 c68025a0..32fb8a6f 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 @@ -116,7 +116,7 @@ public interface IAftersalesWarehouseOutService List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); /** - * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 + * 展示售后第一次维护设备 添加出货设备 料号相关出货设备信息 (旧版) * */ List selectAftersalesShippingDeviceListByMaterialNo(WarehouseOutOrderDetail warehouseOutOrderDetail); @@ -150,4 +150,9 @@ public interface IAftersalesWarehouseOutService * 确认验收 */ int confirmCheckGoodsById(Long outOrderId); + + /** + * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 关联物料号、生产单号、销售单号 + * */ + List selectAftersalesShippingDeviceList(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 139a2ab5..4c05cc7a 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 @@ -473,6 +473,35 @@ public class AftersalesWarehouseOutServiceImpl implements IAftersalesWarehouseOu } + /** + * 展示售后第一次维护设备添加出货设备料号相关出货设备信息 关联物料号、生产单号、销售单号 + * */ + @Override + public List selectAftersalesShippingDeviceList(WarehouseOutOrderDetail warehouseOutOrderDetail) { + List selectShippingDeviceVOs = new ArrayList<>(); + AfterSalesShippingDevice afterSalesShippingDevice = new AfterSalesShippingDevice(); + afterSalesShippingDevice.setMaterialNo(warehouseOutOrderDetail.getMaterialNo()); + afterSalesShippingDevice.setMakeNo(warehouseOutOrderDetail.getMakeNo()); + afterSalesShippingDevice.setSalesOrderCode(warehouseOutOrderDetail.getSalesOrderCode()); + List afterSalesShippingDevices = shippingDeviceMapper.selectAfterSalesShippingDeviceByNoAndCode(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/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html index 3df5aba7..e69f32f2 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/addShippingDevicesOne.html @@ -106,6 +106,8 @@ var prefix = ctx + "aftersales/warehouseOutOrder"; var warehouseOutOrderDetail = [[${warehouseOutOrderDetail}]]; + var salesOrderCode = [[${salesOrderCode}]]; + var makeNo = [[${makeNo}]]; $("#form-addShippingDevicesOne-edit").validate({ focusCleanup: true @@ -231,7 +233,7 @@ var options = { id: "table-shippingDevices", - url: prefix + "/getEquipMaterialDetailByMaterialNo", + url: prefix + "/getAllMaterialShippingDevices", pagination: false, showSearch: false, showRefresh: false, @@ -288,7 +290,9 @@ function queryParams(params) { var curParams = { // 传递参数查询参数 - materialNo: warehouseOutOrderDetail.materialNo + materialNo: warehouseOutOrderDetail.materialNo, + salesOrderCode:salesOrderCode, + makeNo:makeNo }; return curParams; } 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 7d3b78f4..1db56a09 100644 --- a/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html +++ b/ruoyi-admin/src/main/resources/templates/aftersales/warehouseOutOrder/maintenanceEquipmentOne.html @@ -339,7 +339,13 @@ // } function addShippingDevicesOne(outOrderDetailId) { - var url = prefix + '/addShippingDevicesOne/' + outOrderDetailId + var salesOrderCode = [[${warehouseOutOrder.salesOrderCode}]]; + var makeNo = [[${warehouseOutOrder.makeNo}]]; + var queryParams = new URLSearchParams(); + queryParams.append('outOrderDetailId', outOrderDetailId); + queryParams.append('salesOrderCode', encodeURIComponent(salesOrderCode)); + queryParams.append('makeNo',encodeURIComponent(makeNo)); + var url = prefix + '/addShippingDevicesOne?' + queryParams.toString(); $.modal.open("添加出货设备", url); }