Your Name лет назад: 5
Родитель
Сommit
2d0e92ced0
23 измененных файлов с 2275 добавлено и 22 удалено
  1. 175 0
      docs/document/services/allocationStorehouseApply/DeleteAllocationStorehouseApplyInfo.md
  2. 175 0
      docs/document/services/allocationStorehouseApply/SaveAllocationStorehouseApplyInfo.md
  3. 188 0
      docs/document/services/allocationStorehouseApply/UpdateAllocationStorehouseApplyInfo.md
  4. 90 0
      java110-bean/src/main/java/com/java110/dto/allocationStorehouseApply/AllocationStorehouseApplyDto.java
  5. 60 0
      java110-bean/src/main/java/com/java110/po/allocationStorehouseApply/AllocationStorehouseApplyPo.java
  6. 202 0
      java110-db/src/main/resources/mapper/store/AllocationStorehouseApplyServiceDaoImplMapper.xml
  7. 23 22
      java110-generator/src/main/resources/back/template_1.json
  8. 42 0
      java110-interface/src/main/java/com/java110/intf/store/IAllocationStorehouseApplyInnerServiceSMO.java
  9. 18 0
      java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
  10. 31 0
      java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAllocationStorehouseApplyConstant.java
  11. 38 0
      service-api/src/main/java/com/java110/api/bmo/allocationStorehouseApply/IAllocationStorehouseApplyBMO.java
  12. 67 0
      service-api/src/main/java/com/java110/api/bmo/allocationStorehouseApply/impl/AllocationStorehouseApplyBMOImpl.java
  13. 49 0
      service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseApplyListener.java
  14. 82 0
      service-api/src/main/java/com/java110/api/listener/resourceStore/ListAllocationStorehouseApplysListener.java
  15. 50 0
      service-api/src/main/java/com/java110/api/listener/resourceStore/SaveAllocationStorehouseApplyListener.java
  16. 51 0
      service-api/src/main/java/com/java110/api/listener/resourceStore/UpdateAllocationStorehouseApplyListener.java
  17. 81 0
      service-store/src/main/java/com/java110/store/dao/IAllocationStorehouseApplyServiceDao.java
  18. 130 0
      service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java
  19. 93 0
      service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener.java
  20. 175 0
      service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/DeleteAllocationStorehouseApplyInfoListener.java
  21. 175 0
      service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/SaveAllocationStorehouseApplyInfoListener.java
  22. 188 0
      service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/UpdateAllocationStorehouseApplyInfoListener.java
  23. 92 0
      service-store/src/main/java/com/java110/store/smo/impl/AllocationStorehouseApplyInnerServiceSMOImpl.java

+ 175 - 0
docs/document/services/allocationStorehouseApply/DeleteAllocationStorehouseApplyInfo.md

@@ -0,0 +1,175 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 删除调拨申请信息 侦听
+ *
+ * 处理节点
+ * 1、businessAllocationStorehouseApply:{} 调拨申请基本信息节点
+ * 2、businessAllocationStorehouseApplyAttr:[{}] 调拨申请属性信息节点
+ * 3、businessAllocationStorehouseApplyPhoto:[{}] 调拨申请照片信息节点
+ * 4、businessAllocationStorehouseApplyCerdentials:[{}] 调拨申请证件信息节点
+ * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("deleteAllocationStorehouseApplyInfoListener")
+@Transactional
+public class DeleteAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteAllocationStorehouseApplyInfoListener.class);
+    @Autowired
+    IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+            //处理 businessAllocationStorehouseApply 节点
+            if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+                Object _obj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+                JSONArray businessAllocationStorehouseApplys = null;
+                if(_obj instanceof JSONObject){
+                    businessAllocationStorehouseApplys = new JSONArray();
+                    businessAllocationStorehouseApplys.add(_obj);
+                }else {
+                    businessAllocationStorehouseApplys = (JSONArray)_obj;
+                }
+                //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+                for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplys.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                    JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                    doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 删除 instance数据
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+
+        //调拨申请信息
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_DEL);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfos != null && businessAllocationStorehouseApplyInfos.size() >0) {
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_INVALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId",businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * 从business表中查询到DEL的数据 将instance中的数据更新回来
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+
+            //调拨申请信息
+            List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessAllocationStorehouseApplyInfos == null ||  businessAllocationStorehouseApplyInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(allocationAllocationStorehouseApplyhouseApply),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);
+    }
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+}

+ 175 - 0
docs/document/services/allocationStorehouseApply/SaveAllocationStorehouseApplyInfo.md

@@ -0,0 +1,175 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.entity.center.Business;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 保存 调拨申请信息 侦听
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("saveAllocationStorehouseApplyInfoListener")
+@Transactional
+public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveAllocationStorehouseApplyInfoListener.class);
+
+    @Autowired
+    private IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * 保存调拨申请信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessAllocationStorehouseApply 节点
+        if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+            Object bObj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+            JSONArray businessAllocationStorehouseApplys = null;
+            if(bObj instanceof JSONObject){
+                businessAllocationStorehouseApplys = new JSONArray();
+                businessAllocationStorehouseApplys.add(bObj);
+            }else {
+                businessAllocationStorehouseApplys = (JSONArray)bObj;
+            }
+            //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+            for (int bAllocationStorehouseApplyIndex = 0; bAllocationStorehouseApplyIndex < businessAllocationStorehouseApplys.size();bAllocationStorehouseApplyIndex++) {
+                JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(bAllocationStorehouseApplyIndex);
+                doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * business 数据转移到 instance
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfo != null && businessAllocationStorehouseApplyInfo.size() >0) {
+            reFreshShareColumn(info, businessAllocationStorehouseApplyInfo.get(0));
+            allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance(info);
+            if(businessAllocationStorehouseApplyInfo.size() == 1) {
+                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get(0).get("allocationAllocationStorehouseApplyhouseApply_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("storeId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("store_id")) {
+            return;
+        }
+
+        info.put("storeId", businessInfo.get("store_id"));
+    }
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map paramIn = new HashMap();
+        paramIn.put("bId",bId);
+        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+            reFreshShareColumn(paramIn, allocationAllocationStorehouseApplyhouseApplyInfo.get(0));
+            allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            //刷新缓存
+            //flushAllocationStorehouseApplyId(business.getDatas());
+
+            businessAllocationStorehouseApply.put("allocationAllocationStorehouseApplyhouseApplyId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_allocationAllocationStorehouseApplyhouseApplyId));
+
+        }
+
+        businessAllocationStorehouseApply.put("bId",business.getbId());
+        businessAllocationStorehouseApply.put("operate", StatusConstant.OPERATE_ADD);
+        //保存调拨申请信息
+        allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApply);
+
+    }
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+}

