Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
+28
@@ -300,6 +300,34 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
? exist.getAllocationQuantity()
|
||||
: BigDecimal.ZERO;
|
||||
exist.setAllocationQuantity(existAlloc.add(delta));
|
||||
// 净重累加
|
||||
if (materialInventoryDO.getNetWeight() != null) {
|
||||
BigDecimal existNetWeight = exist.getNetWeight() != null
|
||||
? exist.getNetWeight()
|
||||
: BigDecimal.ZERO;
|
||||
exist.setNetWeight(existNetWeight.add(materialInventoryDO.getNetWeight()));
|
||||
}
|
||||
// 毛重累加
|
||||
if (materialInventoryDO.getGrossWeight() != null) {
|
||||
BigDecimal existGrossWeight = exist.getGrossWeight() != null
|
||||
? exist.getGrossWeight()
|
||||
: BigDecimal.ZERO;
|
||||
exist.setGrossWeight(existGrossWeight.add(materialInventoryDO.getGrossWeight()));
|
||||
}
|
||||
// 体积累加
|
||||
if (materialInventoryDO.getVolume() != null) {
|
||||
BigDecimal existVolume = exist.getVolume() != null
|
||||
? exist.getVolume()
|
||||
: BigDecimal.ZERO;
|
||||
exist.setVolume(existVolume.add(materialInventoryDO.getVolume()));
|
||||
}
|
||||
// 面积累加
|
||||
if (materialInventoryDO.getArea() != null) {
|
||||
BigDecimal existArea = exist.getArea() != null
|
||||
? exist.getArea()
|
||||
: BigDecimal.ZERO;
|
||||
exist.setArea(existArea.add(materialInventoryDO.getArea()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-5
@@ -436,11 +436,11 @@ public class ShiftManageDomainService {
|
||||
MaterialInventory materialInventoryOldDb = materialInventoryService.getById(shiftMaterialDetailPO.getMaterialInventoryId());
|
||||
BigDecimal shiftQuantity = shiftMaterialDetailPO.getShiftQuantity();
|
||||
//构建新物料库存信息
|
||||
shiftMaterialDetailPO.setNetWeight(materialInventoryOldDb.getNetWeight());
|
||||
shiftMaterialDetailPO.setGrossWeight(materialInventoryOldDb.getGrossWeight());
|
||||
shiftMaterialDetailPO.setVolume(materialInventoryOldDb.getVolume());
|
||||
shiftMaterialDetailPO.setArea(materialInventoryOldDb.getArea());
|
||||
shiftMaterialDetailPO.setMaterialInventoryId(materialInventoryOldDb.getMaterialInventoryId());
|
||||
// shiftMaterialDetailPO.setNetWeight(materialInventoryOldDb.getNetWeight());
|
||||
// shiftMaterialDetailPO.setGrossWeight(materialInventoryOldDb.getGrossWeight());
|
||||
// shiftMaterialDetailPO.setVolume(materialInventoryOldDb.getVolume());
|
||||
// shiftMaterialDetailPO.setArea(materialInventoryOldDb.getArea());
|
||||
// shiftMaterialDetailPO.setMaterialInventoryId(materialInventoryOldDb.getMaterialInventoryId());
|
||||
materialInventoryNowList.add(genMaterialInventory(shiftMaterialDetailPO));
|
||||
List<ShiftMaterialDetailPO> shiftMaterialDetailPOChildrenList = shiftMaterialDetailPO.getChildren();
|
||||
for (ShiftMaterialDetailPO shiftMaterialDetailPOChildren : shiftMaterialDetailPOChildrenList){
|
||||
@@ -456,6 +456,10 @@ public class ShiftManageDomainService {
|
||||
materialInventoryDOOld.setMaterialInventoryId(shiftMaterialDetailPO.getMaterialInventoryId());
|
||||
materialInventoryDOOld.setInventoryQuantity(shiftQuantity);
|
||||
materialInventoryDOOld.setAllocationQuantity(shiftQuantity);
|
||||
materialInventoryDOOld.setNetWeight(shiftMaterialDetailPO.getNetWeight());
|
||||
materialInventoryDOOld.setGrossWeight(shiftMaterialDetailPO.getGrossWeight());
|
||||
materialInventoryDOOld.setVolume(shiftMaterialDetailPO.getVolume());
|
||||
materialInventoryDOOld.setArea(shiftMaterialDetailPO.getArea());
|
||||
materialInventoryOldList.add(materialInventoryDOOld);
|
||||
}
|
||||
|
||||
|
||||
@@ -342,6 +342,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHEN #{item.materialInventoryId} THEN allocation_quantity + #{item.inventoryQuantity}
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="net_weight = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(net_weight + #{item.netWeight}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="gross_weight = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(gross_weight + #{item.grossWeight}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="volume = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(volume + #{item.volume}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<trim prefix="area = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(area + #{item.area}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
update_by = #{updateBy},
|
||||
update_by_name = #{updateByName},
|
||||
update_time = #{updateTime}
|
||||
@@ -365,6 +385,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST( allocation_quantity - #{item.inventoryQuantity}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<!-- 净重直接减 -->
|
||||
<trim prefix="net_weight = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(net_weight - #{item.netWeight}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<!-- 毛重直接减 -->
|
||||
<trim prefix="gross_weight = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(gross_weight - #{item.grossWeight}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<!-- 体积直接减 -->
|
||||
<trim prefix="volume = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(volume - #{item.volume}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
<!-- 面积直接减 -->
|
||||
<trim prefix="area = CASE material_inventory_id" suffix="END,">
|
||||
<foreach collection="materialInventoryDOList" item="item" index="index">
|
||||
WHEN #{item.materialInventoryId} THEN GREATEST(area - #{item.area}, 0)
|
||||
</foreach>
|
||||
</trim>
|
||||
update_by = #{updateBy},
|
||||
update_by_name = #{updateByName},
|
||||
update_time = #{updateTime}
|
||||
|
||||
Reference in New Issue
Block a user