wuxw 5 lat temu
rodzic
commit
54bbf8be79

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -196,6 +196,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_usId = "27";
     public static final String CODE_PREFIX_crId = "28";
     public static final String CODE_PREFIX_partyaId = "28";
+    public static final String CODE_PREFIX_applyId = "29";
 
 
     /**

+ 35 - 36
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener.java

@@ -1,12 +1,12 @@
-package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+package com.java110.store.listener.allocationStorehouseApply;
 
 import com.alibaba.fastjson.JSONObject;
+import com.java110.core.event.service.AbstractBusinessServiceDataFlowListener;
+import com.java110.entity.center.Business;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.constant.StatusConstant;
 import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.entity.center.Business;
-import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
-import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -15,16 +15,16 @@ import java.util.List;
 import java.util.Map;
 
 /**
- *
  * 调拨申请 服务侦听 父类
  * Created by wuxw on 2018/7/4.
  */
-public abstract class AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{
+public abstract class AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
     private static Logger logger = LoggerFactory.getLogger(AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener.class);
 
 
     /**
      * 获取 DAO工具类
+     *
      * @return
      */
     public abstract IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl();
@@ -32,62 +32,61 @@ public abstract class AbstractAllocationStorehouseApplyBusinessServiceDataFlowLi
     /**
      * 刷新 businessAllocationStorehouseApplyInfo 数据
      * 主要将 数据库 中字段和 接口传递字段建立关系
+     *
      * @param businessAllocationStorehouseApplyInfo
      */
-    protected void flushBusinessAllocationStorehouseApplyInfo(Map businessAllocationStorehouseApplyInfo,String statusCd){
+    protected void flushBusinessAllocationStorehouseApplyInfo(Map businessAllocationStorehouseApplyInfo, String statusCd) {
         businessAllocationStorehouseApplyInfo.put("newBId", businessAllocationStorehouseApplyInfo.get("b_id"));
-        businessAllocationStorehouseApplyInfo.put("applyId",businessAllocationStorehouseApplyInfo.get("apply_id"));
-businessAllocationStorehouseApplyInfo.put("startUserId",businessAllocationStorehouseApplyInfo.get("start_user_id"));
-businessAllocationStorehouseApplyInfo.put("operate",businessAllocationStorehouseApplyInfo.get("operate"));
-businessAllocationStorehouseApplyInfo.put("startUserName",businessAllocationStorehouseApplyInfo.get("start_user_name"));
-businessAllocationStorehouseApplyInfo.put("applyCount",businessAllocationStorehouseApplyInfo.get("apply_count"));
-businessAllocationStorehouseApplyInfo.put("remark",businessAllocationStorehouseApplyInfo.get("remark"));
-businessAllocationStorehouseApplyInfo.put("state",businessAllocationStorehouseApplyInfo.get("state"));
-businessAllocationStorehouseApplyInfo.put("storeId",businessAllocationStorehouseApplyInfo.get("store_id"));
-businessAllocationStorehouseApplyInfo.remove("bId");
+        businessAllocationStorehouseApplyInfo.put("applyId", businessAllocationStorehouseApplyInfo.get("apply_id"));
+        businessAllocationStorehouseApplyInfo.put("startUserId", businessAllocationStorehouseApplyInfo.get("start_user_id"));
+        businessAllocationStorehouseApplyInfo.put("operate", businessAllocationStorehouseApplyInfo.get("operate"));
+        businessAllocationStorehouseApplyInfo.put("startUserName", businessAllocationStorehouseApplyInfo.get("start_user_name"));
+        businessAllocationStorehouseApplyInfo.put("applyCount", businessAllocationStorehouseApplyInfo.get("apply_count"));
+        businessAllocationStorehouseApplyInfo.put("remark", businessAllocationStorehouseApplyInfo.get("remark"));
+        businessAllocationStorehouseApplyInfo.put("state", businessAllocationStorehouseApplyInfo.get("state"));
+        businessAllocationStorehouseApplyInfo.put("storeId", businessAllocationStorehouseApplyInfo.get("store_id"));
+        businessAllocationStorehouseApplyInfo.remove("bId");
         businessAllocationStorehouseApplyInfo.put("statusCd", statusCd);
     }
 
 
     /**
      * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     *
      * @param businessAllocationStorehouseApply 调拨申请信息
      */
-    protected void autoSaveDelBusinessAllocationStorehouseApply(Business business, JSONObject businessAllocationStorehouseApply){
+    protected void autoSaveDelBusinessAllocationStorehouseApply(Business business, JSONObject businessAllocationStorehouseApply) {
 //自动插入DEL
         Map info = new HashMap();
-        info.put("allocationAllocationStorehouseApplyhouseApplyId",businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        info.put("applyId", businessAllocationStorehouseApply.getString("applyId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
         List<Map> currentAllocationStorehouseApplyInfos = getAllocationStorehouseApplyServiceDaoImpl().getAllocationStorehouseApplyInfo(info);
-        if(currentAllocationStorehouseApplyInfos == null || currentAllocationStorehouseApplyInfos.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
+        if (currentAllocationStorehouseApplyInfos == null || currentAllocationStorehouseApplyInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
         }
 
         Map currentAllocationStorehouseApplyInfo = currentAllocationStorehouseApplyInfos.get(0);
 
-        currentAllocationStorehouseApplyInfo.put("bId",business.getbId());
+        currentAllocationStorehouseApplyInfo.put("bId", business.getbId());
 
-        currentAllocationStorehouseApplyInfo.put("applyId",currentAllocationStorehouseApplyInfo.get("apply_id"));
-currentAllocationStorehouseApplyInfo.put("startUserId",currentAllocationStorehouseApplyInfo.get("start_user_id"));
-currentAllocationStorehouseApplyInfo.put("operate",currentAllocationStorehouseApplyInfo.get("operate"));
-currentAllocationStorehouseApplyInfo.put("startUserName",currentAllocationStorehouseApplyInfo.get("start_user_name"));
-currentAllocationStorehouseApplyInfo.put("applyCount",currentAllocationStorehouseApplyInfo.get("apply_count"));
-currentAllocationStorehouseApplyInfo.put("remark",currentAllocationStorehouseApplyInfo.get("remark"));
-currentAllocationStorehouseApplyInfo.put("state",currentAllocationStorehouseApplyInfo.get("state"));
-currentAllocationStorehouseApplyInfo.put("storeId",currentAllocationStorehouseApplyInfo.get("store_id"));
+        currentAllocationStorehouseApplyInfo.put("applyId", currentAllocationStorehouseApplyInfo.get("apply_id"));
+        currentAllocationStorehouseApplyInfo.put("startUserId", currentAllocationStorehouseApplyInfo.get("start_user_id"));
+        currentAllocationStorehouseApplyInfo.put("operate", currentAllocationStorehouseApplyInfo.get("operate"));
+        currentAllocationStorehouseApplyInfo.put("startUserName", currentAllocationStorehouseApplyInfo.get("start_user_name"));
+        currentAllocationStorehouseApplyInfo.put("applyCount", currentAllocationStorehouseApplyInfo.get("apply_count"));
+        currentAllocationStorehouseApplyInfo.put("remark", currentAllocationStorehouseApplyInfo.get("remark"));
+        currentAllocationStorehouseApplyInfo.put("state", currentAllocationStorehouseApplyInfo.get("state"));
+        currentAllocationStorehouseApplyInfo.put("storeId", currentAllocationStorehouseApplyInfo.get("store_id"));
 
 
-        currentAllocationStorehouseApplyInfo.put("operate",StatusConstant.OPERATE_DEL);
+        currentAllocationStorehouseApplyInfo.put("operate", StatusConstant.OPERATE_DEL);
         getAllocationStorehouseApplyServiceDaoImpl().saveBusinessAllocationStorehouseApplyInfo(currentAllocationStorehouseApplyInfo);
-        for(Object key : currentAllocationStorehouseApplyInfo.keySet()) {
-            if(businessAllocationStorehouseApply.get(key) == null) {
+        for (Object key : currentAllocationStorehouseApplyInfo.keySet()) {
+            if (businessAllocationStorehouseApply.get(key) == null) {
                 businessAllocationStorehouseApply.put(key.toString(), currentAllocationStorehouseApplyInfo.get(key));
             }
         }
     }
 
 
-
-
-
 }

+ 8 - 6
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/DeleteAllocationStorehouseApplyInfoListener.java

@@ -1,7 +1,9 @@
-package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+package com.java110.store.listener.allocationStorehouseApply;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.store.listener.allocationStorehouseApply.AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.constant.StatusConstant;
@@ -75,7 +77,7 @@ public class DeleteAllocationStorehouseApplyInfoListener extends AbstractAllocat
                     JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
                     doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
                     if(_obj instanceof JSONObject) {
-                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                        dataFlowContext.addParamOut("applyId", businessAllocationStorehouseApply.getString("applyId"));
                     }
                 }
 
@@ -106,7 +108,7 @@ public class DeleteAllocationStorehouseApplyInfoListener extends AbstractAllocat
                 Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
                 flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_INVALID);
                 allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
-                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId",businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+                dataFlowContext.addParamOut("applyId",businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
             }
         }
 
@@ -156,10 +158,10 @@ public class DeleteAllocationStorehouseApplyInfoListener extends AbstractAllocat
      */
     private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
 
-        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"applyId","businessAllocationStorehouseApply 节点下没有包含 applyId 节点");
 
-        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        if(businessAllocationStorehouseApply.getString("applyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"applyId 错误,不能自动生成(必须已经存在的applyId)"+businessAllocationStorehouseApply);
         }
         //自动插入DEL
         autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);

+ 9 - 7
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/SaveAllocationStorehouseApplyInfoListener.java

@@ -1,7 +1,9 @@
-package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+package com.java110.store.listener.allocationStorehouseApply;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.store.listener.allocationStorehouseApply.AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.StatusConstant;
 import com.java110.utils.util.Assert;
@@ -25,7 +27,7 @@ import java.util.Map;
  */
 @Java110Listener("saveAllocationStorehouseApplyInfoListener")
 @Transactional
-public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener{
+public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener {
 
     private static Logger logger = LoggerFactory.getLogger(SaveAllocationStorehouseApplyInfoListener.class);
 
@@ -67,7 +69,7 @@ public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocatio
                 JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(bAllocationStorehouseApplyIndex);
                 doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
                 if(bObj instanceof JSONObject) {
-                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                    dataFlowContext.addParamOut("applyId", businessAllocationStorehouseApply.getString("applyId"));
                 }
             }
         }
@@ -92,7 +94,7 @@ public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocatio
             reFreshShareColumn(info, businessAllocationStorehouseApplyInfo.get(0));
             allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance(info);
             if(businessAllocationStorehouseApplyInfo.size() == 1) {
-                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get(0).get("allocationAllocationStorehouseApplyhouseApply_id"));
+                dataFlowContext.addParamOut("applyId", businessAllocationStorehouseApplyInfo.get(0).get("allocationAllocationStorehouseApplyhouseApply_id"));
             }
         }
     }