+ 188 - 0
docs/document/services/allocationStorehouseApply/UpdateAllocationStorehouseApplyInfo.md

@@ -0,0 +1,188 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 修改调拨申请信息 侦听
+ *
+ * 处理节点
+ * 1、businessAllocationStorehouseApply:{} 调拨申请基本信息节点
+ * 2、businessAllocationStorehouseApplyAttr:[{}] 调拨申请属性信息节点
+ * 3、businessAllocationStorehouseApplyPhoto:[{}] 调拨申请照片信息节点
+ * 4、businessAllocationStorehouseApplyCerdentials:[{}] 调拨申请证件信息节点
+ * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("updateAllocationStorehouseApplyInfoListener")
+@Transactional
+public class UpdateAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateAllocationStorehouseApplyInfoListener.class);
+    @Autowired
+    private IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * business过程
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+
+            //处理 businessAllocationStorehouseApply 节点
+            if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+                Object _obj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+                JSONArray businessAllocationStorehouseApplys = null;
+                if(_obj instanceof JSONObject){
+                    businessAllocationStorehouseApplys = new JSONArray();
+                    businessAllocationStorehouseApplys.add(_obj);
+                }else {
+                    businessAllocationStorehouseApplys = (JSONArray)_obj;
+                }
+                //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+                for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplys.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                    JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                    doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                    }
+                }
+            }
+    }
+
+
+    /**
+     * business to instance 过程
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfos != null && businessAllocationStorehouseApplyInfos.size() >0) {
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+                if(businessAllocationStorehouseApplyInfo.size() == 1) {
+                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+
+            //调拨申请信息
+            List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessAllocationStorehouseApplyInfos == null || businessAllocationStorehouseApplyInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(allocationAllocationStorehouseApplyhouseApply),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);
+
+        businessAllocationStorehouseApply.put("bId",business.getbId());
+        businessAllocationStorehouseApply.put("operate", StatusConstant.OPERATE_ADD);
+        //保存调拨申请信息
+        allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApply);
+
+    }
+
+
+
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+
+
+}

+ 90 - 0
java110-bean/src/main/java/com/java110/dto/allocationStorehouseApply/AllocationStorehouseApplyDto.java

@@ -0,0 +1,90 @@
+package com.java110.dto.allocationStorehouseApply;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 调拨申请数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class AllocationStorehouseApplyDto extends PageDto implements Serializable {
+
+    private String applyId;
+private String startUserId;
+private String startUserName;
+private String applyCount;
+private String remark;
+private String state;
+private String storeId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getApplyId() {
+        return applyId;
+    }
+public void setApplyId(String applyId) {
+        this.applyId = applyId;
+    }
+public String getStartUserId() {
+        return startUserId;
+    }
+public void setStartUserId(String startUserId) {
+        this.startUserId = startUserId;
+    }
+public String getStartUserName() {
+        return startUserName;
+    }
+public void setStartUserName(String startUserName) {
+        this.startUserName = startUserName;
+    }
+public String getApplyCount() {
+        return applyCount;
+    }
+public void setApplyCount(String applyCount) {
+        this.applyCount = applyCount;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 60 - 0
java110-bean/src/main/java/com/java110/po/allocationStorehouseApply/AllocationStorehouseApplyPo.java

@@ -0,0 +1,60 @@
+package com.java110.po.allocationStorehouseApply;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class AllocationStorehouseApplyPo implements Serializable {
+
+    private String applyId;
+private String startUserId;
+private String startUserName;
+private String applyCount;
+private String remark;
+private String state;
+private String storeId;
+public String getApplyId() {
+        return applyId;
+    }
+public void setApplyId(String applyId) {
+        this.applyId = applyId;
+    }
+public String getStartUserId() {
+        return startUserId;
+    }
+public void setStartUserId(String startUserId) {
+        this.startUserId = startUserId;
+    }
+public String getStartUserName() {
+        return startUserName;
+    }
+public void setStartUserName(String startUserName) {
+        this.startUserName = startUserName;
+    }
+public String getApplyCount() {
+        return applyCount;
+    }
+public void setApplyCount(String applyCount) {
+        this.applyCount = applyCount;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getState() {
+        return state;
+    }
+public void setState(String state) {
+        this.state = state;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+
+
+}

+ 202 - 0
java110-db/src/main/resources/mapper/store/AllocationStorehouseApplyServiceDaoImplMapper.xml

@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl">
+
+    <!-- 保存调拨申请信息 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessAllocationStorehouseApplyInfo" parameterType="Map">
+           insert into business_allocation_storehouse_apply(
+apply_id,start_user_id,operate,start_user_name,apply_count,remark,state,b_id,store_id
+) values (
+#{applyId},#{startUserId},#{operate},#{startUserName},#{applyCount},#{remark},#{state},#{bId},#{storeId}
+)
+       </insert>
+
+
+       <!-- 查询调拨申请信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessAllocationStorehouseApplyInfo" parameterType="Map" resultType="Map">
+           select  t.apply_id,t.apply_id applyId,t.start_user_id,t.start_user_id startUserId,t.operate,t.start_user_name,t.start_user_name startUserName,t.apply_count,t.apply_count applyCount,t.remark,t.state,t.b_id,t.b_id bId,t.store_id,t.store_id storeId 
+from business_allocation_storehouse_apply t 
+where 1 =1 
+<if test="applyId !=null and applyId != ''">
+   and t.apply_id= #{applyId}
+</if> 
+<if test="startUserId !=null and startUserId != ''">
+   and t.start_user_id= #{startUserId}
+</if> 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="startUserName !=null and startUserName != ''">
+   and t.start_user_name= #{startUserName}
+</if> 
+<if test="applyCount !=null and applyCount != ''">
+   and t.apply_count= #{applyCount}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存调拨申请信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveAllocationStorehouseApplyInfoInstance" parameterType="Map">
+        insert into allocation_storehouse_apply(
+apply_id,start_user_id,start_user_name,apply_count,remark,status_cd,state,b_id,store_id
+) select t.apply_id,t.start_user_id,t.start_user_name,t.apply_count,t.remark,'0',t.state,t.b_id,t.store_id from business_allocation_storehouse_apply t where 1=1
+<if test="applyId !=null and applyId != ''">
+   and t.apply_id= #{applyId}
+</if> 
+<if test="startUserId !=null and startUserId != ''">
+   and t.start_user_id= #{startUserId}
+</if> 
+   and t.operate= 'ADD'
+<if test="startUserName !=null and startUserName != ''">
+   and t.start_user_name= #{startUserName}
+</if> 
+<if test="applyCount !=null and applyCount != ''">
+   and t.apply_count= #{applyCount}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 查询调拨申请信息 add by wuxw 2018-07-03 -->
+    <select id="getAllocationStorehouseApplyInfo" parameterType="Map" resultType="Map">
+        select  t.apply_id,t.apply_id applyId,t.start_user_id,t.start_user_id startUserId,t.start_user_name,t.start_user_name startUserName,t.apply_count,t.apply_count applyCount,t.remark,t.status_cd,t.status_cd statusCd,t.state,t.b_id,t.b_id bId,t.store_id,t.store_id storeId 
+from allocation_storehouse_apply t 
+where 1 =1 
+<if test="applyId !=null and applyId != ''">
+   and t.apply_id= #{applyId}
+</if> 
+<if test="startUserId !=null and startUserId != ''">
+   and t.start_user_id= #{startUserId}
+</if> 
+<if test="startUserName !=null and startUserName != ''">
+   and t.start_user_name= #{startUserName}
+</if> 
+<if test="applyCount !=null and applyCount != ''">
+   and t.apply_count= #{applyCount}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改调拨申请信息 add by wuxw 2018-07-03 -->
+    <update id="updateAllocationStorehouseApplyInfoInstance" parameterType="Map">
+        update  allocation_storehouse_apply t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="startUserId !=null and startUserId != ''">
+, t.start_user_id= #{startUserId}
+</if> 
+<if test="startUserName !=null and startUserName != ''">
+, t.start_user_name= #{startUserName}
+</if> 
+<if test="applyCount !=null and applyCount != ''">
+, t.apply_count= #{applyCount}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="state !=null and state != ''">
+, t.state= #{state}
+</if> 
+<if test="storeId !=null and storeId != ''">
+, t.store_id= #{storeId}
+</if> 
+ where 1=1 <if test="applyId !=null and applyId != ''">
+and t.apply_id= #{applyId}
+</if> 
+<if test="bId !=null and bId != ''">
+and t.b_id= #{bId}
+</if> 
+
+    </update>
+
+    <!-- 查询调拨申请数量 add by wuxw 2018-07-03 -->
+     <select id="queryAllocationStorehouseApplysCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from allocation_storehouse_apply t 
+where 1 =1 
+<if test="applyId !=null and applyId != ''">
+   and t.apply_id= #{applyId}
+</if> 
+<if test="startUserId !=null and startUserId != ''">
+   and t.start_user_id= #{startUserId}
+</if> 
+<if test="startUserName !=null and startUserName != ''">
+   and t.start_user_name= #{startUserName}
+</if> 
+<if test="applyCount !=null and applyCount != ''">
+   and t.apply_count= #{applyCount}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="state !=null and state != ''">
+   and t.state= #{state}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="storeId !=null and storeId != ''">
+   and t.store_id= #{storeId}
+</if> 
+
+
+     </select>
+
+</mapper>

+ 23 - 22
java110-generator/src/main/resources/back/template_1.json

@@ -1,42 +1,43 @@
 {
   "autoMove": true,
-  "id": "usId",
-  "name": "userStorehouse",
-  "desc": "个人物品",
+  "id": "applyId",
+  "name": "allocationStorehouseApply",
+  "desc": "调拨申请",
   "shareParam": "storeId",
   "shareColumn": "store_id",
   "shareName": "store",
-  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_USER_STOREHOUSE",
-  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_USER_STOREHOUSE",
-  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_USER_STOREHOUSE",
-  "newBusinessTypeCdValue": "671100030006",
-  "updateBusinessTypeCdValue": "671100040006",
-  "deleteBusinessTypeCdValue": "671100050006",
-  "businessTableName": "business_user_storehouse",
-  "tableName": "user_storehouse",
+  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY",
+  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_ALLOCATION_STOREHOUSE_APPLY",
+  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_ALLOCATION_STOREHOUSE_APPLY",
+  "newBusinessTypeCdValue": "681100030006",
+  "updateBusinessTypeCdValue": "681100040006",
+  "deleteBusinessTypeCdValue": "681100050006",
+  "businessTableName": "business_allocation_storehouse_apply",
+  "tableName": "allocation_storehouse_apply",
   "param": {
-    "usId": "us_id",
-    "resId": "res_id",
-    "resName": "res_name",
+    "applyId": "apply_id",
+    "startUserId": "start_user_id",
+    "startUserName": "start_user_name",
     "bId": "b_id",
     "storeId": "store_id",
-    "stock": "stock",
-    "userId": "user_id",
+    "remark": "remark",
+    "applyCount": "apply_count",
+    "state": "state",
     "statusCd": "status_cd",
     "operate": "operate"
   },
   "required": [
     {
-      "code": "resId",
-      "msg": "物品不能为空"
+      "code": "startUserId",
+      "msg": "申请人不能为空"
     },
     {
-      "code": "stock",
-      "msg": "库存不能为空"
+      "code": "startUserName",
+      "msg": "申请人不能为空"
     },
     {
-      "code": "userId",
-      "msg": "用户不能为空"
+      "code": "remark",
+      "msg": "申请说明不能为空"
     },
     {
       "code": "storeId",

+ 42 - 0
java110-interface/src/main/java/com/java110/intf/store/IAllocationStorehouseApplyInnerServiceSMO.java

@@ -0,0 +1,42 @@
+package com.java110.intf.store;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName IAllocationStorehouseApplyInnerServiceSMO
+ * @Description 调拨申请接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/allocationAllocationStorehouseApplyhouseApplyApi")
+public interface IAllocationStorehouseApplyInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param allocationAllocationStorehouseApplyhouseApplyDto 数据对象分享
+     * @return AllocationStorehouseApplyDto 对象数据
+     */
+    @RequestMapping(value = "/queryAllocationStorehouseApplys", method = RequestMethod.POST)
+    List<AllocationStorehouseApplyDto> queryAllocationStorehouseApplys(@RequestBody AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApplyDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param allocationAllocationStorehouseApplyhouseApplyDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryAllocationStorehouseApplysCount", method = RequestMethod.POST)
+    int queryAllocationStorehouseApplysCount(@RequestBody AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApplyDto);
+}

