Browse Source

[feat]仓库管理

按照新版prd调整:采购入库单主表、实体类、mapper.xml层的所有方法新增供应商Id、供应商名称、联系人、联系电话、公司地址
删除旧版采购订单新增采购入库单的方法
dev
liuxiaoxu 7 hours ago
parent
commit
53c81222ea
  1. 42
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseStorage.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java
  3. 92
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  4. 14
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageMapper.xml

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

@ -56,6 +56,19 @@ public class PurchaseStorage extends BaseEntity
@Excel(name = "供应商名称")
private String supplierName;
/** 联系人 */
@Excel(name = "联系人")
private String customerContact;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactNumber;
/** 公司地址 */
@Excel(name = "公司地址")
private String supplierAddress;
/** 通知已到货数量 */
@Excel(name = "通知已到货数量")
private Integer notifyArrivedSum;
@ -211,6 +224,32 @@ public class PurchaseStorage extends BaseEntity
{
return supplierName;
}
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 getSupplierAddress() {
return supplierAddress;
}
public void setSupplierAddress(String supplierAddress) {
this.supplierAddress = supplierAddress;
}
public void setNotifyArrivedSum(Integer notifyArrivedSum)
{
this.notifyArrivedSum = notifyArrivedSum;
@ -360,6 +399,9 @@ public class PurchaseStorage extends BaseEntity
.append("warehouseDeptType", getWarehouseDeptType())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("customerContact", getCustomerContact())
.append("contactNumber", getContactNumber())
.append("supplierAddress", getSupplierAddress())
.append("notifyArrivedSum", getNotifyArrivedSum())
.append("actualArrivedSum", getActualArrivedSum())
.append("temporaryQualifiedSum", getTemporaryQualifiedSum())

4
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java

@ -96,10 +96,6 @@ public interface IPurchaseOrderService
PurchaseOrder selectPurchaseOrderByOrderCode(String purchaseOrderCode);
/*
* 采购订单创建采购入库通知单
* */
int addPurchaseOrderStorage(WarehouseStorageOrder warehouseStorageOrder);
Integer addPurchaseOrderPayable(PurchaseOrder purchaseOrder);

92
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java

@ -855,98 +855,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
}
/**
* 采购订单创建采购入库通知单
* */
@Override
@Transactional(rollbackFor = RuntimeException.class)
public int addPurchaseOrderStorage(WarehouseStorageOrder warehouseStorageOrder){
WarehouseStorageOrder warehouseStorageOrder1 = new WarehouseStorageOrder();
String relatedOrderCode = warehouseStorageOrder.getRelatedOrderCode();
warehouseStorageOrder1.setRelatedOrderCode(relatedOrderCode);
//关联开发修改单,修改开发修改单的状态
ErpDevelopModifyorder developModifyorder = developModifyorderMapper.selectErpDevelopModifyorderByCode(relatedOrderCode);
if (developModifyorder != null){
developModifyorder.setPurchaseStorageStatus("2");
developModifyorderMapper.updateErpDevelopModifyorder(developModifyorder);
}
List<WarehouseStorageOrder> warehouseStorageOrderList = warehouseStorageOrderMapper.selectWarehouseStorageOrderList(warehouseStorageOrder1);
List<WarehouseStorageOrderDetail> list = warehouseStorageOrder.getWarehouseStorageOrderDetailList();
//子表中通知到货数位过滤掉物料数位空
list = list.stream().filter(e -> (e.getNotifyArriveNum() != null && e.getNotifyArriveNum() != 0)).collect(Collectors.toList());
int result = 0;
if(!CollectionUtils.isEmpty(list)) {
//根据物料入库部门划分入库单,入库单类型:0 仓库,1 采购,生成入库单号
List<WarehouseStorageOrderDetail> list1 = list.stream().filter(e -> ("1").equals(e.getMaterialDeptType())).collect(Collectors.toList());
List<WarehouseStorageOrderDetail> list2 = list.stream().filter(e -> ("0").equals(e.getMaterialDeptType())).collect(Collectors.toList());
//WarehouseStorageStatus 仓库入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库),
//WarehouseStorageType 仓库入库类型(0采购入库、1供应商补货、2委内入库、3公司退货、4委外入库、5生产入库),
//setWarehouseOrderType仓库订单类型(0采购订单、1生产订单、2退换货订单、3委外订单),
//WarehouseDeptType 仓库入库部门类型(0仓库,1采购 ),
//通知到货数1
Integer notifyArrivedNum = 0;
Integer notifyArrivedNum1 = 0;
//通知到货数2
if(list1.size() > 0) {
//仓库入库单,物料入库列表信息读取,放入生成的入库订单号
String warehouseStorageCode = redisCache.generateBillNo("RK");
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list1) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode);
warehouseStorageOrderDetail.setWarehouseStorageType("0");
warehouseStorageOrderDetail.setMaterialDeptType("1");
warehouseStorageOrderDetail.setWarehouseDeptType("1");
notifyArrivedNum = notifyArrivedNum + warehouseStorageOrderDetail.getNotifyArriveNum();
storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail);
}
warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode);
warehouseStorageOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode());
warehouseStorageOrder.setWarehouseStorageStatus("0");
warehouseStorageOrder.setWarehouseQualityStatus("0");
warehouseStorageOrder.setWarehouseStorageType("0");
warehouseStorageOrder.setWarehouseOrderType("0");
warehouseStorageOrder.setWarehouseDeptType("1");
warehouseStorageOrder.setNotifyArrivedNum(notifyArrivedNum);
warehouseStorageOrder.setCreateTime(DateUtils.getNowDate());
warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName());
notifyArrivedNum = notifyArrivedNum + warehouseStorageOrder.getNotifyArrivedNum();
result = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder);
}
if(list2.size() > 0) {
String warehouseStorageCode1 = redisCache.generateBillNo("RK");
//入库部门类型:采购入库单
for (WarehouseStorageOrderDetail warehouseStorageOrderDetail: list2) {
warehouseStorageOrderDetail.setWarehouseStorageCode(warehouseStorageCode1);
warehouseStorageOrderDetail.setWarehouseStorageType("0");
warehouseStorageOrderDetail.setMaterialDeptType("0");
warehouseStorageOrderDetail.setWarehouseDeptType("0");
notifyArrivedNum1 = notifyArrivedNum + warehouseStorageOrderDetail.getNotifyArriveNum();
storageOrderDetailMapper.insertWarehouseStorageOrderDetail(warehouseStorageOrderDetail);
}
//入库代表为仓库部分的入库单
//WarehouseStorageStatus 仓库入库状态(0待暂收、1已暂收、2待入库、3部分入库、4全部入库),
//WarehouseStorageType 仓库入库类型(0采购入库、1供应商补货、2委内入库、3公司退货、4委外入库、5生产入库),
//setWarehouseOrderType仓库订单类型(0采购订单、1生产订单、2退换货订单、3委外订单),
//WarehouseDeptType 仓库入库部门类型(0仓库,1采购 ),
warehouseStorageOrder.setWarehouseStorageCode(warehouseStorageCode1);
warehouseStorageOrder.setRelatedOrderCode(warehouseStorageOrder.getRelatedOrderCode());
warehouseStorageOrder.setWarehouseStorageStatus("0");
warehouseStorageOrder.setWarehouseQualityStatus("0");
warehouseStorageOrder.setWarehouseStorageType("0");
warehouseStorageOrder.setWarehouseOrderType("0");
warehouseStorageOrder.setWarehouseDeptType("0");
warehouseStorageOrder.setNotifyArrivedNum(notifyArrivedNum1);
warehouseStorageOrder.setCreateTime(DateUtils.getNowDate());
warehouseStorageOrder.setCreateBy(ShiroUtils.getLoginName());
warehouseStorageOrder.setWarehouseStorageOrderDetailList(list2);
result = warehouseStorageOrderMapper.insertWarehouseStorageOrder(warehouseStorageOrder);
}
}
return result;
}
@Transactional(rollbackFor = Exception.class)
@Override
public Integer addPurchaseOrderPayable(PurchaseOrder purchaseOrder){

14
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseStorageMapper.xml

@ -15,6 +15,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="warehouseDeptType" column="warehouse_dept_type" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="customerContact" column="customer_contact" />
<result property="contactNumber" column="contact_number" />
<result property="supplierAddress" column="supplier_address" />
<result property="notifyArrivedSum" column="notify_arrived_sum" />
<result property="actualArrivedSum" column="actual_arrived_sum" />
<result property="temporaryQualifiedSum" column="temporary_qualified_sum" />
@ -37,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectPurchaseStorageVo">
select purchase_storage_id, warehouse_storage_code, related_order_code, warehouse_storage_status, warehouse_quality_status, warehouse_storage_type, warehouse_order_type, warehouse_dept_type, supplier_code, supplier_name, notify_arrived_sum, actual_arrived_sum, temporary_qualified_sum, temporary_unqualified_sum, quality_qualified_sum, refunds_exchanges_sum, storage_sum, arrived_time, temporary_time, delivery_inspection_time, quality_time, storage_time, warehouse_employee, warehouse_code, warehouse_name, create_time, create_by, update_by, update_time from purchase_storage
select purchase_storage_id, warehouse_storage_code, related_order_code, warehouse_storage_status, warehouse_quality_status, warehouse_storage_type, warehouse_order_type, warehouse_dept_type, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, notify_arrived_sum, actual_arrived_sum, temporary_qualified_sum, temporary_unqualified_sum, quality_qualified_sum, refunds_exchanges_sum, storage_sum, arrived_time, temporary_time, delivery_inspection_time, quality_time, storage_time, warehouse_employee, warehouse_code, warehouse_name, create_time, create_by, update_by, update_time from purchase_storage
</sql>
<select id="selectPurchaseStorageList" parameterType="PurchaseStorage" resultMap="PurchaseStorageResult">
@ -73,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseDeptType != null">warehouse_dept_type,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="customerContact != null">customer_contact,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="supplierAddress != null">supplier_address,</if>
<if test="notifyArrivedSum != null">notify_arrived_sum,</if>
<if test="actualArrivedSum != null">actual_arrived_sum,</if>
<if test="temporaryQualifiedSum != null">temporary_qualified_sum,</if>
@ -103,6 +109,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseDeptType != null">#{warehouseDeptType},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="customerContact != null">#{customerContact},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="supplierAddress != null">#{supplierAddress},</if>
<if test="notifyArrivedSum != null">#{notifyArrivedSum},</if>
<if test="actualArrivedSum != null">#{actualArrivedSum},</if>
<if test="temporaryQualifiedSum != null">#{temporaryQualifiedSum},</if>
@ -137,6 +146,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="warehouseDeptType != null">warehouse_dept_type = #{warehouseDeptType},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="supplierAddress != null">supplier_address = #{supplierAddress},</if>
<if test="notifyArrivedSum != null">notify_arrived_sum = #{notifyArrivedSum},</if>
<if test="actualArrivedSum != null">actual_arrived_sum = #{actualArrivedSum},</if>
<if test="temporaryQualifiedSum != null">temporary_qualified_sum = #{temporaryQualifiedSum},</if>

Loading…
Cancel
Save