From c5b887032b18ccd652c8a7ba90ab32ab5c284d2a Mon Sep 17 00:00:00 2001 From: zhangsiqi <2825463979@qq.com> Date: Sat, 6 Jul 2024 13:37:36 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=94=9F=E6=88=90=E9=87=87=E8=B4=AD=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=8D=95=E9=A1=B5=E9=9D=A2=E8=8E=B7=E5=8F=96=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BC=A0=E8=BE=93=E7=9A=84=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=95=B0=E6=8D=AE=E3=80=81=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=88=B0=E8=B4=A7=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PurchaseOrderController.java | 3 ++- .../purchase/domain/PurchaseOrderChild.java | 9 -------- .../mapper/PurchaseOrderChildMapper.java | 2 ++ .../service/IPurchaseOrderChildService.java | 2 ++ .../impl/PurchaseOrderChildServiceImpl.java | 5 +++++ .../impl/PurchaseOrderServiceImpl.java | 17 +++++++++++++-- .../purchase/PurchaseOrderChildMapper.xml | 11 ++++++---- .../purchaseOrder/addPurchaseStorage.html | 21 ++++++++++++------- 8 files changed, 47 insertions(+), 23 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java index 29f0b1be..9ca339f5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java @@ -157,6 +157,7 @@ public class PurchaseOrderController extends BaseController // 生成采购订单编号 // 执行主表插入操作 purchaseOrderService.insertPurchaseOrder(purchaseOrder); + //物料的供应商整合,生成该订单相关的应付账款 return AjaxResult.success(); // 假设toAjax方法处理成功逻辑 } @RequiresPermissions("purchase:purchaseOrder:add") @@ -220,7 +221,7 @@ public class PurchaseOrderController extends BaseController public Map> detailListGroupedBySupplier(String qualityOrderCode) { PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode); - List allDetails = purchaseOrderChildService.selectPurchaseOrderChildList(purchaseOrderChild); + List allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode); Map> groupedDetails = allDetails.stream() .collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode)); return groupedDetails; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java index 4300da38..60d07b68 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java @@ -150,8 +150,6 @@ public class PurchaseOrderChild extends BaseEntity @Excel(name = "实际已到货数量") private Integer actualHasArrivedNum; - private Integer notifyArrivedNum; - public Integer getNotifyHasArrivedNum() { return notifyHasArrivedNum; } @@ -160,13 +158,6 @@ public class PurchaseOrderChild extends BaseEntity this.notifyHasArrivedNum = notifyHasArrivedNum; } - public Integer getNotifyArrivedNum() { - return notifyArrivedNum; - } - - public void setNotifyArrivedNum(Integer notifyArrivedNum) { - this.notifyArrivedNum = notifyArrivedNum; - } private List purchaseQuoteChildList; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java index 6e333575..6089e815 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java @@ -78,4 +78,6 @@ public interface PurchaseOrderChildMapper List selectPurchaseOrderChildByOrderCode(String purchaseOrderCode); List selectPurchaseOrderChildByOrderCodeTotal(String purchaseOrderCode); + + List selectPurchaseOrderStorageByPurchaseOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java index 6b5d74ca..1f52b49f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderChildService.java @@ -76,4 +76,6 @@ public interface IPurchaseOrderChildService List selectPurchaseOrderChildByOrderCode(String purchaseOrderCode); List selectPurchaseOrderChildByOrderCodeTotal(String purchaseOrderCode); + + List selectPurchaseOrderStorageByPurchaseOrderCode(String purchaseOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java index 31300c87..0e7bff7e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderChildServiceImpl.java @@ -135,4 +135,9 @@ public class PurchaseOrderChildServiceImpl implements IPurchaseOrderChildService public List selectPurchaseOrderChildByOrderCodeTotal(String purchaseOrderCode){ return purchaseOrderChildMapper.selectPurchaseOrderChildByOrderCodeTotal(purchaseOrderCode); } + //查询入库单中有无相同采购单数据,已入库数为最新审核通过添加采购物料信息的作为需要的已入库数。如有总和采购单通知到货数为已通知到货数,否则为0, + @Override + public List selectPurchaseOrderStorageByPurchaseOrderCode(String purchaseOrderCode){ + return purchaseOrderChildMapper.selectPurchaseOrderStorageByPurchaseOrderCode(purchaseOrderCode); + } } 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 5bbdc3c3..913cde60 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 @@ -6,6 +6,8 @@ import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.service.ICommonService; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.financial.service.IFinancialAccountsPayableService; +import com.ruoyi.financial.service.impl.FinancialAccountsPayableServiceImpl; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.purchase.domain.PurchaseOrder; @@ -92,6 +94,9 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Autowired private PurchasePlanMapper purchasePlanService; + + @Autowired + private IFinancialAccountsPayableService financialAccountsPayableService; /** * 查询采购订单 * @@ -303,8 +308,15 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService Integer amount = amountSet.size(); purchaseOrder.setMaterialAmount(amount); return purchaseOrderMapper.insertPurchaseOrder(purchaseOrder); - } + + + } + //生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。 + public int purchaseOrderPayment(PurchaseOrder purchaseOrder) { + //获取物料供应商的信息,采购订单的供应商数量 + return 0; + } /** * 修改采购订单 * @@ -424,6 +436,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService return result; } + @Override @Transactional(rollbackFor = Exception.class) public ProcessInstance submitApply(PurchaseOrder purchaseOrder) { @@ -516,7 +529,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService private ProcessInstance startProcessInstance(String applyTitle, String instanceType, PurchaseOrder purchaseOrder, SysUser user) { Long materialId = purchaseOrder.getPurchaseOrderId(); String businessKey = materialId.toString(); // 实体类 ID,作为流程的业务 key - String key = "material"; + String key = "purchaseOrder"; Map variables = new HashMap<>(); // 构造authority传参 buildAuthority(user, variables); diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml index 6f9cd34d..9bf60dea 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml @@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + @@ -235,14 +235,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where purchase_order_code = #{purchaseOrderCode} group by supplier_code - select p.purchase_order_code,p.purchase_plan_code,p.purchase_plan_correlation_code, p.supplier_code,p.supplier_name,p.material_code,p.material_name,p.material_type,p.material_describe, p.material_brand,p.material_photoUrl,p.material_process_method,p.material_unit,p.warehouseDept,p.material_no_rmb, p.material_rmb,p.material_num,p.material_amount,p.material_sum,p.material_no_rmb_sum,p.material_rmb_sum, p.material_real_num,p.material_real_no_rmb,p.material_real_rmb,p.material_real_no_rmb_sum,p.material_real_rmb_sum, - p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag,w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num - from purchase_order_child as p left join warehouse_storage_order_detail as w on p.purchase_order_code = w.related_order_code and p.material_code = w.material_no + p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag, + w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num + from purchase_order_child as p left join warehouse_storage_order_detail as w + on p.purchase_order_code = w.related_order_code + and p.material_code = w.material_no and p.supplier_code = w.supplier_code where p.purchase_order_code = #{purchaseOrderCode} GROUP BY supplier_code,material_code \ No newline at end of file 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 26a6dbe7..d76864a2 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/addPurchaseStorage.html @@ -122,7 +122,7 @@ {title: '通知已到货数',field: 'notifyHasArrivedNum', formatter: function (value, row, index) { if (value == null || value == '') { - return 0; + value = 0; } return value; } @@ -130,14 +130,22 @@ {title: '已入库数',field: 'hasStorageNum', formatter: function (value, row, index) { if (value == null || value == '') { - return 0; + value = 0; } return value; } }, - {title: '通知到货数',field: 'notifyArriveNum', - formatter: function (value, row, index) { - return '