+ 18 - 0
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java

@@ -1488,4 +1488,22 @@ public class BusinessTypeConstant {
     public static final String BUSINESS_TYPE_DELETE_USER_STOREHOUSE="671100050006";
 
 
+    /**
+     *  修改工作流节点 处理员工
+     *  3保存
+     */
+    public static final String BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY="681100030006";
+
+    /**
+     *  修改工作流节点 处理员工
+     *  3保存
+     */
+    public static final String BUSINESS_TYPE_UPDATE_ALLOCATION_STOREHOUSE_APPLY="681100040006";
+
+    /**
+     * 删除工作流节点 处理员工
+     */
+    public static final String BUSINESS_TYPE_DELETE_ALLOCATION_STOREHOUSE_APPLY="681100050006";
+
+
 }

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

@@ -0,0 +1,31 @@
+package com.java110.utils.constant;
+
+/**
+ * 调拨申请常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeAllocationStorehouseApplyConstant {
+
+    /**
+     * 添加 调拨申请
+     */
+    public static final String ADD_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.saveAllocationStorehouseApply";
+
+
+    /**
+     * 修改 调拨申请
+     */
+    public static final String UPDATE_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.updateAllocationStorehouseApply";
+    /**
+     * 删除 调拨申请
+     */
+    public static final String DELETE_ALLOCATIONSTOREHOUSEAPPLY = "allocationStorehouseApply.deleteAllocationStorehouseApply";
+
+
+    /**
+     * 查询 调拨申请
+     */
+    public static final String LIST_ALLOCATIONSTOREHOUSEAPPLYS = "allocationStorehouseApply.listAllocationStorehouseApplys";
+
+
+}