@@ -148,13 +150,13 @@ public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocatio
      */
     private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
 
-        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"applyId","businessAllocationStorehouseApply 节点下没有包含 applyId 节点");
 
-        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+        if(businessAllocationStorehouseApply.getString("applyId").startsWith("-")){
             //刷新缓存
             //flushAllocationStorehouseApplyId(business.getDatas());
 
-            businessAllocationStorehouseApply.put("allocationAllocationStorehouseApplyhouseApplyId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_allocationAllocationStorehouseApplyhouseApplyId));
+            businessAllocationStorehouseApply.put("applyId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_applyId));
 
         }
 

+ 8 - 6
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/UpdateAllocationStorehouseApplyInfoListener.java

@@ -1,7 +1,9 @@
-package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+package com.java110.store.listener.allocationStorehouseApply;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.store.listener.allocationStorehouseApply.AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.ResponseConstant;
 import com.java110.utils.constant.StatusConstant;
@@ -77,7 +79,7 @@ public class UpdateAllocationStorehouseApplyInfoListener extends AbstractAllocat
                     JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
                     doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
                     if(_obj instanceof JSONObject) {
-                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                        dataFlowContext.addParamOut("applyId", businessAllocationStorehouseApply.getString("applyId"));
                     }
                 }
             }
@@ -106,7 +108,7 @@ public class UpdateAllocationStorehouseApplyInfoListener extends AbstractAllocat
                 flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
                 allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
                 if(businessAllocationStorehouseApplyInfo.size() == 1) {
-                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+                    dataFlowContext.addParamOut("applyId", businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
                 }
             }
         }
@@ -157,10 +159,10 @@ public class UpdateAllocationStorehouseApplyInfoListener extends AbstractAllocat
      */
     private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
 
-        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"applyId","businessAllocationStorehouseApply 节点下没有包含 applyId 节点");
 
-        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        if(businessAllocationStorehouseApply.getString("applyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"applyId 错误,不能自动生成(必须已经存在的applyId)"+businessAllocationStorehouseApply);
         }
         //自动保存DEL
         autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);