Commit 215565b20999c2cf00b9afad863ba9671ecb98cf

Authored by 周鸿
1 parent adf7f069

盘点任务时详情数量为0,未删除库存详情问题;

src/main/java/com/huaheng/pc/inventory/inventoryHeader/service/InventoryHeaderCheckCountService.java
... ... @@ -148,7 +148,11 @@ public class InventoryHeaderCheckCountService extends ServiceImpl<InventoryHeade
148 148 updateQty=qty1.subtract(qty);
149 149 }
150 150 inventoryDetail1.setQty(inventoryDetail.getQty());
151   - inventoryDetailService.updateById(inventoryDetail1);
  151 + if(inventoryDetail1.getQty().compareTo(new BigDecimal(0))==0){
  152 + inventoryDetailService.removeById(inventoryDetail1);
  153 + }else {
  154 + inventoryDetailService.updateById(inventoryDetail1);
  155 + }
152 156 //库存交易
153 157 saveInventoryTransaction(inventoryDetail1,tagIn, updateQty);
154 158 //库存主表数量更新
... ... @@ -207,7 +211,14 @@ public class InventoryHeaderCheckCountService extends ServiceImpl<InventoryHeade
207 211 }
208 212 inventoryHeader.setTotalQty(totolqty);
209 213 inventoryHeader.setTotalLines(detaillist.size());
210   - this.updateById(inventoryHeader);
  214 + if (totolqty.compareTo(new BigDecimal(0))==0){
  215 + this.removeById(inventoryHeader);
  216 + locationService.updateContainerCodeAndStatus(inventoryHeader.getLocationCode(),"","empty",inventoryHeader.getWarehouseCode());
  217 + containerService.updateLocationCodeAndStatus(inventoryHeader.getContainerCode(),"","empty",inventoryHeader.getWarehouseCode());
  218 + }else{
  219 + this.updateById(inventoryHeader);
  220 + }
  221 +
211 222 }
212 223 }
213 224  
... ...