From f9240b1143a5b519808fae0810bd24e822f439f1 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 20 Jun 2024 20:56:14 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8D=95=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E5=8D=95=E7=9A=84=E6=95=B0=E6=8D=AE=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E6=88=90=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=8D=95=E6=95=B0=E6=8D=AE=E7=9A=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E9=80=9A=E7=9F=A5=E5=8D=95=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E7=B1=BBPurchaseStorage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PurchaseStorageController.java | 4 +- .../purchase/domain/PurchaseStorage.java | 294 ++++++++++-------- .../service/IPurchaseStorageService.java | 2 +- .../impl/PurchaseStorageServiceImpl.java | 22 +- 4 files changed, 190 insertions(+), 132 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java index c8d33fda..7f566d33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java @@ -63,9 +63,9 @@ public class PurchaseStorageController extends BaseController @Log(title = "采购入库通知单", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(PurchaseStorage purchaseStorage) + public AjaxResult export(WarehouseStorageOrder warehouseStorageOrder) { - List list = purchaseStorageService.selectPurchaseStorageList(purchaseStorage); + List list = purchaseStorageService.selectPurchaseStorageList(warehouseStorageOrder); ExcelUtil util = new ExcelUtil(PurchaseStorage.class); return util.exportExcel(list, "采购入库通知单数据"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java index 3cad5db9..5d24d48b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java @@ -1,7 +1,10 @@ package com.ruoyi.purchase.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; @@ -17,60 +20,66 @@ public class PurchaseStorage extends BaseEntity { private static final long serialVersionUID = 1L; - /** 采购入库单id */ - private Long purchaseStorageId; + /** 入库单id */ + private Long warehouseStorageId; /** 入库单号 */ @Excel(name = "入库单号") - private String purchaseStorageCode; + private String warehouseStorageCode; - /** 关联订单号 */ - @Excel(name = "关联订单号") - private String purchaseOrderCode; + /** 关联订单号(多种订单类型) */ + @Excel(name = "关联订单号", readConverterExp = "多=种订单类型") + private String relatedOrderCode; - /** 入库状态 */ - @Excel(name = "入库状态") - private String storageStatus; + /** 仓库入库状态 */ + @Excel(name = "仓库入库状态") + private String warehouseStorageStatus; - /** 品质状态 */ - @Excel(name = "品质状态") - private String qualityStatus; + /** 仓库品质状态 */ + @Excel(name = "仓库品质状态") + private String warehouseQualityStatus; - /** 入库类型 */ - @Excel(name = "入库类型") - private String purchaseStorageType; + /** 仓库入库类型 */ + @Excel(name = "仓库入库类型") + private String warehouseStorageType; - /** 订单类型 */ - @Excel(name = "订单类型") - private String purchaseOrderType; + /** 仓库订单类型 */ + @Excel(name = "仓库订单类型") + private String warehouseOrderType; - /** 入库部门 */ - @Excel(name = "入库部门") - private String purchaseDeptType; + /** 仓库入库部门类型 */ + @Excel(name = "仓库入库部门类型") + private String warehouseDeptType; /** 通知已到货数量 */ @Excel(name = "通知已到货数量") - private Long notifyArrivedNum; + private Integer notifyArrivedNum; /** 实际已到货数量 */ @Excel(name = "实际已到货数量") - private Long actualArrivedNum; + private Integer actualArrivedNum; /** 暂收合格数量 */ @Excel(name = "暂收合格数量") - private Long temporaryQualifiedNum; + private Integer temporaryQualifiedNum; /** 暂收不合格数量 */ @Excel(name = "暂收不合格数量") - private Long temporaryUnqualifiedNum; + private Integer temporaryUnqualifiedNum; /** 品质合格数量 */ @Excel(name = "品质合格数量") - private Long qualityQualifiedNum; + private Integer qualityQualifiedNum; + + + /** 品质不合格数量 */ + @Excel(name = "品质不合格数量") + private Integer qualityUnqualifiedNum; + /** 入库数量 */ @Excel(name = "入库数量") - private Long storageNum; + private Integer storageNum; /** 到货时间 */ @JsonFormat(pattern = "yyyy-MM-dd") @@ -97,246 +106,281 @@ public class PurchaseStorage extends BaseEntity @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") private Date storageTime; - /** 仓库员 */ - @Excel(name = "仓库员") - private String storageEmployee; + /** 仓库员工 */ + @Excel(name = "仓库员工") + private String warehouseEmployee; /** 仓库ID */ @Excel(name = "仓库ID") - private Long stockId; + private String warehouseCode; /** 仓库名称 */ @Excel(name = "仓库名称") - private String stockName; + private String warehouseName; + + /** 仓库详细地址 */ + @Excel(name = "仓库详细地址") + private String warehouseDetailAddress; - public void setPurchaseStorageId(Long purchaseStorageId) + /** 仓库入库单详情 */ + @Excel(name = "仓库名称") + private List warehouseStorageOrderDetailList; + public void setWarehouseStorageId(Long warehouseStorageId) { - this.purchaseStorageId = purchaseStorageId; + this.warehouseStorageId = warehouseStorageId; } - public Long getPurchaseStorageId() + public Long getWarehouseStorageId() { - return purchaseStorageId; + return warehouseStorageId; } - public void setPurchaseStorageCode(String purchaseStorageCode) + public void setWarehouseStorageCode(String warehouseStorageCode) { - this.purchaseStorageCode = purchaseStorageCode; + this.warehouseStorageCode = warehouseStorageCode; } - public String getPurchaseStorageCode() + public String getWarehouseStorageCode() { - return purchaseStorageCode; + return warehouseStorageCode; } - public void setPurchaseOrderCode(String purchaseOrderCode) + public void setRelatedOrderCode(String relatedOrderCode) { - this.purchaseOrderCode = purchaseOrderCode; + this.relatedOrderCode = relatedOrderCode; } - public String getPurchaseOrderCode() + public String getRelatedOrderCode() { - return purchaseOrderCode; + return relatedOrderCode; } - public void setStorageStatus(String storageStatus) + public void setWarehouseStorageStatus(String warehouseStorageStatus) { - this.storageStatus = storageStatus; + this.warehouseStorageStatus = warehouseStorageStatus; } - public String getStorageStatus() + public String getWarehouseStorageStatus() { - return storageStatus; + return warehouseStorageStatus; } - public void setQualityStatus(String qualityStatus) + public void setWarehouseQualityStatus(String warehouseQualityStatus) { - this.qualityStatus = qualityStatus; + this.warehouseQualityStatus = warehouseQualityStatus; } - public String getQualityStatus() + public String getWarehouseQualityStatus() { - return qualityStatus; + return warehouseQualityStatus; } - public void setPurchaseStorageType(String purchaseStorageType) + public void setWarehouseStorageType(String warehouseStorageType) { - this.purchaseStorageType = purchaseStorageType; + this.warehouseStorageType = warehouseStorageType; } - public String getPurchaseStorageType() + public String getWarehouseStorageType() { - return purchaseStorageType; + return warehouseStorageType; } - public void setPurchaseOrderType(String purchaseOrderType) + public void setWarehouseOrderType(String warehouseOrderType) { - this.purchaseOrderType = purchaseOrderType; + this.warehouseOrderType = warehouseOrderType; } - public String getPurchaseOrderType() + public String getWarehouseOrderType() { - return purchaseOrderType; + return warehouseOrderType; } - public void setPurchaseDeptType(String purchaseDeptType) + public void setWarehouseDeptType(String warehouseDeptType) { - this.purchaseDeptType = purchaseDeptType; + this.warehouseDeptType = warehouseDeptType; } - public String getPurchaseDeptType() + public String getWarehouseDeptType() { - return purchaseDeptType; + return warehouseDeptType; } - public void setNotifyArrivedNum(Long notifyArrivedNum) + public void setNotifyArrivedNum(Integer notifyArrivedNum) { this.notifyArrivedNum = notifyArrivedNum; } - public Long getNotifyArrivedNum() + public Integer getNotifyArrivedNum() { return notifyArrivedNum; } - public void setActualArrivedNum(Long actualArrivedNum) + public void setActualArrivedNum(Integer actualArrivedNum) { this.actualArrivedNum = actualArrivedNum; } - public Long getActualArrivedNum() + public Integer getActualArrivedNum() { return actualArrivedNum; } - public void setTemporaryQualifiedNum(Long temporaryQualifiedNum) + public void setTemporaryQualifiedNum(Integer temporaryQualifiedNum) { this.temporaryQualifiedNum = temporaryQualifiedNum; } - public Long getTemporaryQualifiedNum() + public Integer getTemporaryQualifiedNum() { return temporaryQualifiedNum; } - public void setTemporaryUnqualifiedNum(Long temporaryUnqualifiedNum) + public void setTemporaryUnqualifiedNum(Integer temporaryUnqualifiedNum) { this.temporaryUnqualifiedNum = temporaryUnqualifiedNum; } - public Long getTemporaryUnqualifiedNum() + public Integer getTemporaryUnqualifiedNum() { return temporaryUnqualifiedNum; } - public void setQualityQualifiedNum(Long qualityQualifiedNum) + public void setQualityQualifiedNum(Integer qualityQualifiedNum) { this.qualityQualifiedNum = qualityQualifiedNum; } - public Long getQualityQualifiedNum() + public Integer getQualityQualifiedNum() { return qualityQualifiedNum; } - public void setStorageNum(Long storageNum) + + public Integer getQualityUnqualifiedNum() { + return qualityUnqualifiedNum; + } + + public void setQualityUnqualifiedNum(Integer qualityUnqualifiedNum) { + this.qualityUnqualifiedNum = qualityUnqualifiedNum; + } + + public void setStorageNum(Integer storageNum) { this.storageNum = storageNum; } - public Long getStorageNum() + public Integer getStorageNum() { return storageNum; } - public void setArrivedTime(Date arrivedTime) + public void setArrivedTime(Date arrivedTime) { this.arrivedTime = arrivedTime; } - public Date getArrivedTime() + public Date getArrivedTime() { return arrivedTime; } - public void setTemporaryTime(Date temporaryTime) + public void setTemporaryTime(Date temporaryTime) { this.temporaryTime = temporaryTime; } - public Date getTemporaryTime() + public Date getTemporaryTime() { return temporaryTime; } - public void setDeliveryInspectionTime(Date deliveryInspectionTime) + public void setDeliveryInspectionTime(Date deliveryInspectionTime) { this.deliveryInspectionTime = deliveryInspectionTime; } - public Date getDeliveryInspectionTime() + public Date getDeliveryInspectionTime() { return deliveryInspectionTime; } - public void setQualityTime(Date qualityTime) + public void setQualityTime(Date qualityTime) { this.qualityTime = qualityTime; } - public Date getQualityTime() + public Date getQualityTime() { return qualityTime; } - public void setStorageTime(Date storageTime) + public void setStorageTime(Date storageTime) { this.storageTime = storageTime; } - public Date getStorageTime() + public Date getStorageTime() { return storageTime; } - public void setStorageEmployee(String storageEmployee) + public void setWarehouseEmployee(String warehouseEmployee) { - this.storageEmployee = storageEmployee; + this.warehouseEmployee = warehouseEmployee; } - public String getStorageEmployee() + public String getWarehouseEmployee() { - return storageEmployee; + return warehouseEmployee; } - public void setStockId(Long stockId) + public void setWarehouseCode(String warehouseCode) { - this.stockId = stockId; + this.warehouseCode = warehouseCode; } - public Long getStockId() + public String getWarehouseCode() { - return stockId; + return warehouseCode; } - public void setStockName(String stockName) + public void setWarehouseName(String warehouseName) { - this.stockName = stockName; + this.warehouseName = warehouseName; } - public String getStockName() + public String getWarehouseName() { - return stockName; + return warehouseName; + } + + public String getWarehouseDetailAddress() { + return warehouseDetailAddress; + } + + public void setWarehouseDetailAddress(String warehouseDetailAddress) { + this.warehouseDetailAddress = warehouseDetailAddress; + } + + public List getWarehouseStorageOrderDetailList() { + return warehouseStorageOrderDetailList; + } + + public void setWarehouseStorageOrderDetailList(List warehouseStorageOrderDetailList) { + this.warehouseStorageOrderDetailList = warehouseStorageOrderDetailList; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("purchaseStorageId", getPurchaseStorageId()) - .append("purchaseStorageCode", getPurchaseStorageCode()) - .append("purchaseOrderCode", getPurchaseOrderCode()) - .append("storageStatus", getStorageStatus()) - .append("qualityStatus", getQualityStatus()) - .append("purchaseStorageType", getPurchaseStorageType()) - .append("purchaseOrderType", getPurchaseOrderType()) - .append("purchaseDeptType", getPurchaseDeptType()) - .append("notifyArrivedNum", getNotifyArrivedNum()) - .append("actualArrivedNum", getActualArrivedNum()) - .append("temporaryQualifiedNum", getTemporaryQualifiedNum()) - .append("temporaryUnqualifiedNum", getTemporaryUnqualifiedNum()) - .append("qualityQualifiedNum", getQualityQualifiedNum()) - .append("storageNum", getStorageNum()) - .append("arrivedTime", getArrivedTime()) - .append("temporaryTime", getTemporaryTime()) - .append("deliveryInspectionTime", getDeliveryInspectionTime()) - .append("qualityTime", getQualityTime()) - .append("storageTime", getStorageTime()) - .append("storageEmployee", getStorageEmployee()) - .append("stockId", getStockId()) - .append("stockName", getStockName()) - .append("createTime", getCreateTime()) - .append("createBy", getCreateBy()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .toString(); + .append("warehouseStorageId", getWarehouseStorageId()) + .append("warehouseStorageCode", getWarehouseStorageCode()) + .append("relatedOrderCode", getRelatedOrderCode()) + .append("warehouseStorageStatus", getWarehouseStorageStatus()) + .append("warehouseQualityStatus", getWarehouseQualityStatus()) + .append("warehouseStorageType", getWarehouseStorageType()) + .append("warehouseOrderType", getWarehouseOrderType()) + .append("warehouseDeptType", getWarehouseDeptType()) + .append("notifyArrivedNum", getNotifyArrivedNum()) + .append("actualArrivedNum", getActualArrivedNum()) + .append("temporaryQualifiedNum", getTemporaryQualifiedNum()) + .append("temporaryUnqualifiedNum", getTemporaryUnqualifiedNum()) + .append("qualityQualifiedNum", getQualityQualifiedNum()) + .append("qualityUnqualifiedNum", getQualityUnqualifiedNum()) + .append("storageNum", getStorageNum()) + .append("arrivedTime", getArrivedTime()) + .append("temporaryTime", getTemporaryTime()) + .append("deliveryInspectionTime", getDeliveryInspectionTime()) + .append("qualityTime", getQualityTime()) + .append("storageTime", getStorageTime()) + .append("warehouseEmployee", getWarehouseEmployee()) + .append("warehouseCode", getWarehouseCode()) + .append("warehouseName", getWarehouseName()) + .append("warehouseDetailAddress",getWarehouseDetailAddress()) + .append("createTime", getCreateTime()) + .append("createBy", getCreateBy()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("warehouseStorageOrderDetailList",getWarehouseStorageOrderDetailList()) + .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java index b7deaf12..c0ca219f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java @@ -26,7 +26,7 @@ public interface IPurchaseStorageService * @param purchaseStorage 采购入库通知单 * @return 采购入库通知单集合 */ - public List selectPurchaseStorageList(PurchaseStorage purchaseStorage); + public List selectPurchaseStorageList(WarehouseStorageOrder warehouseStorageOrder); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java index 272c3616..88d653c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.purchase.service.impl; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -7,6 +8,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.purchase.mapper.PurchaseStorageMapper; @@ -42,15 +44,27 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService } /** - * 查询采购入库通知单列表 + * 查询仓库入库单的采购入库通知单列表 用于数据的导出 * - * @param purchaseStorage 采购入库通知单 + * @param warehouseStorageOrder 采购入库通知单 * @return 采购入库通知单 */ @Override - public List selectPurchaseStorageList(PurchaseStorage purchaseStorage) + public List selectPurchaseStorageList(WarehouseStorageOrder warehouseStorageOrder) { - return purchaseStorageMapper.selectPurchaseStorageList(purchaseStorage); + List allWarehouseStorageOrders = warehouseStorageOrderMapper.selectWarehouseStorageOrderList(warehouseStorageOrder); + List purchaseStorages = new ArrayList<>(); + // 使用流过滤出warehouseOrderType为"0"的记录 也就是采购订单 + List filteredWarehouseStorageOrders = allWarehouseStorageOrders.stream() + .filter(s -> "0".equals(s.getWarehouseOrderType())) + .collect(Collectors.toList()); + + for (WarehouseStorageOrder wso : filteredWarehouseStorageOrders) { + PurchaseStorage ps = new PurchaseStorage(); + BeanUtils.copyProperties(wso, ps); + purchaseStorages.add(ps); + } + return purchaseStorages; } @Override