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. 796
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java
  5. 542
      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. 32
      ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseStorageOrderServiceImpl.java
  9. 311
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  10. 6
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.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 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(); ErpMaterialPurchaseHistoryVo erpMaterialPurchaseHistoryVo = new ErpMaterialPurchaseHistoryVo();
String purchaseOrderCode = purchaseOrderChild.getPurchaseOrderCode(); String purchaseOrderCode = purchaseOrderChild.getPurchaseOrderCode();
PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode); PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode);
erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getMaterialNum()); erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getActualPurchaseNum());
erpMaterialPurchaseHistoryVo.setPurchaseUser(purchaseOrder.getPurchaseBuyer()); erpMaterialPurchaseHistoryVo.setPurchaseUser(purchaseOrder.getPurchaseBuyer());
erpMaterialPurchaseHistoryVo.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode()); erpMaterialPurchaseHistoryVo.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
erpMaterialPurchaseHistoryVo.setPurchaseTime(purchaseOrderChild.getCreateTime()); erpMaterialPurchaseHistoryVo.setPurchaseTime(purchaseOrderChild.getCreateTime());
erpMaterialPurchaseHistoryVo.setTaxPrice(purchaseOrderChild.getMaterialRmb());
erpMaterialPurchaseHistoryVo.setNoTaxPrice(purchaseOrderChild.getMaterialNoRmb());
erpMaterialPurchaseHistoryVo.setTaxSum(purchaseOrderChild.getMaterialRmbSum()); erpMaterialPurchaseHistoryVo.setTaxSum(purchaseOrderChild.getMaterialRmbSum());
erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNoRmbSum()); erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNormbSum());
erpMaterialPurchaseHistoryVos.add(erpMaterialPurchaseHistoryVo); erpMaterialPurchaseHistoryVos.add(erpMaterialPurchaseHistoryVo);
} }
return erpMaterialPurchaseHistoryVos; 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()); List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectPurchaseOrderChildByOrderCode(purchaseOrder.getPurchaseOrderCode());
//Set<String>子表供应商的信息 供应商编号-供应商名称 //Set<String>子表供应商的信息 供应商编号-供应商名称
//Set<String>子表采购计划单信息 //Set<String>子表采购计划单信息
Set<String> supplierCodes = new HashSet<>(); // Set<String> supplierCodes = new HashSet<>();
Set<String> purchasePlanCodes = new HashSet<>(); // Set<String> purchasePlanCodes = new HashSet<>();
for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ // for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){
supplierCodes.add(purchaseOrderChild.getSupplierCode()); // supplierCodes.add(purchaseOrderChild.getSupplierCode());
purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); // purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode());
} // }
purchaseOrder.setPurchaseOrderChildList(purchaseOrderChildList); // purchaseOrder.setPurchaseOrderChildList(purchaseOrderChildList);
mmap.put("supplierCodes", supplierCodes); // mmap.put("supplierCodes", supplierCodes);
mmap.put("purchasePlanCodes", purchasePlanCodes); // mmap.put("purchasePlanCodes", purchasePlanCodes);
mmap.put("purchaseOrder", purchaseOrder); // mmap.put("purchaseOrder", purchaseOrder);
return prefix + "/edit"; return prefix + "/edit";
} }
@ -228,21 +228,21 @@ public class PurchaseOrderController extends BaseController
//Set<String>子表采购计划单信息 //Set<String>子表采购计划单信息
Set<String> supplierCodes = new HashSet<>(); Set<String> supplierCodes = new HashSet<>();
Set<String> purchasePlanCodes = new HashSet<>(); Set<String> purchasePlanCodes = new HashSet<>();
for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){ // for(PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList){
//获取区分的供应商物料信息 // //获取区分的供应商物料信息
if(!purchasePlanCodes.contains(purchaseOrderChild.getPurchasePlanCode())){ // if(!purchasePlanCodes.contains(purchaseOrderChild.getPurchasePlanCode())){
purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode()); // purchasePlanCodes.add(purchaseOrderChild.getPurchasePlanCode());
} // }
//获取区分的采购计划单信息 // //获取区分的采购计划单信息
if(!supplierCodes.contains(purchaseOrderChild.getSupplierCode())){ // if(!supplierCodes.contains(purchaseOrderChild.getSupplierCode())){
supplierCodes.add(purchaseOrderChild.getSupplierCode()); // supplierCodes.add(purchaseOrderChild.getSupplierCode());
} // }
supplierCodes.add(purchaseOrderChild.getSupplierCode()); // supplierCodes.add(purchaseOrderChild.getSupplierCode());
} // }
mmap.put("supplierCodes", supplierCodes); // mmap.put("supplierCodes", supplierCodes);
mmap.put("purchasePlanCodes", purchasePlanCodes); // mmap.put("purchasePlanCodes", purchasePlanCodes);
mmap.put("purchaseOrder", purchaseOrder); // mmap.put("purchaseOrder", purchaseOrder);
mmap.put("purchasePlanChildList",purchaseOrderChildList); // mmap.put("purchasePlanChildList",purchaseOrderChildList);
return AjaxResult.success(mmap); return AjaxResult.success(mmap);
} }
@GetMapping("/detail/{purchaseOrderId}") @GetMapping("/detail/{purchaseOrderId}")
@ -284,16 +284,16 @@ public class PurchaseOrderController extends BaseController
@ResponseBody // @ResponseBody
@RequestMapping("/detailListGroupedBySupplier") // @RequestMapping("/detailListGroupedBySupplier")
public Map<String, List<PurchaseOrderChild>> detailListGroupedBySupplier(String qualityOrderCode) { // public Map<String, List<PurchaseOrderChild>> detailListGroupedBySupplier(String qualityOrderCode) {
PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); // PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode); // purchaseOrderChild.setPurchaseOrderCode(qualityOrderCode);
List<PurchaseOrderChild> allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode); // List<PurchaseOrderChild> allDetails = purchaseOrderChildService.selectPurchaseOrderStorageByPurchaseOrderCode(qualityOrderCode);
Map<String, List< PurchaseOrderChild>> groupedDetails = allDetails.stream() // Map<String, List< PurchaseOrderChild>> groupedDetails = allDetails.stream()
.collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode)); // .collect(Collectors.groupingBy(PurchaseOrderChild::getSupplierCode));
return groupedDetails; // return groupedDetails;
} // }
/** /**
* 修改保存采购订单 * 修改保存采购订单
*/ */

796
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java

