Browse Source

[feat]

按照新版prd
新增采购订单purchase_order
数据库新增5条测试数据
新增采购订单实体类
新增采购订单Controller
新增采购订单Mapper
新增采购订单Mapper.XML
新增采购订单Service接口
新增采购订单ServiceImpl实现类
按照新版prd
新增采购订单子表purchase_order_child
数据库新增10条测试数据
新增采购订单子表实体类
新增采购订单子表Mapper
新增采购订单子表Mapper.XML
新增采购订单子表Service接口
新增采购订单子表ServiceImpl实现类
暂时去掉报销单关联采购订单的业务逻辑
暂时去掉物料采购历史关联采购订单的业务逻辑
暂时去掉物料表关联采购订单的业务逻辑
暂时去掉仓库入库单关联采购订单的业务逻辑
dev
liuxiaoxu 1 week ago
parent
commit
51cbbf1bac
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  3. 70
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  4. 784
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java
  5. 510
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java
  6. 670
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  7. 62
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseExpenseConfirmAmountServiceImpl.java
  8. 30
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  9. 273
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml

2
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;
//含税价格

6
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;

70
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -204,16 +204,16 @@ public class PurchaseOrderController extends BaseController
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrder.getPurchaseOrderCode());
//Set<String>子表供应商的信息 供应商编号-供应商名称
//Set<String>子表采购计划单信息
Set<String> supplierCodes = new HashSet<>();
Set<String> 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<String> supplierCodes = new HashSet<>();
// Set<String> 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<String>子表采购计划单信息
Set<String> supplierCodes = new HashSet<>();
Set<String> 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<String, List<PurchaseOrderChild>> detailListGroupedBySupplier(String qualityOrderCode) {
PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode);
List<PurchaseOrderChild> allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode);
Map<String, List< PurchaseOrderChild>> groupedDetails = allDetails.stream()
.collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode));
return groupedDetails;
}
// @ResponseBody
// @RequestMapping("/detailListGroupedBySupplier")
// public Map<String, List<PurchaseOrderChild>> detailListGroupedBySupplier(String qualityOrderCode) {
// PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
// purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode);
// List<PurchaseOrderChild> allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode);
// Map<String, List< PurchaseOrderChild>> groupedDetails = allDetails.stream()
// .collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode));
// return groupedDetails;
// }
/**
* 修改保存采购订单
*/