+ 38 - 0
service-api/src/main/java/com/java110/api/bmo/allocationStorehouseApply/IAllocationStorehouseApplyBMO.java

@@ -0,0 +1,38 @@
+package com.java110.api.bmo.allocationStorehouseApply;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.IApiBaseBMO;
+import com.java110.core.context.DataFlowContext;
+
+public interface IAllocationStorehouseApplyBMO extends IApiBaseBMO {
+
+
+    /**
+     * 添加调拨申请
+     * @param paramInJson
+     * @param dataFlowContext
+     * @return
+     */
+     void addAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 添加调拨申请信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     void updateAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 删除调拨申请
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+     void deleteAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+
+
+}

+ 67 - 0
service-api/src/main/java/com/java110/api/bmo/allocationStorehouseApply/impl/AllocationStorehouseApplyBMOImpl.java

@@ -0,0 +1,67 @@
+package com.java110.api.bmo.allocationStorehouseApply.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.ApiBaseBMO;
+import com.java110.api.bmo.allocationStorehouseApply.IAllocationStorehouseApplyBMO;
+import com.java110.core.context.DataFlowContext;
+import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
+import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
+import com.java110.po.allocationStorehouseApply.AllocationStorehouseApplyPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.CommonConstant;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service("allocationStorehouseApplyBMOImpl")
+public class AllocationStorehouseApplyBMOImpl extends ApiBaseBMO implements IAllocationStorehouseApplyBMO {
+
+    @Autowired
+    private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void addAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        paramInJson.put("applyId", "-1");
+        AllocationStorehouseApplyPo allocationStorehouseApplyPo = BeanConvertUtil.covertBean(paramInJson, AllocationStorehouseApplyPo.class);
+        super.insert(dataFlowContext, allocationStorehouseApplyPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY);
+    }
+
+
+    /**
+     * 添加活动信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void updateAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        AllocationStorehouseApplyPo allocationStorehouseApplyPo = BeanConvertUtil.covertBean(paramInJson, AllocationStorehouseApplyPo.class);
+        super.update(dataFlowContext, allocationStorehouseApplyPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ALLOCATION_STOREHOUSE_APPLY);
+    }
+
+
+
+    /**
+     * 添加小区信息
+     *
+     * @param paramInJson     接口调用放传入入参
+     * @param dataFlowContext 数据上下文
+     * @return 订单服务能够接受的报文
+     */
+    public void deleteAllocationStorehouseApply(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        AllocationStorehouseApplyPo allocationStorehouseApplyPo = BeanConvertUtil.covertBean(paramInJson, AllocationStorehouseApplyPo.class);
+        super.update(dataFlowContext, allocationStorehouseApplyPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ALLOCATION_STOREHOUSE_APPLY);
+    }
+
+}

