Explorar el Código

优化取消调拨bug

Your Name hace 2 años
padre
commit
75e778dbc1

+ 0 - 44
service-store/src/main/java/com/java110/store/cmd/resourceStore/DeleteAllocationStorehouseCmd.java

@@ -97,35 +97,6 @@ public class DeleteAllocationStorehouseCmd extends Cmd {
             if (flag < 1) {
                 throw new CmdException("删除失败");
             }
-            ResourceStorePo resourceStorePo = new ResourceStorePo();
-            resourceStorePo.setResId(allocationStorehousePo.getResId());
-            //查询资源物品表
-            List<ResourceStorePo> resourceStores = resourceStoreServiceSMOImpl.getResourceStores(resourceStorePo);
-            Assert.listOnlyOne(resourceStores, "资源物品信息错误");
-            //获取库存数量
-            BigDecimal resourceStoreStock = new BigDecimal(resourceStores.get(0).getStock());
-            //获取调拨的数量
-            BigDecimal storehouseStock = new BigDecimal(allocationStorehousePo.getStock());
-            //库存数量
-            BigDecimal stock = resourceStoreStock.add(storehouseStock);
-            resourceStorePo.setStock(String.valueOf(stock));
-            //计算最小计量总数
-            if (StringUtil.isEmpty(resourceStores.get(0).getMiniStock())) {
-                throw new IllegalArgumentException("最小计量总数不能为空!");
-            }
-            BigDecimal miniStock = new BigDecimal(resourceStores.get(0).getMiniStock()); //获取物品表的最小计量总数
-            if (StringUtil.isEmpty(resourceStores.get(0).getMiniUnitStock())) {
-                throw new IllegalArgumentException("最小计量单位数量不能为空!");
-            }
-            BigDecimal miniUnitStock = new BigDecimal(resourceStores.get(0).getMiniUnitStock()); //获取最小计量单位数量
-            BigDecimal stock2 = new BigDecimal(allocationStorehousePo.getStock()); //获取最小计量单位数量
-            BigDecimal nowMiniStock = stock2.multiply(miniUnitStock); //计算当前的最小计量总数
-            BigDecimal newMiniStock = miniStock.add(nowMiniStock);
-            resourceStorePo.setMiniStock(String.valueOf(newMiniStock));
-            flag = resourceStoreV1InnerServiceSMOImpl.updateResourceStore(resourceStorePo);
-            if (flag < 1) {
-                throw new CmdException("修改失败");
-            }
             //取消流程审批
             //查询任务
             PurchaseApplyDto purchaseDto = new PurchaseApplyDto();
@@ -137,21 +108,6 @@ public class DeleteAllocationStorehouseCmd extends Cmd {
                 purchaseDto1.setAssigneeUser("999999");
                 purchaseApplyInnerServiceSMOImpl.updateActRuTaskById(purchaseDto1);
             }
-            // 保存至 物品 times表
-            //查询调拨批次价格
-            ResourceStoreTimesDto resourceStoreTimesDto = new ResourceStoreTimesDto();
-            resourceStoreTimesDto.setTimesId(tmpAllocationStorehouseDto.getTimesId());
-            List<ResourceStoreTimesDto> resourceStoreTimesDtos = resourceStoreTimesV1InnerServiceSMOImpl.queryResourceStoreTimess(resourceStoreTimesDto);
-
-            ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
-            resourceStoreTimesPo.setApplyOrderId(tmpAllocationStorehouseDto.getApplyId());
-            resourceStoreTimesPo.setPrice(resourceStoreTimesDtos.get(0).getPrice());
-            resourceStoreTimesPo.setStock(tmpAllocationStorehouseDto.getStock());
-            resourceStoreTimesPo.setResCode(tmpAllocationStorehouseDto.getResCode());
-            resourceStoreTimesPo.setStoreId(tmpAllocationStorehouseDto.getStoreId());
-            resourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("10"));
-            resourceStoreTimesPo.setShId(tmpAllocationStorehouseDto.getShIda());
-            resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);
         }
 
         AllocationStorehouseApplyPo allocationStorehouseApplyPo = new AllocationStorehouseApplyPo();