784
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 String materialSum;
@Excel(name = "到货时间")
private Date arrivedTime;
/** 实际采购总数 */
@Excel(name = "实际采购总数")
private Integer actualPurchaseSum;
/** 联系人 */
@Excel(name = "联系人")
private String customerContact;
/** 共享库存占用总数 */
@Excel(name = "共享库存占用总数")
private Integer sharedInventoryOccupancySum;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactNumber;
/** 退换货数 */
@Excel(name = "退换货数")
private Integer refundsExchangesSum;
/** 传真号码 */
@Excel(name = "传真号码")
private String customerFax;
/** 入库数 */
@Excel(name = "入库数")
private Integer storageSum;
/** 交货地点 */
@Excel(name = "交货地点")
private String deliveryAddress;
/** 不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)")
private BigDecimal normbSum;
/** 付款条件 */
@Excel(name = "付款条件")
private String paymentTerms;
/** 交货条件 */
@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,461 +140,302 @@ public class PurchaseOrder extends BaseEntity
/** 申请时间 */
private Date applyTime;
private Long photoAttachId;
private String fileIdStr;
private String removeFileIdStr;
/** 子表信息 */
private List<PurchaseOrderChild> 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 setNormbSum(BigDecimal normbSum)
{
this.normbSum = normbSum;
}
public void setBillingDate(String billingDate) {
this.billingDate = billingDate;
public BigDecimal getNormbSum()
{
return normbSum;
}
public String getTaxRate() {
return taxRate;
public void setRmbSum(BigDecimal rmbSum)
{
this.rmbSum = rmbSum;
}
public void setTaxRate(String taxRate) {
this.taxRate = taxRate;
public BigDecimal getRmbSum()
{
return rmbSum;
}
public String getPurchaseCategory() {
return purchaseCategory;
public void setEceiptType(String eceiptType)
{
this.eceiptType = eceiptType;
}
public void setPurchaseCategory(String purchaseCategory) {
this.purchaseCategory = purchaseCategory;
public String getEceiptType()
{
return eceiptType;
}
public String getPurchaseCommander() {
return purchaseCommander;
public void setArrivedTime(Date arrivedTime)
{
this.arrivedTime = arrivedTime;
}
public void setPurchaseCommander(String purchaseCommander) {
this.purchaseCommander = purchaseCommander;
public Date getArrivedTime()
{
return arrivedTime;
}
public String getCustomerOrderNumber() {
return customerOrderNumber;
public void setStockNo(String stockNo)
{
this.stockNo = stockNo;
}
public void setCustomerOrderNumber(String customerOrderNumber) {
this.customerOrderNumber = customerOrderNumber;
public String getStockNo()
{
return stockNo;
}
public String getRemarkContent() {
return remarkContent;
public void setStockName(String stockName)
{
this.stockName = stockName;
}
public void setRemarkContent(String remarkContent) {
this.remarkContent = remarkContent;
public String getStockName()
{
return stockName;
}
public String getCloseCaseNo() {
return closeCaseNo;
public void setReceivePerson(String receivePerson)
{
this.receivePerson = receivePerson;
}
public void setCloseCaseNo(String closeCaseNo) {
this.closeCaseNo = closeCaseNo;
public String getReceivePerson()
{
return receivePerson;
}
public String getCloseCaseName() {
return closeCaseName;
public void setReceivePersonPhone(String receivePersonPhone)
{
this.receivePersonPhone = receivePersonPhone;
}
public void setCloseCaseName(String closeCaseName) {
this.closeCaseName = closeCaseName;
public String getReceivePersonPhone()
{
return receivePersonPhone;
}
public String getCloseCaseTime() {
return closeCaseTime;
public void setReceiveAddress(String receiveAddress)
{
this.receiveAddress = receiveAddress;
}
public void setCloseCaseTime(String closeCaseTime) {
this.closeCaseTime = closeCaseTime;
public String getReceiveAddress()
{
return receiveAddress;
}
public String getAccountReconciliationFlag() {
return accountReconciliationFlag;
}
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<PurchaseOrderChild> getPurchaseOrderChildList() {
return purchaseOrderChildList;
}
public void setPurchaseOrderChildList(List<PurchaseOrderChild> purchaseOrderChildList) {
this.purchaseOrderChildList = purchaseOrderChildList;
public Date getApplyTime()
{
return applyTime;
}
@Override
@ -648,32 +443,41 @@ public class PurchaseOrder extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("purchaseOrderId", getPurchaseOrderId())
.append("purchaseOrderCode", getPurchaseOrderCode())
.append("purchasePlanCode", getPurchasePlanCode())
.append("warehouseStorageStatus", getWarehouseStorageStatus())
.append("paymentStatus", getPaymentStatus())
.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())
.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();
}
}

510
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;
@ -12,8 +11,8 @@ 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,172 +21,78 @@ 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<PurchaseOrderChildSupplier> supplierList;
public Integer getNotifyHasArrivedNum() {
return notifyHasArrivedNum;
}
public void setNotifyHasArrivedNum(Integer notifyHasArrivedNum) {
this.notifyHasArrivedNum = notifyHasArrivedNum;
}
private List<PurchaseQuoteChild> purchaseQuoteChildList;
public List<PurchaseQuoteChild> getPurchaseQuoteChildList() {
return purchaseQuoteChildList;
}
public void setPurchaseQuoteChildList(List<PurchaseQuoteChild> purchaseQuoteChildList) {
this.purchaseQuoteChildList = purchaseQuoteChildList;
}
public List<PurchaseOrderChildSupplier> getPurchaseOrderChildSupplierList() {
return supplierList;
}
public void setPurchaseOrderChildSupplierList(List<PurchaseOrderChildSupplier> 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;
@ -206,40 +111,14 @@ public class PurchaseOrderChild extends BaseEntity
{
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)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setMaterialCode(String materialCode)
public void setMaterialNo(String materialNo)
{
this.materialCode = materialCode;
this.materialNo = materialNo;
}
public String getMaterialCode()
public String getMaterialNo()
{
return materialCode;
return materialNo;
}
public void setMaterialName(String materialName)
{
@ -250,274 +129,138 @@ public class PurchaseOrderChild extends BaseEntity
{
return materialName;
}
public BigDecimal getMaterialNoRmb() {
return materialNoRmb;
}
public void setMaterialNoRmb(BigDecimal materialNoRmb) {
this.materialNoRmb = materialNoRmb;
}
public void setMaterialRmb(BigDecimal materialRmb)
{
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNum(BigDecimal materialNum)
public void setMaterialType(String materialType)
{
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;
}
public String getMaterialProcessMethod() {
return materialProcessMethod;
}
public void setMaterialProcessMethod(String materialProcessMethod) {
this.materialProcessMethod = materialProcessMethod;
return materialRmbSum;
}
public String getMaterialBrand() {
return materialBrand;
public Integer getPlanPurchaseNum() {
return planPurchaseNum;
}
public void setMaterialBrand(String materialBrand) {
this.materialBrand = materialBrand;
public void setPlanPurchaseNum(Integer planPurchaseNum) {
this.planPurchaseNum = planPurchaseNum;
}
public String getMaterialPhotourl() {
return materialPhotourl;
public Integer getActualPurchaseNum() {
return actualPurchaseNum;
}
public void setMaterialPhotourl(String materialPhotourl) {
this.materialPhotourl = materialPhotourl;
public void setActualPurchaseNum(Integer actualPurchaseNum) {
this.actualPurchaseNum = actualPurchaseNum;
}
public Integer getHasStorageNum() {
return hasStorageNum;
public Integer getSharedInventoryOccupancyNum() {
return sharedInventoryOccupancyNum;
}
public void setHasStorageNum(Integer hasStorageNum) {
this.hasStorageNum = hasStorageNum;
public void setSharedInventoryOccupancyNum(Integer sharedInventoryOccupancyNum) {
this.sharedInventoryOccupancyNum = sharedInventoryOccupancyNum;
}
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
@ -525,30 +268,27 @@ public class PurchaseOrderChild extends BaseEntity
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("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("materialNoRmb", getMaterialNoRmb())
.append("materialRmb", getMaterialRmb())
.append("materialNum", getMaterialNum())
.append("materialAmount", getMaterialAmount())
.append("materialSum", getMaterialSum())
.append("materialNoRmbSum", getMaterialNoRmbSum())
.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("deliveryTime", getDeliveryTime())
.append("eceiptStatus", getEceiptStatus())
.append("paymentStatus", getPaymentStatus())
.append("taxRate", getTaxRate())
.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())
.append("standbyOne", getStandbyOne())
.append("standbyTwo", getStandbyTwo())
.toString();
}
}

670
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<PurchaseOrderChild> 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<String> 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<PurchaseOrderChild> 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<String> 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<PurchaseOrderChild> children = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrder.getPurchaseOrderCode());
// 分组供应商的子订单,分组统计各供应商应付单供应商
List<PurchaseOrderChild> supplierGroup = (List<PurchaseOrderChild>) 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<PurchaseOrderChild> 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<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild);
List<Map<String, Object>> 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<String, Object> 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<Date> optionalDeliveryTime = Optional.ofNullable(item.getDeliveryTime());
String formattedDeliveryTime = optionalDeliveryTime.map(dateFormat::format).orElse("未提供");
detailMap.put("deliveryTime", formattedDeliveryTime);
detailList.add(detailMap);
}
// for (PurchaseOrderChild item : purchaseOrderChildList) {
// Map<String, Object> 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<Date> 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());
}}
);

62
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<PurchaseOrderChild> 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<PurchaseOrderChild> purchaseOrderChildren = purchaseChildMapper.selectPurchaseOrderChildByOrderCode(purchaseOrderCode);
if(CollectionUtils.isEmpty(purchaseOrderChildren)){
throw new BusinessException("采购订单详情记录为空!");
}
String isAllPaid = "3";
// 获取所有 paymentStatus 的集合
Set<String> 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<String> 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);
}

30
ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java

@ -675,16 +675,16 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
// 新增采购入库库存历史记录
List<PurchaseOrderChild> 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")) {
//// 有无归属分类
// 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);
// }
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());

273
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml

@ -1,244 +1,127 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.purchase.mapper.PurchaseOrderChildMapper">
<resultMap type="PurchaseOrderChild" id="PurchaseOrderChildResult">
<result property="purchaseOrderChildId" column="purchase_order_child_id" />
<result property="purchaseOrderCode" column="purchase_order_code" />
<result property="purchasePlanCode" column="purchase_plan_code" />
<result property="purchasePlanCorrelationCode" column="purchase_plan_correlation_code" />
<result property="correlationCode" column="correlation_code" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="materialCode" column="material_code" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="materialBrand" column="material_brand" />
<result property="materialUnit" column="material_unit" />
<result property="materialDescribe" column="material_describe" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="warehouseDept" column="warehouseDept" />
<result property="materialProcessMethod" column="material_process_method" />
<result property="materialUnit" column="material_unit" />
<result property="hasStorageNum" column="has_storage_num" />
<result property="notifyHasArrivedNum" column="notify_has_arrived_num" />
<result property="materialNoRmb" column="material_no_rmb" />
<result property="materialRmb" column="material_rmb" />
<result property="materialNum" column="material_num" />
<result property="materialAmount" column="material_amount" />
<result property="materialSum" column="material_sum" />
<result property="materialNoRmbSum" column="material_no_rmb_sum" />
<result property="materialModel" column="material_model" />
<result property="warehouseDept" column="warehouse_dept" />
<result property="materialNormbSum" column="material_noRmb_sum" />
<result property="materialRmbSum" column="material_rmb_sum" />
<result property="materialRealNum" column="material_real_num" />
<result property="materialRealNoRmb" column="material_real_no_rmb" />
<result property="materialRealRmb" column="material_real_rmb" />
<result property="materialRealNoRmbSum" column="material_real_no_rmb_sum" />
<result property="materialRealRmbSum" column="material_real_rmb_sum" />
<result property="deliveryTime" column="delivery_time" />
<result property="eceiptStatus" column="eceipt_status" />
<result property="paymentStatus" column="payment_status" />
<result property="taxRate" column="tax_rate" />
<result property="planPurchaseNum" column="plan_purchase_num" />
<result property="actualPurchaseNum" column="actual_purchase_num" />
<result property="sharedInventoryOccupancyNum" column="shared_inventory_occupancy_num" />
<result property="planDeliveryTime" column="plan_delivery_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="standbyOne" column="standby_one" />
<result property="standbyTwo" column="standby_two" />
<collection property="supplierList" ofType="com.ruoyi.purchase.domain.PurchaseOrderChildSupplier">
<id property="purchaseOrderCode" column="purchaseOrderCode" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="materialCode" column="material_code" />
<result property="materialNum" column="material_num" />
<result property="materialNoRmbSum" column="material_no_rmb_sum" />
<result property="materialRmbSum" column="material_rmb_sum" />
<result property="materialRealNum" column="material_real_num" />
<result property="materialRealNoRmb" column="material_real_no_rmb" />
<result property="materialRealRmb" column="material_real_rmb" />
<result property="materialRealNoRmbSum" column="material_real_no_rmb_sum" />
<result property="materialRealRmbSum" column="material_real_rmb_sum" />
<result property="deliveryTime" column="delivery_time" />
<!-- 其他供应商字段映射 -->
</collection>
</resultMap>
<!-- 映射供应商列表 -->
<sql id="selectPurchaseOrderChildVo">
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
</sql>
<select id="selectPurchaseOrderChildList" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo" />
<include refid="selectPurchaseOrderChildVo"/>
<where>
<if test="purchaseOrderCode != null and purchaseOrderCode != ''"> and purchase_order_code = #{purchaseOrderCode}</if>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="deliveryTime != null "> and delivery_time = #{deliveryTime}</if>
<if test="eceiptStatus != null and eceiptStatus != ''"> and eceipt_status = #{eceiptStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and payment_status = #{paymentStatus}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
</where>
</select>
<select id="selectPurchaseOrderChildById" parameterType="Long" resultMap="PurchaseOrderChildResult">
select p.purchase_order_code,p.purchase_plan_code,p.purchase_plan_correlation_code,
p.supplier_code,p.supplier_name,p.material_code,p.material_name,p.material_type,p.material_describe,
p.material_brand,p.material_photoUrl,p.material_process_method,p.material_unit,p.warehouseDept,p.material_no_rmb,
p.material_rmb,p.material_num,p.material_amount,p.material_sum,p.material_no_rmb_sum,p.material_rmb_sum,
p.material_real_num,p.material_real_no_rmb,p.material_real_rmb,p.material_real_no_rmb_sum,p.material_real_rmb_sum,
p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag,
w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num
from purchase_order_child as p left join warehouse_storage_order_detail as w
on p.purchase_order_code = w.related_order_code
and p.material_code = w.material_no and p.supplier_code = w.supplier_code
where p.purchase_order_child_id = #{purchaseOrderChildId}
</select>
<select id="selectPurchaseOrderChildBySupplierCode" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where supplier_code = #{supplierCode}
</select>
<select id="selectChildListBySupplierCodeAndOrderCode" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where supplier_code = #{supplierCode}
and purchase_order_code = #{purchaseOrderCode}
</select>
<select id="selectOrderChildListByMaterialNo" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where material_code = #{materialCode}
where purchase_order_child_id = #{purchaseOrderChildId}
</select>
<insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code,</if>
<if test="purchasePlanCode != null">purchase_plan_code,</if>
<if test="purchasePlanCorrelationCode != null">purchase_plan_correlation_code,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="materialCode != null">material_code,</if>
<if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if>
<if test="materialDescribe != null">material_describe,</if>
<if test="materialBrand != null">material_brand,</if>
<if test="materialPhotourl != null">material_photoUrl,</if>
<if test="materialProcessMethod != null">material_process_method,</if>
<if test="materialBrand != null">material_brand,</if>
<if test="materialUnit != null">material_unit,</if>
<if test="warehouseDept != null">warehouseDept,</if>
<if test="materialNoRmb != null">material_no_rmb,</if>
<if test="materialRmb != null">material_rmb,</if>
<if test="materialNum != null">material_num,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="materialSum != null">material_sum,</if>
<if test="materialNoRmbSum != null">material_no_rmb_sum,</if>
<if test="materialDescribe != null">material_describe,</if>
<if test="materialProcessMethod != null">material_process_method,</if>
<if test="materialModel != null">material_model,</if>
<if test="warehouseDept != null">warehouse_dept,</if>
<if test="materialNormbSum != null">material_noRmb_sum,</if>
<if test="materialRmbSum != null">material_rmb_sum,</if>
<if test="materialRealNum != null">material_real_num,</if>
<if test="materialRealNoRmb != null">material_real_no_rmb,</if>
<if test="materialRealRmb != null">material_real_rmb,</if>
<if test="materialRealNoRmbSum != null">material_real_no_rmb_sum,</if>
<if test="materialRealRmbSum != null">material_real_rmb_sum,</if>
<if test="deliveryTime != null">delivery_time,</if>
<if test="eceiptStatus != null">eceipt_status,</if>
<if test="paymentStatus != null">payment_status,</if>
<if test="taxRate != null">tax_rate,</if>
<if test="planPurchaseNum != null">plan_purchase_num,</if>
<if test="actualPurchaseNum != null">actual_purchase_num,</if>
<if test="sharedInventoryOccupancyNum != null">shared_inventory_occupancy_num,</if>
<if test="planDeliveryTime != null">plan_delivery_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="delFlag != null">del_flag,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">#{purchaseOrderCode},</if>
<if test="purchasePlanCode != null">#{purchasePlanCode},</if>
<if test="purchasePlanCorrelationCode != null">#{purchasePlanCorrelationCode},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="materialCode != null">#{materialCode},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if>
<if test="materialDescribe != null">#{materialDescribe},</if>
<if test="materialBrand != null">#{materialBrand},</if>
<if test="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="materialBrand != null">#{materialBrand},</if>
<if test="materialUnit != null">#{materialUnit},</if>
<if test="materialDescribe != null">#{materialDescribe},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="materialModel != null">#{materialModel},</if>
<if test="warehouseDept != null">#{warehouseDept},</if>
<if test="materialNoRmb != null">#{materialNoRmb},</if>
<if test="materialRmb != null">#{materialRmb},</if>
<if test="materialNum != null">#{materialNum},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="materialSum != null">#{materialSum},</if>
<if test="materialNoRmbSum != null">#{materialNormbsum},</if>
<if test="materialRmbSum != null">#{materialRmbsum},</if>
<if test="materialRealNum != null">#{materialRealNum},</if>
<if test="materialRealNoRmb != null">#{materialRealNoRmb},</if>
<if test="materialRealRmb != null">#{materialRealRmb},</if>
<if test="materialRealNoRmbSum != null">#{materialRealNoRmbSum},</if>
<if test="materialRealRmbSum != null">#{materialRealRmbSum},</if>
<if test="deliveryTime != null">#{deliveryTime},</if>
<if test="eceiptStatus != null">#{eceiptStatus},</if>
<if test="paymentStatus != null">#{paymentStatus},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="materialNormbSum != null">#{materialNormbSum},</if>
<if test="materialRmbSum != null">#{materialRmbSum},</if>
<if test="planPurchaseNum != null">#{planPurchaseNum},</if>
<if test="actualPurchaseNum != null">#{actualPurchaseNum},</if>
<if test="sharedInventoryOccupancyNum != null">#{sharedInventoryOccupancyNum},</if>
<if test="planDeliveryTime != null">#{planDeliveryTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
</trim>
</insert>
<update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild">
update purchase_order_child
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if>
<if test="purchasePlanCode != null">purchase_plan_code = #{purchasePlanCode},</if>
<if test="purchasePlanCorrelationCode != null">purchase_plan_correlation_code = #{purchasePlanCorrelationCode},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl},</if>
<if test="materialBrand != null">material_brand = #{materialBrand},</if>
<if test="materialPhotourl != null">material_photoUrl = #{materialPhotourl}</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="warehouseDept != null">warehouseDept = #{warehouseDept},</if>
<if test="materialNoRmb != null">material_no_rmb = #{materialNoRmb},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if>
<if test="materialNum != null">material_num = #{materialNum},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="materialNoRmbSum != null">material_no_rmb_sum = #{materialNoRmbSum},</if>
<if test="materialRmbSum != null">material_rmb_sum = #{materialRmbsum},</if>
<if test="materialRealNum != null">material_real_num = #{materialRealNum},</if>
<if test="materialRealNoRmb != null">material_real_no_rmb = #{materialRealNoRmb},</if>
<if test="materialRealRmb != null">material_real_rmb = #{materialRealRmb},</if>
<if test="materialRealNoRmbSum != null">material_real_no_rmb_sum = #{materialRealNoRmbSum},</if>
<if test="materialRealRmbSum != null">material_real_rmb_sum = #{materialRealRmbSum},</if>
<if test="deliveryTime != null">delivery_time = #{deliveryTime},</if>
<if test="eceiptStatus != null">eceipt_status = #{eceiptStatus},</if>
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if>
<if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialModel != null">material_model = #{materialModel},</if>
<if test="warehouseDept != null">warehouse_dept = #{warehouseDept},</if>
<if test="materialNormbSum != null">material_noRmb_sum = #{materialNormbSum},</if>
<if test="materialRmbSum != null">material_rmb_sum = #{materialRmbSum},</if>
<if test="planPurchaseNum != null">plan_purchase_num = #{planPurchaseNum},</if>
<if test="actualPurchaseNum != null">actual_purchase_num = #{actualPurchaseNum},</if>
<if test="sharedInventoryOccupancyNum != null">shared_inventory_occupancy_num = #{sharedInventoryOccupancyNum},</if>
<if test="planDeliveryTime != null">plan_delivery_time = #{planDeliveryTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
</trim>
where purchase_order_child_id = #{purchaseOrderChildId}
</update>
@ -246,15 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deletePurchaseOrderChildById" parameterType="Long">
delete from purchase_order_child where purchase_order_child_id = #{purchaseOrderChildId}
</delete>
<delete id="deletePurchaseOrderChildByPurchaseOrderCode" parameterType="String">
delete from purchase_order_child where purchase_order_code = #{purchaseOrderCode}
</delete>
<delete id="deletePurchaseOrderChildByPurchaseOrderCodes" parameterType="String">
delete from purchase_order_child where purchase_order_code = in
<foreach collection="array" item="purchaseOrderCode" open="(" separator="," close=")">
#{purchaseOrderCode}
</foreach>
</delete>
<delete id="deletePurchaseOrderChildByIds" parameterType="String">
delete from purchase_order_child where purchase_order_child_id in
<foreach item="purchaseOrderChildId" collection="array" open="(" separator="," close=")">
@ -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}
</update>
<select id="selectPurchaseOrderChildByOrderCode" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where purchase_order_code = #{purchaseOrderCode}
</select>
<select id="selectPurchaseOrderChildByOrderCodeTotal" parameterType="String" resultMap="PurchaseOrderChildResult">
select
supplier_code,supplier_name,
count(material_code) as material_amount,
sum(material_real_num) as material_sum,
sum(material_real_no_rmb_sum) as material_no_rmb_sum,
sum(material_real_rmb_sum) as material_rmb_sum,
payment_status,
eceipt_status
from purchase_order_child
where purchase_order_code = #{purchaseOrderCode} group by supplier_code
</select>
<select id="selectPurchaseOrderStorageByPurchaseOrderCode" parameterType="String" resultMap="PurchaseOrderChildResult">
select p.purchase_order_code,p.purchase_plan_code,p.purchase_plan_correlation_code,
p.supplier_code,p.supplier_name,p.material_code,p.material_name,p.material_type,p.material_describe,
p.material_brand,p.material_photoUrl,p.material_process_method,p.material_unit,p.warehouseDept,p.material_no_rmb,
p.material_rmb,p.material_num,p.material_amount,p.material_sum,p.material_no_rmb_sum,p.material_rmb_sum,
p.material_real_num,p.material_real_no_rmb,p.material_real_rmb,p.material_real_no_rmb_sum,p.material_real_rmb_sum,
p.delivery_time,p.eceipt_status,p.payment_status,p.tax_rate,p.create_by,p.create_time,p.update_by,p.update_time,p.del_flag,
w.has_storage_num,sum(w.notify_arrive_num) as notify_has_arrived_num
from purchase_order_child as p left join warehouse_storage_order_detail as w
on p.purchase_order_code = w.related_order_code
and p.material_code = w.material_no and p.supplier_code = w.supplier_code
where p.purchase_order_code = #{purchaseOrderCode} GROUP BY supplier_code,material_code
</select>
<select id="selectPurchaseOrderChldByPurchaseOrderCode" parameterType="String" resultMap="PurchaseOrderChildResult">
SELECT purchase_order_code,material_code,GROUP_CONCAT(DISTINCT purchase_plan_code SEPARATOR ',') AS correlation_codes
FROM purchase_order_child where purchase_order_code = #{purchaseOrderCode}
GROUP BY purchase_order_code,material_code
</select>
</mapper>
Loading…
Cancel
Save