From 51cbbf1bac114e9f675d7da8cbfd323bc28dc6a2 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Mon, 18 Nov 2024 18:37:20 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=8C=89=E7=85=A7=E6=96=B0=E7=89=88pr?= =?UTF-8?q?d=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95purch?= =?UTF-8?q?ase=5Forder=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=96=B0=E5=A2=9E5?= =?UTF-8?q?=E6=9D=A1=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BB=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95Controller=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95Mapper=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95Mapper.XML=20=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95Service=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95ServiceIm?= =?UTF-8?q?pl=E5=AE=9E=E7=8E=B0=E7=B1=BB=20=E6=8C=89=E7=85=A7=E6=96=B0?= =?UTF-8?q?=E7=89=88prd=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AD=90=E8=A1=A8purchase=5Forder=5Fchild=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=96=B0=E5=A2=9E10=E6=9D=A1=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=95=B0=E6=8D=AE=20=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BB=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AD=90=E8=A1=A8Mapper=20=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8Mapper.XML=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8Service=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8ServiceIm?= =?UTF-8?q?pl=E5=AE=9E=E7=8E=B0=E7=B1=BB=20=E6=9A=82=E6=97=B6=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E6=8A=A5=E9=94=80=E5=8D=95=E5=85=B3=E8=81=94=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E8=AE=A2=E5=8D=95=E7=9A=84=E4=B8=9A=E5=8A=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91=20=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89=E7=89=A9?= =?UTF-8?q?=E6=96=99=E9=87=87=E8=B4=AD=E5=8E=86=E5=8F=B2=E5=85=B3=E8=81=94?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E7=9A=84=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E7=89=A9=E6=96=99=E8=A1=A8=E5=85=B3=E8=81=94=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91?= =?UTF-8?q?=20=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E5=85=B3=E8=81=94=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E4=B8=9A=E5=8A=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/ErpMaterialPurchaseHistoryVo.java | 2 +- .../service/impl/ErpMaterialServiceImpl.java | 6 +- .../controller/PurchaseOrderController.java | 70 +- .../ruoyi/purchase/domain/PurchaseOrder.java | 796 +++++++----------- .../purchase/domain/PurchaseOrderChild.java | 542 ++++-------- .../impl/PurchaseOrderServiceImpl.java | 670 +-------------- .../BaseExpenseConfirmAmountServiceImpl.java | 62 +- .../WarehouseStorageOrderServiceImpl.java | 32 +- .../purchase/PurchaseOrderChildMapper.xml | 311 ++----- .../mapper/purchase/PurchaseOrderMapper.xml | 6 +- 10 files changed, 639 insertions(+), 1858 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java index c0c6d418..b222b932 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java @@ -14,7 +14,7 @@ public class ErpMaterialPurchaseHistoryVo { private Date purchaseTime; //物料数量 - private BigDecimal materialNum; + private Integer materialNum; //含税价格 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java index d435600d..ea944024 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java @@ -836,14 +836,12 @@ public class ErpMaterialServiceImpl implements IErpMaterialService ErpMaterialPurchaseHistoryVo erpMaterialPurchaseHistoryVo = new ErpMaterialPurchaseHistoryVo(); String purchaseOrderCode = purchaseOrderChild.getPurchaseOrderCode(); PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode); - erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getMaterialNum()); + erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getActualPurchaseNum()); erpMaterialPurchaseHistoryVo.setPurchaseUser(purchaseOrder.getPurchaseBuyer()); erpMaterialPurchaseHistoryVo.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); erpMaterialPurchaseHistoryVo.setPurchaseTime(purchaseOrderChild.getCreateTime()); - erpMaterialPurchaseHistoryVo.setTaxPrice(purchaseOrderChild.getMaterialRmb()); - erpMaterialPurchaseHistoryVo.setNoTaxPrice(purchaseOrderChild.getMaterialNoRmb()); erpMaterialPurchaseHistoryVo.setTaxSum(purchaseOrderChild.getMaterialRmbSum()); - erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNoRmbSum()); + erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNormbSum()); erpMaterialPurchaseHistoryVos.add(erpMaterialPurchaseHistoryVo); } return erpMaterialPurchaseHistoryVos; 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 44ff5c5b..ba123e28 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 @@ -204,16 +204,16 @@ public class PurchaseOrderController extends BaseController List purchaseOrderChildList = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrder.getPurchaseOrderCode()); //Set子表供应商的信息 供应商编号-供应商名称 //Set子表采购计划单信息 - Set supplierCodes = new HashSet<>(); - Set purchasePlanCodes = new HashSet<>(); - for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ - supplierCodes.add(purchaseOrderChild.getSupplierCode()); - purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); - } - purchaseOrder.setPurchaseOrderChildList(purchaseOrderChildList); - mmap.put("supplierCodes", supplierCodes); - mmap.put("purchasePlanCodes", purchasePlanCodes); - mmap.put("purchaseOrder", purchaseOrder); +// Set supplierCodes = new HashSet<>(); +// Set purchasePlanCodes = new HashSet<>(); +// for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ +// supplierCodes.add(purchaseOrderChild.getSupplierCode()); +// purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); +// } +// purchaseOrder.setPurchaseOrderChildList(purchaseOrderChildList); +// mmap.put("supplierCodes", supplierCodes); +// mmap.put("purchasePlanCodes", purchasePlanCodes); +// mmap.put("purchaseOrder", purchaseOrder); return prefix + "/edit"; } @@ -228,21 +228,21 @@ public class PurchaseOrderController extends BaseController //Set子表采购计划单信息 Set supplierCodes = new HashSet<>(); Set purchasePlanCodes = new HashSet<>(); - for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ - //获取区分的供应商物料信息 - if(!purchasePlanCodes.contains(purchaseOrderChild.getPurchasePlanCode())){ - purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); - } - //获取区分的采购计划单信息 - if(!supplierCodes.contains(purchaseOrderChild.getSupplierCode())){ - supplierCodes.add(purchaseOrderChild.getSupplierCode()); - } - supplierCodes.add(purchaseOrderChild.getSupplierCode()); - } - mmap.put("supplierCodes", supplierCodes); - mmap.put("purchasePlanCodes", purchasePlanCodes); - mmap.put("purchaseOrder", purchaseOrder); - mmap.put("purchasePlanChildList",purchaseOrderChildList); +// for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ +// //获取区分的供应商物料信息 +// if(!purchasePlanCodes.contains(purchaseOrderChild.getPurchasePlanCode())){ +// purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); +// } +// //获取区分的采购计划单信息 +// if(!supplierCodes.contains(purchaseOrderChild.getSupplierCode())){ +// supplierCodes.add(purchaseOrderChild.getSupplierCode()); +// } +// supplierCodes.add(purchaseOrderChild.getSupplierCode()); +// } +// mmap.put("supplierCodes", supplierCodes); +// mmap.put("purchasePlanCodes", purchasePlanCodes); +// mmap.put("purchaseOrder", purchaseOrder); +// mmap.put("purchasePlanChildList",purchaseOrderChildList); return AjaxResult.success(mmap); } @GetMapping("/detail/{purchaseOrderId}") @@ -284,16 +284,16 @@ public class PurchaseOrderController extends BaseController - @ResponseBody - @RequestMapping("/detailListGroupedBySupplier") - public Map> detailListGroupedBySupplier(String qualityOrderCode) { - PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); - purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode); - List allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode); - Map> groupedDetails = allDetails.stream() - .collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode)); - return groupedDetails; - } +// @ResponseBody +// @RequestMapping("/detailListGroupedBySupplier") +// public Map> detailListGroupedBySupplier(String qualityOrderCode) { +// PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); +// purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode); +// 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/PurchaseOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java index a14113fc..a3df134e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java @@ -1,20 +1,18 @@ package com.ruoyi.purchase.domain; +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; -import org.apache.poi.hpsf.Decimal; - -import java.math.BigDecimal; -import java.util.Date; -import java.util.List; /** * 采购订单对象 purchase_order - * - * @author ruoyi - * @date 2023-03-31 + * + * @author 刘晓旭 + * @date 2024-11-18 */ public class PurchaseOrder extends BaseEntity { @@ -23,161 +21,117 @@ public class PurchaseOrder extends BaseEntity /** 采购订单id */ private Long purchaseOrderId; - /** 订购单号 */ - @Excel(name = "采购订单单号") + /** 采购订购单号 */ + @Excel(name = "采购订购单号") private String purchaseOrderCode; - @Excel(name="采购员") - private String purchaseBuyer; - @Excel(name="审核状态") - private String auditStatus; - @Excel(name="使用状态") - private String useStatus; - @Excel(name="入库状态") - private String eceiptStatus; - @Excel(name="打款结案状态") + + /** 采购计划单号 */ + @Excel(name = "采购计划单号") + private String purchasePlanCode; + + /** 采购入库状态(0待采购、1采购中、2待暂收、3部分暂收、4全部暂收、5已暂收、6待入库、7部分入库、8全部入库、9已入库) */ + @Excel(name = "采购入库状态",dictType = "eceiptStatus") + private String warehouseStorageStatus; + + /** 打款结案状态(0待打款、1部分打款、2全部打款、3部分结案、4已结案) */ + @Excel(name = "打款结案状态", dictType = "sys_pay_close") private String paymentStatus; - @Excel(name="供应商数量") - private Integer supplierNum; - @Excel(name="物料合计") - private Integer materialAmount; - @Excel(name="数量合计") - private BigDecimal materialSum; - @Excel(name="不含税总价(RMB)") - private BigDecimal noRmbSum; - @Excel(name="含税总价") - private BigDecimal rmbSum; - /** 供应商代码 */ - @Excel(name = "供应商代码") + /** 供应商ID */ + @Excel(name = "供应商ID") private String supplierCode; + /** 供应商名称 */ @Excel(name = "供应商名称") private String supplierName; - @Excel(name = "入库类型") - private String eceiptType; - - @Excel(name = "到货时间") - private Date arrivedTime; + /** 物料合计 */ + @Excel(name = "物料合计") + private String materialSum; - /** 联系人 */ - @Excel(name = "联系人") - private String customerContact; + /** 实际采购总数 */ + @Excel(name = "实际采购总数") + private Integer actualPurchaseSum; - /** 联系电话 */ - @Excel(name = "联系电话") - private String contactNumber; + /** 共享库存占用总数 */ + @Excel(name = "共享库存占用总数") + private Integer sharedInventoryOccupancySum; - /** 传真号码 */ - @Excel(name = "传真号码") - private String customerFax; + /** 退换货数 */ + @Excel(name = "退换货数") + private Integer refundsExchangesSum; - /** 交货地点 */ - @Excel(name = "交货地点") - private String deliveryAddress; + /** 入库数 */ + @Excel(name = "入库数") + private Integer storageSum; - /** 付款条件 */ - @Excel(name = "付款条件") - private String paymentTerms; + /** 不含税总价(RMB) */ + @Excel(name = "不含税总价(RMB)") + private BigDecimal normbSum; - /** 交货条件 */ - @Excel(name = "交货条件") - private String deliveryConditions; - - /** 交货方式 */ - @Excel(name = "交货方式") - private String deliveryMethod; - - /** 购方名称 */ - @Excel(name = "购方名称") - private String purchaseName; - - /** 开单日期 */ - @Excel(name = "开单日期") - private String billingDate; - - /** 税率 */ - @Excel(name = "税率") - private String taxRate; - - /** 订购种类 */ - @Excel(name = "订购种类") - private String purchaseCategory; + /** 含税总价(RMB) */ + @Excel(name = "含税总价(RMB)") + private BigDecimal rmbSum; - /** 采购担当 */ - @Excel(name = "采购担当") - private String purchaseCommander; + /** 入库类型 */ + private String eceiptType; - /** 客户订单号 */ - @Excel(name = "客户订单号") - private String customerOrderNumber; + /** 到货时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "到货时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date arrivedTime; - /** 备注内容 */ - @Excel(name = "备注内容") - private String remarkContent; + /** 仓库ID */ + @Excel(name = "仓库ID") + private String stockNo; - /** 结案否 */ - @Excel(name = "结案否") - private String closeCaseNo; + /** 仓库名称 */ + @Excel(name = "仓库名称") + private String stockName; - /** 结案人 */ - @Excel(name = "结案人") - private String closeCaseName; + /** 收货人 */ + @Excel(name = "收货人") + private String receivePerson; - /** 结案时间 */ - @Excel(name = "结案时间") - private String closeCaseTime; + /** 收货电话 */ + @Excel(name = "收货电话") + private String receivePersonPhone; + /** 收货地址 */ + @Excel(name = "收货地址") + private String receiveAddress; - /** 对账否 */ - @Excel(name = "对账否") - private String accountReconciliationFlag; + /** 采购员 */ + @Excel(name = "采购员") + private String purchaseBuyer; - /** 对账人 */ - @Excel(name = "对账人") - private String accountReconciliationPerson; + /** 使用状态 (0未使用,1使用,2已作废) */ + @Excel(name = "使用状态",dictType = "useStatus") + private String useStatus; - /** 对账时间 */ - @Excel(name = "对账时间") - private String accountReconciliationTime; - /** 录入时间 */ + /** 审核状态(0待审核、1审核通过、2审核拒绝) */ + @Excel(name = "审核状态",dictType = "auditStatus") + private String auditStatus; - /** 删除标志(0代表存在 2代表删除) */ + /** 删除标志 */ private String delFlag; - /*仓库ID*/ - private String stockNo; - /*仓库名称*/ - private String stockName; - - /*仓库收货地址*/ - private String stockAddress; - /*仓库收货电话*/ - private String stockPhone; - /*仓库收货人*/ - private String stockContact; - - /** 备用一 */ - private String standbyOne; - - /** 备用二 */ - private String standbyTwo; /** 流程实例ID */ private String instanceId; /** 流程实例类型 */ private String instanceType; - /** 提交流程实例ID */ + /** 流程提交实例ID */ private String submitInstanceId; - /** 作废流程实例ID */ + /** 流程作废实例ID */ private String cancelInstanceId; - /** 恢复流程实例ID */ + /** 流程恢复实例ID */ private String restoreInstanceId; - /** 申请人 */ + /** 申请标题 */ private String applyTitle; /** 申请人 */ @@ -186,494 +140,344 @@ public class PurchaseOrder extends BaseEntity /** 申请时间 */ private Date applyTime; - private Long photoAttachId; - - private String fileIdStr; - - private String removeFileIdStr; - - /** 子表信息 */ - private List purchaseOrderChildList; - - public Long getPurchaseOrderId() { - return purchaseOrderId; - } - - public void setPurchaseOrderId(Long purchaseOrderId) { + public void setPurchaseOrderId(Long purchaseOrderId) + { this.purchaseOrderId = purchaseOrderId; } - public String getPurchaseOrderCode() { - return purchaseOrderCode; + public Long getPurchaseOrderId() + { + return purchaseOrderId; } - - public void setPurchaseOrderCode(String purchaseOrderCode) { + public void setPurchaseOrderCode(String purchaseOrderCode) + { this.purchaseOrderCode = purchaseOrderCode; } - public String getPurchaseBuyer() { - return purchaseBuyer; - } - - public void setPurchaseBuyer(String purchaseBuyer) { - this.purchaseBuyer = purchaseBuyer; - } - - public String getAuditStatus() { - return auditStatus; - } - - public void setAuditStatus(String auditStatus) { - this.auditStatus = auditStatus; - } - - public String getUseStatus() { - return useStatus; + public String getPurchaseOrderCode() + { + return purchaseOrderCode; } - - public void setUseStatus(String useStatus) { - this.useStatus = useStatus; + public void setPurchasePlanCode(String purchasePlanCode) + { + this.purchasePlanCode = purchasePlanCode; } - public String getEceiptStatus() { - return eceiptStatus; + public String getPurchasePlanCode() + { + return purchasePlanCode; } - - public void setEceiptStatus(String eceiptStatus) { - this.eceiptStatus = eceiptStatus; + public void setWarehouseStorageStatus(String warehouseStorageStatus) + { + this.warehouseStorageStatus = warehouseStorageStatus; } - public String getPaymentStatus() { - return paymentStatus; + public String getWarehouseStorageStatus() + { + return warehouseStorageStatus; } - - public void setPaymentStatus(String paymentStatus) { + public void setPaymentStatus(String paymentStatus) + { this.paymentStatus = paymentStatus; } - public Integer getSupplierNum() { - return supplierNum; - } - - public void setSupplierNum(Integer supplierNum) { - this.supplierNum = supplierNum; - } - - public Integer getMaterialAmount() { - return materialAmount; - } - - public void setMaterialAmount(Integer materialAmount) { - this.materialAmount = materialAmount; - } - - public BigDecimal getMaterialSum() { - return materialSum; - } - - public void setMaterialSum(BigDecimal materialSum) { - this.materialSum = materialSum; - } - - public BigDecimal getNoRmbSum() { - return noRmbSum; - } - - public void setNoRmbSum(BigDecimal noRmbSum) { - this.noRmbSum = noRmbSum; - } - - public BigDecimal getRmbSum() { - return rmbSum; - } - - public void setRmbSum(BigDecimal rmbSum) { - this.rmbSum = rmbSum; - } - - public String getSupplierCode() { - return supplierCode; + public String getPaymentStatus() + { + return paymentStatus; } - - public void setSupplierCode(String supplierCode) { + public void setSupplierCode(String supplierCode) + { this.supplierCode = supplierCode; } - public String getSupplierName() { - return supplierName; + public String getSupplierCode() + { + return supplierCode; } - - public void setSupplierName(String supplierName) { + public void setSupplierName(String supplierName) + { this.supplierName = supplierName; } - public String getEceiptType() { - return eceiptType; - } - - public void setEceiptType(String eceiptType) { - this.eceiptType = eceiptType; - } - - public Date getArrivedTime() { - return arrivedTime; - } - - public void setArrivedTime(Date arrivedTime) { - this.arrivedTime = arrivedTime; - } - - public String getCustomerContact() { - return customerContact; - } - - public void setCustomerContact(String customerContact) { - this.customerContact = customerContact; - } - - public String getContactNumber() { - return contactNumber; - } - - public void setContactNumber(String contactNumber) { - this.contactNumber = contactNumber; - } - - public String getCustomerFax() { - return customerFax; - } - - public void setCustomerFax(String customerFax) { - this.customerFax = customerFax; + public String getSupplierName() + { + return supplierName; } - - public String getDeliveryAddress() { - return deliveryAddress; + public void setMaterialSum(String materialSum) + { + this.materialSum = materialSum; } - public void setDeliveryAddress(String deliveryAddress) { - this.deliveryAddress = deliveryAddress; + public String getMaterialSum() + { + return materialSum; } - - public String getPaymentTerms() { - return paymentTerms; + public void setActualPurchaseSum(Integer actualPurchaseSum) + { + this.actualPurchaseSum = actualPurchaseSum; } - public void setPaymentTerms(String paymentTerms) { - this.paymentTerms = paymentTerms; + public Integer getActualPurchaseSum() + { + return actualPurchaseSum; } - - public String getDeliveryConditions() { - return deliveryConditions; + public void setSharedInventoryOccupancySum(Integer sharedInventoryOccupancySum) + { + this.sharedInventoryOccupancySum = sharedInventoryOccupancySum; } - public void setDeliveryConditions(String deliveryConditions) { - this.deliveryConditions = deliveryConditions; + public Integer getSharedInventoryOccupancySum() + { + return sharedInventoryOccupancySum; } - - public String getDeliveryMethod() { - return deliveryMethod; + public void setRefundsExchangesSum(Integer refundsExchangesSum) + { + this.refundsExchangesSum = refundsExchangesSum; } - public void setDeliveryMethod(String deliveryMethod) { - this.deliveryMethod = deliveryMethod; + public Integer getRefundsExchangesSum() + { + return refundsExchangesSum; } - - public String getPurchaseName() { - return purchaseName; + public void setStorageSum(Integer storageSum) + { + this.storageSum = storageSum; } - public void setPurchaseName(String purchaseName) { - this.purchaseName = purchaseName; + public Integer getStorageSum() + { + return storageSum; } - - public String getBillingDate() { - return billingDate; - } - - public void setBillingDate(String billingDate) { - this.billingDate = billingDate; + public void setNormbSum(BigDecimal normbSum) + { + this.normbSum = normbSum; } - public String getTaxRate() { - return taxRate; + public BigDecimal getNormbSum() + { + return normbSum; } - - public void setTaxRate(String taxRate) { - this.taxRate = taxRate; + public void setRmbSum(BigDecimal rmbSum) + { + this.rmbSum = rmbSum; } - public String getPurchaseCategory() { - return purchaseCategory; + public BigDecimal getRmbSum() + { + return rmbSum; } - - public void setPurchaseCategory(String purchaseCategory) { - this.purchaseCategory = purchaseCategory; + public void setEceiptType(String eceiptType) + { + this.eceiptType = eceiptType; } - public String getPurchaseCommander() { - return purchaseCommander; + public String getEceiptType() + { + return eceiptType; } - - public void setPurchaseCommander(String purchaseCommander) { - this.purchaseCommander = purchaseCommander; + public void setArrivedTime(Date arrivedTime) + { + this.arrivedTime = arrivedTime; } - public String getCustomerOrderNumber() { - return customerOrderNumber; + public Date getArrivedTime() + { + return arrivedTime; } - - public void setCustomerOrderNumber(String customerOrderNumber) { - this.customerOrderNumber = customerOrderNumber; + public void setStockNo(String stockNo) + { + this.stockNo = stockNo; } - public String getRemarkContent() { - return remarkContent; + public String getStockNo() + { + return stockNo; } - - public void setRemarkContent(String remarkContent) { - this.remarkContent = remarkContent; + public void setStockName(String stockName) + { + this.stockName = stockName; } - public String getCloseCaseNo() { - return closeCaseNo; + public String getStockName() + { + return stockName; } - - public void setCloseCaseNo(String closeCaseNo) { - this.closeCaseNo = closeCaseNo; + public void setReceivePerson(String receivePerson) + { + this.receivePerson = receivePerson; } - public String getCloseCaseName() { - return closeCaseName; + public String getReceivePerson() + { + return receivePerson; } - - public void setCloseCaseName(String closeCaseName) { - this.closeCaseName = closeCaseName; + public void setReceivePersonPhone(String receivePersonPhone) + { + this.receivePersonPhone = receivePersonPhone; } - public String getCloseCaseTime() { - return closeCaseTime; + public String getReceivePersonPhone() + { + return receivePersonPhone; } - - public void setCloseCaseTime(String closeCaseTime) { - this.closeCaseTime = closeCaseTime; + public void setReceiveAddress(String receiveAddress) + { + this.receiveAddress = receiveAddress; } - public String getAccountReconciliationFlag() { - return accountReconciliationFlag; + public String getReceiveAddress() + { + return receiveAddress; } - - public void setAccountReconciliationFlag(String accountReconciliationFlag) { - this.accountReconciliationFlag = accountReconciliationFlag; + public void setPurchaseBuyer(String purchaseBuyer) + { + this.purchaseBuyer = purchaseBuyer; } - public String getAccountReconciliationPerson() { - return accountReconciliationPerson; + public String getPurchaseBuyer() + { + return purchaseBuyer; } - - public void setAccountReconciliationPerson(String accountReconciliationPerson) { - this.accountReconciliationPerson = accountReconciliationPerson; + public void setUseStatus(String useStatus) + { + this.useStatus = useStatus; } - public String getAccountReconciliationTime() { - return accountReconciliationTime; + public String getUseStatus() + { + return useStatus; } - - public void setAccountReconciliationTime(String accountReconciliationTime) { - this.accountReconciliationTime = accountReconciliationTime; + public void setAuditStatus(String auditStatus) + { + this.auditStatus = auditStatus; } - public String getDelFlag() { - return delFlag; + public String getAuditStatus() + { + return auditStatus; } - - public void setDelFlag(String delFlag) { + public void setDelFlag(String delFlag) + { this.delFlag = delFlag; } - public String getStockNo() { - return stockNo; - } - - public void setStockNo(String stockNo) { - this.stockNo = stockNo; - } - - public String getStockName() { - return stockName; - } - - public void setStockName(String stockName) { - this.stockName = stockName; - } - - public String getStockAddress() { - return stockAddress; - } - - public void setStockAddress(String stockAddress) { - this.stockAddress = stockAddress; - } - - public String getStockPhone() { - return stockPhone; - } - - public void setStockPhone(String stockPhone) { - this.stockPhone = stockPhone; - } - - public String getStockContact() { - return stockContact; - } - - public void setStockContact(String stockContact) { - this.stockContact = stockContact; - } - - public String getStandbyOne() { - return standbyOne; - } - - public void setStandbyOne(String standbyOne) { - this.standbyOne = standbyOne; - } - - public String getStandbyTwo() { - return standbyTwo; - } - - public void setStandbyTwo(String standbyTwo) { - this.standbyTwo = standbyTwo; - } - - public String getInstanceId() { - return instanceId; + public String getDelFlag() + { + return delFlag; } - - public void setInstanceId(String instanceId) { + public void setInstanceId(String instanceId) + { this.instanceId = instanceId; } - public String getInstanceType() { - return instanceType; + public String getInstanceId() + { + return instanceId; } - - public void setInstanceType(String instanceType) { + public void setInstanceType(String instanceType) + { this.instanceType = instanceType; } - public String getSubmitInstanceId() { - return submitInstanceId; + public String getInstanceType() + { + return instanceType; } - - public void setSubmitInstanceId(String submitInstanceId) { + public void setSubmitInstanceId(String submitInstanceId) + { this.submitInstanceId = submitInstanceId; } - public String getCancelInstanceId() { - return cancelInstanceId; + public String getSubmitInstanceId() + { + return submitInstanceId; } - - public void setCancelInstanceId(String cancelInstanceId) { + public void setCancelInstanceId(String cancelInstanceId) + { this.cancelInstanceId = cancelInstanceId; } - public String getRestoreInstanceId() { - return restoreInstanceId; + public String getCancelInstanceId() + { + return cancelInstanceId; } - - public void setRestoreInstanceId(String restoreInstanceId) { + public void setRestoreInstanceId(String restoreInstanceId) + { this.restoreInstanceId = restoreInstanceId; } - public String getApplyTitle() { - return applyTitle; + public String getRestoreInstanceId() + { + return restoreInstanceId; } - - public void setApplyTitle(String applyTitle) { + public void setApplyTitle(String applyTitle) + { this.applyTitle = applyTitle; } - public String getApplyUser() { - return applyUser; + public String getApplyTitle() + { + return applyTitle; } - - public void setApplyUser(String applyUser) { + public void setApplyUser(String applyUser) + { this.applyUser = applyUser; } - public Date getApplyTime() { - return applyTime; + public String getApplyUser() + { + return applyUser; } - - public void setApplyTime(Date applyTime) { + public void setApplyTime(Date applyTime) + { this.applyTime = applyTime; } - public Long getPhotoAttachId() { - return photoAttachId; - } - - public void setPhotoAttachId(Long photoAttachId) { - this.photoAttachId = photoAttachId; - } - - public String getFileIdStr() { - return fileIdStr; - } - - public void setFileIdStr(String fileIdStr) { - this.fileIdStr = fileIdStr; - } - - public String getRemoveFileIdStr() { - return removeFileIdStr; - } - - public void setRemoveFileIdStr(String removeFileIdStr) { - this.removeFileIdStr = removeFileIdStr; - } - - public List getPurchaseOrderChildList() { - return purchaseOrderChildList; - } - - public void setPurchaseOrderChildList(List purchaseOrderChildList) { - this.purchaseOrderChildList = purchaseOrderChildList; + public Date getApplyTime() + { + return applyTime; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("purchaseOrderId", getPurchaseOrderId()) - .append("purchaseOrderCode", getPurchaseOrderCode()) - .append("supplierCode", getSupplierCode()) - .append("supplierName", getSupplierName()) - .append("customerContact", getCustomerContact()) - .append("contactNumber", getContactNumber()) - .append("customerFax", getCustomerFax()) - .append("deliveryAddress", getDeliveryAddress()) - .append("paymentTerms", getPaymentTerms()) - .append("deliveryConditions", getDeliveryConditions()) - .append("deliveryMethod", getDeliveryMethod()) - .append("purchaseName", getPurchaseName()) - .append("billingDate", getBillingDate()) - .append("taxRate", getTaxRate()) - .append("purchaseCategory", getPurchaseCategory()) - .append("purchaseCommander", getPurchaseCommander()) - .append("customerOrderNumber", getCustomerOrderNumber()) - .append("remarkContent", getRemarkContent()) - .append("closeCaseNo", getCloseCaseNo()) - .append("closeCaseName", getCloseCaseName()) - .append("closeCaseTime", getCloseCaseTime()) - .append("accountReconciliationFlag", getAccountReconciliationFlag()) - .append("accountReconciliationPerson", getAccountReconciliationPerson()) - .append("accountReconciliationTime", getAccountReconciliationTime()) - .append("standbyOne", getStandbyOne()) - .append("standbyTwo", getStandbyTwo()) - .toString(); + .append("purchaseOrderId", getPurchaseOrderId()) + .append("purchaseOrderCode", getPurchaseOrderCode()) + .append("purchasePlanCode", getPurchasePlanCode()) + .append("warehouseStorageStatus", getWarehouseStorageStatus()) + .append("paymentStatus", getPaymentStatus()) + .append("supplierCode", getSupplierCode()) + .append("supplierName", getSupplierName()) + .append("materialSum", getMaterialSum()) + .append("actualPurchaseSum", getActualPurchaseSum()) + .append("sharedInventoryOccupancySum", getSharedInventoryOccupancySum()) + .append("refundsExchangesSum", getRefundsExchangesSum()) + .append("storageSum", getStorageSum()) + .append("normbSum", getNormbSum()) + .append("rmbSum", getRmbSum()) + .append("eceiptType", getEceiptType()) + .append("arrivedTime", getArrivedTime()) + .append("stockNo", getStockNo()) + .append("stockName", getStockName()) + .append("receivePerson", getReceivePerson()) + .append("receivePersonPhone", getReceivePersonPhone()) + .append("receiveAddress", getReceiveAddress()) + .append("purchaseBuyer", getPurchaseBuyer()) + .append("useStatus", getUseStatus()) + .append("auditStatus", getAuditStatus()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .append("instanceId", getInstanceId()) + .append("instanceType", getInstanceType()) + .append("submitInstanceId", getSubmitInstanceId()) + .append("cancelInstanceId", getCancelInstanceId()) + .append("restoreInstanceId", getRestoreInstanceId()) + .append("applyTitle", getApplyTitle()) + .append("applyUser", getApplyUser()) + .append("applyTime", getApplyTime()) + .toString(); } - - } 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 af227e7e..af62adee 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 @@ -1,7 +1,6 @@ package com.ruoyi.purchase.domain; import java.math.BigDecimal; -import java.util.List; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -11,9 +10,9 @@ import com.ruoyi.common.core.domain.BaseEntity; /** * 采购订单子表对象 purchase_order_child - * - * @author zhang - * @date 2024-06-19 + * + * @author 刘晓旭 + * @date 2024-11-18 */ public class PurchaseOrderChild extends BaseEntity { @@ -22,533 +21,274 @@ public class PurchaseOrderChild extends BaseEntity /** 采购订单子表id */ private Long purchaseOrderChildId; - /** 关联采购订单号 */ - @Excel(name = "关联采购订单号") + /** 采购订单号 */ + @Excel(name = "采购订单号") private String purchaseOrderCode; - /*关联计划单号*/ - private String purchasePlanCode; - /*采购计划关联单号*/ - private String correlationCode;; - - @Excel(name = "关联报价编号字段") - private String purchaseQuoteCode; - /** 供应商代码 */ - @Excel(name = "供应商代码") - private String supplierCode; - - /** 供应商名称 */ - @Excel(name = "供应商名称") - private String supplierName; - - /** 物料料号 */ - @Excel(name = "物料料号") - private String materialCode; + /** 料号 */ + @Excel(name = "料号") + private String materialNo; /** 物料名称 */ @Excel(name = "物料名称") private String materialName; + /** 物料类型 */ @Excel(name = "物料类型") private String materialType; - private String materialBrand; - @Excel(name = "物料图片") + /** 物料图片地址 */ + @Excel(name = "物料图片地址") private String materialPhotourl; - @Excel(name = "物料描述") - private String materialDescribe; + /** 物料品牌 */ + @Excel(name = "物料品牌") + private String materialBrand; + /** 物料单位 */ @Excel(name = "物料单位") private String materialUnit; - @Excel(name = "物料加工方法") - private String materialProcessMethod; - - @Excel(name = "入库部门") - private String warehouseDept; - /** 物料不含税单价 */ - @Excel(name = "物料不含税单价") - private BigDecimal materialNoRmb; - - /** 物料含税单价 */ - @Excel(name = "物料含税单价") - private BigDecimal materialRmb; + /** 物料描述 */ + @Excel(name = "物料描述") + private String materialDescribe; - /** 采购物料数量 */ - @Excel(name = "计划采购物料数量") - private BigDecimal materialNum; + /** 物料加工方式 */ + @Excel(name = "物料加工方式") + private String materialProcessMethod; - /** 物料合计 */ - @Excel(name = "物料合计") - private Long materialAmount; + /** 物料型号 */ + @Excel(name = "物料型号") + private String materialModel; - /** 数量合计 */ - @Excel(name = "数量合计") - private BigDecimal materialSum; + /** 入库部门(0仓库、1采购) */ + @Excel(name = "入库部门(0仓库、1采购)") + private String warehouseDept; - /** 不含税总价(RMB) */ - @Excel(name = "不含税总价(RMB)") - private BigDecimal materialNoRmbSum; + /** 物料不含税总价(RMB) */ + @Excel(name = "物料不含税总价(RMB)") + private BigDecimal materialNormbSum; - /** 含税总价(RMB) */ - @Excel(name = "含税总价(RMB)") + /** 物料含税总价(RMB) */ + @Excel(name = "物料含税总价(RMB)") private BigDecimal materialRmbSum; - /*关联采购计划的关联单号*/ - private String purchasePlanCorrelationCode; - @Excel(name="实际采购数") - private BigDecimal materialRealNum; - @Excel(name="实际采购不含税单价") - private BigDecimal materialRealNoRmb; - @Excel(name="实际采购含税单价") - private BigDecimal materialRealRmb; - @Excel(name="实际采购含税金额") - private BigDecimal materialRealRmbSum; - @Excel(name="实际采购不含税金额") - private BigDecimal materialRealNoRmbSum; + /** 计划采购数 */ + @Excel(name = "计划采购数") + private Integer planPurchaseNum; + /** 实际采购数 */ + @Excel(name = "实际采购数") + private Integer actualPurchaseNum; + /** 共享库存占用数 */ + @Excel(name = "共享库存占用数") + private Integer sharedInventoryOccupancyNum; - /** 交货时间 */ + /** 计划交付时间 */ @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "交货时间", width = 30, dateFormat = "yyyy-MM-dd") - private Date deliveryTime; - - /** 收货状态 */ - @Excel(name = "收货状态") - private String eceiptStatus; - - /** 打款结案状态 */ - @Excel(name = "打款结案状态") - private String paymentStatus; - - /** 税率 */ - @Excel(name = "税率") - private String taxRate; + @Excel(name = "计划交付时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date planDeliveryTime; /** 删除标志 */ private String delFlag; - /** 备用一 */ - @Excel(name = "备用一") - private String standbyOne; - - /** 备用二 */ - @Excel(name = "备用二") - private String standbyTwo; - - @Excel(name = "已入库数量") - private Integer hasStorageNum; - - @Excel(name = "通知到货数量") - private Integer notifyArriveNum; - - private Integer notifyHasArrivedNum; - - /** 实际已到货数量 */ - @Excel(name = "实际已到货数量") - private Integer actualHasArrivedNum; - - private List supplierList; - - public Integer getNotifyHasArrivedNum() { - return notifyHasArrivedNum; - } - - public void setNotifyHasArrivedNum(Integer notifyHasArrivedNum) { - this.notifyHasArrivedNum = notifyHasArrivedNum; - } - - - private List purchaseQuoteChildList; - - public List getPurchaseQuoteChildList() { - return purchaseQuoteChildList; - } - - public void setPurchaseQuoteChildList(List purchaseQuoteChildList) { - this.purchaseQuoteChildList = purchaseQuoteChildList; - } - - - public List getPurchaseOrderChildSupplierList() { - return supplierList; - } - - public void setPurchaseOrderChildSupplierList(List supplierList) { - this.supplierList = supplierList; - } - - public String getWarehouseDept() { - return warehouseDept; - } - - public void setWarehouseDept(String warehouseDept) { - this.warehouseDept = warehouseDept; - } - public void setPurchaseOrderChildId(Long purchaseOrderChildId) { this.purchaseOrderChildId = purchaseOrderChildId; } - public Long getPurchaseOrderChildId() + public Long getPurchaseOrderChildId() { return purchaseOrderChildId; } - public void setPurchaseOrderCode(String purchaseOrderCode) + public void setPurchaseOrderCode(String purchaseOrderCode) { this.purchaseOrderCode = purchaseOrderCode; } - public String getPurchaseOrderCode() + public String getPurchaseOrderCode() { return purchaseOrderCode; } - public void setSupplierCode(String supplierCode) - { - this.supplierCode = supplierCode; - } - - public String getPurchasePlanCode() { - return purchasePlanCode; - } - - public void setPurchasePlanCode(String purchasePlanCode) { - this.purchasePlanCode = purchasePlanCode; - } - - public String getSupplierCode() - { - return supplierCode; - } - public void setSupplierName(String supplierName) + public void setMaterialNo(String materialNo) { - this.supplierName = supplierName; + this.materialNo = materialNo; } - public String getSupplierName() + public String getMaterialNo() { - return supplierName; + return materialNo; } - public void setMaterialCode(String materialCode) - { - this.materialCode = materialCode; - } - - public String getMaterialCode() - { - return materialCode; - } - public void setMaterialName(String materialName) + public void setMaterialName(String materialName) { this.materialName = materialName; } - public String getMaterialName() + public String getMaterialName() { return materialName; } - - public BigDecimal getMaterialNoRmb() { - return materialNoRmb; - } - - public void setMaterialNoRmb(BigDecimal materialNoRmb) { - this.materialNoRmb = materialNoRmb; - } - - public void setMaterialRmb(BigDecimal materialRmb) + public void setMaterialType(String materialType) { - this.materialRmb = materialRmb; - } - - public BigDecimal getMaterialRmb() - { - return materialRmb; - } - public void setMaterialNum(BigDecimal materialNum) - { - this.materialNum = materialNum; + this.materialType = materialType; } - public BigDecimal getMaterialNum() + public String getMaterialType() { - return materialNum; + return materialType; } - public void setMaterialAmount(Long materialAmount) + public void setMaterialPhotourl(String materialPhotourl) { - this.materialAmount = materialAmount; + this.materialPhotourl = materialPhotourl; } - public Long getMaterialAmount() + public String getMaterialPhotourl() { - return materialAmount; + return materialPhotourl; } - public void setMaterialSum(BigDecimal materialSum) + public void setMaterialBrand(String materialBrand) { - this.materialSum = materialSum; + this.materialBrand = materialBrand; } - public BigDecimal getMaterialSum() + public String getMaterialBrand() { - return materialSum; - } - - public BigDecimal getMaterialNoRmbSum() { - return materialNoRmbSum; - } - - public void setMaterialNoRmbSum(BigDecimal materialNoRmbSum) { - this.materialNoRmbSum = materialNoRmbSum; - } - - public BigDecimal getMaterialRmbSum() { - return materialRmbSum; - } - - public void setMaterialRmbSum(BigDecimal materialRmbSum) { - this.materialRmbSum = materialRmbSum; + return materialBrand; } - - public void setDeliveryTime(Date deliveryTime) + public void setMaterialUnit(String materialUnit) { - this.deliveryTime = deliveryTime; + this.materialUnit = materialUnit; } - public Date getDeliveryTime() + public String getMaterialUnit() { - return deliveryTime; + return materialUnit; } - public void setEceiptStatus(String eceiptStatus) + public void setMaterialDescribe(String materialDescribe) { - this.eceiptStatus = eceiptStatus; + this.materialDescribe = materialDescribe; } - public String getEceiptStatus() + public String getMaterialDescribe() { - return eceiptStatus; + return materialDescribe; } - public void setPaymentStatus(String paymentStatus) + public void setMaterialProcessMethod(String materialProcessMethod) { - this.paymentStatus = paymentStatus; + this.materialProcessMethod = materialProcessMethod; } - public String getPaymentStatus() + public String getMaterialProcessMethod() { - return paymentStatus; + return materialProcessMethod; } - public void setTaxRate(String taxRate) + public void setMaterialModel(String materialModel) { - this.taxRate = taxRate; + this.materialModel = materialModel; } - public String getTaxRate() + public String getMaterialModel() { - return taxRate; + return materialModel; } - public void setDelFlag(String delFlag) + public void setWarehouseDept(String warehouseDept) { - this.delFlag = delFlag; + this.warehouseDept = warehouseDept; } - public String getDelFlag() + public String getWarehouseDept() { - return delFlag; + return warehouseDept; } - public void setStandbyOne(String standbyOne) + public void setMaterialNormbSum(BigDecimal materialNormbSum) { - this.standbyOne = standbyOne; + this.materialNormbSum = materialNormbSum; } - public String getStandbyOne() + public BigDecimal getMaterialNormbSum() { - return standbyOne; + return materialNormbSum; } - public void setStandbyTwo(String standbyTwo) + public void setMaterialRmbSum(BigDecimal materialRmbSum) { - this.standbyTwo = standbyTwo; + this.materialRmbSum = materialRmbSum; } - public String getStandbyTwo() + public BigDecimal getMaterialRmbSum() { - return standbyTwo; - } - - public String getCorrelationCode() { - return correlationCode; - } - - public void setCorrelationCode(String correlationCode) { - this.correlationCode = correlationCode; - } - - public String getPurchaseQuoteCode() { - return purchaseQuoteCode; - } - - public void setPurchaseQuoteCode(String purchaseQuoteCode) { - this.purchaseQuoteCode = purchaseQuoteCode; - } - - public String getPurchasePlanCorrelationCode() { - return purchasePlanCorrelationCode; - } - - public void setPurchasePlanCorrelationCode(String purchasePlanCorrelationCode) { - this.purchasePlanCorrelationCode = purchasePlanCorrelationCode; - } - - public BigDecimal getMaterialRealNum() { - return materialRealNum; - } - - public void setMaterialRealNum(BigDecimal materialRealNum) { - this.materialRealNum = materialRealNum; - } - - public BigDecimal getMaterialRealNoRmb() { - return materialRealNoRmb; - } - - public void setMaterialRealNoRmb(BigDecimal materialRealNoRmb) { - this.materialRealNoRmb = materialRealNoRmb; - } - - public BigDecimal getMaterialRealRmb() { - return materialRealRmb; - } - - public void setMaterialRealRmb(BigDecimal materialRealRmb) { - this.materialRealRmb = materialRealRmb; - } - - public BigDecimal getMaterialRealRmbSum() { - return materialRealRmbSum; - } - - public void setMaterialRealRmbSum(BigDecimal materialRealRmbSum) { - this.materialRealRmbSum = materialRealRmbSum; - } - - public BigDecimal getMaterialRealNoRmbSum() { - return materialRealNoRmbSum; - } - - public void setMaterialRealNoRmbSum(BigDecimal materialRealNoRmbSum) { - this.materialRealNoRmbSum = materialRealNoRmbSum; - } - - public String getMaterialType() { - return materialType; - } - - public void setMaterialType(String materialType) { - this.materialType = materialType; - } - - public String getMaterialPhotoUrl() { - return materialPhotourl; - } - - public void setMaterialPhotoUrl(String materialPhotourl) { - this.materialPhotourl = materialPhotourl; - } - - public String getMaterialDescribe() { - return materialDescribe; - } - - public void setMaterialDescribe(String materialDescribe) { - this.materialDescribe = materialDescribe; - } - - public String getMaterialUnit() { - return materialUnit; - } - - public void setMaterialUnit(String materialUnit) { - this.materialUnit = materialUnit; + return materialRmbSum; } - public String getMaterialProcessMethod() { - return materialProcessMethod; + public Integer getPlanPurchaseNum() { + return planPurchaseNum; } - public void setMaterialProcessMethod(String materialProcessMethod) { - this.materialProcessMethod = materialProcessMethod; + public void setPlanPurchaseNum(Integer planPurchaseNum) { + this.planPurchaseNum = planPurchaseNum; } - public String getMaterialBrand() { - return materialBrand; + public Integer getActualPurchaseNum() { + return actualPurchaseNum; } - public void setMaterialBrand(String materialBrand) { - this.materialBrand = materialBrand; + public void setActualPurchaseNum(Integer actualPurchaseNum) { + this.actualPurchaseNum = actualPurchaseNum; } - public String getMaterialPhotourl() { - return materialPhotourl; - } - - public void setMaterialPhotourl(String materialPhotourl) { - this.materialPhotourl = materialPhotourl; + public Integer getSharedInventoryOccupancyNum() { + return sharedInventoryOccupancyNum; } - public Integer getHasStorageNum() { - return hasStorageNum; + public void setSharedInventoryOccupancyNum(Integer sharedInventoryOccupancyNum) { + this.sharedInventoryOccupancyNum = sharedInventoryOccupancyNum; } - public void setHasStorageNum(Integer hasStorageNum) { - this.hasStorageNum = hasStorageNum; - } - - public Integer getNotifyArriveNum() { - return notifyArriveNum; + public void setPlanDeliveryTime(Date planDeliveryTime) + { + this.planDeliveryTime = planDeliveryTime; } - public void setNotifyArriveNum(Integer notifyArriveNum) { - this.notifyArriveNum = notifyArriveNum; + public Date getPlanDeliveryTime() + { + return planDeliveryTime; } - - public Integer getActualHasArrivedNum() { - return actualHasArrivedNum; + public void setDelFlag(String delFlag) + { + this.delFlag = delFlag; } - public void setActualHasArrivedNum(Integer actualHasArrivedNum) { - this.actualHasArrivedNum = actualHasArrivedNum; + public String getDelFlag() + { + return delFlag; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("purchaseOrderChildId", getPurchaseOrderChildId()) - .append("purchaseOrderCode", getPurchaseOrderCode()) - .append("purchasePlanCode", getPurchasePlanCode()) - .append("supplierCode", getSupplierCode()) - .append("supplierName", getSupplierName()) - .append("materialCode", getMaterialCode()) - .append("materialName", getMaterialName()) - .append("materialNoRmb", getMaterialNoRmb()) - .append("materialRmb", getMaterialRmb()) - .append("materialNum", getMaterialNum()) - .append("materialAmount", getMaterialAmount()) - .append("materialSum", getMaterialSum()) - .append("materialNoRmbSum", getMaterialNoRmbSum()) - .append("materialRmbSum", getMaterialRmbSum()) - .append("deliveryTime", getDeliveryTime()) - .append("eceiptStatus", getEceiptStatus()) - .append("paymentStatus", getPaymentStatus()) - .append("taxRate", getTaxRate()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("delFlag", getDelFlag()) - .append("standbyOne", getStandbyOne()) - .append("standbyTwo", getStandbyTwo()) - .toString(); + .append("purchaseOrderChildId", getPurchaseOrderChildId()) + .append("purchaseOrderCode", getPurchaseOrderCode()) + .append("materialNo", getMaterialNo()) + .append("materialName", getMaterialName()) + .append("materialType", getMaterialType()) + .append("materialPhotourl", getMaterialPhotourl()) + .append("materialBrand", getMaterialBrand()) + .append("materialUnit", getMaterialUnit()) + .append("materialDescribe", getMaterialDescribe()) + .append("materialProcessMethod", getMaterialProcessMethod()) + .append("materialModel", getMaterialModel()) + .append("warehouseDept", getWarehouseDept()) + .append("materialNormbSum", getMaterialNormbSum()) + .append("materialRmbSum", getMaterialRmbSum()) + .append("planPurchaseNum", getPlanPurchaseNum()) + .append("actualPurchaseNum", getActualPurchaseNum()) + .append("sharedInventoryOccupancyNum", getSharedInventoryOccupancyNum()) + .append("planDeliveryTime", getPlanDeliveryTime()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("delFlag", getDelFlag()) + .toString(); } - } 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 0e7e3dd3..230ffbdc 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 @@ -232,276 +232,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Transactional(rollbackFor = Exception.class) public int insertPurchaseOrder(PurchaseOrder purchaseOrder) { - // 生成采购订单编号 - purchaseOrder.setPurchaseOrderCode(redisCache.generateBillNo("CG")); - // 初始化累加变量 - BigDecimal materialNoRmb = BigDecimal.ZERO; - BigDecimal materialRmb = BigDecimal.ZERO; - BigDecimal materialNoRmbSum = BigDecimal.ZERO; - BigDecimal materialRmbSum = BigDecimal.ZERO; - BigDecimal materialNum = BigDecimal.ZERO; - int supplierNum = 0; - //根据上传的物料信息做采购订单子项 - if (!CollectionUtils.isEmpty(purchaseOrder.getPurchaseOrderChildList())) { - supplierNum = purchaseOrder.getPurchaseOrderChildList().size(); - } - if (purchaseOrder.getPurchaseOrderChildList() != null) { - List purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList(); - //订单子表去除实际物料数量位null或者0的物料信息 - purchaseOrderChildList = purchaseOrderChildList.stream().filter(child -> child.getMaterialRealNum() != null).collect(Collectors.toList()); - for (PurchaseOrderChild child : purchaseOrderChildList) { - if (child.getCorrelationCode().contains(",")) - { - String[] correlationCodes = child.getCorrelationCode().split(","); - String[] planCodes = child.getPurchasePlanCode().split(","); - String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(","); - for (int i = 0; i < planCodes.length - 1; i++) { - String planCode = planCodes[i]; - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if(suplierMaterialNoRmb == null){suplierMaterialNoRmb = BigDecimal.ZERO;} - if(suplierMaterialRmb == null){suplierMaterialRmb = BigDecimal.ZERO;} - if(suplierMaterialNum == null){suplierMaterialNum = new BigDecimal(0);} - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setPurchasePlanCorrelationCode(correlationCodes[i]); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(correlationCodes[i]); - material.setDeliveryTime(child.getDeliveryTime()); - material.setPurchasePlanCode(planCode); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(planCode); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - else if ((child.getPurchasePlanCode().contains(",") && !child.getCorrelationCode().contains(",") - && child.getCorrelationCode()!= null)) - { - String[] planCodes = child.getPurchasePlanCode().split(","); - for (int i = 0; i < planCodes.length - 1; i++) { - String[] correlationCodes = child.getCorrelationCode().split(","); - String[] planCode2 = child.getPurchasePlanCode().split(","); - String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(","); - String planCode = planCode2[i]; - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if (suplierMaterialNoRmb == null) { - suplierMaterialNoRmb = BigDecimal.ZERO; - } - if (suplierMaterialRmb == null) { - suplierMaterialRmb = BigDecimal.ZERO; - } - if (suplierMaterialNum == null) { - suplierMaterialNum = new BigDecimal(0); - } - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setCorrelationCode(purchasePlan.getCorrelationCode()); - material.setPurchasePlanCorrelationCode(correlationCodes[i]); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - material.setDeliveryTime(child.getDeliveryTime()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(child.getCorrelationCode()); - material.setPurchasePlanCode(planCode); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(planCode); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - else if(child.getCorrelationCode().contains(",") && child.getCorrelationCode().contains(",") && - child.getPurchasePlanCode()!=null && child.getCorrelationCode()!=null){ - String planCode = child.getPurchasePlanCode(); - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if (suplierMaterialNoRmb == null) { - suplierMaterialNoRmb = BigDecimal.ZERO; - } - if (suplierMaterialRmb == null) { - suplierMaterialRmb = BigDecimal.ZERO; - } - if (suplierMaterialNum == null) { - suplierMaterialNum = new BigDecimal(0); - } - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setCorrelationCode(purchasePlan.getCorrelationCode()); - material.setPurchasePlanCorrelationCode(child.getCorrelationCode()); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - material.setDeliveryTime(child.getDeliveryTime()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(child.getCorrelationCode()); - material.setPurchasePlanCode(child.getPurchasePlanCode()); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(child.getPurchasePlanCode()); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - } - // 遍历处理采购订单子表 - // 设置累加的物料信息到子表 - -// purchaseOrder.setMaterialSum(purchaseOrder.getMaterialSum()); -// purchaseOrder.setNoRmbSum(purchaseOrder.getNoRmbSum()); -// purchaseOrder.setRmbSum(purchaseOrder.getRmbSum()); - // 设置主表的供应商数量 - purchaseOrder.setSupplierNum(supplierNum); - purchaseOrder.setNoRmbSum(materialNoRmbSum); - purchaseOrder.setRmbSum(materialRmbSum); - purchaseOrder.setDelFlag("0"); - purchaseOrder.setEceiptStatus("0"); - purchaseOrder.setPaymentStatus("0"); - purchaseOrder.setPurchaseBuyer(purchaseOrder.getPurchaseBuyer()); - purchaseOrder.setCreateTime(DateUtils.getNowDate()); - purchaseOrder.setCreateBy(ShiroUtils.getLoginName()); - Set amountSet = purchaseOrder.getPurchaseOrderChildList().stream().map(PurchaseOrderChild::getMaterialCode).collect(Collectors.toSet()); - Integer amount = amountSet.size(); - purchaseOrder.setMaterialAmount(amount); - return purchaseOrderMapper.insertPurchaseOrder(purchaseOrder); + return 1; } //生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。 public int purchaseOrderPayment(PurchaseOrder purchaseOrder) { @@ -531,270 +262,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Override public int updatePurchaseOrderCode(PurchaseOrder purchaseOrder) { - // 初始化累加变量 - BigDecimal materialNoRmb = BigDecimal.ZERO; - BigDecimal materialRmb = BigDecimal.ZERO; - BigDecimal materialNoRmbSum = BigDecimal.ZERO; - BigDecimal materialRmbSum = BigDecimal.ZERO; - BigDecimal materialNum = BigDecimal.ZERO; - int supplierNum = 0; - //根据上传的物料信息做采购订单子项 - if (!CollectionUtils.isEmpty(purchaseOrder.getPurchaseOrderChildList())) { - supplierNum = purchaseOrder.getPurchaseOrderChildList().size(); - } - if (purchaseOrder.getPurchaseOrderChildList() != null) { - List purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList(); - //订单子表去除实际物料数量位null或者0的物料信息 - purchaseOrderChildList = purchaseOrderChildList.stream().filter(child -> child.getMaterialRealNum() != null).collect(Collectors.toList()); - for (PurchaseOrderChild child : purchaseOrderChildList) { - purchaseOrderChildService.deletePurchaseOrderChildByPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - if (child.getCorrelationCode().contains(",")) - { - String[] correlationCodes = child.getCorrelationCode().split(","); - String[] planCodes = child.getPurchasePlanCode().split(","); - String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(","); - for (int i = 0; i < planCodes.length - 1; i++) { - String planCode = planCodes[i]; - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if(suplierMaterialNoRmb == null){suplierMaterialNoRmb = BigDecimal.ZERO;} - if(suplierMaterialRmb == null){suplierMaterialRmb = BigDecimal.ZERO;} - if(suplierMaterialNum == null){suplierMaterialNum = new BigDecimal(0);} - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setPurchasePlanCorrelationCode(correlationCodes[i]); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(correlationCodes[i]); - material.setDeliveryTime(child.getDeliveryTime()); - material.setPurchasePlanCode(planCode); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(planCode); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - else if ((child.getPurchasePlanCode().contains(",") && !child.getCorrelationCode().contains(",") - && child.getCorrelationCode()!= null)) { - String[] planCodes = child.getPurchasePlanCode().split(","); - for (int i = 0; i < planCodes.length - 1; i++) { - String[] correlationCodes = child.getCorrelationCode().split(","); - String[] planCode2 = child.getPurchasePlanCode().split(","); - String[] purchaseQuoteCodes = child.getPurchaseQuoteCode().split(","); - String planCode = planCode2[i]; - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if (suplierMaterialNoRmb == null) { - suplierMaterialNoRmb = BigDecimal.ZERO; - } - if (suplierMaterialRmb == null) { - suplierMaterialRmb = BigDecimal.ZERO; - } - if (suplierMaterialNum == null) { - suplierMaterialNum = new BigDecimal(0); - } - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setCorrelationCode(purchasePlan.getCorrelationCode()); - material.setPurchasePlanCorrelationCode(correlationCodes[i]); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - material.setDeliveryTime(child.getDeliveryTime()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(child.getCorrelationCode()); - material.setPurchasePlanCode(planCode); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(planCode); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - else if(child.getCorrelationCode().contains(",") && child.getCorrelationCode().contains(",") && - child.getPurchasePlanCode()!=null && child.getCorrelationCode()!=null){ - String planCode = child.getPurchasePlanCode(); - PurchasePlan purchasePlan = purchasePlanService.selectPurchasePlanByPlanCode(planCode); - if (planCode != null) { - PurchaseOrderChild material = new PurchaseOrderChild(); - child.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - //获取物料供应商不含税采购价格 - BigDecimal suplierMaterialNoRmb = child.getMaterialRealNoRmb(); - // 获取物料供应商含税采购价格 - BigDecimal suplierMaterialRmb = child.getMaterialRealRmb(); - // 获取物料数量 - BigDecimal suplierMaterialNum = child.getMaterialRealNum(); - if (suplierMaterialNoRmb == null) { - suplierMaterialNoRmb = BigDecimal.ZERO; - } - if (suplierMaterialRmb == null) { - suplierMaterialRmb = BigDecimal.ZERO; - } - if (suplierMaterialNum == null) { - suplierMaterialNum = new BigDecimal(0); - } - //获取供应商不含税价格合计 = 物料数量 * 供应商采购不含税价格 - BigDecimal suplierMaterialNoRmbSumLocal = suplierMaterialNoRmb.multiply(suplierMaterialNum); - //获取供应商含税价格合计 = 物料数量 * 供应商采购含税价格 - BigDecimal suplierMaterialRmbSumLocal = suplierMaterialRmb.multiply(suplierMaterialNum); - // 累加物料数量 - materialNum = materialNum.add(suplierMaterialNum); - // 累加物料总价 - materialNoRmbSum = materialNoRmbSum.add(suplierMaterialNoRmbSumLocal); - // 累加物料含税总价 - materialRmbSum = materialRmbSum.add(suplierMaterialRmbSumLocal); - // 设置采购报价单编号和供应商信息到QuoteChild - material.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); - material.setCorrelationCode(purchasePlan.getCorrelationCode()); - material.setPurchasePlanCorrelationCode(child.getCorrelationCode()); - material.setSupplierCode(child.getSupplierCode()); - material.setMaterialUnit(child.getMaterialUnit()); - material.setWarehouseDept(child.getWarehouseDept()); - material.setSupplierName(child.getSupplierName()); - material.setMaterialCode(child.getMaterialCode()); - material.setMaterialName(child.getMaterialName()); - material.setMaterialBrand(child.getMaterialBrand()); - material.setMaterialDescribe(child.getMaterialDescribe()); - material.setMaterialPhotoUrl(child.getMaterialPhotoUrl()); - material.setMaterialProcessMethod(child.getMaterialProcessMethod()); - material.setWarehouseDept(child.getWarehouseDept()); - //计划采购数 - material.setMaterialNum(child.getMaterialNum()); - material.setMaterialNoRmb(child.getMaterialNoRmb()); - material.setMaterialRmb(child.getMaterialRmb()); - material.setMaterialNoRmbSum(child.getMaterialNoRmbSum()); - material.setMaterialRmbSum(child.getMaterialRmbSum()); - //实际采购数 - material.setMaterialRealNum(child.getMaterialRealNum()); - material.setMaterialRealNoRmb(child.getMaterialRealNoRmb()); - material.setMaterialRealRmb(child.getMaterialRealRmb()); - material.setDeliveryTime(child.getDeliveryTime()); - //实际采购单价合计 - material.setMaterialRealRmbSum(suplierMaterialRmbSumLocal); - material.setMaterialRealNoRmbSum(suplierMaterialNoRmbSumLocal); - material.setCorrelationCode(child.getCorrelationCode()); - material.setPurchasePlanCode(child.getPurchasePlanCode()); - material.setPurchaseQuoteCode(child.getPurchaseQuoteCode()); - //收货状态,0:未收货,1:已收货 收款状态:0:待付款,1:已付款 - material.setEceiptStatus("0"); - material.setPaymentStatus("0"); - // 执行子表插入操作 - purchaseOrderChildService.insertPurchaseOrderChild(material); - PurchasePlan plan = new PurchasePlan(); - plan.setPurchasePlanCode(child.getPurchasePlanCode()); - plan.setPurchasePlanStatus("1"); - int result = purchasePlanService.updatePurchasePlan(plan); - } - } - } - } - // 遍历处理采购订单子表 - // 设置累加的物料信息到子表 - // 设置主表的供应商数量 - purchaseOrder.setSupplierNum(supplierNum); - purchaseOrder.setNoRmbSum(materialNoRmbSum); - purchaseOrder.setRmbSum(materialRmbSum); - purchaseOrder.setDelFlag("0"); - purchaseOrder.setEceiptStatus("0"); - purchaseOrder.setPaymentStatus("0"); - purchaseOrder.setPurchaseBuyer(purchaseOrder.getPurchaseBuyer()); - purchaseOrder.setCreateTime(DateUtils.getNowDate()); - purchaseOrder.setCreateBy(ShiroUtils.getLoginName()); - Set amountSet = purchaseOrder.getPurchaseOrderChildList().stream().map(PurchaseOrderChild::getMaterialCode).collect(Collectors.toSet()); - Integer amount = amountSet.size(); - purchaseOrder.setMaterialAmount(amount); - return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); + return 1; } /** @@ -927,72 +395,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService @Override public Integer addPurchaseOrderPayable(PurchaseOrder purchaseOrder){ //根据供应商划分物料信息,合计物料不含税单价 ,含税单价,含税总价,不含税总价,实际采购数量 - // 获取采购订单的子项列表 - List children = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrder.getPurchaseOrderCode()); - // 分组供应商的子订单,分组统计各供应商应付单供应商 - List supplierGroup = (List) children.stream() - // 分组依据为supplierCode - .collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode)) - // 把每个分组转为流,然后取第一个元素 - .values().stream() - .map(groupSupplier -> groupSupplier.stream().findFirst().orElse(null)) - // 过滤掉null值,以防万一某些分组是空的 - .filter(Objects::nonNull) - .collect(Collectors.toList()); - //根据物料中提出的供应商列表核对, 遍历每个相关的子订单,合计数据量 - for (PurchaseOrderChild purchaseOrderChild : supplierGroup) { - //初始化合计数 - BigDecimal supplierNoRmbPrice = BigDecimal.ZERO; - BigDecimal supplierRmbTaxPrice = BigDecimal.ZERO; - List purchaseOrderChildList = purchaseOrder.getPurchaseOrderChildList(); - //创建供应商应付单 - FinancialAccountsPayable financialAccountsPayable = new FinancialAccountsPayable(); - financialAccountsPayable.setAccountsPayableCode(redisCache.generateBillNo("YF")); - financialAccountsPayable.setRelevanceCode(purchaseOrder.getPurchaseOrderCode()); - for (PurchaseOrderChild purchaseOrderChild1 : children) { - //如果是如上述的供应商,则进行统计 - if (purchaseOrderChild1.getSupplierCode().equals(purchaseOrderChild.getSupplierCode())) { - //供应商应付账款 不含税金额 - supplierNoRmbPrice = supplierNoRmbPrice.add(purchaseOrderChild1.getMaterialRealNoRmbSum()); - //供应商应付账款 含税金额 - supplierRmbTaxPrice = supplierRmbTaxPrice.add(purchaseOrderChild1.getMaterialRealRmbSum()); - }else{ - continue; - } - } - //每当当前供应商完成一次循环,生成一条供应商应付账款 - SysSupplier sysSupplier = sysSupplierService.selectSysSupplierByCode(purchaseOrderChild.getSupplierCode()); - if(ObjectUtils.isEmpty(sysSupplier)){ - continue; - }else{ - //获取供应商开户银行 - financialAccountsPayable.setOpenBank(sysSupplier.getDepositBank()); - //供应商银行账号 - financialAccountsPayable.setOpenAccount(sysSupplier.getBankAccount()); - //供应商付款条件 - financialAccountsPayable.setPaymentCondition(sysSupplier.getPaymentTerms()); - } - //供应商编号 - financialAccountsPayable.setSupplierCode(purchaseOrderChild.getSupplierCode()); - //供应商名称 - financialAccountsPayable.setSupplierName(purchaseOrderChild.getSupplierName()); - //创建单号人员 - financialAccountsPayable.setCreateBy(ShiroUtils.getLoginName()); - //创建时间 - financialAccountsPayable.setCreateTime(DateUtils.getNowDate()); - //采购订单的采购员 - financialAccountsPayable.setPurchaseBuyer(purchaseOrder.getPurchaseBuyer()); - //不含税金额 - financialAccountsPayable.setPriceExcludingTax(supplierNoRmbPrice); - //含税金额 - financialAccountsPayable.setPriceIncludesTax(supplierRmbTaxPrice); - financialAccountsPayable.setStorageStatus("0"); - financialAccountsPayable.setAccountsPayableStatus("0"); - financialAccountsPayable.setCreateTime(DateUtils.getNowDate()); - financialAccountsPayable.setCreateBy(purchaseOrderChild.getCreateBy()); - financialAccountsPayableMapper.insertFinancialAccountsPayable(financialAccountsPayable); - } - //根据供应商编分组,合计供应商总共合计了多少数,采购物采购,采购物料料 return 1; // 返回成功标识 } @Transactional(rollbackFor = Exception.class) @@ -1105,36 +507,36 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService String orderDate = dateFormat.format(applyTime); PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); purchaseOrderChild.setPurchaseOrderCode(purchaseOrderCode); - purchaseOrderChild.setSupplierCode(supplierCode); + //purchaseOrderChild.setSupplierCode(supplierCode); List purchaseOrderChildList = purchaseOrderChildService.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild); List> detailList = new ArrayList<>(); - // 数字合计金额 - BigDecimal totalAmount = purchaseOrderChildList.stream() - .filter(item -> item.getMaterialRealRmbSum() != null) // 过滤掉值为空的字段 - .map(item -> item.getMaterialRealRmbSum()) - .reduce(BigDecimal.ZERO, BigDecimal::add); +// // 数字合计金额 +// BigDecimal totalAmount = purchaseOrderChildList.stream() +// .filter(item -> item.getMaterialRealRmbSum() != null) // 过滤掉值为空的字段 +// .map(item -> item.getMaterialRealRmbSum()) +// .reduce(BigDecimal.ZERO, BigDecimal::add); //转换成中文金额 //汉字大写合计金额 - String ChineseCharacterAmount = MoneyUtils.amountConversion(totalAmount.toString()); +// String ChineseCharacterAmount = MoneyUtils.amountConversion(totalAmount.toString()); AtomicInteger index = new AtomicInteger(1); - for (PurchaseOrderChild item : purchaseOrderChildList) { - Map detailMap = new HashMap<>(); - detailMap.put("index", index.getAndIncrement()); - detailMap.put("materialName", item.getMaterialName()); - detailMap.put("materialDescribe", item.getMaterialDescribe()); - detailMap.put("materialUnit", item.getMaterialUnit()); - detailMap.put("materialRealNum", item.getMaterialRealNum()); - detailMap.put("materialRealRmb", item.getMaterialRealRmb()); - detailMap.put("materialRealRmbSum", item.getMaterialRealRmbSum()); - - // 使用 Optional 来安全地处理可能为 null 的值 - Optional optionalDeliveryTime = Optional.ofNullable(item.getDeliveryTime()); - String formattedDeliveryTime = optionalDeliveryTime.map(dateFormat::format).orElse("未提供"); - - detailMap.put("deliveryTime", formattedDeliveryTime); - detailList.add(detailMap); - } +// for (PurchaseOrderChild item : purchaseOrderChildList) { +// Map detailMap = new HashMap<>(); +// detailMap.put("index", index.getAndIncrement()); +// detailMap.put("materialName", item.getMaterialName()); +// detailMap.put("materialDescribe", item.getMaterialDescribe()); +// detailMap.put("materialUnit", item.getMaterialUnit()); +// detailMap.put("materialRealNum", item.getMaterialRealNum()); +// detailMap.put("materialRealRmb", item.getMaterialRealRmb()); +// detailMap.put("materialRealRmbSum", item.getMaterialRealRmbSum()); +// +// // 使用 Optional 来安全地处理可能为 null 的值 +// Optional optionalDeliveryTime = Optional.ofNullable(item.getDeliveryTime()); +// String formattedDeliveryTime = optionalDeliveryTime.map(dateFormat::format).orElse("未提供"); +// +// detailMap.put("deliveryTime", formattedDeliveryTime); +// detailList.add(detailMap); +// } //查询仓库信息 @@ -1162,16 +564,16 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService put("depositBank", sysSupplier.getDepositBank()); put("bankAccount", sysSupplier.getBankAccount()); put("exchangeSettlementAccount", sysSupplier.getExchangeSettlementAccount()); - put("totalAmount", totalAmount); - put("ChineseCharacterAmount", ChineseCharacterAmount); - put("taxRate", taxRate); - put("enterpriseName", enterpriseName); - put("bankAccountWC", bankAccountWC); - put("depositBankWC", depositBankWC); - put("contacts", contacts); - put("stockAddress", purchaseOrder.getStockAddress()); - put("stockPhone", purchaseOrder.getStockPhone()); - put("stockContact", purchaseOrder.getStockContact()); +// put("totalAmount", totalAmount); +// put("ChineseCharacterAmount", ChineseCharacterAmount); +// put("taxRate", taxRate); +// put("enterpriseName", enterpriseName); +// put("bankAccountWC", bankAccountWC); +// put("depositBankWC", depositBankWC); +// put("contacts", contacts); +// put("stockAddress", purchaseOrder.getStockAddress()); +// put("stockPhone", purchaseOrder.getStockPhone()); +// put("stockContact", purchaseOrder.getStockContact()); }} ); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java index 43fca6c9..b6117977 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java @@ -159,11 +159,11 @@ public class BaseExpenseConfirmAmountServiceImpl implements IBaseExpenseConfirmA int updateResult = 0; PurchaseOrderChild tempChild = new PurchaseOrderChild(); tempChild.setPurchaseOrderCode(child.getPurchaseCode()); - tempChild.setSupplierCode(supplierCode); + //tempChild.setSupplierCode(supplierCode); List purchaseChildren = purchaseChildMapper.selectChildListBySupplierCodeAndOrderCode(tempChild); if(CollectionUtils.isNotEmpty(purchaseChildren)){ for (PurchaseOrderChild purchaseChild: purchaseChildren) { - purchaseChild.setPaymentStatus("2"); + //purchaseChild.setPaymentStatus("2"); purchaseChildMapper.updatePurchaseOrderChild(purchaseChild); updateResult ++; } @@ -212,35 +212,35 @@ public class BaseExpenseConfirmAmountServiceImpl implements IBaseExpenseConfirmA public int updatePurchaseOrderPayableStatus(String purchaseOrderCode){ PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode); List purchaseOrderChildren = purchaseChildMapper.selectPurchaseOrderChildByOrderCode(purchaseOrderCode); - if(CollectionUtils.isEmpty(purchaseOrderChildren)){ - throw new BusinessException("采购订单详情记录为空!"); - } - String isAllPaid = "3"; - // 获取所有 paymentStatus 的集合 - Set statuses = purchaseOrderChildren.stream() - .map(PurchaseOrderChild::getPaymentStatus) - .collect(Collectors.toSet()); - - // 判断状态 - if (statuses.size() == 1) { - String singleStatus = statuses.iterator().next(); - if (singleStatus.equals("0")) { - isAllPaid = "0"; - } else if (singleStatus.equals("2")) { - isAllPaid = "1"; - } - } else if (statuses.size() == 2 && statuses.contains("0") && statuses.contains("2")) { - isAllPaid = "2"; - } - if(isAllPaid.equals("1")){ -// 订单内供应商全部打款 - purchaseOrder.setPaymentStatus("2"); - }else if(isAllPaid.equals("0")){ -// 订单内供应商全未打款 - purchaseOrder.setPaymentStatus("0"); - }else if(isAllPaid.equals("2")){ - purchaseOrder.setPaymentStatus("1"); - } +// if(CollectionUtils.isEmpty(purchaseOrderChildren)){ +// throw new BusinessException("采购订单详情记录为空!"); +// } +// String isAllPaid = "3"; +// // 获取所有 paymentStatus 的集合 +// Set statuses = purchaseOrderChildren.stream() +// .map(PurchaseOrderChild::getPaymentStatus) +// .collect(Collectors.toSet()); +// +// // 判断状态 +// if (statuses.size() == 1) { +// String singleStatus = statuses.iterator().next(); +// if (singleStatus.equals("0")) { +// isAllPaid = "0"; +// } else if (singleStatus.equals("2")) { +// isAllPaid = "1"; +// } +// } else if (statuses.size() == 2 && statuses.contains("0") && statuses.contains("2")) { +// isAllPaid = "2"; +// } +// if(isAllPaid.equals("1")){ +//// 订单内供应商全部打款 +// purchaseOrder.setPaymentStatus("2"); +// }else if(isAllPaid.equals("0")){ +//// 订单内供应商全未打款 +// purchaseOrder.setPaymentStatus("0"); +// }else if(isAllPaid.equals("2")){ +// purchaseOrder.setPaymentStatus("1"); +// } purchaseOrder.setUpdateTime(DateUtils.getNowDate()); return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java index d3fb88e3..9854c417 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java @@ -675,16 +675,16 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS // 新增采购入库库存历史记录 List purchaseOrderChild = purchaseOrderChildMapper.selectPurchaseOrderChildByOrderCode(warehouseStorageOrderDetail.getRelatedOrderCode()); for (PurchaseOrderChild child : purchaseOrderChild) { - if(child.getMaterialCode().equals(materialNo)){ - int storageNum = warehouseStorageOrderDetail.getStorageNum(); - WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); - inquiryDetail = generateInquiryDetailByPurchaseChild(child,storageNum); - inquiryDetail.setInventoryHistoricalType("0"); -// if (correlationCode.startsWith("QG")) { -//// 有无归属分类 -// } - inventoryInquiryDetailMapper.insertWarehouseInventoryInquiryDetail(inquiryDetail); - } +// if(child.getMaterialCode().equals(materialNo)){ +// int storageNum = warehouseStorageOrderDetail.getStorageNum(); +// WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); +// inquiryDetail = generateInquiryDetailByPurchaseChild(child,storageNum); +// inquiryDetail.setInventoryHistoricalType("0"); +//// if (correlationCode.startsWith("QG")) { +////// 有无归属分类 +//// } +// inventoryInquiryDetailMapper.insertWarehouseInventoryInquiryDetail(inquiryDetail); +// } } }else if(warehouseStorageType.equals("2")){//新增委内入库库存历史记录 WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); @@ -766,23 +766,23 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS // 生成采购订单库存历史记录 public WarehouseInventoryInquiryDetail generateInquiryDetailByPurchaseChild(PurchaseOrderChild child,int storageNum){ WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); - inquiryDetail.setMaterialNo(child.getMaterialCode()); + inquiryDetail.setMaterialNo(child.getMaterialNo()); inquiryDetail.setMaterialName(child.getMaterialName()); inquiryDetail.setMaterialBrand(child.getMaterialBrand()); inquiryDetail.setMaterialPhotourl(child.getMaterialPhotourl()); inquiryDetail.setMaterialDescribe(child.getMaterialDescribe()); inquiryDetail.setMaterialType(child.getMaterialType()); inquiryDetail.setMaterialUnit(child.getMaterialUnit()); - inquiryDetail.setInventoryAttributionCode(child.getPurchasePlanCorrelationCode()); - inquiryDetail.setSupplierCode(child.getSupplierCode()); - inquiryDetail.setSupplierName(child.getSupplierName()); +// inquiryDetail.setInventoryAttributionCode(child.getPurchasePlanCorrelationCode()); +// inquiryDetail.setSupplierCode(child.getSupplierCode()); +// inquiryDetail.setSupplierName(child.getSupplierName()); inquiryDetail.setPurchaseOrderCode(child.getPurchaseOrderCode()); // 库存归属单号 BigDecimal realStorageNum = BigDecimal.valueOf(storageNum); inquiryDetail.setAvailableStockNum(realStorageNum); - inquiryDetail.setPurchasePriceIncludesTax(child.getMaterialRealRmbSum()); - inquiryDetail.setPurchasePriceExcludingTax(child.getMaterialRealNoRmbSum()); +// inquiryDetail.setPurchasePriceIncludesTax(child.getMaterialRealRmbSum()); +// inquiryDetail.setPurchasePriceExcludingTax(child.getMaterialRealNoRmbSum()); inquiryDetail.setInventoryIncreaseDecrease("1"); inquiryDetail.setCreateBy(ShiroUtils.getLoginName()); inquiryDetail.setCreateTime(DateUtils.getNowDate()); diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml index b4ed390b..fcaa3e38 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml @@ -1,244 +1,127 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - select purchase_order_child_id, purchase_order_code, purchase_plan_code, purchase_plan_correlation_code, supplier_code, supplier_name, - material_code, material_name, material_type, material_brand, material_describe, material_photoUrl, warehouseDept, material_process_method, - material_unit, material_no_rmb, material_rmb, material_num, material_amount, - material_sum, material_no_rmb_sum, material_rmb_sum, material_real_num, material_real_no_rmb, material_real_rmb, - material_real_no_rmb_sum, material_real_rmb_sum, delivery_time, - eceipt_status, payment_status, tax_rate, create_by, create_time, update_by, update_time, del_flag, standby_one, standby_two - from purchase_order_child + select purchase_order_child_id, purchase_order_code, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, material_model, warehouse_dept, material_noRmb_sum, material_rmb_sum, plan_purchase_num, actual_purchase_num, shared_inventory_occupancy_num, plan_delivery_time, create_by, create_time, update_by, update_time, del_flag from purchase_order_child - - - - - - where supplier_code = #{supplierCode} - and purchase_order_code = #{purchaseOrderCode} - - - - - insert into purchase_order_child purchase_order_code, - purchase_plan_code, - purchase_plan_correlation_code, - supplier_code, - supplier_name, - material_code, + material_no, material_name, material_type, - material_describe, - material_brand, material_photoUrl, - material_process_method, + material_brand, material_unit, - warehouseDept, - material_no_rmb, - material_rmb, - material_num, - material_amount, - material_sum, - material_no_rmb_sum, + material_describe, + material_process_method, + material_model, + warehouse_dept, + material_noRmb_sum, material_rmb_sum, - material_real_num, - material_real_no_rmb, - material_real_rmb, - material_real_no_rmb_sum, - material_real_rmb_sum, - delivery_time, - eceipt_status, - payment_status, - tax_rate, + plan_purchase_num, + actual_purchase_num, + shared_inventory_occupancy_num, + plan_delivery_time, create_by, create_time, + update_by, + update_time, del_flag, - standby_one, - standby_two, - + #{purchaseOrderCode}, - #{purchasePlanCode}, - #{purchasePlanCorrelationCode}, - #{supplierCode}, - #{supplierName}, - #{materialCode}, + #{materialNo}, #{materialName}, #{materialType}, - #{materialDescribe}, - #{materialBrand}, #{materialPhotourl}, - #{materialProcessMethod}, + #{materialBrand}, #{materialUnit}, + #{materialDescribe}, + #{materialProcessMethod}, + #{materialModel}, #{warehouseDept}, - #{materialNoRmb}, - #{materialRmb}, - #{materialNum}, - #{materialAmount}, - #{materialSum}, - #{materialNormbsum}, - #{materialRmbsum}, - #{materialRealNum}, - #{materialRealNoRmb}, - #{materialRealRmb}, - #{materialRealNoRmbSum}, - #{materialRealRmbSum}, - #{deliveryTime}, - #{eceiptStatus}, - #{paymentStatus}, - #{taxRate}, + #{materialNormbSum}, + #{materialRmbSum}, + #{planPurchaseNum}, + #{actualPurchaseNum}, + #{sharedInventoryOccupancyNum}, + #{planDeliveryTime}, #{createBy}, #{createTime}, + #{updateBy}, + #{updateTime}, #{delFlag}, - #{standbyOne}, - #{standbyTwo}, - + + update purchase_order_child purchase_order_code = #{purchaseOrderCode}, - purchase_plan_code = #{purchasePlanCode}, - purchase_plan_correlation_code = #{purchasePlanCorrelationCode}, - supplier_code = #{supplierCode}, - supplier_name = #{supplierName}, - material_code = #{materialCode}, + material_no = #{materialNo}, material_name = #{materialName}, material_type = #{materialType}, - material_describe = #{materialDescribe}, + material_photoUrl = #{materialPhotourl}, material_brand = #{materialBrand}, - material_photoUrl = #{materialPhotourl} - material_process_method = #{materialProcessMethod}, material_unit = #{materialUnit}, - warehouseDept = #{warehouseDept}, - material_no_rmb = #{materialNoRmb}, - material_rmb = #{materialRmb}, - material_num = #{materialNum}, - material_amount = #{materialAmount}, - material_sum = #{materialSum}, - material_no_rmb_sum = #{materialNoRmbSum}, - material_rmb_sum = #{materialRmbsum}, - material_real_num = #{materialRealNum}, - material_real_no_rmb = #{materialRealNoRmb}, - material_real_rmb = #{materialRealRmb}, - material_real_no_rmb_sum = #{materialRealNoRmbSum}, - material_real_rmb_sum = #{materialRealRmbSum}, - delivery_time = #{deliveryTime}, - eceipt_status = #{eceiptStatus}, - payment_status = #{paymentStatus}, - tax_rate = #{taxRate}, + material_describe = #{materialDescribe}, + material_process_method = #{materialProcessMethod}, + material_model = #{materialModel}, + warehouse_dept = #{warehouseDept}, + material_noRmb_sum = #{materialNormbSum}, + material_rmb_sum = #{materialRmbSum}, + plan_purchase_num = #{planPurchaseNum}, + actual_purchase_num = #{actualPurchaseNum}, + shared_inventory_occupancy_num = #{sharedInventoryOccupancyNum}, + plan_delivery_time = #{planDeliveryTime}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, del_flag = #{delFlag}, - standby_one = #{standbyOne}, - standby_two = #{standbyTwo}, where purchase_order_child_id = #{purchaseOrderChildId} @@ -246,17 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from purchase_order_child where purchase_order_child_id = #{purchaseOrderChildId} - - delete from purchase_order_child where purchase_order_code = #{purchaseOrderCode} - - - delete from purchase_order_child where purchase_order_code = in - - #{purchaseOrderCode} - - + - delete from purchase_order_child where purchase_order_child_id in + delete from purchase_order_child where purchase_order_child_id in #{purchaseOrderChildId} @@ -270,42 +145,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update purchase_order_child set del_flag = '0' where purchase_order_child_id = #{purchaseOrderChildId} - - - - - - - - \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml index d88633c1..f8ec81c8 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml @@ -121,12 +121,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by pur.audit_status asc, pur.create_time desc - + - + insert into purchase_order @@ -286,7 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select count(1) from purchase_order where purchase_ordre_code = #{purchaseOrderCode} limit 1 - delete from purchase_order where purchase_order_id in + delete from purchase_order where purchase_order_id in #{purchaseOrderId}