Browse Source

1.库存品数量

training
0.0 1 year ago
parent
commit
0a8be6bec4
  1. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml
  2. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java
  3. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java
  4. 13
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml

@ -19,10 +19,10 @@
FROM logpm_warehouse_goods_allocation ${ew.customSqlSegment}
</select>
<select id="selectnum" resultType="com.logpm.warehouse.vo.WarehouseGoodsAllocationVO">
SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN 1 END), 0) orderNum,
COALESCE(SUM(CASE WHEN association_type = '2' THEN 1 END), 0) lessNum,
COALESCE(SUM(CASE WHEN association_type = '3' THEN 1 END), 0) packageNum,
COALESCE(SUM(CASE WHEN association_type = '4' THEN 1 END), 0) inventoryNum
SELECT COALESCE(SUM(CASE WHEN association_type = '1' THEN num END), 0) orderNum,
COALESCE(SUM(CASE WHEN association_type = '2' THEN num END), 0) lessNum,
COALESCE(SUM(CASE WHEN association_type = '3' THEN num END), 0) packageNum,
COALESCE(SUM(CASE WHEN association_type = '4' THEN num END), 0) inventoryNum
FROM logpm_warehouse_updown_goods
where allocation_id = #{id}
and is_deleted = 0
@ -238,7 +238,7 @@
left JOIN logpm_warehouse_updown_goods lwug ON ldsl.material_id = lwug.association_id
left join logpm_basicdata_material lbm on lbm.id =ldsl.material_id
<where>
lwug.association_id is null and ldsl.is_deleted = 0
(ldsl.quantity_stock > lwug.num or lwug.association_id is null) and ldsl.is_deleted = 0
<if test="param.orderCode!=null and param.orderCode !=''">
and ldpl.order_code like concat('%',#{param.orderCode},'%')
</if>

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java

@ -207,11 +207,12 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl<Warehou
for (WarehouseStockListZationVO warehouseStockListZationVO : list) {
Integer quantityStock = warehouseStockListZationVO.getQuantityStock();
Long id = warehouseStockListZationVO.getId();
log.info("传入id>>>>>>>>>>>>{}",id);
//查询库位数量
Integer num1 = warehouseUpdownGoodsService.getNumByZation(id);
//查询不在库位的托盘数量
Integer num2 =warehouseTrayGoodsService.getNumByZation(id);
warehouseStockListZationVO.setResidueNumber(quantityStock-(null==num1?0:num1)-(null==num2?0:num2));
//Integer num2 =warehouseTrayGoodsService.getNumByZation(id); -(null==num2?0:num2)
warehouseStockListZationVO.setResidueNumber(quantityStock-(null==num1?0:num1));
}
return page.setRecords(list);
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

@ -210,6 +210,7 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
@Override
public Integer getNumByZation(Long id) {
log.info("id>>>>>>>>>>{}",id);
return baseMapper.getNumByZation(id);
}

13
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1609,13 +1609,16 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
.eq("association_value",materialCode)
.eq("incoming_batch",incomingBatch);
WarehouseUpdownGoodsEntity updownGoodsEntity = warehouseUpdownGoodsService.getOne(queryWrapper);
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch);
if(!Objects.isNull(updownGoodsEntity)){
Integer num = updownGoodsEntity.getNum();
if (enterNum>num){
int i = num + enterNum;
//对比原库存数量
if (i>stockListEntity.getQuantityStock()){
stringBuffer.append("{").append(materialCode).append("},");
continue;
}
updownGoodsEntity.setNum(num+enterNum);
updownGoodsEntity.setNum(i);
updownGoodsList.add(updownGoodsEntity);
//存入日志对象
WarehouseUpdownGoodsEntity oldUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
@ -1624,7 +1627,11 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
oldUpdownGoodsEntity.setId(null);
updownGoodsLogList.add(oldUpdownGoodsEntity);
}else{
DistributionStockListEntity stockListEntity = distributionStockListClient.getEntityByMarketIdAndMaterialCodeAndIncomingBatch(marketId, materialCode,incomingBatch);
//对比原库存数量
if (enterNum>stockListEntity.getQuantityStock()){
stringBuffer.append("{").append(materialCode).append("},");
continue;
}
updownGoodsEntity = new WarehouseUpdownGoodsEntity();
updownGoodsEntity.setUpdownTypeId(updownTypeEntity.getId());
updownGoodsEntity.setAreaId(updownTypeEntity.getAreaId());

Loading…
Cancel
Save