wuxw 5 lat temu
rodzic
commit
ab370ef488

+ 4 - 4
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAllocationStorehouseApplyConstant.java

@@ -9,23 +9,23 @@ public class ServiceCodeAllocationStorehouseApplyConstant {
     /**
      * 添加 调拨申请
      */
-    public static final String ADD_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.saveAllocationStorehouseApply";
+    public static final String ADD_ALLOCATIONSTOREHOUSEAPPLY = "resourceStore.saveAllocationStorehouseApply";
 
 
     /**
      * 修改 调拨申请
      */
-    public static final String UPDATE_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.updateAllocationStorehouseApply";
+    public static final String UPDATE_ALLOCATIONSTOREHOUSEAPPLY = "resourceStore.updateAllocationStorehouseApply";
     /**
      * 删除 调拨申请
      */
-    public static final String DELETE_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.deleteAllocationStorehouseApply";
+    public static final String DELETE_ALLOCATIONSTOREHOUSEAPPLY = "resourceStore.deleteAllocationStorehouseApply";
 
 
     /**
      * 查询 调拨申请
      */
-    public static final String LIST_ALLOCATIONSTOREHOUSEAPPLYS = "allocationStorehouseApply.listAllocationStorehouseApplys";
+    public static final String LIST_ALLOCATIONSTOREHOUSEAPPLYS = "resourceStore.listAllocationStorehouseApplys";
 
 
 }

+ 5 - 2
service-api/src/main/java/com/java110/api/listener/resourceStore/SaveAllocationStorehouseListener.java

@@ -91,8 +91,8 @@ public class SaveAllocationStorehouseListener extends AbstractServiceApiPlusList
     @Override
     protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
         AllocationStorehouseApplyPo allocationStorehouseApplyPo = new AllocationStorehouseApplyPo();
-        allocationStorehouseApplyPo.setApplyId(GenerateCodeFactory.CODE_PREFIX_applyId);
-        allocationStorehouseApplyPo.setApplyCount("1");
+        allocationStorehouseApplyPo.setApplyId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyId));
+        allocationStorehouseApplyPo.setApplyCount("0");
         allocationStorehouseApplyPo.setRemark(reqJson.getString("remark"));
         allocationStorehouseApplyPo.setStartUserId(reqJson.getString("userId"));
         allocationStorehouseApplyPo.setStartUserName(reqJson.getString("userName"));
@@ -127,6 +127,9 @@ public class SaveAllocationStorehouseListener extends AbstractServiceApiPlusList
             int stockB = Integer.parseInt(resObj.getString("stock"));
             resourceStorePo.setStock((stockA - stockB) + "");
             super.update(context, resourceStorePo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RESOURCE_STORE);
+            int oldCurStore = Integer.parseInt(allocationStorehouseApplyPo.getApplyCount());
+            oldCurStore += Integer.parseInt(resObj.getString("curStock"));
+            allocationStorehouseApplyPo.setApplyCount(oldCurStore + "");
         }
         super.insert(context, allocationStorehouseApplyPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY);
         commit(context);