Browse Source

[fix]采购管理:

采购入库通知单
新增采购入库通知单导出功能
新增查询仓库入库单的数据转换成采购入库通知单数据的查询接口
新增采购入库通知单实体类PurchaseStorage
dev
liuxiaoxu 5 months ago
parent
commit
f9240b1143
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java
  2. 294
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java
  4. 22
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java

4
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) @Log(title = "采购入库通知单", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
public AjaxResult export(PurchaseStorage purchaseStorage) public AjaxResult export(WarehouseStorageOrder warehouseStorageOrder)
{ {
List<PurchaseStorage> list = purchaseStorageService.selectPurchaseStorageList(purchaseStorage); List<PurchaseStorage> list = purchaseStorageService.selectPurchaseStorageList(warehouseStorageOrder);
ExcelUtil<PurchaseStorage> util = new ExcelUtil<PurchaseStorage>(PurchaseStorage.class); ExcelUtil<PurchaseStorage> util = new ExcelUtil<PurchaseStorage>(PurchaseStorage.class);
return util.exportExcel(list, "采购入库通知单数据"); return util.exportExcel(list, "采购入库通知单数据");
} }

294
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java

@ -1,7 +1,10 @@
package com.ruoyi.purchase.domain; package com.ruoyi.purchase.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; 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.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;
@ -17,60 +20,66 @@ public class PurchaseStorage extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 采购入库单id */ /** 入库单id */
private Long purchaseStorageId; private Long warehouseStorageId;
/** 入库单号 */ /** 入库单号 */
@Excel(name = "入库单号") @Excel(name = "入库单号")
private String purchaseStorageCode; private String warehouseStorageCode;
/** 关联订单号 */ /** 关联订单号(多种订单类型) */
@Excel(name = "关联订单号") @Excel(name = "关联订单号", readConverterExp = "多=种订单类型")
private String purchaseOrderCode; private String relatedOrderCode;
/** 入库状态 */ /** 仓库入库状态 */
@Excel(name = "入库状态") @Excel(name = "仓库入库状态")
private String storageStatus; private String warehouseStorageStatus;
/** 品质状态 */ /** 仓库品质状态 */
@Excel(name = "品质状态") @Excel(name = "仓库品质状态")
private String qualityStatus; private String warehouseQualityStatus;
/** 入库类型 */ /** 仓库入库类型 */
@Excel(name = "入库类型") @Excel(name = "仓库入库类型")
private String purchaseStorageType; private String warehouseStorageType;
/** 订单类型 */ /** 仓库订单类型 */
@Excel(name = "订单类型") @Excel(name = "仓库订单类型")
private String purchaseOrderType; private String warehouseOrderType;
/** 入库部门 */ /** 仓库入库部门类型 */
@Excel(name = "入库部门") @Excel(name = "仓库入库部门类型")
private String purchaseDeptType; private String warehouseDeptType;
/** 通知已到货数量 */ /** 通知已到货数量 */
@Excel(name = "通知已到货数量") @Excel(name = "通知已到货数量")
private Long notifyArrivedNum; private Integer notifyArrivedNum;
/** 实际已到货数量 */ /** 实际已到货数量 */
@Excel(name = "实际已到货数量") @Excel(name = "实际已到货数量")
private Long actualArrivedNum; private Integer actualArrivedNum;
/** 暂收合格数量 */ /** 暂收合格数量 */
@Excel(name = "暂收合格数量") @Excel(name = "暂收合格数量")
private Long temporaryQualifiedNum; private Integer temporaryQualifiedNum;
/** 暂收不合格数量 */ /** 暂收不合格数量 */
@Excel(name = "暂收不合格数量") @Excel(name = "暂收不合格数量")
private Long temporaryUnqualifiedNum; private Integer temporaryUnqualifiedNum;
/** 品质合格数量 */ /** 品质合格数量 */
@Excel(name = "品质合格数量") @Excel(name = "品质合格数量")
private Long qualityQualifiedNum; private Integer qualityQualifiedNum;
/** 品质不合格数量 */
@Excel(name = "品质不合格数量")
private Integer qualityUnqualifiedNum;
/** 入库数量 */ /** 入库数量 */
@Excel(name = "入库数量") @Excel(name = "入库数量")
private Long storageNum; private Integer storageNum;
/** 到货时间 */ /** 到货时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@ -97,246 +106,281 @@ public class PurchaseStorage extends BaseEntity
@Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "入库时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date storageTime; private Date storageTime;
/** 仓库员 */ /** 仓库员 */
@Excel(name = "仓库员") @Excel(name = "仓库员")
private String storageEmployee; private String warehouseEmployee;
/** 仓库ID */ /** 仓库ID */
@Excel(name = "仓库ID") @Excel(name = "仓库ID")
private Long stockId; private String warehouseCode;
/** 仓库名称 */ /** 仓库名称 */
@Excel(name = "仓库名称") @Excel(name = "仓库名称")
private String stockName; private String warehouseName;
/** 仓库详细地址 */
@Excel(name = "仓库详细地址")
private String warehouseDetailAddress;
public void setPurchaseStorageId(Long purchaseStorageId) /** 仓库入库单详情 */
@Excel(name = "仓库名称")
private List<WarehouseStorageOrderDetail> 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; this.notifyArrivedNum = notifyArrivedNum;
} }
public Long getNotifyArrivedNum() public Integer getNotifyArrivedNum()
{ {
return notifyArrivedNum; return notifyArrivedNum;
} }
public void setActualArrivedNum(Long actualArrivedNum) public void setActualArrivedNum(Integer actualArrivedNum)
{ {
this.actualArrivedNum = actualArrivedNum; this.actualArrivedNum = actualArrivedNum;
} }
public Long getActualArrivedNum() public Integer getActualArrivedNum()
{ {
return actualArrivedNum; return actualArrivedNum;
} }
public void setTemporaryQualifiedNum(Long temporaryQualifiedNum) public void setTemporaryQualifiedNum(Integer temporaryQualifiedNum)
{ {
this.temporaryQualifiedNum = temporaryQualifiedNum; this.temporaryQualifiedNum = temporaryQualifiedNum;
} }
public Long getTemporaryQualifiedNum() public Integer getTemporaryQualifiedNum()
{ {
return temporaryQualifiedNum; return temporaryQualifiedNum;
} }
public void setTemporaryUnqualifiedNum(Long temporaryUnqualifiedNum) public void setTemporaryUnqualifiedNum(Integer temporaryUnqualifiedNum)
{ {
this.temporaryUnqualifiedNum = temporaryUnqualifiedNum; this.temporaryUnqualifiedNum = temporaryUnqualifiedNum;
} }
public Long getTemporaryUnqualifiedNum() public Integer getTemporaryUnqualifiedNum()
{ {
return temporaryUnqualifiedNum; return temporaryUnqualifiedNum;
} }
public void setQualityQualifiedNum(Long qualityQualifiedNum) public void setQualityQualifiedNum(Integer qualityQualifiedNum)
{ {
this.qualityQualifiedNum = qualityQualifiedNum; this.qualityQualifiedNum = qualityQualifiedNum;
} }
public Long getQualityQualifiedNum() public Integer getQualityQualifiedNum()
{ {
return qualityQualifiedNum; 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; this.storageNum = storageNum;
} }
public Long getStorageNum() public Integer getStorageNum()
{ {
return storageNum; return storageNum;
} }
public void setArrivedTime(Date arrivedTime) public void setArrivedTime(Date arrivedTime)
{ {
this.arrivedTime = arrivedTime; this.arrivedTime = arrivedTime;
} }
public Date getArrivedTime() public Date getArrivedTime()
{ {
return arrivedTime; return arrivedTime;
} }
public void setTemporaryTime(Date temporaryTime) public void setTemporaryTime(Date temporaryTime)
{ {
this.temporaryTime = temporaryTime; this.temporaryTime = temporaryTime;
} }
public Date getTemporaryTime() public Date getTemporaryTime()
{ {
return temporaryTime; return temporaryTime;
} }
public void setDeliveryInspectionTime(Date deliveryInspectionTime) public void setDeliveryInspectionTime(Date deliveryInspectionTime)
{ {
this.deliveryInspectionTime = deliveryInspectionTime; this.deliveryInspectionTime = deliveryInspectionTime;
} }
public Date getDeliveryInspectionTime() public Date getDeliveryInspectionTime()
{ {
return deliveryInspectionTime; return deliveryInspectionTime;
} }
public void setQualityTime(Date qualityTime) public void setQualityTime(Date qualityTime)
{ {
this.qualityTime = qualityTime; this.qualityTime = qualityTime;
} }
public Date getQualityTime() public Date getQualityTime()
{ {
return qualityTime; return qualityTime;
} }
public void setStorageTime(Date storageTime) public void setStorageTime(Date storageTime)
{ {
this.storageTime = storageTime; this.storageTime = storageTime;
} }
public Date getStorageTime() public Date getStorageTime()
{ {
return storageTime; 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<WarehouseStorageOrderDetail> getWarehouseStorageOrderDetailList() {
return warehouseStorageOrderDetailList;
}
public void setWarehouseStorageOrderDetailList(List<WarehouseStorageOrderDetail> warehouseStorageOrderDetailList) {
this.warehouseStorageOrderDetailList = warehouseStorageOrderDetailList;
} }
@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("purchaseStorageId", getPurchaseStorageId()) .append("warehouseStorageId", getWarehouseStorageId())
.append("purchaseStorageCode", getPurchaseStorageCode()) .append("warehouseStorageCode", getWarehouseStorageCode())
.append("purchaseOrderCode", getPurchaseOrderCode()) .append("relatedOrderCode", getRelatedOrderCode())
.append("storageStatus", getStorageStatus()) .append("warehouseStorageStatus", getWarehouseStorageStatus())
.append("qualityStatus", getQualityStatus()) .append("warehouseQualityStatus", getWarehouseQualityStatus())
.append("purchaseStorageType", getPurchaseStorageType()) .append("warehouseStorageType", getWarehouseStorageType())
.append("purchaseOrderType", getPurchaseOrderType()) .append("warehouseOrderType", getWarehouseOrderType())
.append("purchaseDeptType", getPurchaseDeptType()) .append("warehouseDeptType", getWarehouseDeptType())
.append("notifyArrivedNum", getNotifyArrivedNum()) .append("notifyArrivedNum", getNotifyArrivedNum())
.append("actualArrivedNum", getActualArrivedNum()) .append("actualArrivedNum", getActualArrivedNum())
.append("temporaryQualifiedNum", getTemporaryQualifiedNum()) .append("temporaryQualifiedNum", getTemporaryQualifiedNum())
.append("temporaryUnqualifiedNum", getTemporaryUnqualifiedNum()) .append("temporaryUnqualifiedNum", getTemporaryUnqualifiedNum())
.append("qualityQualifiedNum", getQualityQualifiedNum()) .append("qualityQualifiedNum", getQualityQualifiedNum())
.append("storageNum", getStorageNum()) .append("qualityUnqualifiedNum", getQualityUnqualifiedNum())
.append("arrivedTime", getArrivedTime()) .append("storageNum", getStorageNum())
.append("temporaryTime", getTemporaryTime()) .append("arrivedTime", getArrivedTime())
.append("deliveryInspectionTime", getDeliveryInspectionTime()) .append("temporaryTime", getTemporaryTime())
.append("qualityTime", getQualityTime()) .append("deliveryInspectionTime", getDeliveryInspectionTime())
.append("storageTime", getStorageTime()) .append("qualityTime", getQualityTime())
.append("storageEmployee", getStorageEmployee()) .append("storageTime", getStorageTime())
.append("stockId", getStockId()) .append("warehouseEmployee", getWarehouseEmployee())
.append("stockName", getStockName()) .append("warehouseCode", getWarehouseCode())
.append("createTime", getCreateTime()) .append("warehouseName", getWarehouseName())
.append("createBy", getCreateBy()) .append("warehouseDetailAddress",getWarehouseDetailAddress())
.append("updateBy", getUpdateBy()) .append("createTime", getCreateTime())
.append("updateTime", getUpdateTime()) .append("createBy", getCreateBy())
.toString(); .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("warehouseStorageOrderDetailList",getWarehouseStorageOrderDetailList())
.toString();
} }
} }

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseStorageService.java