+ 49 - 0
service-api/src/main/java/com/java110/api/listener/resourceStore/DeleteAllocationStorehouseApplyListener.java

@@ -0,0 +1,49 @@
+package com.java110.api.listener.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.allocationStorehouseApply.IAllocationStorehouseApplyBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeAllocationStorehouseApplyConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+
+/**
+ * 保存小区侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("deleteAllocationStorehouseApplyListener")
+public class DeleteAllocationStorehouseApplyListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAllocationStorehouseApplyBMO allocationStorehouseApplyBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        allocationStorehouseApplyBMOImpl.deleteAllocationStorehouseApply(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAllocationStorehouseApplyConstant.DELETE_ALLOCATIONSTOREHOUSEAPPLY;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}

+ 82 - 0
service-api/src/main/java/com/java110/api/listener/resourceStore/ListAllocationStorehouseApplysListener.java

@@ -0,0 +1,82 @@
+package com.java110.api.listener.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.listener.AbstractServiceApiListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
+import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
+import com.java110.utils.constant.ServiceCodeAllocationStorehouseApplyConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 查询小区侦听类
+ */
+@Java110Listener("listAllocationStorehouseApplysListener")
+public class ListAllocationStorehouseApplysListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAllocationStorehouseApplyConstant.LIST_ALLOCATIONSTOREHOUSEAPPLYS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IAllocationStorehouseApplyInnerServiceSMO getAllocationStorehouseApplyInnerServiceSMOImpl() {
+        return allocationStorehouseApplyInnerServiceSMOImpl;
+    }
+
+    public void setAllocationStorehouseApplyInnerServiceSMOImpl(IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl) {
+        this.allocationStorehouseApplyInnerServiceSMOImpl = allocationStorehouseApplyInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        AllocationStorehouseApplyDto allocationStorehouseApplyDto = BeanConvertUtil.covertBean(reqJson, AllocationStorehouseApplyDto.class);
+
+        int count = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplysCount(allocationStorehouseApplyDto);
+
+        List<AllocationStorehouseApplyDto> allocationStorehouseApplyDtos = null;
+
+        if (count > 0) {
+            allocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);
+        } else {
+            allocationStorehouseApplyDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, allocationStorehouseApplyDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 50 - 0
service-api/src/main/java/com/java110/api/listener/resourceStore/SaveAllocationStorehouseApplyListener.java

@@ -0,0 +1,50 @@
+package com.java110.api.listener.resourceStore;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.allocationStorehouseApply.IAllocationStorehouseApplyBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeAllocationStorehouseApplyConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+/**
+ * 保存商户侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("saveAllocationStorehouseApplyListener")
+public class SaveAllocationStorehouseApplyListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAllocationStorehouseApplyBMO allocationStorehouseApplyBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "startUserId", "请求报文中未包含startUserId");
+        Assert.hasKeyAndValue(reqJson, "startUserName", "请求报文中未包含startUserName");
+        Assert.hasKeyAndValue(reqJson, "remark", "请求报文中未包含remark");
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+        allocationStorehouseApplyBMOImpl.addAllocationStorehouseApply(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAllocationStorehouseApplyConstant.ADD_ALLOCATIONSTOREHOUSEAPPLY;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}

+ 51 - 0
service-api/src/main/java/com/java110/api/listener/resourceStore/UpdateAllocationStorehouseApplyListener.java

@@ -0,0 +1,51 @@
+package com.java110.api.listener.resourceStore;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.allocationStorehouseApply.IAllocationStorehouseApplyBMO;
+import com.java110.api.listener.AbstractServiceApiPlusListener;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.utils.constant.ServiceCodeAllocationStorehouseApplyConstant;
+import com.java110.utils.util.Assert;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+/**
+ * 保存调拨申请侦听
+ * add by wuxw 2019-06-30
+ */
+@Java110Listener("updateAllocationStorehouseApplyListener")
+public class UpdateAllocationStorehouseApplyListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAllocationStorehouseApplyBMO allocationStorehouseApplyBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "applyId", "applyId不能为空");
+        Assert.hasKeyAndValue(reqJson, "startUserId", "请求报文中未包含startUserId");
+        Assert.hasKeyAndValue(reqJson, "startUserName", "请求报文中未包含startUserName");
+        Assert.hasKeyAndValue(reqJson, "remark", "请求报文中未包含remark");
+        Assert.hasKeyAndValue(reqJson, "storeId", "请求报文中未包含storeId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        allocationStorehouseApplyBMOImpl.updateAllocationStorehouseApply(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAllocationStorehouseApplyConstant.UPDATE_ALLOCATIONSTOREHOUSEAPPLY;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+}

+ 81 - 0
service-store/src/main/java/com/java110/store/dao/IAllocationStorehouseApplyServiceDao.java

@@ -0,0 +1,81 @@
+package com.java110.store.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 调拨申请组件内部之间使用,没有给外围系统提供服务能力
+ * 调拨申请服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IAllocationStorehouseApplyServiceDao {
+
+    /**
+     * 保存 调拨申请信息
+     * @param businessAllocationStorehouseApplyInfo 调拨申请信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessAllocationStorehouseApplyInfo(Map businessAllocationStorehouseApplyInfo) throws DAOException;
+
+
+
+    /**
+     * 查询调拨申请信息(business过程)
+     * 根据bId 查询调拨申请信息
+     * @param info bId 信息
+     * @return 调拨申请信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessAllocationStorehouseApplyInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 调拨申请信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveAllocationStorehouseApplyInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询调拨申请信息(instance过程)
+     * 根据bId 查询调拨申请信息
+     * @param info bId 信息
+     * @return 调拨申请信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getAllocationStorehouseApplyInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改调拨申请信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateAllocationStorehouseApplyInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询调拨申请总数
+     *
+     * @param info 调拨申请信息
+     * @return 调拨申请数量
+     */
+    int queryAllocationStorehouseApplysCount(Map info);
+
+}

+ 130 - 0
service-store/src/main/java/com/java110/store/dao/impl/AllocationStorehouseApplyServiceDaoImpl.java

@@ -0,0 +1,130 @@
+package com.java110.store.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 调拨申请服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl")
+//@Transactional
+public class AllocationStorehouseApplyServiceDaoImpl extends BaseServiceDao implements IAllocationStorehouseApplyServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(AllocationStorehouseApplyServiceDaoImpl.class);
+
+    /**
+     * 调拨申请信息封装
+     * @param businessAllocationStorehouseApplyInfo 调拨申请信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessAllocationStorehouseApplyInfo(Map businessAllocationStorehouseApplyInfo) throws DAOException {
+        businessAllocationStorehouseApplyInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存调拨申请信息 入参 businessAllocationStorehouseApplyInfo : {}",businessAllocationStorehouseApplyInfo);
+        int saveFlag = sqlSessionTemplate.insert("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo",businessAllocationStorehouseApplyInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存调拨申请数据失败:"+ JSONObject.toJSONString(businessAllocationStorehouseApplyInfo));
+        }
+    }
+
+
+    /**
+     * 查询调拨申请信息
+     * @param info bId 信息
+     * @return 调拨申请信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessAllocationStorehouseApplyInfo(Map info) throws DAOException {
+
+        logger.debug("查询调拨申请信息 入参 info : {}",info);
+
+        List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo",info);
+
+        return businessAllocationStorehouseApplyInfos;
+    }
+
+
+
+    /**
+     * 保存调拨申请信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveAllocationStorehouseApplyInfoInstance(Map info) throws DAOException {
+        logger.debug("保存调拨申请信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存调拨申请信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询调拨申请信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getAllocationStorehouseApplyInfo(Map info) throws DAOException {
+        logger.debug("查询调拨申请信息 入参 info : {}",info);
+
+        List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo",info);
+
+        return businessAllocationStorehouseApplyInfos;
+    }
+
+
+    /**
+     * 修改调拨申请信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateAllocationStorehouseApplyInfoInstance(Map info) throws DAOException {
+        logger.debug("修改调拨申请信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改调拨申请信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询调拨申请数量
+     * @param info 调拨申请信息
+     * @return 调拨申请数量
+     */
+    @Override
+    public int queryAllocationStorehouseApplysCount(Map info) {
+        logger.debug("查询调拨申请数据 入参 info : {}",info);
+
+        List<Map> businessAllocationStorehouseApplyInfos = sqlSessionTemplate.selectList("allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.queryAllocationStorehouseApplysCount", info);
+        if (businessAllocationStorehouseApplyInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessAllocationStorehouseApplyInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 93 - 0
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener.java

@@ -0,0 +1,93 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONObject;
+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;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * 调拨申请 服务侦听 父类
+ * Created by wuxw on 2018/7/4.
+ */
+public abstract class AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{
+    private static Logger logger = LoggerFactory.getLogger(AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 获取 DAO工具类
+     * @return
+     */
+    public abstract IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl();
+
+    /**
+     * 刷新 businessAllocationStorehouseApplyInfo 数据
+     * 主要将 数据库 中字段和 接口传递字段建立关系
+     * @param businessAllocationStorehouseApplyInfo
+     */
+    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("statusCd", statusCd);
+    }
+
+
+    /**
+     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
+     * @param 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);
+        List<Map> currentAllocationStorehouseApplyInfos = getAllocationStorehouseApplyServiceDaoImpl().getAllocationStorehouseApplyInfo(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("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);
+        getAllocationStorehouseApplyServiceDaoImpl().saveBusinessAllocationStorehouseApplyInfo(currentAllocationStorehouseApplyInfo);
+        for(Object key : currentAllocationStorehouseApplyInfo.keySet()) {
+            if(businessAllocationStorehouseApply.get(key) == null) {
+                businessAllocationStorehouseApply.put(key.toString(), currentAllocationStorehouseApplyInfo.get(key));
+            }
+        }
+    }
+
+
+
+
+
+}

+ 175 - 0
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/DeleteAllocationStorehouseApplyInfoListener.java

@@ -0,0 +1,175 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 删除调拨申请信息 侦听
+ *
+ * 处理节点
+ * 1、businessAllocationStorehouseApply:{} 调拨申请基本信息节点
+ * 2、businessAllocationStorehouseApplyAttr:[{}] 调拨申请属性信息节点
+ * 3、businessAllocationStorehouseApplyPhoto:[{}] 调拨申请照片信息节点
+ * 4、businessAllocationStorehouseApplyCerdentials:[{}] 调拨申请证件信息节点
+ * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("deleteAllocationStorehouseApplyInfoListener")
+@Transactional
+public class DeleteAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteAllocationStorehouseApplyInfoListener.class);
+    @Autowired
+    IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+            //处理 businessAllocationStorehouseApply 节点
+            if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+                Object _obj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+                JSONArray businessAllocationStorehouseApplys = null;
+                if(_obj instanceof JSONObject){
+                    businessAllocationStorehouseApplys = new JSONArray();
+                    businessAllocationStorehouseApplys.add(_obj);
+                }else {
+                    businessAllocationStorehouseApplys = (JSONArray)_obj;
+                }
+                //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+                for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplys.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                    JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                    doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 删除 instance数据
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+
+        //调拨申请信息
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_DEL);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfos != null && businessAllocationStorehouseApplyInfos.size() >0) {
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_INVALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId",businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * 从business表中查询到DEL的数据 将instance中的数据更新回来
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+
+            //调拨申请信息
+            List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessAllocationStorehouseApplyInfos == null ||  businessAllocationStorehouseApplyInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(allocationAllocationStorehouseApplyhouseApply),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        }
+        //自动插入DEL
+        autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);
+    }
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+}

+ 175 - 0
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/SaveAllocationStorehouseApplyInfoListener.java

@@ -0,0 +1,175 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.entity.center.Business;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 保存 调拨申请信息 侦听
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("saveAllocationStorehouseApplyInfoListener")
+@Transactional
+public class SaveAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveAllocationStorehouseApplyInfoListener.class);
+
+    @Autowired
+    private IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * 保存调拨申请信息 business 表中
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+        //处理 businessAllocationStorehouseApply 节点
+        if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+            Object bObj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+            JSONArray businessAllocationStorehouseApplys = null;
+            if(bObj instanceof JSONObject){
+                businessAllocationStorehouseApplys = new JSONArray();
+                businessAllocationStorehouseApplys.add(bObj);
+            }else {
+                businessAllocationStorehouseApplys = (JSONArray)bObj;
+            }
+            //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+            for (int bAllocationStorehouseApplyIndex = 0; bAllocationStorehouseApplyIndex < businessAllocationStorehouseApplys.size();bAllocationStorehouseApplyIndex++) {
+                JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(bAllocationStorehouseApplyIndex);
+                doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * business 数据转移到 instance
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfo != null && businessAllocationStorehouseApplyInfo.size() >0) {
+            reFreshShareColumn(info, businessAllocationStorehouseApplyInfo.get(0));
+            allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveAllocationStorehouseApplyInfoInstance(info);
+            if(businessAllocationStorehouseApplyInfo.size() == 1) {
+                dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get(0).get("allocationAllocationStorehouseApplyhouseApply_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 刷 分片字段
+     *
+     * @param info         查询对象
+     * @param businessInfo 小区ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("storeId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("store_id")) {
+            return;
+        }
+
+        info.put("storeId", businessInfo.get("store_id"));
+    }
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map paramIn = new HashMap();
+        paramIn.put("bId",bId);
+        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+            reFreshShareColumn(paramIn, allocationAllocationStorehouseApplyhouseApplyInfo.get(0));
+            allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            //刷新缓存
+            //flushAllocationStorehouseApplyId(business.getDatas());
+
+            businessAllocationStorehouseApply.put("allocationAllocationStorehouseApplyhouseApplyId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_allocationAllocationStorehouseApplyhouseApplyId));
+
+        }
+
+        businessAllocationStorehouseApply.put("bId",business.getbId());
+        businessAllocationStorehouseApply.put("operate", StatusConstant.OPERATE_ADD);
+        //保存调拨申请信息
+        allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApply);
+
+    }
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+}

+ 188 - 0
service-store/src/main/java/com/java110/store/listener/allocationStorehouseApply/UpdateAllocationStorehouseApplyInfoListener.java

@@ -0,0 +1,188 @@
+package com.java110.store.listener.allocationAllocationStorehouseApplyhouseApply;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+import com.java110.utils.util.Assert;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 修改调拨申请信息 侦听
+ *
+ * 处理节点
+ * 1、businessAllocationStorehouseApply:{} 调拨申请基本信息节点
+ * 2、businessAllocationStorehouseApplyAttr:[{}] 调拨申请属性信息节点
+ * 3、businessAllocationStorehouseApplyPhoto:[{}] 调拨申请照片信息节点
+ * 4、businessAllocationStorehouseApplyCerdentials:[{}] 调拨申请证件信息节点
+ * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
+ * Created by wuxw on 2018/5/18.
+ */
+@Java110Listener("updateAllocationStorehouseApplyInfoListener")
+@Transactional
+public class UpdateAllocationStorehouseApplyInfoListener extends AbstractAllocationStorehouseApplyBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateAllocationStorehouseApplyInfoListener.class);
+    @Autowired
+    private IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ALLOCATION_STOREHOUSE_APPLY;
+    }
+
+    /**
+     * business过程
+     * @param dataFlowContext 上下文对象
+     * @param business 业务对象
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
+
+
+            //处理 businessAllocationStorehouseApply 节点
+            if(data.containsKey(AllocationStorehouseApplyPo.class.getSimpleName())){
+                Object _obj = data.get(AllocationStorehouseApplyPo.class.getSimpleName());
+                JSONArray businessAllocationStorehouseApplys = null;
+                if(_obj instanceof JSONObject){
+                    businessAllocationStorehouseApplys = new JSONArray();
+                    businessAllocationStorehouseApplys.add(_obj);
+                }else {
+                    businessAllocationStorehouseApplys = (JSONArray)_obj;
+                }
+                //JSONObject businessAllocationStorehouseApply = data.getJSONObject(AllocationStorehouseApplyPo.class.getSimpleName());
+                for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplys.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                    JSONObject businessAllocationStorehouseApply = businessAllocationStorehouseApplys.getJSONObject(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                    doBusinessAllocationStorehouseApply(business, businessAllocationStorehouseApply);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId"));
+                    }
+                }
+            }
+    }
+
+
+    /**
+     * business to instance 过程
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Map info = new HashMap();
+        info.put("bId",business.getbId());
+        info.put("operate",StatusConstant.OPERATE_ADD);
+
+        //调拨申请信息
+        List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(info);
+        if( businessAllocationStorehouseApplyInfos != null && businessAllocationStorehouseApplyInfos.size() >0) {
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+                if(businessAllocationStorehouseApplyInfo.size() == 1) {
+                    dataFlowContext.addParamOut("allocationAllocationStorehouseApplyhouseApplyId", businessAllocationStorehouseApplyInfo.get("allocationAllocationStorehouseApplyhouseApply_id"));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 撤单
+     * @param dataFlowContext 数据对象
+     * @param business 当前业务对象
+     */
+    @Override
+    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
+
+        String bId = business.getbId();
+        //Assert.hasLength(bId,"请求报文中没有包含 bId");
+        Map info = new HashMap();
+        info.put("bId",bId);
+        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
+        Map delInfo = new HashMap();
+        delInfo.put("bId",business.getbId());
+        delInfo.put("operate",StatusConstant.OPERATE_DEL);
+        //调拨申请信息
+        List<Map> allocationAllocationStorehouseApplyhouseApplyInfo = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(info);
+        if(allocationAllocationStorehouseApplyhouseApplyInfo != null && allocationAllocationStorehouseApplyhouseApplyInfo.size() > 0){
+
+            //调拨申请信息
+            List<Map> businessAllocationStorehouseApplyInfos = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getBusinessAllocationStorehouseApplyInfo(delInfo);
+            //除非程序出错了,这里不会为空
+            if(businessAllocationStorehouseApplyInfos == null || businessAllocationStorehouseApplyInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(allocationAllocationStorehouseApplyhouseApply),程序内部异常,请检查! "+delInfo);
+            }
+            for (int _allocationAllocationStorehouseApplyhouseApplyIndex = 0; _allocationAllocationStorehouseApplyhouseApplyIndex < businessAllocationStorehouseApplyInfos.size();_allocationAllocationStorehouseApplyhouseApplyIndex++) {
+                Map businessAllocationStorehouseApplyInfo = businessAllocationStorehouseApplyInfos.get(_allocationAllocationStorehouseApplyhouseApplyIndex);
+                flushBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApplyInfo,StatusConstant.STATUS_CD_VALID);
+                allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.updateAllocationStorehouseApplyInfoInstance(businessAllocationStorehouseApplyInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 处理 businessAllocationStorehouseApply 节点
+     * @param business 总的数据节点
+     * @param businessAllocationStorehouseApply 调拨申请节点
+     */
+    private void doBusinessAllocationStorehouseApply(Business business,JSONObject businessAllocationStorehouseApply){
+
+        Assert.jsonObjectHaveKey(businessAllocationStorehouseApply,"allocationAllocationStorehouseApplyhouseApplyId","businessAllocationStorehouseApply 节点下没有包含 allocationAllocationStorehouseApplyhouseApplyId 节点");
+
+        if(businessAllocationStorehouseApply.getString("allocationAllocationStorehouseApplyhouseApplyId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"allocationAllocationStorehouseApplyhouseApplyId 错误,不能自动生成(必须已经存在的allocationAllocationStorehouseApplyhouseApplyId)"+businessAllocationStorehouseApply);
+        }
+        //自动保存DEL
+        autoSaveDelBusinessAllocationStorehouseApply(business,businessAllocationStorehouseApply);
+
+        businessAllocationStorehouseApply.put("bId",business.getbId());
+        businessAllocationStorehouseApply.put("operate", StatusConstant.OPERATE_ADD);
+        //保存调拨申请信息
+        allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.saveBusinessAllocationStorehouseApplyInfo(businessAllocationStorehouseApply);
+
+    }
+
+
+
+    @Override
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+
+
+}

+ 92 - 0
service-store/src/main/java/com/java110/store/smo/impl/AllocationStorehouseApplyInnerServiceSMOImpl.java

@@ -0,0 +1,92 @@
+package com.java110.store.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
+import com.java110.dto.user.UserDto;
+import com.java110.store.dao.IAllocationStorehouseApplyServiceDao;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 调拨申请内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class AllocationStorehouseApplyInnerServiceSMOImpl extends BaseServiceSMO implements IAllocationStorehouseApplyInnerServiceSMO {
+
+    @Autowired
+    private IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+
+
+    @Override
+    public List<AllocationStorehouseApplyDto> queryAllocationStorehouseApplys(@RequestBody AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApplyDto) {
+
+        //校验是否传了 分页信息
+
+        int page = allocationAllocationStorehouseApplyhouseApplyDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            allocationAllocationStorehouseApplyhouseApplyDto.setPage((page - 1) * allocationAllocationStorehouseApplyhouseApplyDto.getRow());
+        }
+
+        List<AllocationStorehouseApplyDto> allocationAllocationStorehouseApplyhouseApplys = BeanConvertUtil.covertBeanList(allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.getAllocationStorehouseApplyInfo(BeanConvertUtil.beanCovertMap(allocationAllocationStorehouseApplyhouseApplyDto)), AllocationStorehouseApplyDto.class);
+
+        return allocationAllocationStorehouseApplyhouseApplys;
+    }
+
+    /**
+     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
+     *
+     * @param allocationAllocationStorehouseApplyhouseApply 小区调拨申请信息
+     * @param users                                         用户列表
+     */
+    private void refreshAllocationStorehouseApply(AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApply, List<UserDto> users) {
+        for (UserDto user : users) {
+            if (allocationAllocationStorehouseApplyhouseApply.getApplyId().equals(user.getUserId())) {
+                BeanConvertUtil.covertBean(user, allocationAllocationStorehouseApplyhouseApply);
+            }
+        }
+    }
+
+    /**
+     * 获取批量userId
+     *
+     * @param allocationAllocationStorehouseApplyhouseApplys 小区楼信息
+     * @return 批量userIds 信息
+     */
+    private String[] getUserIds(List<AllocationStorehouseApplyDto> allocationAllocationStorehouseApplyhouseApplys) {
+        List<String> userIds = new ArrayList<String>();
+        for (AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApply : allocationAllocationStorehouseApplyhouseApplys) {
+            userIds.add(allocationAllocationStorehouseApplyhouseApply.getApplyId());
+        }
+
+        return userIds.toArray(new String[userIds.size()]);
+    }
+
+    @Override
+    public int queryAllocationStorehouseApplysCount(@RequestBody AllocationStorehouseApplyDto allocationAllocationStorehouseApplyhouseApplyDto) {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl.queryAllocationStorehouseApplysCount(BeanConvertUtil.beanCovertMap(allocationAllocationStorehouseApplyhouseApplyDto));
+    }
+
+    public IAllocationStorehouseApplyServiceDao getAllocationStorehouseApplyServiceDaoImpl() {
+        return allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+    public void setAllocationStorehouseApplyServiceDaoImpl(IAllocationStorehouseApplyServiceDao allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl) {
+        this.allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl = allocationAllocationStorehouseApplyhouseApplyServiceDaoImpl;
+    }
+
+
+}