@ -1,20 +1,18 @@
package com.ruoyi.purchase.domain; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; 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 * 采购订单对象 purchase_order
* *
* @author ruoyi * @author 刘晓旭
* @date 2023-03-31 * @date 2024-11-18
*/ */
public class PurchaseOrder extends BaseEntity public class PurchaseOrder extends BaseEntity
{ {
@ -23,161 +21,117 @@ public class PurchaseOrder extends BaseEntity
/** 采购订单id */ /** 采购订单id */
private Long purchaseOrderId; private Long purchaseOrderId;
/** 订购单号 */ /** 采购订购单号 */
@Excel(name = "采购订单号") @Excel(name = "采购订单号")
private String purchaseOrderCode; private String purchaseOrderCode;
@Excel(name="采购员")
private String purchaseBuyer; /** 采购计划单号 */
@Excel(name="审核状态") @Excel(name = "采购计划单号")
private String auditStatus; private String purchasePlanCode;
@Excel(name="使用状态")
private String useStatus; /** 采购入库状态(0待采购、1采购中、2待暂收、3部分暂收、4全部暂收、5已暂收、6待入库、7部分入库、8全部入库、9已入库) */
@Excel(name="入库状态") @Excel(name = "采购入库状态",dictType = "eceiptStatus")
private String eceiptStatus; private String warehouseStorageStatus;
@Excel(name="打款结案状态")
/** 打款结案状态(0待打款、1部分打款、2全部打款、3部分结案、4已结案) */
@Excel(name = "打款结案状态", dictType = "sys_pay_close")
private String paymentStatus; private String paymentStatus;
@Excel(name="供应商数量") /** 供应商ID */
private Integer supplierNum; @Excel(name = "供应商ID")
@Excel(name="物料合计")
private Integer materialAmount;
@Excel(name="数量合计")
private BigDecimal materialSum;
@Excel(name="不含税总价(RMB)")
private BigDecimal noRmbSum;
@Excel(name="含税总价")
private BigDecimal rmbSum;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode; private String supplierCode;
/** 供应商名称 */ /** 供应商名称 */
@Excel(name = "供应商名称") @Excel(name = "供应商名称")
private String supplierName; private String supplierName;
@Excel(name = "入库类型") /** 物料合计 */
private String eceiptType; @Excel(name = "物料合计")
private String materialSum;
@Excel(name = "到货时间")
private Date arrivedTime;
/** 联系人 */ /** 实际采购总数 */
@Excel(name = "联系人") @Excel(name = "实际采购总数")
private String customerContact; private Integer actualPurchaseSum;
/** 联系电话 */ /** 共享库存占用总数 */
@Excel(name = "联系电话") @Excel(name = "共享库存占用总数")
private String contactNumber; private Integer sharedInventoryOccupancySum;
/** 传真号码 */ /** 退换货数 */
@Excel(name = "传真号码") @Excel(name = "退换货数")
private String customerFax; private Integer refundsExchangesSum;
/** 交货地点 */ /** 入库数 */
@Excel(name = "交货地点") @Excel(name = "入库数")
private String deliveryAddress; private Integer storageSum;
/** 付款条件 */ /** 不含税总价(RMB) */
@Excel(name = "付款条件") @Excel(name = "不含税总价(RMB)")
private String paymentTerms; private BigDecimal normbSum;
/** 交货条件 */ /** 含税总价(RMB) */
@Excel(name = "交货条件") @Excel(name = "含税总价(RMB)")
private String deliveryConditions; private BigDecimal rmbSum;
/** 交货方式 */
@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;
/** 采购担当 */ /** 入库类型 */
@Excel(name = "采购担当") private String eceiptType;
private String purchaseCommander;
/** 客户订单号 */ /** 到货时间 */
@Excel(name = "客户订单号") @JsonFormat(pattern = "yyyy-MM-dd")
private String customerOrderNumber; @Excel(name = "到货时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date arrivedTime;
/** 备注内容 */ /** 仓库ID */
@Excel(name = "备注内容") @Excel(name = "仓库ID")
private String remarkContent; private String stockNo;
/** 结案否 */ /** 仓库名称 */
@Excel(name = "结案否") @Excel(name = "仓库名称")
private String closeCaseNo; private String stockName;
/** 结案人 */ /** 收货人 */
@Excel(name = "结案人") @Excel(name = "收货人")
private String closeCaseName; private String receivePerson;
/** 结案时间 */ /** 收货电话 */
@Excel(name = "结案时间") @Excel(name = "收货电话")
private String closeCaseTime; private String receivePersonPhone;
/** 收货地址 */
@Excel(name = "收货地址")
private String receiveAddress;
/** 对账否 */ /** 采购员 */
@Excel(name = "对账否") @Excel(name = "采购员")
private String accountReconciliationFlag; private String purchaseBuyer;
/** 对账人 */ /** 使用状态 (0未使用,1使用,2已作废) */
@Excel(name = "对账人") @Excel(name = "使用状态",dictType = "useStatus")
private String accountReconciliationPerson; private String useStatus;
/** 对账时间 */ /** 审核状态(0待审核、1审核通过、2审核拒绝) */
@Excel(name = "对账时间") @Excel(name = "审核状态",dictType = "auditStatus")
private String accountReconciliationTime; private String auditStatus;
/** 录入时间 */
/** 删除标志(0代表存在 2代表删除) */ /** 删除标志 */
private String delFlag; 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 */ /** 流程实例ID */
private String instanceId; private String instanceId;
/** 流程实例类型 */ /** 流程实例类型 */
private String instanceType; private String instanceType;
/** 提交流程实例ID */ /** 流程提交实例ID */
private String submitInstanceId; private String submitInstanceId;
/** 作废流程实例ID */ /** 流程作废实例ID */
private String cancelInstanceId; private String cancelInstanceId;
/** 恢复流程实例ID */ /** 流程恢复实例ID */
private String restoreInstanceId; private String restoreInstanceId;
/** 申请 */ /** 申请标题 */
private String applyTitle; private String applyTitle;
/** 申请人 */ /** 申请人 */
@ -186,494 +140,344 @@ public class PurchaseOrder extends BaseEntity
/** 申请时间 */ /** 申请时间 */
private Date applyTime; private Date applyTime;
private Long photoAttachId; public void setPurchaseOrderId(Long purchaseOrderId)
{
private String fileIdStr;
private String removeFileIdStr;
/** 子表信息 */
private List<PurchaseOrderChild> purchaseOrderChildList;
public Long getPurchaseOrderId() {
return purchaseOrderId;
}
public void setPurchaseOrderId(Long purchaseOrderId) {
this.purchaseOrderId = purchaseOrderId; this.purchaseOrderId = purchaseOrderId;
} }
public String getPurchaseOrderCode() { public Long getPurchaseOrderId()
return purchaseOrderCode; {
return purchaseOrderId;
} }
public void setPurchaseOrderCode(String purchaseOrderCode)
public void setPurchaseOrderCode(String purchaseOrderCode) { {
this.purchaseOrderCode = purchaseOrderCode; this.purchaseOrderCode = purchaseOrderCode;
} }
public String getPurchaseBuyer() { public String getPurchaseOrderCode()
return purchaseBuyer; {
} return purchaseOrderCode;
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 void setPurchasePlanCode(String purchasePlanCode)
public void setUseStatus(String useStatus) { {
this.useStatus = useStatus; this.purchasePlanCode = purchasePlanCode;
} }
public String getEceiptStatus() { public String getPurchasePlanCode()
return eceiptStatus; {
return purchasePlanCode;
} }
public void setWarehouseStorageStatus(String warehouseStorageStatus)
public void setEceiptStatus(String eceiptStatus) { {
this.eceiptStatus = eceiptStatus; this.warehouseStorageStatus = warehouseStorageStatus;
} }
public String getPaymentStatus() { public String getWarehouseStorageStatus()
return paymentStatus; {
return warehouseStorageStatus;
} }
public void setPaymentStatus(String paymentStatus)
public void setPaymentStatus(String paymentStatus) { {
this.paymentStatus = paymentStatus; this.paymentStatus = paymentStatus;
} }
public Integer getSupplierNum() { public String getPaymentStatus()
return supplierNum; {
} return paymentStatus;
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 void setSupplierCode(String supplierCode)
public void setSupplierCode(String supplierCode) { {
this.supplierCode = supplierCode; this.supplierCode = supplierCode;
} }
public String getSupplierName() { public String getSupplierCode()
return supplierName; {
return supplierCode;
} }
public void setSupplierName(String supplierName)
public void setSupplierName(String supplierName) { {
this.supplierName = supplierName; this.supplierName = supplierName;
} }
public String getEceiptType() { public String getSupplierName()
return eceiptType; {
} return supplierName;
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 void setMaterialSum(String materialSum)
public String getDeliveryAddress() { {
return deliveryAddress; this.materialSum = materialSum;
} }
public void setDeliveryAddress(String deliveryAddress) { public String getMaterialSum()
this.deliveryAddress = deliveryAddress; {
return materialSum;
} }
public void setActualPurchaseSum(Integer actualPurchaseSum)
public String getPaymentTerms() { {
return paymentTerms; this.actualPurchaseSum = actualPurchaseSum;
} }
public void setPaymentTerms(String paymentTerms) { public Integer getActualPurchaseSum()
this.paymentTerms = paymentTerms; {
return actualPurchaseSum;
} }
public void setSharedInventoryOccupancySum(Integer sharedInventoryOccupancySum)
public String getDeliveryConditions() { {
return deliveryConditions; this.sharedInventoryOccupancySum = sharedInventoryOccupancySum;
} }
public void setDeliveryConditions(String deliveryConditions) { public Integer getSharedInventoryOccupancySum()
this.deliveryConditions = deliveryConditions; {
return sharedInventoryOccupancySum;
} }
public void setRefundsExchangesSum(Integer refundsExchangesSum)
public String getDeliveryMethod() { {
return deliveryMethod; this.refundsExchangesSum = refundsExchangesSum;
} }
public void setDeliveryMethod(String deliveryMethod) { public Integer getRefundsExchangesSum()
this.deliveryMethod = deliveryMethod; {
return refundsExchangesSum;
} }
public void setStorageSum(Integer storageSum)
public String getPurchaseName() { {
return purchaseName; this.storageSum = storageSum;
} }
public void setPurchaseName(String purchaseName) { public Integer getStorageSum()
this.purchaseName = purchaseName; {
return storageSum;
} }
public void setNormbSum(BigDecimal normbSum)
public String getBillingDate() { {
return billingDate; this.normbSum = normbSum;
}
public void setBillingDate(String billingDate) {
this.billingDate = billingDate;
} }
public String getTaxRate() { public BigDecimal getNormbSum()
return taxRate; {
return normbSum;
} }
public void setRmbSum(BigDecimal rmbSum)
public void setTaxRate(String taxRate) { {
this.taxRate = taxRate; this.rmbSum = rmbSum;
} }
public String getPurchaseCategory() { public BigDecimal getRmbSum()
return purchaseCategory; {
return rmbSum;
} }
public void setEceiptType(String eceiptType)
public void setPurchaseCategory(String purchaseCategory) { {
this.purchaseCategory = purchaseCategory; this.eceiptType = eceiptType;
} }
public String getPurchaseCommander() { public String getEceiptType()
return purchaseCommander; {
return eceiptType;
} }
public void setArrivedTime(Date arrivedTime)
public void setPurchaseCommander(String purchaseCommander) { {
this.purchaseCommander = purchaseCommander; this.arrivedTime = arrivedTime;
} }
public String getCustomerOrderNumber() { public Date getArrivedTime()
return customerOrderNumber; {
return arrivedTime;
} }
public void setStockNo(String stockNo)
public void setCustomerOrderNumber(String customerOrderNumber) { {
this.customerOrderNumber = customerOrderNumber; this.stockNo = stockNo;
} }
public String getRemarkContent() { public String getStockNo()
return remarkContent; {
return stockNo;
} }
public void setStockName(String stockName)
public void setRemarkContent(String remarkContent) { {
this.remarkContent = remarkContent; this.stockName = stockName;
} }
public String getCloseCaseNo() { public String getStockName()
return closeCaseNo; {
return stockName;
} }
public void setReceivePerson(String receivePerson)
public void setCloseCaseNo(String closeCaseNo) { {
this.closeCaseNo = closeCaseNo; this.receivePerson = receivePerson;
} }
public String getCloseCaseName() { public String getReceivePerson()
return closeCaseName; {
return receivePerson;
} }
public void setReceivePersonPhone(String receivePersonPhone)
public void setCloseCaseName(String closeCaseName) { {
this.closeCaseName = closeCaseName; this.receivePersonPhone = receivePersonPhone;
} }
public String getCloseCaseTime() { public String getReceivePersonPhone()
return closeCaseTime; {
return receivePersonPhone;
} }
public void setReceiveAddress(String receiveAddress)
public void setCloseCaseTime(String closeCaseTime) { {
this.closeCaseTime = closeCaseTime; this.receiveAddress = receiveAddress;
} }
public String getAccountReconciliationFlag() { public String getReceiveAddress()
return accountReconciliationFlag; {
return receiveAddress;
} }
public void setPurchaseBuyer(String purchaseBuyer)
public void setAccountReconciliationFlag(String accountReconciliationFlag) { {
this.accountReconciliationFlag = accountReconciliationFlag; this.purchaseBuyer = purchaseBuyer;
} }
public String getAccountReconciliationPerson() { public String getPurchaseBuyer()
return accountReconciliationPerson; {
return purchaseBuyer;
} }
public void setUseStatus(String useStatus)
public void setAccountReconciliationPerson(String accountReconciliationPerson) { {
this.accountReconciliationPerson = accountReconciliationPerson; this.useStatus = useStatus;
} }
public String getAccountReconciliationTime() { public String getUseStatus()
return accountReconciliationTime; {
return useStatus;
} }
public void setAuditStatus(String auditStatus)
public void setAccountReconciliationTime(String accountReconciliationTime) { {
this.accountReconciliationTime = accountReconciliationTime; this.auditStatus = auditStatus;
} }
public String getDelFlag() { public String getAuditStatus()
return delFlag; {
return auditStatus;
} }
public void setDelFlag(String delFlag)
public void setDelFlag(String delFlag) { {
this.delFlag = delFlag; this.delFlag = delFlag;
} }
public String getStockNo() { public String getDelFlag()
return stockNo; {
} return delFlag;
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 void setInstanceId(String instanceId)
public void setInstanceId(String instanceId) { {
this.instanceId = instanceId; this.instanceId = instanceId;
} }
public String getInstanceType() { public String getInstanceId()
return instanceType; {
return instanceId;
} }
public void setInstanceType(String instanceType)
public void setInstanceType(String instanceType) { {
this.instanceType = instanceType; this.instanceType = instanceType;
} }
public String getSubmitInstanceId() { public String getInstanceType()
return submitInstanceId; {
return instanceType;
} }
public void setSubmitInstanceId(String submitInstanceId)
public void setSubmitInstanceId(String submitInstanceId) { {
this.submitInstanceId = submitInstanceId; this.submitInstanceId = submitInstanceId;
} }
public String getCancelInstanceId() { public String getSubmitInstanceId()
return cancelInstanceId; {
return submitInstanceId;
} }
public void setCancelInstanceId(String cancelInstanceId)
public void setCancelInstanceId(String cancelInstanceId) { {
this.cancelInstanceId = cancelInstanceId; this.cancelInstanceId = cancelInstanceId;
} }
public String getRestoreInstanceId() { public String getCancelInstanceId()
return restoreInstanceId; {
return cancelInstanceId;
} }
public void setRestoreInstanceId(String restoreInstanceId)
public void setRestoreInstanceId(String restoreInstanceId) { {
this.restoreInstanceId = restoreInstanceId; this.restoreInstanceId = restoreInstanceId;
} }
public String getApplyTitle() { public String getRestoreInstanceId()
return applyTitle; {
return restoreInstanceId;
} }
public void setApplyTitle(String applyTitle)
public void setApplyTitle(String applyTitle) { {
this.applyTitle = applyTitle; this.applyTitle = applyTitle;
} }
public String getApplyUser() { public String getApplyTitle()
return applyUser; {
return applyTitle;
} }
public void setApplyUser(String applyUser)
public void setApplyUser(String applyUser) { {
this.applyUser = applyUser; this.applyUser = applyUser;
} }
public Date getApplyTime() { public String getApplyUser()
return applyTime; {
return applyUser;
} }
public void setApplyTime(Date applyTime)
public void setApplyTime(Date applyTime) { {
this.applyTime = applyTime; this.applyTime = applyTime;
} }
public Long getPhotoAttachId() { public Date getApplyTime()
return photoAttachId; {
} return applyTime;
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;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("purchaseOrderId", getPurchaseOrderId()) .append("purchaseOrderId", getPurchaseOrderId())
.append("purchaseOrderCode", getPurchaseOrderCode()) .append("purchaseOrderCode", getPurchaseOrderCode())
.append("supplierCode", getSupplierCode()) .append("purchasePlanCode", getPurchasePlanCode())
.append("supplierName", getSupplierName()) .append("warehouseStorageStatus", getWarehouseStorageStatus())
.append("customerContact", getCustomerContact()) .append("paymentStatus", getPaymentStatus())
.append("contactNumber", getContactNumber()) .append("supplierCode", getSupplierCode())
.append("customerFax", getCustomerFax()) .append("supplierName", getSupplierName())
.append("deliveryAddress", getDeliveryAddress()) .append("materialSum", getMaterialSum())
.append("paymentTerms", getPaymentTerms()) .append("actualPurchaseSum", getActualPurchaseSum())
.append("deliveryConditions", getDeliveryConditions()) .append("sharedInventoryOccupancySum", getSharedInventoryOccupancySum())
.append("deliveryMethod", getDeliveryMethod()) .append("refundsExchangesSum", getRefundsExchangesSum())
.append("purchaseName", getPurchaseName()) .append("storageSum", getStorageSum())
.append("billingDate", getBillingDate()) .append("normbSum", getNormbSum())
.append("taxRate", getTaxRate()) .append("rmbSum", getRmbSum())
.append("purchaseCategory", getPurchaseCategory()) .append("eceiptType", getEceiptType())
.append("purchaseCommander", getPurchaseCommander()) .append("arrivedTime", getArrivedTime())
.append("customerOrderNumber", getCustomerOrderNumber()) .append("stockNo", getStockNo())
.append("remarkContent", getRemarkContent()) .append("stockName", getStockName())
.append("closeCaseNo", getCloseCaseNo()) .append("receivePerson", getReceivePerson())
.append("closeCaseName", getCloseCaseName()) .append("receivePersonPhone", getReceivePersonPhone())
.append("closeCaseTime", getCloseCaseTime()) .append("receiveAddress", getReceiveAddress())
.append("accountReconciliationFlag", getAccountReconciliationFlag()) .append("purchaseBuyer", getPurchaseBuyer())
.append("accountReconciliationPerson", getAccountReconciliationPerson()) .append("useStatus", getUseStatus())
.append("accountReconciliationTime", getAccountReconciliationTime()) .append("auditStatus", getAuditStatus())
.append("standbyOne", getStandbyOne()) .append("createBy", getCreateBy())
.append("standbyTwo", getStandbyTwo()) .append("createTime", getCreateTime())
.toString(); .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();
} }
} }

542
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrderChild.java

@ -1,7 +1,6 @@
package com.ruoyi.purchase.domain; package com.ruoyi.purchase.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -11,9 +10,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
/** /**
* 采购订单子表对象 purchase_order_child * 采购订单子表对象 purchase_order_child
* *
* @author zhang * @author 刘晓旭
* @date 2024-06-19 * @date 2024-11-18
*/ */
public class PurchaseOrderChild extends BaseEntity public class PurchaseOrderChild extends BaseEntity
{ {
@ -22,533 +21,274 @@ public class PurchaseOrderChild extends BaseEntity
/** 采购订单子表id */ /** 采购订单子表id */
private Long purchaseOrderChildId; private Long purchaseOrderChildId;
/** 关联采购订单号 */ /** 采购订单号 */
@Excel(name = "关联采购订单号") @Excel(name = "采购订单号")
private String purchaseOrderCode; private String purchaseOrderCode;
/*关联计划单号*/
private String purchasePlanCode;
/*采购计划关联单号*/ /** 料号 */
private String correlationCode;; @Excel(name = "料号")
private String materialNo;
@Excel(name = "关联报价编号字段")
private String purchaseQuoteCode;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 物料料号 */
@Excel(name = "物料料号")
private String materialCode;
/** 物料名称 */ /** 物料名称 */
@Excel(name = "物料名称") @Excel(name = "物料名称")
private String materialName; private String materialName;
/** 物料类型 */
@Excel(name = "物料类型") @Excel(name = "物料类型")
private String materialType; private String materialType;
private String materialBrand; /** 物料图片地址 */
@Excel(name = "物料图片") @Excel(name = "物料图片地址")
private String materialPhotourl; private String materialPhotourl;
@Excel(name = "物料描述") /** 物料品牌 */
private String materialDescribe; @Excel(name = "物料品牌")
private String materialBrand;
/** 物料单位 */
@Excel(name = "物料单位") @Excel(name = "物料单位")
private String materialUnit; private String materialUnit;
@Excel(name = "物料加工方法") /** 物料描述 */
private String materialProcessMethod; @Excel(name = "物料描述")
private String materialDescribe;
@Excel(name = "入库部门")
private String warehouseDept;
/** 物料不含税单价 */
@Excel(name = "物料不含税单价")
private BigDecimal materialNoRmb;
/** 物料含税单价 */
@Excel(name = "物料含税单价")
private BigDecimal materialRmb;
/** 采购物料数量 */ /** 物料加工方式 */
@Excel(name = "计划采购物料数量") @Excel(name = "物料加工方式")
private BigDecimal materialNum; private String materialProcessMethod;
/** 物料合计 */ /** 物料型号 */
@Excel(name = "物料合计") @Excel(name = "物料型号")
private Long materialAmount; private String materialModel;
/** 数量合计 */ /** 入库部门(0仓库、1采购) */
@Excel(name = "数量合计") @Excel(name = "入库部门(0仓库、1采购)")
private BigDecimal materialSum; private String warehouseDept;
/** 不含税总价(RMB) */ /** 物料不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)") @Excel(name = "物料不含税总价(RMB)")
private BigDecimal materialNoRmbSum; private BigDecimal materialNormbSum;
/** 含税总价(RMB) */ /** 物料含税总价(RMB) */
@Excel(name = "含税总价(RMB)") @Excel(name = "物料含税总价(RMB)")
private BigDecimal materialRmbSum; 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") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交货时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划交付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliveryTime; private Date planDeliveryTime;
/** 收货状态 */
@Excel(name = "收货状态")
private String eceiptStatus;
/** 打款结案状态 */
@Excel(name = "打款结案状态")
private String paymentStatus;
/** 税率 */
@Excel(name = "税率")
private String taxRate;
/** 删除标志 */ /** 删除标志 */
private String delFlag; 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) public void setPurchaseOrderChildId(Long purchaseOrderChildId)
{ {
this.purchaseOrderChildId = purchaseOrderChildId; this.purchaseOrderChildId = purchaseOrderChildId;
} }
public Long getPurchaseOrderChildId() public Long getPurchaseOrderChildId()
{ {
return purchaseOrderChildId; return purchaseOrderChildId;
} }
public void setPurchaseOrderCode(String purchaseOrderCode) public void setPurchaseOrderCode(String purchaseOrderCode)
{ {
this.purchaseOrderCode = purchaseOrderCode; this.purchaseOrderCode = purchaseOrderCode;
} }
public String getPurchaseOrderCode() public String getPurchaseOrderCode()
{ {
return purchaseOrderCode; return purchaseOrderCode;
} }
public void setSupplierCode(String supplierCode) public void setMaterialNo(String materialNo)
{
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; this.materialNo = materialNo;
} }
public String getSupplierName() public String getMaterialNo()
{ {
return supplierName; return materialNo;
} }
public void setMaterialCode(String materialCode) public void setMaterialName(String materialName)
{
this.materialCode = materialCode;
}
public String getMaterialCode()
{
return materialCode;
}
public void setMaterialName(String materialName)
{ {
this.materialName = materialName; this.materialName = materialName;
} }
public String getMaterialName() public String getMaterialName()
{ {
return materialName; return materialName;
} }
public void setMaterialType(String materialType)
public BigDecimal getMaterialNoRmb() {
return materialNoRmb;
}
public void setMaterialNoRmb(BigDecimal materialNoRmb) {
this.materialNoRmb = materialNoRmb;
}
public void setMaterialRmb(BigDecimal materialRmb)
{ {
this.materialRmb = materialRmb; this.materialType = materialType;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNum(BigDecimal materialNum)
{
this.materialNum = materialNum;
} }
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; return materialBrand;
}
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;
} }
public void setMaterialUnit(String materialUnit)
public void setDeliveryTime(Date deliveryTime)
{ {
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; return materialRmbSum;
}
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() { public Integer getPlanPurchaseNum() {
return materialProcessMethod; return planPurchaseNum;
} }
public void setMaterialProcessMethod(String materialProcessMethod) { public void setPlanPurchaseNum(Integer planPurchaseNum) {
this.materialProcessMethod = materialProcessMethod; this.planPurchaseNum = planPurchaseNum;
} }
public String getMaterialBrand() { public Integer getActualPurchaseNum() {
return materialBrand; return actualPurchaseNum;
} }
public void setMaterialBrand(String materialBrand) { public void setActualPurchaseNum(Integer actualPurchaseNum) {
this.materialBrand = materialBrand; this.actualPurchaseNum = actualPurchaseNum;
} }
public String getMaterialPhotourl() { public Integer getSharedInventoryOccupancyNum() {
return materialPhotourl; return sharedInventoryOccupancyNum;
}
public void setMaterialPhotourl(String materialPhotourl) {
this.materialPhotourl = materialPhotourl;
} }
public Integer getHasStorageNum() { public void setSharedInventoryOccupancyNum(Integer sharedInventoryOccupancyNum) {
return hasStorageNum; this.sharedInventoryOccupancyNum = sharedInventoryOccupancyNum;
} }
public void setHasStorageNum(Integer hasStorageNum) { public void setPlanDeliveryTime(Date planDeliveryTime)
this.hasStorageNum = hasStorageNum; {
} this.planDeliveryTime = planDeliveryTime;
public Integer getNotifyArriveNum() {
return notifyArriveNum;
} }
public void setNotifyArriveNum(Integer notifyArriveNum) { public Date getPlanDeliveryTime()
this.notifyArriveNum = notifyArriveNum; {
return planDeliveryTime;
} }
public void setDelFlag(String delFlag)
public Integer getActualHasArrivedNum() { {
return actualHasArrivedNum; this.delFlag = delFlag;
} }
public void setActualHasArrivedNum(Integer actualHasArrivedNum) { public String getDelFlag()
this.actualHasArrivedNum = actualHasArrivedNum; {
return delFlag;
} }
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("purchaseOrderChildId", getPurchaseOrderChildId()) .append("purchaseOrderChildId", getPurchaseOrderChildId())
.append("purchaseOrderCode", getPurchaseOrderCode()) .append("purchaseOrderCode", getPurchaseOrderCode())
.append("purchasePlanCode", getPurchasePlanCode()) .append("materialNo", getMaterialNo())
.append("supplierCode", getSupplierCode()) .append("materialName", getMaterialName())
.append("supplierName", getSupplierName()) .append("materialType", getMaterialType())
.append("materialCode", getMaterialCode()) .append("materialPhotourl", getMaterialPhotourl())
.append("materialName", getMaterialName()) .append("materialBrand", getMaterialBrand())
.append("materialNoRmb", getMaterialNoRmb()) .append("materialUnit", getMaterialUnit())
.append("materialRmb", getMaterialRmb()) .append("materialDescribe", getMaterialDescribe())
.append("materialNum", getMaterialNum()) .append("materialProcessMethod", getMaterialProcessMethod())
.append("materialAmount", getMaterialAmount()) .append("materialModel", getMaterialModel())
.append("materialSum", getMaterialSum()) .append("warehouseDept", getWarehouseDept())
.append("materialNoRmbSum", getMaterialNoRmbSum()) .append("materialNormbSum", getMaterialNormbSum())
.append("materialRmbSum", getMaterialRmbSum()) .append("materialRmbSum", getMaterialRmbSum())
.append("deliveryTime", getDeliveryTime()) .append("planPurchaseNum", getPlanPurchaseNum())
.append("eceiptStatus", getEceiptStatus()) .append("actualPurchaseNum", getActualPurchaseNum())
.append("paymentStatus", getPaymentStatus()) .append("sharedInventoryOccupancyNum", getSharedInventoryOccupancyNum())
.append("taxRate", getTaxRate()) .append("planDeliveryTime", getPlanDeliveryTime())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("delFlag", getDelFlag()) .append("delFlag", getDelFlag())
.append("standbyOne", getStandbyOne()) .toString();
.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) @Transactional(rollbackFor = Exception.class)
public int insertPurchaseOrder(PurchaseOrder purchaseOrder) public int insertPurchaseOrder(PurchaseOrder purchaseOrder)
{ {
// 生成采购订单编号 return 1;
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);
} }
//生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。 //生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。
public int purchaseOrderPayment(PurchaseOrder purchaseOrder) { public int purchaseOrderPayment(PurchaseOrder purchaseOrder) {
@ -531,270 +262,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Override @Override
public int updatePurchaseOrderCode(PurchaseOrder purchaseOrder) public int updatePurchaseOrderCode(PurchaseOrder purchaseOrder)
{ {
// 初始化累加变量 return 1;
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);
} }
/** /**
@ -927,72 +395,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Override @Override
public Integer addPurchaseOrderPayable(PurchaseOrder purchaseOrder){ 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; // 返回成功标识 return 1; // 返回成功标识
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -1105,36 +507,36 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
String orderDate = dateFormat.format(applyTime); String orderDate = dateFormat.format(applyTime);
PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
purchaseOrderChild.setPurchaseOrderCode(purchaseOrderCode); purchaseOrderChild.setPurchaseOrderCode(purchaseOrderCode);
purchaseOrderChild.setSupplierCode(supplierCode); //purchaseOrderChild.setSupplierCode(supplierCode);
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild); List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild);
List<Map<String, Object>> detailList = new ArrayList<>(); List<Map<String, Object>> detailList = new ArrayList<>();
// 数字合计金额 // // 数字合计金额
BigDecimal totalAmount = purchaseOrderChildList.stream() // BigDecimal totalAmount = purchaseOrderChildList.stream()
.filter(item -> item.getMaterialRealRmbSum() != null) // 过滤掉值为空的字段 // .filter(item -> item.getMaterialRealRmbSum() != null) // 过滤掉值为空的字段
.map(item -> item.getMaterialRealRmbSum()) // .map(item -> item.getMaterialRealRmbSum())
.reduce(BigDecimal.ZERO, BigDecimal::add); // .reduce(BigDecimal.ZERO, BigDecimal::add);
//转换成中文金额 //汉字大写合计金额 //转换成中文金额 //汉字大写合计金额
String ChineseCharacterAmount = MoneyUtils.amountConversion(totalAmount.toString()); // String ChineseCharacterAmount = MoneyUtils.amountConversion(totalAmount.toString());
AtomicInteger index = new AtomicInteger(1); AtomicInteger index = new AtomicInteger(1);
for (PurchaseOrderChild item : purchaseOrderChildList) { // for (PurchaseOrderChild item : purchaseOrderChildList) {
Map<String, Object> detailMap = new HashMap<>(); // Map<String, Object> detailMap = new HashMap<>();
detailMap.put("index", index.getAndIncrement()); // detailMap.put("index", index.getAndIncrement());
detailMap.put("materialName", item.getMaterialName()); // detailMap.put("materialName", item.getMaterialName());
detailMap.put("materialDescribe", item.getMaterialDescribe()); // detailMap.put("materialDescribe", item.getMaterialDescribe());
detailMap.put("materialUnit", item.getMaterialUnit()); // detailMap.put("materialUnit", item.getMaterialUnit());
detailMap.put("materialRealNum", item.getMaterialRealNum()); // detailMap.put("materialRealNum", item.getMaterialRealNum());
detailMap.put("materialRealRmb", item.getMaterialRealRmb()); // detailMap.put("materialRealRmb", item.getMaterialRealRmb());
detailMap.put("materialRealRmbSum", item.getMaterialRealRmbSum()); // detailMap.put("materialRealRmbSum", item.getMaterialRealRmbSum());
//
// 使用 Optional 来安全地处理可能为 null 的值 // // 使用 Optional 来安全地处理可能为 null 的值
Optional<Date> optionalDeliveryTime = Optional.ofNullable(item.getDeliveryTime()); // Optional<Date> optionalDeliveryTime = Optional.ofNullable(item.getDeliveryTime());
String formattedDeliveryTime = optionalDeliveryTime.map(dateFormat::format).orElse("未提供"); // String formattedDeliveryTime = optionalDeliveryTime.map(dateFormat::format).orElse("未提供");
//
detailMap.put("deliveryTime", formattedDeliveryTime); // detailMap.put("deliveryTime", formattedDeliveryTime);
detailList.add(detailMap); // detailList.add(detailMap);
} // }
//查询仓库信息 //查询仓库信息
@ -1162,16 +564,16 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
put("depositBank", sysSupplier.getDepositBank()); put("depositBank", sysSupplier.getDepositBank());
put("bankAccount", sysSupplier.getBankAccount()); put("bankAccount", sysSupplier.getBankAccount());
put("exchangeSettlementAccount", sysSupplier.getExchangeSettlementAccount()); put("exchangeSettlementAccount", sysSupplier.getExchangeSettlementAccount());
put("totalAmount", totalAmount); // put("totalAmount", totalAmount);
put("ChineseCharacterAmount", ChineseCharacterAmount); // put("ChineseCharacterAmount", ChineseCharacterAmount);
put("taxRate", taxRate); // put("taxRate", taxRate);
put("enterpriseName", enterpriseName); // put("enterpriseName", enterpriseName);
put("bankAccountWC", bankAccountWC); // put("bankAccountWC", bankAccountWC);
put("depositBankWC", depositBankWC); // put("depositBankWC", depositBankWC);
put("contacts", contacts); // put("contacts", contacts);
put("stockAddress", purchaseOrder.getStockAddress()); // put("stockAddress", purchaseOrder.getStockAddress());
put("stockPhone", purchaseOrder.getStockPhone()); // put("stockPhone", purchaseOrder.getStockPhone());
put("stockContact", purchaseOrder.getStockContact()); // 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; int updateResult = 0;
PurchaseOrderChild tempChild = new PurchaseOrderChild(); PurchaseOrderChild tempChild = new PurchaseOrderChild();
tempChild.setPurchaseOrderCode(child.getPurchaseCode()); tempChild.setPurchaseOrderCode(child.getPurchaseCode());
tempChild.setSupplierCode(supplierCode); //tempChild.setSupplierCode(supplierCode);
List<PurchaseOrderChild> purchaseChildren = purchaseChildMapper.selectChildListBySupplierCodeAndOrderCode(tempChild); List<PurchaseOrderChild> purchaseChildren = purchaseChildMapper.selectChildListBySupplierCodeAndOrderCode(tempChild);
if(CollectionUtils.isNotEmpty(purchaseChildren)){ if(CollectionUtils.isNotEmpty(purchaseChildren)){
for (PurchaseOrderChild purchaseChild: purchaseChildren) { for (PurchaseOrderChild purchaseChild: purchaseChildren) {
purchaseChild.setPaymentStatus("2"); //purchaseChild.setPaymentStatus("2");
purchaseChildMapper.updatePurchaseOrderChild(purchaseChild); purchaseChildMapper.updatePurchaseOrderChild(purchaseChild);
updateResult ++; updateResult ++;
} }
@ -212,35 +212,35 @@ public class BaseExpenseConfirmAmountServiceImpl implements IBaseExpenseConfirmA
public int updatePurchaseOrderPayableStatus(String purchaseOrderCode){ public int updatePurchaseOrderPayableStatus(String purchaseOrderCode){
PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode); PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode);
List<PurchaseOrderChild> purchaseOrderChildren = purchaseChildMapper.selectPurchaseOrderChildByOrderCode(purchaseOrderCode); List<PurchaseOrderChild> purchaseOrderChildren = purchaseChildMapper.selectPurchaseOrderChildByOrderCode(purchaseOrderCode);
if(CollectionUtils.isEmpty(purchaseOrderChildren)){ // if(CollectionUtils.isEmpty(purchaseOrderChildren)){
throw new BusinessException("采购订单详情记录为空!"); // throw new BusinessException("采购订单详情记录为空!");
} // }
String isAllPaid = "3"; // String isAllPaid = "3";
// 获取所有 paymentStatus 的集合 // // 获取所有 paymentStatus 的集合
Set<String> statuses = purchaseOrderChildren.stream() // Set<String> statuses = purchaseOrderChildren.stream()
.map(PurchaseOrderChild::getPaymentStatus) // .map(PurchaseOrderChild::getPaymentStatus)
.collect(Collectors.toSet()); // .collect(Collectors.toSet());
//
// 判断状态 // // 判断状态
if (statuses.size() == 1) { // if (statuses.size() == 1) {
String singleStatus = statuses.iterator().next(); // String singleStatus = statuses.iterator().next();
if (singleStatus.equals("0")) { // if (singleStatus.equals("0")) {
isAllPaid = "0"; // isAllPaid = "0";
} else if (singleStatus.equals("2")) { // } else if (singleStatus.equals("2")) {
isAllPaid = "1"; // isAllPaid = "1";
} // }
} else if (statuses.size() == 2 && statuses.contains("0") && statuses.contains("2")) { // } else if (statuses.size() == 2 && statuses.contains("0") && statuses.contains("2")) {
isAllPaid = "2"; // isAllPaid = "2";
} // }
if(isAllPaid.equals("1")){ // if(isAllPaid.equals("1")){
// 订单内供应商全部打款 //// 订单内供应商全部打款
purchaseOrder.setPaymentStatus("2"); // purchaseOrder.setPaymentStatus("2");
}else if(isAllPaid.equals("0")){ // }else if(isAllPaid.equals("0")){
// 订单内供应商全未打款 //// 订单内供应商全未打款
purchaseOrder.setPaymentStatus("0"); // purchaseOrder.setPaymentStatus("0");
}else if(isAllPaid.equals("2")){ // }else if(isAllPaid.equals("2")){
purchaseOrder.setPaymentStatus("1"); // purchaseOrder.setPaymentStatus("1");
} // }
purchaseOrder.setUpdateTime(DateUtils.getNowDate()); purchaseOrder.setUpdateTime(DateUtils.getNowDate());
return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder); return purchaseOrderMapper.updatePurchaseOrder(purchaseOrder);
} }

32
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()); List<PurchaseOrderChild> purchaseOrderChild = purchaseOrderChildMapper.selectPurchaseOrderChildByOrderCode(warehouseStorageOrderDetail.getRelatedOrderCode());
for (PurchaseOrderChild child : purchaseOrderChild) { for (PurchaseOrderChild child : purchaseOrderChild) {
if(child.getMaterialCode().equals(materialNo)){ // if(child.getMaterialCode().equals(materialNo)){
int storageNum = warehouseStorageOrderDetail.getStorageNum(); // int storageNum = warehouseStorageOrderDetail.getStorageNum();
WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); // WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail();
inquiryDetail = generateInquiryDetailByPurchaseChild(child,storageNum); // inquiryDetail = generateInquiryDetailByPurchaseChild(child,storageNum);
inquiryDetail.setInventoryHistoricalType("0"); // inquiryDetail.setInventoryHistoricalType("0");
// if (correlationCode.startsWith("QG")) { //// if (correlationCode.startsWith("QG")) {
//// 有无归属分类 ////// 有无归属分类
// } //// }
inventoryInquiryDetailMapper.insertWarehouseInventoryInquiryDetail(inquiryDetail); // inventoryInquiryDetailMapper.insertWarehouseInventoryInquiryDetail(inquiryDetail);
} // }
} }
}else if(warehouseStorageType.equals("2")){//新增委内入库库存历史记录 }else if(warehouseStorageType.equals("2")){//新增委内入库库存历史记录
WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail();
@ -766,23 +766,23 @@ public class WarehouseStorageOrderServiceImpl implements IWarehouseStorageOrderS
// 生成采购订单库存历史记录 // 生成采购订单库存历史记录
public WarehouseInventoryInquiryDetail generateInquiryDetailByPurchaseChild(PurchaseOrderChild child,int storageNum){ public WarehouseInventoryInquiryDetail generateInquiryDetailByPurchaseChild(PurchaseOrderChild child,int storageNum){
WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail(); WarehouseInventoryInquiryDetail inquiryDetail = new WarehouseInventoryInquiryDetail();
inquiryDetail.setMaterialNo(child.getMaterialCode()); inquiryDetail.setMaterialNo(child.getMaterialNo());
inquiryDetail.setMaterialName(child.getMaterialName()); inquiryDetail.setMaterialName(child.getMaterialName());
inquiryDetail.setMaterialBrand(child.getMaterialBrand()); inquiryDetail.setMaterialBrand(child.getMaterialBrand());
inquiryDetail.setMaterialPhotourl(child.getMaterialPhotourl()); inquiryDetail.setMaterialPhotourl(child.getMaterialPhotourl());
inquiryDetail.setMaterialDescribe(child.getMaterialDescribe()); inquiryDetail.setMaterialDescribe(child.getMaterialDescribe());
inquiryDetail.setMaterialType(child.getMaterialType()); inquiryDetail.setMaterialType(child.getMaterialType());
inquiryDetail.setMaterialUnit(child.getMaterialUnit()); inquiryDetail.setMaterialUnit(child.getMaterialUnit());
inquiryDetail.setInventoryAttributionCode(child.getPurchasePlanCorrelationCode()); // inquiryDetail.setInventoryAttributionCode(child.getPurchasePlanCorrelationCode());
inquiryDetail.setSupplierCode(child.getSupplierCode()); // inquiryDetail.setSupplierCode(child.getSupplierCode());
inquiryDetail.setSupplierName(child.getSupplierName()); // inquiryDetail.setSupplierName(child.getSupplierName());
inquiryDetail.setPurchaseOrderCode(child.getPurchaseOrderCode()); inquiryDetail.setPurchaseOrderCode(child.getPurchaseOrderCode());
// 库存归属单号 // 库存归属单号
BigDecimal realStorageNum = BigDecimal.valueOf(storageNum); BigDecimal realStorageNum = BigDecimal.valueOf(storageNum);
inquiryDetail.setAvailableStockNum(realStorageNum); inquiryDetail.setAvailableStockNum(realStorageNum);
inquiryDetail.setPurchasePriceIncludesTax(child.getMaterialRealRmbSum()); // inquiryDetail.setPurchasePriceIncludesTax(child.getMaterialRealRmbSum());
inquiryDetail.setPurchasePriceExcludingTax(child.getMaterialRealNoRmbSum()); // inquiryDetail.setPurchasePriceExcludingTax(child.getMaterialRealNoRmbSum());
inquiryDetail.setInventoryIncreaseDecrease("1"); inquiryDetail.setInventoryIncreaseDecrease("1");
inquiryDetail.setCreateBy(ShiroUtils.getLoginName()); inquiryDetail.setCreateBy(ShiroUtils.getLoginName());
inquiryDetail.setCreateTime(DateUtils.getNowDate()); inquiryDetail.setCreateTime(DateUtils.getNowDate());

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

@ -1,244 +1,127 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.purchase.mapper.PurchaseOrderChildMapper"> <mapper namespace="com.ruoyi.purchase.mapper.PurchaseOrderChildMapper">
<resultMap type="PurchaseOrderChild" id="PurchaseOrderChildResult"> <resultMap type="PurchaseOrderChild" id="PurchaseOrderChildResult">
<result property="purchaseOrderChildId" column="purchase_order_child_id" /> <result property="purchaseOrderChildId" column="purchase_order_child_id" />
<result property="purchaseOrderCode" column="purchase_order_code" /> <result property="purchaseOrderCode" column="purchase_order_code" />
<result property="purchasePlanCode" column="purchase_plan_code" /> <result property="materialNo" column="material_no" />
<result property="purchasePlanCorrelationCode" column="purchase_plan_correlation_code" /> <result property="materialName" column="material_name" />
<result property="correlationCode" column="correlation_code" /> <result property="materialType" column="material_type" />
<result property="supplierCode" column="supplier_code" /> <result property="materialPhotourl" column="material_photoUrl" />
<result property="supplierName" column="supplier_name" /> <result property="materialBrand" column="material_brand" />
<result property="materialCode" column="material_code" /> <result property="materialUnit" column="material_unit" />
<result property="materialName" column="material_name" /> <result property="materialDescribe" column="material_describe" />
<result property="materialType" column="material_type" /> <result property="materialProcessMethod" column="material_process_method" />
<result property="materialBrand" column="material_brand" /> <result property="materialModel" column="material_model" />
<result property="materialDescribe" column="material_describe" /> <result property="warehouseDept" column="warehouse_dept" />
<result property="materialPhotourl" column="material_photoUrl" /> <result property="materialNormbSum" column="material_noRmb_sum" />
<result property="warehouseDept" column="warehouseDept" /> <result property="materialRmbSum" column="material_rmb_sum" />
<result property="materialProcessMethod" column="material_process_method" /> <result property="planPurchaseNum" column="plan_purchase_num" />
<result property="materialUnit" column="material_unit" /> <result property="actualPurchaseNum" column="actual_purchase_num" />
<result property="hasStorageNum" column="has_storage_num" /> <result property="sharedInventoryOccupancyNum" column="shared_inventory_occupancy_num" />
<result property="notifyHasArrivedNum" column="notify_has_arrived_num" /> <result property="planDeliveryTime" column="plan_delivery_time" />
<result property="materialNoRmb" column="material_no_rmb" /> <result property="createBy" column="create_by" />
<result property="materialRmb" column="material_rmb" /> <result property="createTime" column="create_time" />
<result property="materialNum" column="material_num" /> <result property="updateBy" column="update_by" />
<result property="materialAmount" column="material_amount" /> <result property="updateTime" column="update_time" />
<result property="materialSum" column="material_sum" /> <result property="delFlag" column="del_flag" />
<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" />
<result property="eceiptStatus" column="eceipt_status" />
<result property="paymentStatus" column="payment_status" />
<result property="taxRate" column="tax_rate" />
<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> </resultMap>
<!-- 映射供应商列表 -->
<sql id="selectPurchaseOrderChildVo"> <sql id="selectPurchaseOrderChildVo">
select purchase_order_child_id, purchase_order_code, purchase_plan_code, purchase_plan_correlation_code, supplier_code, supplier_name, 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
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
</sql> </sql>
<select id="selectPurchaseOrderChildList" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult"> <select id="selectPurchaseOrderChildList" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo" /> <include refid="selectPurchaseOrderChildVo"/>
<where> <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> </where>
</select> </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"> <select id="selectPurchaseOrderChildById" parameterType="Long" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where supplier_code = #{supplierCode}
</select>
<select id="selectChildListBySupplierCodeAndOrderCode" parameterType="PurchaseOrderChild" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/> <include refid="selectPurchaseOrderChildVo"/>
where supplier_code = #{supplierCode} where purchase_order_child_id = #{purchaseOrderChildId}
and purchase_order_code = #{purchaseOrderCode}
</select>
<select id="selectOrderChildListByMaterialNo" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where material_code = #{materialCode}
</select> </select>
<insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId"> <insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child insert into purchase_order_child
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code,</if> <if test="purchaseOrderCode != null">purchase_order_code,</if>
<if test="purchasePlanCode != null">purchase_plan_code,</if> <if test="materialNo != null">material_no,</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="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</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="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="materialUnit != null">material_unit,</if>
<if test="warehouseDept != null">warehouseDept,</if> <if test="materialDescribe != null">material_describe,</if>
<if test="materialNoRmb != null">material_no_rmb,</if> <if test="materialProcessMethod != null">material_process_method,</if>
<if test="materialRmb != null">material_rmb,</if> <if test="materialModel != null">material_model,</if>
<if test="materialNum != null">material_num,</if> <if test="warehouseDept != null">warehouse_dept,</if>
<if test="materialAmount != null">material_amount,</if> <if test="materialNormbSum != null">material_noRmb_sum,</if>
<if test="materialSum != null">material_sum,</if>
<if test="materialNoRmbSum != null">material_no_rmb_sum,</if>
<if test="materialRmbSum != null">material_rmb_sum,</if> <if test="materialRmbSum != null">material_rmb_sum,</if>
<if test="materialRealNum != null">material_real_num,</if> <if test="planPurchaseNum != null">plan_purchase_num,</if>
<if test="materialRealNoRmb != null">material_real_no_rmb,</if> <if test="actualPurchaseNum != null">actual_purchase_num,</if>
<if test="materialRealRmb != null">material_real_rmb,</if> <if test="sharedInventoryOccupancyNum != null">shared_inventory_occupancy_num,</if>
<if test="materialRealNoRmbSum != null">material_real_no_rmb_sum,</if> <if test="planDeliveryTime != null">plan_delivery_time,</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="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</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="delFlag != null">del_flag,</if>
<if test="standbyOne != null">standby_one,</if> </trim>
<if test="standbyTwo != null">standby_two,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">#{purchaseOrderCode},</if> <if test="purchaseOrderCode != null">#{purchaseOrderCode},</if>
<if test="purchasePlanCode != null">#{purchasePlanCode},</if> <if test="materialNo != null">#{materialNo},</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="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</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="materialPhotourl != null">#{materialPhotourl},</if>
<if test="materialProcessMethod != null">#{materialProcessMethod},</if> <if test="materialBrand != null">#{materialBrand},</if>
<if test="materialUnit != null">#{materialUnit},</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="warehouseDept != null">#{warehouseDept},</if>
<if test="materialNoRmb != null">#{materialNoRmb},</if> <if test="materialNormbSum != null">#{materialNormbSum},</if>
<if test="materialRmb != null">#{materialRmb},</if> <if test="materialRmbSum != null">#{materialRmbSum},</if>
<if test="materialNum != null">#{materialNum},</if> <if test="planPurchaseNum != null">#{planPurchaseNum},</if>
<if test="materialAmount != null">#{materialAmount},</if> <if test="actualPurchaseNum != null">#{actualPurchaseNum},</if>
<if test="materialSum != null">#{materialSum},</if> <if test="sharedInventoryOccupancyNum != null">#{sharedInventoryOccupancyNum},</if>
<if test="materialNoRmbSum != null">#{materialNormbsum},</if> <if test="planDeliveryTime != null">#{planDeliveryTime},</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="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</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="delFlag != null">#{delFlag},</if>
<if test="standbyOne != null">#{standbyOne},</if> </trim>
<if test="standbyTwo != null">#{standbyTwo},</if>
</trim>
</insert> </insert>
<update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild"> <update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild">
update purchase_order_child update purchase_order_child
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if> <if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if>
<if test="purchasePlanCode != null">purchase_plan_code = #{purchasePlanCode},</if> <if test="materialNo != null">material_no = #{materialNo},</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="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</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="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="materialUnit != null">material_unit = #{materialUnit},</if>
<if test="warehouseDept != null">warehouseDept = #{warehouseDept},</if> <if test="materialDescribe != null">material_describe = #{materialDescribe},</if>
<if test="materialNoRmb != null">material_no_rmb = #{materialNoRmb},</if> <if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if> <if test="materialModel != null">material_model = #{materialModel},</if>
<if test="materialNum != null">material_num = #{materialNum},</if> <if test="warehouseDept != null">warehouse_dept = #{warehouseDept},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if> <if test="materialNormbSum != null">material_noRmb_sum = #{materialNormbSum},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if> <if test="materialRmbSum != null">material_rmb_sum = #{materialRmbSum},</if>
<if test="materialNoRmbSum != null">material_no_rmb_sum = #{materialNoRmbSum},</if> <if test="planPurchaseNum != null">plan_purchase_num = #{planPurchaseNum},</if>
<if test="materialRmbSum != null">material_rmb_sum = #{materialRmbsum},</if> <if test="actualPurchaseNum != null">actual_purchase_num = #{actualPurchaseNum},</if>
<if test="materialRealNum != null">material_real_num = #{materialRealNum},</if> <if test="sharedInventoryOccupancyNum != null">shared_inventory_occupancy_num = #{sharedInventoryOccupancyNum},</if>
<if test="materialRealNoRmb != null">material_real_no_rmb = #{materialRealNoRmb},</if> <if test="planDeliveryTime != null">plan_delivery_time = #{planDeliveryTime},</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="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</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> </trim>
where purchase_order_child_id = #{purchaseOrderChildId} where purchase_order_child_id = #{purchaseOrderChildId}
</update> </update>
@ -246,17 +129,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deletePurchaseOrderChildById" parameterType="Long"> <delete id="deletePurchaseOrderChildById" parameterType="Long">
delete from purchase_order_child where purchase_order_child_id = #{purchaseOrderChildId} delete from purchase_order_child where purchase_order_child_id = #{purchaseOrderChildId}
</delete> </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 id="deletePurchaseOrderChildByIds" parameterType="String">
delete from purchase_order_child where purchase_order_child_id in delete from purchase_order_child where purchase_order_child_id in
<foreach item="purchaseOrderChildId" collection="array" open="(" separator="," close=")"> <foreach item="purchaseOrderChildId" collection="array" open="(" separator="," close=")">
#{purchaseOrderChildId} #{purchaseOrderChildId}
</foreach> </foreach>
@ -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 purchase_order_child set del_flag = '0' where purchase_order_child_id = #{purchaseOrderChildId}
</update> </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> </mapper>

6
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml

@ -121,12 +121,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
order by pur.audit_status asc, pur.create_time desc order by pur.audit_status asc, pur.create_time desc
</select> </select>
<select id="selectPurchaseOrderById" parameterType="Long" resultMap="PurchaseOrderResult"> <select id="selectPurchaseOrderById" parameterType="Long" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/> <include refid="selectPurchaseOrderVo"/>
where purchase_order_id = #{purchaseOrderId} where purchase_order_id = #{purchaseOrderId}
</select> </select>
<insert id="insertPurchaseOrder" parameterType="PurchaseOrder" useGeneratedKeys="true" keyProperty="purchaseOrderId"> <insert id="insertPurchaseOrder" parameterType="PurchaseOrder" useGeneratedKeys="true" keyProperty="purchaseOrderId">
insert into purchase_order insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -286,7 +286,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select count(1) from purchase_order where purchase_ordre_code = #{purchaseOrderCode} limit 1 select count(1) from purchase_order where purchase_ordre_code = #{purchaseOrderCode} limit 1
</select> </select>
<delete id="deletePurchaseOrderByIds" parameterType="String"> <delete id="deletePurchaseOrderByIds" parameterType="String">
delete from purchase_order where purchase_order_id in delete from purchase_order where purchase_order_id in
<foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")"> <foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")">
#{purchaseOrderId} #{purchaseOrderId}
</foreach> </foreach>

Loading…
Cancel
Save