@ -26,7 +26,7 @@ public interface IPurchaseStorageService
* @param purchaseStorage 采购入库通知单 * @param purchaseStorage 采购入库通知单
* @return 采购入库通知单集合 * @return 采购入库通知单集合
*/ */
public List<PurchaseStorage> selectPurchaseStorageList(PurchaseStorage purchaseStorage); public List<PurchaseStorage> selectPurchaseStorageList(WarehouseStorageOrder warehouseStorageOrder);
/** /**

22
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseStorageServiceImpl.java

@ -1,5 +1,6 @@
package com.ruoyi.purchase.service.impl; package com.ruoyi.purchase.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -7,6 +8,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper; import com.ruoyi.warehouse.mapper.WarehouseStorageOrderMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchaseStorageMapper; import com.ruoyi.purchase.mapper.PurchaseStorageMapper;
@ -42,15 +44,27 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService
} }
/** /**
* 查询采购入库通知单列表 * 查询仓库入库单的采购入库通知单列表 用于数据的导出
* *
* @param purchaseStorage 采购入库通知单 * @param warehouseStorageOrder 采购入库通知单
* @return 采购入库通知单 * @return 采购入库通知单
*/ */
@Override @Override
public List<PurchaseStorage> selectPurchaseStorageList(PurchaseStorage purchaseStorage) public List<PurchaseStorage> selectPurchaseStorageList(WarehouseStorageOrder warehouseStorageOrder)
{ {
return purchaseStorageMapper.selectPurchaseStorageList(purchaseStorage); List<WarehouseStorageOrder> allWarehouseStorageOrders = warehouseStorageOrderMapper.selectWarehouseStorageOrderList(warehouseStorageOrder);
List<PurchaseStorage> purchaseStorages = new ArrayList<>();
// 使用流过滤出warehouseOrderType为"0"的记录 也就是采购订单
List<WarehouseStorageOrder> 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 @Override

Loading…
Cancel
Save