From 06fef80377875c28991a26c6034dc92151dbba75 Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Fri, 5 Jul 2024 08:21:54 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E4=BF=AE=E6=94=B9=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=8E=B7=E5=8F=96=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=B1=BB=E5=9E=8B=E4=B8=BA=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E7=94=9F=E6=88=90=E6=98=AF=E6=90=BA?= =?UTF-8?q?=E5=B8=A6=E6=95=B0=E6=8D=AE=E4=B8=BA=E5=88=86=E7=B1=BB=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E5=85=A5=E5=BA=93=EF=BC=8C=E4=BB=93=E5=BA=93=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PurchaseOrderServiceImpl.java | 32 ++++--- .../service/impl/PurchasePlanServiceImpl.java | 2 + .../purchaseOrder/addPurchaseStorage.html | 8 +- .../purchasePlan/addPurchaseOrder.html | 93 +++++++++++++------ .../templates/stock/stockInfo/stockInfo.html | 2 +- 5 files changed, 92 insertions(+), 45 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java index 5780051f..c49ff949 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java @@ -366,14 +366,14 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService int result = 0; if(!CollectionUtils.isEmpty(list)) { //根据物料入库部门划分入库单,入库单类型:0 仓库,1 采购,生成入库单号 - List list1 = list.stream().filter(e -> e.getMaterialDeptType().equals("0")).collect(Collectors.toList()); - List list2 = list.stream().filter(e -> e.getMaterialDeptType().equals("1")).collect(Collectors.toList()); + List list1 = list.stream().filter(e -> ("1").equals(e.getMaterialDeptType())).collect(Collectors.toList()); + List list2 = list.stream().filter(e -> ("0").equals(e.getMaterialDeptType())).collect(Collectors.toList()); //WarehouseStorageStatus 仓库入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库), //WarehouseStorageType 仓库入库类型(0采购入库、1供应商补货、2委内入库、3公司退货、4委外入库、5生产入库), //setWarehouseOrderType仓库订单类型(0采购订单、1生产订单、2退换货订单、3委外订单), //WarehouseDeptType 仓库入库部门类型(0仓库,1采购 ), if(list1.size() > 0) { - //采购入库单,物料入库列表信息读取,放入生成的入库订单号 + //仓库入库单,物料入库列表信息读取,放入生成的入库订单号 String warehouseStorageCode = redisCache.generateBillNo("RK"); for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list1) { warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode); @@ -384,36 +384,42 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService } //入库代表为采购部分的入库单 warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode); - warehouseStorageOrder.setWarehouseStorageType("0"); - warehouseStorageOrder.setWarehouseDeptType("0"); - warehouseStorageOrder.setWarehouseOrderType("1"); + warehouseStorageOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode()); warehouseStorageOrder.setWarehouseStorageStatus("0"); + warehouseStorageOrder.setWarehouseQualityStatus("0"); + warehouseStorageOrder.setWarehouseStorageType("0"); + warehouseStorageOrder.setWarehouseOrderType("0"); + warehouseStorageOrder.setWarehouseDeptType("1"); warehouseStorageOrder.setCreateTime(DateUtils.getNowDate()); warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName()); result = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); } - if(list.size()>0) { + if(list2.size()>0) { String warehouseStorageCode1 = redisCache.generateBillNo("RK"); - //仓库入库单 + //入库部门类型:采购入库单 for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list2) { warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode1); - warehouseStorageOrderDetail.setWarehouseStorageType("1"); - warehouseStorageOrderDetail.setMaterialDeptType("0"); + warehouseStorageOrderDetail.setWarehouseStorageType("0"); + warehouseStorageOrderDetail.setMaterialDeptType("1"); warehouseStorageOrderDetail.setWarehouseDeptType("0"); storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail); } //入库代表为仓库部分的入库单 + //WarehouseStorageStatus 仓库入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库), + //WarehouseStorageType 仓库入库类型(0采购入库、1供应商补货、2委内入库、3公司退货、4委外入库、5生产入库), + //setWarehouseOrderType仓库订单类型(0采购订单、1生产订单、2退换货订单、3委外订单), + //WarehouseDeptType 仓库入库部门类型(0仓库,1采购 ), warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode1); + warehouseStorageOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode()); warehouseStorageOrder.setWarehouseStorageStatus("0"); warehouseStorageOrder.setWarehouseQualityStatus("0"); - warehouseStorageOrder.setWarehouseStorageType("1"); + warehouseStorageOrder.setWarehouseStorageType("0"); warehouseStorageOrder.setWarehouseOrderType("0"); - warehouseStorageOrder.setWarehouseDeptType("1"); + warehouseStorageOrder.setWarehouseDeptType("0"); warehouseStorageOrder.setCreateTime(DateUtils.getNowDate()); warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName()); warehouseStorageOrder.setWarehouseStorageOrderDetailList(list2); result = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder); - } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java index 0aaa86ee..29ecf592 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchasePlanServiceImpl.java @@ -254,6 +254,8 @@ public class PurchasePlanServiceImpl implements IPurchasePlanService purchasePlanChild.setProcessMethod("0"); purchasePlanChild.setBrand(bom.getBrand()); purchasePlanChild.setDescribe(bom.getDescribe()); + purchasePlanChild.setUnit(bom.getUnit()); + purchasePlanChild.setWarehouseDept(bom.getWarehouseDept()); //物料用量 Long useNum = bom.getUseNum(); //物料的计划采购数 diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html index 684d63ae..2a3f8bdb 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html @@ -56,6 +56,7 @@ var materialUnitDatas = [[${@dict.getType('sysUnitClassDatas')}]]; var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; + var purchaseOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; $("#form-addPurchaseStorage-edit").validate({ focusCleanup: true}); //生成的不同table的id集合 var tableDatas = []; @@ -144,7 +145,7 @@ $tableWrapper.append($header).append($table); $('#tablesContainer').append($tableWrapper); } - var purchaseOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; + var relatedOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; var warehouseCode = [[${purchaseOrder.stockNo}]]; var warehouseName = [[${purchaseOrder.stockName}]]; var warehouseDetailAddress = [[${purchaseOrder.stockAddress}]]; @@ -179,7 +180,6 @@ "deliveryInspectionTime":item.deliveryTime, "hasStorageNum": item.hasStorageNum, //已入库数量 "notifyArriveNum": item.notifyArriveNum, //通知到货数量 - "actualArriveNum": item.actualArriveNum, //实际到货数量 "relatedOrderCode":purchaseOrderCode, // ...其他字段 }; @@ -188,6 +188,10 @@ }); } const combinedData = Object.assign({}, storageOrderData, { + relatedOrderCode:relatedOrderCode, + warehouseCode:warehouseCode, + warehouseName:warehouseName, + warehouseDetailAddress:warehouseDetailAddress, warehouseStorageOrderDetailList: allMaterialDataList }); // 合并表单数据和表格数据 diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html b/ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html index 7a1442a1..b633214c 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html @@ -257,6 +257,8 @@ var materialRmbTotal = 0; var totalMaterialSum = 0; var totalPurchaseSum = 0; + var totalRmbSum = 0; + var totalNoRmbSum = 0; tableIdList.forEach(function(tableId) { $('#' + 'supplier-' + tableId).find('.supplier-card').each(function (supplierIndex, supplierCard) { var purchaseNum = parseFloat($(supplierCard).find('.supplierMaterialNum').val()) || 0; @@ -442,38 +444,71 @@ } } //获取仓库相关信息Select2 - $("#stockNo").on("select2:select", function (e) { - var data = e.params.data; - $("#stockName").val(data.stockName); - $("#stockAddress").val(data.stockAddr); - $("#stockContact").val(data.stockManager); - }); - $("#stockNo").select2({ - theme: "bootstrap", - allowClear: true, - placeholder: "请选择仓库", - ajax: { - url: ctx + "stock/stockInfo/getAllWarehouseCode", - type: "get", - dataType: "json", - delay: 250, - processResults: function (data) { - var resultList = data; - var options = []; - for(var i= 0, len=resultList.length;i所有'); + + // 遍历返回的数据,添加为下拉框的选项 + $.each(data, function(index, item) { + // 仓库ID + selectElement.append(''); + }); + // $('#warehouseCode').val(stockNO); + } else { + $.modal.errMsg("数据为空"); + } + } + }); + } + $("input[name='deliveryTime']").datepicker({ language: 'zh-CN', todayHighlight: true, diff --git a/ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html b/ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html index 2f070fee..dbefeffb 100644 --- a/ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html +++ b/ruoyi-admin/src/main/resources/templates/stock/stockInfo/stockInfo.html @@ -76,7 +76,7 @@ {title: '仓库名',field: 'stockName',}, {title: '仓库地址',field: 'stockAddr',}, {title: '仓库管理人',field: 'stockManager',}, - {title: '仓库管理人',field: 'stockManagerPhone',}, + {title: '仓库管理人电话',field: 'stockManagerPhone',}, {title: '仓库备注',field: 'stockMemo',}, {title: '录入时间',field: 'firstAddTime', formatter: function (value, row, index) {