From 65ae2fe39c6e52bfefd6a9e6dd8083a178c37b54 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 02 五月 2021 14:23:28 +0800
Subject: [PATCH] 加入账户交易明细

---
 java110-db/src/main/resources/mapper/acct/AccountDetailServiceDaoImplMapper.xml                                              |  232 +++++
 service-acct/src/main/java/com/java110/acct/dao/IAccountDetailServiceDao.java                                                |   81 ++
 service-acct/src/main/java/com/java110/acct/listener/accountDetail/AbstractAccountDetailBusinessServiceDataFlowListener.java |   96 ++
 docs/document/services/accountDetail/UpdateAccountDetailInfo.md                                                              |  188 ++++
 service-api/src/main/java/com/java110/api/listener/account/SaveAccountDetailListener.java                                    |   50 +
 java110-generator/src/main/resources/back/template_1.json                                                                    |   37 
 service-api/src/main/java/com/java110/api/listener/account/UpdateAccountDetailListener.java                                  |   51 +
 service-acct/src/main/java/com/java110/acct/listener/accountDetail/SaveAccountDetailInfoListener.java                        |  176 ++++
 service-api/src/main/java/com/java110/api/bmo/account/IAccountDetailBMO.java                                                 |   38 
 service-api/src/main/java/com/java110/api/listener/account/ListAccountDetailsListener.java                                   |   82 ++
 java110-interface/src/main/java/com/java110/intf/acct/IAccountDetailInnerServiceSMO.java                                     |   42 +
 java110-bean/src/main/java/com/java110/dto/accountDetail/AccountDetailDto.java                                               |  104 ++
 service-api/src/main/java/com/java110/api/bmo/account/impl/AccountDetailBMOImpl.java                                         |   61 +
 docs/document/services/accountDetail/DeleteAccountDetailInfo.md                                                              |  175 ++++
 service-acct/src/main/java/com/java110/acct/smo/impl/AccountDetailInnerServiceSMOImpl.java                                   |   91 ++
 java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAccountDetailConstant.java                                 |   31 
 service-api/src/main/java/com/java110/api/listener/account/DeleteAccountDetailListener.java                                  |   49 +
 docs/document/services/accountDetail/SaveAccountDetailInfo.md                                                                |  175 ++++
 service-acct/src/main/java/com/java110/acct/listener/accountDetail/UpdateAccountDetailInfoListener.java                      |  190 ++++
 java110-bean/src/main/java/com/java110/po/accountDetail/AccountDetailPo.java                                                 |   74 +
 service-acct/src/main/java/com/java110/acct/listener/accountDetail/DeleteAccountDetailInfoListener.java                      |  176 ++++
 java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java                                             |   18 
 service-acct/src/main/java/com/java110/acct/dao/impl/AccountDetailServiceDaoImpl.java                                        |  130 +++
 23 files changed, 2,330 insertions(+), 17 deletions(-)

diff --git a/docs/document/services/accountDetail/DeleteAccountDetailInfo.md b/docs/document/services/accountDetail/DeleteAccountDetailInfo.md
new file mode 100644
index 0000000..a3d4cc2
--- /dev/null
+++ b/docs/document/services/accountDetail/DeleteAccountDetailInfo.md
@@ -0,0 +1,175 @@
+package com.java110.acct.listener.accountDetail;
+
+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.acct.dao.IAccountDetailServiceDao;
+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銆乥usinessAccountDetail:{} 璐︽埛浜ゆ槗鍩烘湰淇℃伅鑺傜偣
+ * 2銆乥usinessAccountDetailAttr:[{}] 璐︽埛浜ゆ槗灞炴�т俊鎭妭鐐�
+ * 3銆乥usinessAccountDetailPhoto:[{}] 璐︽埛浜ゆ槗鐓х墖淇℃伅鑺傜偣
+ * 4銆乥usinessAccountDetailCerdentials:[{}] 璐︽埛浜ゆ槗璇佷欢淇℃伅鑺傜偣
+ * 鍗忚鍦板潃 锛歨ttps://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("deleteAccountDetailInfoListener")
+@Transactional
+public class DeleteAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteAccountDetailInfoListener.class);
+    @Autowired
+    IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ACCT_DETAIL;
+    }
+
+    /**
+     * 鏍规嵁鍒犻櫎淇℃伅 鏌ュ嚭Instance琛ㄤ腑鏁版嵁 淇濆瓨鑷砨usiness琛� 锛堢姸鎬佸啓DEL锛� 鏂逛究鎾ゅ崟鏃剁洿鎺ユ洿鏂板洖鍘�
+     * @param dataFlowContext 鏁版嵁瀵硅薄
+     * @param business 褰撳墠涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+            //澶勭悊 businessAccountDetail 鑺傜偣
+            if(data.containsKey(AccountDetailPo.class.getSimpleName())){
+                Object _obj = data.get(AccountDetailPo.class.getSimpleName());
+                JSONArray businessAccountDetails = null;
+                if(_obj instanceof JSONObject){
+                    businessAccountDetails = new JSONArray();
+                    businessAccountDetails.add(_obj);
+                }else {
+                    businessAccountDetails = (JSONArray)_obj;
+                }
+                //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+                for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetails.size();_accountDetailIndex++) {
+                    JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(_accountDetailIndex);
+                    doBusinessAccountDetail(business, businessAccountDetail);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 鍒犻櫎 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> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if( businessAccountDetailInfos != null && businessAccountDetailInfos.size() >0) {
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_INVALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+                dataFlowContext.addParamOut("detailId",businessAccountDetailInfo.get("detail_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 鎾ゅ崟
+     * 浠巄usiness琛ㄤ腑鏌ヨ鍒癉EL鐨勬暟鎹� 灏唅nstance涓殑鏁版嵁鏇存柊鍥炴潵
+     * @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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if(accountDetailInfo != null && accountDetailInfo.size() > 0){
+
+            //璐︽埛浜ゆ槗淇℃伅
+            List<Map> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(delInfo);
+            //闄ら潪绋嬪簭鍑洪敊浜嗭紝杩欓噷涓嶄細涓虹┖
+            if(businessAccountDetailInfos == null ||  businessAccountDetailInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"鎾ゅ崟澶辫触锛坅ccountDetail锛夛紝绋嬪簭鍐呴儴寮傚父,璇锋鏌ワ紒 "+delInfo);
+            }
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     * @param business 鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business,JSONObject businessAccountDetail){
+
+        Assert.jsonObjectHaveKey(businessAccountDetail,"detailId","businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if(businessAccountDetail.getString("detailId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"detailId 閿欒锛屼笉鑳借嚜鍔ㄧ敓鎴愶紙蹇呴』宸茬粡瀛樺湪鐨刣etailId锛�"+businessAccountDetail);
+        }
+        //鑷姩鎻掑叆DEL
+        autoSaveDelBusinessAccountDetail(business,businessAccountDetail);
+    }
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+}
diff --git a/docs/document/services/accountDetail/SaveAccountDetailInfo.md b/docs/document/services/accountDetail/SaveAccountDetailInfo.md
new file mode 100644
index 0000000..65c16bc
--- /dev/null
+++ b/docs/document/services/accountDetail/SaveAccountDetailInfo.md
@@ -0,0 +1,175 @@
+package com.java110.acct.listener.accountDetail;
+
+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.acct.dao.IAccountDetailServiceDao;
+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("saveAccountDetailInfoListener")
+@Transactional
+public class SaveAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveAccountDetailInfoListener.class);
+
+    @Autowired
+    private IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ACCT_DETAIL;
+    }
+
+    /**
+     * 淇濆瓨璐︽埛浜ゆ槗淇℃伅 business 琛ㄤ腑
+     * @param dataFlowContext 鏁版嵁瀵硅薄
+     * @param business 褰撳墠涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+        //澶勭悊 businessAccountDetail 鑺傜偣
+        if(data.containsKey(AccountDetailPo.class.getSimpleName())){
+            Object bObj = data.get(AccountDetailPo.class.getSimpleName());
+            JSONArray businessAccountDetails = null;
+            if(bObj instanceof JSONObject){
+                businessAccountDetails = new JSONArray();
+                businessAccountDetails.add(bObj);
+            }else {
+                businessAccountDetails = (JSONArray)bObj;
+            }
+            //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+            for (int bAccountDetailIndex = 0; bAccountDetailIndex < businessAccountDetails.size();bAccountDetailIndex++) {
+                JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(bAccountDetailIndex);
+                doBusinessAccountDetail(business, businessAccountDetail);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessAccountDetailInfo = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if( businessAccountDetailInfo != null && businessAccountDetailInfo.size() >0) {
+            reFreshShareColumn(info, businessAccountDetailInfo.get(0));
+            accountDetailServiceDaoImpl.saveAccountDetailInfoInstance(info);
+            if(businessAccountDetailInfo.size() == 1) {
+                dataFlowContext.addParamOut("detailId", businessAccountDetailInfo.get(0).get("detail_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 鍒� 鍒嗙墖瀛楁
+     *
+     * @param info         鏌ヨ瀵硅薄
+     * @param businessInfo 灏忓尯ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("objId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("obj_id")) {
+            return;
+        }
+
+        info.put("objId", businessInfo.get("obj_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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if(accountDetailInfo != null && accountDetailInfo.size() > 0){
+            reFreshShareColumn(paramIn, accountDetailInfo.get(0));
+            accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     * @param business 鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business,JSONObject businessAccountDetail){
+
+        Assert.jsonObjectHaveKey(businessAccountDetail,"detailId","businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if(businessAccountDetail.getString("detailId").startsWith("-")){
+            //鍒锋柊缂撳瓨
+            //flushAccountDetailId(business.getDatas());
+
+            businessAccountDetail.put("detailId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
+
+        }
+
+        businessAccountDetail.put("bId",business.getbId());
+        businessAccountDetail.put("operate", StatusConstant.OPERATE_ADD);
+        //淇濆瓨璐︽埛浜ゆ槗淇℃伅
+        accountDetailServiceDaoImpl.saveBusinessAccountDetailInfo(businessAccountDetail);
+
+    }
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+}
diff --git a/docs/document/services/accountDetail/UpdateAccountDetailInfo.md b/docs/document/services/accountDetail/UpdateAccountDetailInfo.md
new file mode 100644
index 0000000..8a94e24
--- /dev/null
+++ b/docs/document/services/accountDetail/UpdateAccountDetailInfo.md
@@ -0,0 +1,188 @@
+package com.java110.acct.listener.accountDetail;
+
+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.acct.dao.IAccountDetailServiceDao;
+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銆乥usinessAccountDetail:{} 璐︽埛浜ゆ槗鍩烘湰淇℃伅鑺傜偣
+ * 2銆乥usinessAccountDetailAttr:[{}] 璐︽埛浜ゆ槗灞炴�т俊鎭妭鐐�
+ * 3銆乥usinessAccountDetailPhoto:[{}] 璐︽埛浜ゆ槗鐓х墖淇℃伅鑺傜偣
+ * 4銆乥usinessAccountDetailCerdentials:[{}] 璐︽埛浜ゆ槗璇佷欢淇℃伅鑺傜偣
+ * 鍗忚鍦板潃 锛歨ttps://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("updateAccountDetailInfoListener")
+@Transactional
+public class UpdateAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateAccountDetailInfoListener.class);
+    @Autowired
+    private IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ACCT_DETAIL;
+    }
+
+    /**
+     * business杩囩▼
+     * @param dataFlowContext 涓婁笅鏂囧璞�
+     * @param business 涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+
+            //澶勭悊 businessAccountDetail 鑺傜偣
+            if(data.containsKey(AccountDetailPo.class.getSimpleName())){
+                Object _obj = data.get(AccountDetailPo.class.getSimpleName());
+                JSONArray businessAccountDetails = null;
+                if(_obj instanceof JSONObject){
+                    businessAccountDetails = new JSONArray();
+                    businessAccountDetails.add(_obj);
+                }else {
+                    businessAccountDetails = (JSONArray)_obj;
+                }
+                //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+                for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetails.size();_accountDetailIndex++) {
+                    JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(_accountDetailIndex);
+                    doBusinessAccountDetail(business, businessAccountDetail);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                    }
+                }
+            }
+    }
+
+
+    /**
+     * 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> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if( businessAccountDetailInfos != null && businessAccountDetailInfos.size() >0) {
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+                if(businessAccountDetailInfo.size() == 1) {
+                    dataFlowContext.addParamOut("detailId", businessAccountDetailInfo.get("detail_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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if(accountDetailInfo != null && accountDetailInfo.size() > 0){
+
+            //璐︽埛浜ゆ槗淇℃伅
+            List<Map> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(delInfo);
+            //闄ら潪绋嬪簭鍑洪敊浜嗭紝杩欓噷涓嶄細涓虹┖
+            if(businessAccountDetailInfos == null || businessAccountDetailInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"鎾ゅ崟澶辫触锛坅ccountDetail锛夛紝绋嬪簭鍐呴儴寮傚父,璇锋鏌ワ紒 "+delInfo);
+            }
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+            }
+        }
+
+    }
+
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     * @param business 鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business,JSONObject businessAccountDetail){
+
+        Assert.jsonObjectHaveKey(businessAccountDetail,"detailId","businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if(businessAccountDetail.getString("detailId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"detailId 閿欒锛屼笉鑳借嚜鍔ㄧ敓鎴愶紙蹇呴』宸茬粡瀛樺湪鐨刣etailId锛�"+businessAccountDetail);
+        }
+        //鑷姩淇濆瓨DEL
+        autoSaveDelBusinessAccountDetail(business,businessAccountDetail);
+
+        businessAccountDetail.put("bId",business.getbId());
+        businessAccountDetail.put("operate", StatusConstant.OPERATE_ADD);
+        //淇濆瓨璐︽埛浜ゆ槗淇℃伅
+        accountDetailServiceDaoImpl.saveBusinessAccountDetailInfo(businessAccountDetail);
+
+    }
+
+
+
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+
+
+
+}
diff --git a/java110-bean/src/main/java/com/java110/dto/accountDetail/AccountDetailDto.java b/java110-bean/src/main/java/com/java110/dto/accountDetail/AccountDetailDto.java
new file mode 100644
index 0000000..efb6bf9
--- /dev/null
+++ b/java110-bean/src/main/java/com/java110/dto/accountDetail/AccountDetailDto.java
@@ -0,0 +1,104 @@
+package com.java110.dto.accountDetail;
+
+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 AccountDetailDto extends PageDto implements Serializable {
+
+    private String detailType;
+private String amount;
+private String orderId;
+private String objId;
+private String detailId;
+private String acctId;
+private String relAcctId;
+private String remark;
+private String objType;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getDetailType() {
+        return detailType;
+    }
+public void setDetailType(String detailType) {
+        this.detailType = detailType;
+    }
+public String getAmount() {
+        return amount;
+    }
+public void setAmount(String amount) {
+        this.amount = amount;
+    }
+public String getOrderId() {
+        return orderId;
+    }
+public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+public String getObjId() {
+        return objId;
+    }
+public void setObjId(String objId) {
+        this.objId = objId;
+    }
+public String getDetailId() {
+        return detailId;
+    }
+public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+public String getAcctId() {
+        return acctId;
+    }
+public void setAcctId(String acctId) {
+        this.acctId = acctId;
+    }
+public String getRelAcctId() {
+        return relAcctId;
+    }
+public void setRelAcctId(String relAcctId) {
+        this.relAcctId = relAcctId;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getObjType() {
+        return objType;
+    }
+public void setObjType(String objType) {
+        this.objType = objType;
+    }
+
+
+    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;
+    }
+}
diff --git a/java110-bean/src/main/java/com/java110/po/accountDetail/AccountDetailPo.java b/java110-bean/src/main/java/com/java110/po/accountDetail/AccountDetailPo.java
new file mode 100644
index 0000000..b8c8006
--- /dev/null
+++ b/java110-bean/src/main/java/com/java110/po/accountDetail/AccountDetailPo.java
@@ -0,0 +1,74 @@
+package com.java110.po.accountDetail;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class AccountDetailPo implements Serializable {
+
+    private String detailType;
+private String amount;
+private String orderId;
+private String objId;
+private String detailId;
+private String acctId;
+private String relAcctId;
+private String remark;
+private String objType;
+public String getDetailType() {
+        return detailType;
+    }
+public void setDetailType(String detailType) {
+        this.detailType = detailType;
+    }
+public String getAmount() {
+        return amount;
+    }
+public void setAmount(String amount) {
+        this.amount = amount;
+    }
+public String getOrderId() {
+        return orderId;
+    }
+public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+public String getObjId() {
+        return objId;
+    }
+public void setObjId(String objId) {
+        this.objId = objId;
+    }
+public String getDetailId() {
+        return detailId;
+    }
+public void setDetailId(String detailId) {
+        this.detailId = detailId;
+    }
+public String getAcctId() {
+        return acctId;
+    }
+public void setAcctId(String acctId) {
+        this.acctId = acctId;
+    }
+public String getRelAcctId() {
+        return relAcctId;
+    }
+public void setRelAcctId(String relAcctId) {
+        this.relAcctId = relAcctId;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getObjType() {
+        return objType;
+    }
+public void setObjType(String objType) {
+        this.objType = objType;
+    }
+
+
+
+}
diff --git a/java110-db/src/main/resources/mapper/acct/AccountDetailServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/acct/AccountDetailServiceDaoImplMapper.xml
new file mode 100644
index 0000000..455be64
--- /dev/null
+++ b/java110-db/src/main/resources/mapper/acct/AccountDetailServiceDaoImplMapper.xml
@@ -0,0 +1,232 @@
+<?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="accountDetailServiceDaoImpl">
+
+    <!-- 淇濆瓨璐︽埛浜ゆ槗淇℃伅 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessAccountDetailInfo" parameterType="Map">
+           insert into business_account_detail(
+detail_type,amount,operate,order_id,obj_id,detail_id,acct_id,rel_acct_id,remark,b_id,obj_type
+) values (
+#{detailType},#{amount},#{operate},#{orderId},#{objId},#{detailId},#{acctId},#{relAcctId},#{remark},#{bId},#{objType}
+)
+       </insert>
+
+
+       <!-- 鏌ヨ璐︽埛浜ゆ槗淇℃伅锛圔usiness锛� add by wuxw 2018-07-03 -->
+       <select id="getBusinessAccountDetailInfo" parameterType="Map" resultType="Map">
+           select  t.detail_type,t.detail_type detailType,t.amount,t.operate,t.order_id,t.order_id orderId,t.obj_id,t.obj_id objId,t.detail_id,t.detail_id detailId,t.acct_id,t.acct_id acctId,t.rel_acct_id,t.rel_acct_id relAcctId,t.remark,t.b_id,t.b_id bId,t.obj_type,t.obj_type objType 
+from business_account_detail t 
+where 1 =1 
+<if test="detailType !=null and detailType != ''">
+   and t.detail_type= #{detailType}
+</if> 
+<if test="amount !=null and amount != ''">
+   and t.amount= #{amount}
+</if> 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="orderId !=null and orderId != ''">
+   and t.order_id= #{orderId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="detailId !=null and detailId != ''">
+   and t.detail_id= #{detailId}
+</if> 
+<if test="acctId !=null and acctId != ''">
+   and t.acct_id= #{acctId}
+</if> 
+<if test="relAcctId !=null and relAcctId != ''">
+   and t.rel_acct_id= #{relAcctId}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 淇濆瓨璐︽埛浜ゆ槗淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
+    <insert id="saveAccountDetailInfoInstance" parameterType="Map">
+        insert into account_detail(
+detail_type,amount,order_id,obj_id,detail_id,acct_id,rel_acct_id,remark,status_cd,b_id,obj_type
+) select t.detail_type,t.amount,t.order_id,t.obj_id,t.detail_id,t.acct_id,t.rel_acct_id,t.remark,'0',t.b_id,t.obj_type from business_account_detail t where 1=1
+<if test="detailType !=null and detailType != ''">
+   and t.detail_type= #{detailType}
+</if> 
+<if test="amount !=null and amount != ''">
+   and t.amount= #{amount}
+</if> 
+   and t.operate= 'ADD'
+<if test="orderId !=null and orderId != ''">
+   and t.order_id= #{orderId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="detailId !=null and detailId != ''">
+   and t.detail_id= #{detailId}
+</if> 
+<if test="acctId !=null and acctId != ''">
+   and t.acct_id= #{acctId}
+</if> 
+<if test="relAcctId !=null and relAcctId != ''">
+   and t.rel_acct_id= #{relAcctId}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 鏌ヨ璐︽埛浜ゆ槗淇℃伅 add by wuxw 2018-07-03 -->
+    <select id="getAccountDetailInfo" parameterType="Map" resultType="Map">
+        select  t.detail_type,t.detail_type detailType,t.amount,t.order_id,t.order_id orderId,t.obj_id,t.obj_id objId,t.detail_id,t.detail_id detailId,t.acct_id,t.acct_id acctId,t.rel_acct_id,t.rel_acct_id relAcctId,t.remark,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.obj_type,t.obj_type objType 
+from account_detail t 
+where 1 =1 
+<if test="detailType !=null and detailType != ''">
+   and t.detail_type= #{detailType}
+</if> 
+<if test="amount !=null and amount != ''">
+   and t.amount= #{amount}
+</if> 
+<if test="orderId !=null and orderId != ''">
+   and t.order_id= #{orderId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="detailId !=null and detailId != ''">
+   and t.detail_id= #{detailId}
+</if> 
+<if test="acctId !=null and acctId != ''">
+   and t.acct_id= #{acctId}
+</if> 
+<if test="relAcctId !=null and relAcctId != ''">
+   and t.rel_acct_id= #{relAcctId}
+</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="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</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="updateAccountDetailInfoInstance" parameterType="Map">
+        update  account_detail t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if> 
+<if test="detailType !=null and detailType != ''">
+, t.detail_type= #{detailType}
+</if> 
+<if test="amount !=null and amount != ''">
+, t.amount= #{amount}
+</if> 
+<if test="orderId !=null and orderId != ''">
+, t.order_id= #{orderId}
+</if> 
+<if test="objId !=null and objId != ''">
+, t.obj_id= #{objId}
+</if> 
+<if test="acctId !=null and acctId != ''">
+, t.acct_id= #{acctId}
+</if> 
+<if test="relAcctId !=null and relAcctId != ''">
+, t.rel_acct_id= #{relAcctId}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="objType !=null and objType != ''">
+, t.obj_type= #{objType}
+</if> 
+ where 1=1 <if test="detailId !=null and detailId != ''">
+and t.detail_id= #{detailId}
+</if> 
+<if test="bId !=null and bId != ''">
+and t.b_id= #{bId}
+</if> 
+
+    </update>
+
+    <!-- 鏌ヨ璐︽埛浜ゆ槗鏁伴噺 add by wuxw 2018-07-03 -->
+     <select id="queryAccountDetailsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from account_detail t 
+where 1 =1 
+<if test="detailType !=null and detailType != ''">
+   and t.detail_type= #{detailType}
+</if> 
+<if test="amount !=null and amount != ''">
+   and t.amount= #{amount}
+</if> 
+<if test="orderId !=null and orderId != ''">
+   and t.order_id= #{orderId}
+</if> 
+<if test="objId !=null and objId != ''">
+   and t.obj_id= #{objId}
+</if> 
+<if test="detailId !=null and detailId != ''">
+   and t.detail_id= #{detailId}
+</if> 
+<if test="acctId !=null and acctId != ''">
+   and t.acct_id= #{acctId}
+</if> 
+<if test="relAcctId !=null and relAcctId != ''">
+   and t.rel_acct_id= #{relAcctId}
+</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="bId !=null and bId != ''">
+   and t.b_id= #{bId}
+</if> 
+<if test="objType !=null and objType != ''">
+   and t.obj_type= #{objType}
+</if> 
+
+
+     </select>
+
+</mapper>
diff --git a/java110-generator/src/main/resources/back/template_1.json b/java110-generator/src/main/resources/back/template_1.json
index 936e789..43d5043 100755
--- a/java110-generator/src/main/resources/back/template_1.json
+++ b/java110-generator/src/main/resources/back/template_1.json
@@ -1,38 +1,41 @@
 {
   "autoMove": true,
-  "id": "acctId",
-  "name": "account",
-  "desc": "璐︽埛",
+  "id": "detailId",
+  "name": "accountDetail",
+  "desc": "璐︽埛浜ゆ槗",
   "shareParam": "objId",
   "shareColumn": "obj_id",
   "shareName": "acct",
-  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_ACCT",
-  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_ACCT",
-  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_ACCT",
-  "newBusinessTypeCdValue": "121100030001",
-  "updateBusinessTypeCdValue": "121100040001",
-  "deleteBusinessTypeCdValue": "121100050001",
-  "businessTableName": "business_account",
-  "tableName": "account",
+  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_ACCT_DETAIL",
+  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_ACCT_DETAIL",
+  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_ACCT_DETAIL",
+  "newBusinessTypeCdValue": "121100030002",
+  "updateBusinessTypeCdValue": "121100040002",
+  "deleteBusinessTypeCdValue": "121100050002",
+  "businessTableName": "business_account_detail",
+  "tableName": "account_detail",
   "param": {
+    "detailId": "detail_id",
     "acctId": "acct_id",
-    "acctName": "acct_name",
-    "acctType": "acct_type",
+    "detailType": "detail_type",
     "bId": "b_id",
+    "relAcctId": "rel_acct_id",
     "amount": "amount",
     "objType": "obj_type",
     "objId": "obj_id",
+    "orderId": "order_id",
+    "remark": "remark",
     "statusCd": "status_cd",
     "operate": "operate"
   },
   "required": [
     {
-      "code": "acctName",
-      "msg": "璐︽埛鍚嶇О涓嶈兘涓虹┖"
+      "code": "acctId",
+      "msg": "璐︽埛涓嶈兘涓虹┖"
     },
     {
-      "code": "acctType",
-      "msg": "璐︽埛绫诲瀷涓嶈兘涓虹┖"
+      "code": "detailType",
+      "msg": "绫诲瀷涓嶈兘涓虹┖"
     },
     {
       "code": "amount",
diff --git a/java110-interface/src/main/java/com/java110/intf/acct/IAccountDetailInnerServiceSMO.java b/java110-interface/src/main/java/com/java110/intf/acct/IAccountDetailInnerServiceSMO.java
new file mode 100644
index 0000000..d5fb861
--- /dev/null
+++ b/java110-interface/src/main/java/com/java110/intf/acct/IAccountDetailInnerServiceSMO.java
@@ -0,0 +1,42 @@
+package com.java110.intf.acct;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.accountDetail.AccountDetailDto;
+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 IAccountDetailInnerServiceSMO
+ * @Description 璐︽埛浜ゆ槗鎺ュ彛绫�
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "acct-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/accountDetailApi")
+public interface IAccountDetailInnerServiceSMO {
+
+    /**
+     * <p>鏌ヨ灏忓尯妤间俊鎭�</p>
+     *
+     *
+     * @param accountDetailDto 鏁版嵁瀵硅薄鍒嗕韩
+     * @return AccountDetailDto 瀵硅薄鏁版嵁
+     */
+    @RequestMapping(value = "/queryAccountDetails", method = RequestMethod.POST)
+    List<AccountDetailDto> queryAccountDetails(@RequestBody AccountDetailDto accountDetailDto);
+
+    /**
+     * 鏌ヨ<p>灏忓尯妤�</p>鎬昏褰曟暟
+     *
+     * @param accountDetailDto 鏁版嵁瀵硅薄鍒嗕韩
+     * @return 灏忓尯涓嬬殑灏忓尯妤艰褰曟暟
+     */
+    @RequestMapping(value = "/queryAccountDetailsCount", method = RequestMethod.POST)
+    int queryAccountDetailsCount(@RequestBody AccountDetailDto accountDetailDto);
+}
diff --git a/java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java b/java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
index bde3f6a..896ffc7 100755
--- a/java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
+++ b/java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
@@ -1590,4 +1590,22 @@
     public static final String BUSINESS_TYPE_DELETE_ACCT="121100050001";
 
 
+    /**
+     *  娣诲姞璐︽埛鏄庣粏
+     *  3淇濆瓨
+     */
+    public static final String BUSINESS_TYPE_SAVE_ACCT_DETAIL="121100030002";
+
+    /**
+     *  淇敼璐︽埛鏄庣粏
+     *  3淇濆瓨
+     */
+    public static final String BUSINESS_TYPE_UPDATE_ACCT_DETAIL="121100040002";
+
+    /**
+     * 鍒犻櫎璐︽埛鏄庣粏
+     */
+    public static final String BUSINESS_TYPE_DELETE_ACCT_DETAIL="121100050002";
+
+
 }
diff --git a/java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAccountDetailConstant.java b/java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAccountDetailConstant.java
new file mode 100644
index 0000000..e2037c4
--- /dev/null
+++ b/java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeAccountDetailConstant.java
@@ -0,0 +1,31 @@
+package com.java110.utils.constant;
+
+/**
+ * 璐︽埛浜ゆ槗甯搁噺绫�
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeAccountDetailConstant {
+
+    /**
+     * 娣诲姞 璐︽埛浜ゆ槗
+     */
+    public static final String ADD_ACCOUNTDETAIL = "account.saveAccountDetail";
+
+
+    /**
+     * 淇敼 璐︽埛浜ゆ槗
+     */
+    public static final String UPDATE_ACCOUNTDETAIL = "account.updateAccountDetail";
+    /**
+     * 鍒犻櫎 璐︽埛浜ゆ槗
+     */
+    public static final String DELETE_ACCOUNTDETAIL = "account.deleteAccountDetail";
+
+
+    /**
+     * 鏌ヨ 璐︽埛浜ゆ槗
+     */
+    public static final String LIST_ACCOUNTDETAILS = "account.listAccountDetails";
+
+
+}
diff --git a/service-acct/src/main/java/com/java110/acct/dao/IAccountDetailServiceDao.java b/service-acct/src/main/java/com/java110/acct/dao/IAccountDetailServiceDao.java
new file mode 100644
index 0000000..00231f7
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/dao/IAccountDetailServiceDao.java
@@ -0,0 +1,81 @@
+package com.java110.acct.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 IAccountDetailServiceDao {
+
+    /**
+     * 淇濆瓨 璐︽埛浜ゆ槗淇℃伅
+     * @param businessAccountDetailInfo 璐︽埛浜ゆ槗淇℃伅 灏佽
+     * @throws DAOException 鎿嶄綔鏁版嵁搴撳紓甯�
+     */
+    void saveBusinessAccountDetailInfo(Map businessAccountDetailInfo) throws DAOException;
+
+
+
+    /**
+     * 鏌ヨ璐︽埛浜ゆ槗淇℃伅锛坆usiness杩囩▼锛�
+     * 鏍规嵁bId 鏌ヨ璐︽埛浜ゆ槗淇℃伅
+     * @param info bId 淇℃伅
+     * @return 璐︽埛浜ゆ槗淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    List<Map> getBusinessAccountDetailInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 淇濆瓨 璐︽埛浜ゆ槗淇℃伅 Business鏁版嵁鍒� Instance涓�
+     * @param info
+     * @throws DAOException DAO寮傚父
+     */
+    void saveAccountDetailInfoInstance(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 鏌ヨ璐︽埛浜ゆ槗淇℃伅锛坕nstance杩囩▼锛�
+     * 鏍规嵁bId 鏌ヨ璐︽埛浜ゆ槗淇℃伅
+     * @param info bId 淇℃伅
+     * @return 璐︽埛浜ゆ槗淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    List<Map> getAccountDetailInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 淇敼璐︽埛浜ゆ槗淇℃伅
+     * @param info 淇敼淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    void updateAccountDetailInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 鏌ヨ璐︽埛浜ゆ槗鎬绘暟
+     *
+     * @param info 璐︽埛浜ゆ槗淇℃伅
+     * @return 璐︽埛浜ゆ槗鏁伴噺
+     */
+    int queryAccountDetailsCount(Map info);
+
+}
diff --git a/service-acct/src/main/java/com/java110/acct/dao/impl/AccountDetailServiceDaoImpl.java b/service-acct/src/main/java/com/java110/acct/dao/impl/AccountDetailServiceDaoImpl.java
new file mode 100644
index 0000000..6de6196
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/dao/impl/AccountDetailServiceDaoImpl.java
@@ -0,0 +1,130 @@
+package com.java110.acct.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.acct.dao.IAccountDetailServiceDao;
+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("accountDetailServiceDaoImpl")
+//@Transactional
+public class AccountDetailServiceDaoImpl extends BaseServiceDao implements IAccountDetailServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(AccountDetailServiceDaoImpl.class);
+
+    /**
+     * 璐︽埛浜ゆ槗淇℃伅灏佽
+     * @param businessAccountDetailInfo 璐︽埛浜ゆ槗淇℃伅 灏佽
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public void saveBusinessAccountDetailInfo(Map businessAccountDetailInfo) throws DAOException {
+        businessAccountDetailInfo.put("month", DateUtil.getCurrentMonth());
+        // 鏌ヨbusiness_user 鏁版嵁鏄惁宸茬粡瀛樺湪
+        logger.debug("淇濆瓨璐︽埛浜ゆ槗淇℃伅 鍏ュ弬 businessAccountDetailInfo : {}",businessAccountDetailInfo);
+        int saveFlag = sqlSessionTemplate.insert("accountDetailServiceDaoImpl.saveBusinessAccountDetailInfo",businessAccountDetailInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璐︽埛浜ゆ槗鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(businessAccountDetailInfo));
+        }
+    }
+
+
+    /**
+     * 鏌ヨ璐︽埛浜ゆ槗淇℃伅
+     * @param info bId 淇℃伅
+     * @return 璐︽埛浜ゆ槗淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public List<Map> getBusinessAccountDetailInfo(Map info) throws DAOException {
+
+        logger.debug("鏌ヨ璐︽埛浜ゆ槗淇℃伅 鍏ュ弬 info : {}",info);
+
+        List<Map> businessAccountDetailInfos = sqlSessionTemplate.selectList("accountDetailServiceDaoImpl.getBusinessAccountDetailInfo",info);
+
+        return businessAccountDetailInfos;
+    }
+
+
+
+    /**
+     * 淇濆瓨璐︽埛浜ゆ槗淇℃伅 鍒� instance
+     * @param info   bId 淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public void saveAccountDetailInfoInstance(Map info) throws DAOException {
+        logger.debug("淇濆瓨璐︽埛浜ゆ槗淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("accountDetailServiceDaoImpl.saveAccountDetailInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇濆瓨璐︽埛浜ゆ槗淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 鏌ヨ璐︽埛浜ゆ槗淇℃伅锛坕nstance锛�
+     * @param info bId 淇℃伅
+     * @return List<Map>
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public List<Map> getAccountDetailInfo(Map info) throws DAOException {
+        logger.debug("鏌ヨ璐︽埛浜ゆ槗淇℃伅 鍏ュ弬 info : {}",info);
+
+        List<Map> businessAccountDetailInfos = sqlSessionTemplate.selectList("accountDetailServiceDaoImpl.getAccountDetailInfo",info);
+
+        return businessAccountDetailInfos;
+    }
+
+
+    /**
+     * 淇敼璐︽埛浜ゆ槗淇℃伅
+     * @param info 淇敼淇℃伅
+     * @throws DAOException DAO寮傚父
+     */
+    @Override
+    public void updateAccountDetailInfoInstance(Map info) throws DAOException {
+        logger.debug("淇敼璐︽埛浜ゆ槗淇℃伅Instance 鍏ュ弬 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("accountDetailServiceDaoImpl.updateAccountDetailInfoInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"淇敼璐︽埛浜ゆ槗淇℃伅Instance鏁版嵁澶辫触锛�"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 鏌ヨ璐︽埛浜ゆ槗鏁伴噺
+     * @param info 璐︽埛浜ゆ槗淇℃伅
+     * @return 璐︽埛浜ゆ槗鏁伴噺
+     */
+    @Override
+    public int queryAccountDetailsCount(Map info) {
+        logger.debug("鏌ヨ璐︽埛浜ゆ槗鏁版嵁 鍏ュ弬 info : {}",info);
+
+        List<Map> businessAccountDetailInfos = sqlSessionTemplate.selectList("accountDetailServiceDaoImpl.queryAccountDetailsCount", info);
+        if (businessAccountDetailInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessAccountDetailInfos.get(0).get("count").toString());
+    }
+
+
+}
diff --git a/service-acct/src/main/java/com/java110/acct/listener/accountDetail/AbstractAccountDetailBusinessServiceDataFlowListener.java b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/AbstractAccountDetailBusinessServiceDataFlowListener.java
new file mode 100644
index 0000000..6c02d95
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/AbstractAccountDetailBusinessServiceDataFlowListener.java
@@ -0,0 +1,96 @@
+package com.java110.acct.listener.accountDetail;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.acct.dao.IAccountDetailServiceDao;
+import com.java110.core.event.service.AbstractBusinessServiceDataFlowListener;
+import com.java110.entity.center.Business;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.exception.ListenerExecuteException;
+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 AbstractAccountDetailBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
+    private static Logger logger = LoggerFactory.getLogger(AbstractAccountDetailBusinessServiceDataFlowListener.class);
+
+
+    /**
+     * 鑾峰彇 DAO宸ュ叿绫�
+     *
+     * @return
+     */
+    public abstract IAccountDetailServiceDao getAccountDetailServiceDaoImpl();
+
+    /**
+     * 鍒锋柊 businessAccountDetailInfo 鏁版嵁
+     * 涓昏灏� 鏁版嵁搴� 涓瓧娈靛拰 鎺ュ彛浼犻�掑瓧娈靛缓绔嬪叧绯�
+     *
+     * @param businessAccountDetailInfo
+     */
+    protected void flushBusinessAccountDetailInfo(Map businessAccountDetailInfo, String statusCd) {
+        businessAccountDetailInfo.put("newBId", businessAccountDetailInfo.get("b_id"));
+        businessAccountDetailInfo.put("detailType", businessAccountDetailInfo.get("detail_type"));
+        businessAccountDetailInfo.put("amount", businessAccountDetailInfo.get("amount"));
+        businessAccountDetailInfo.put("operate", businessAccountDetailInfo.get("operate"));
+        businessAccountDetailInfo.put("orderId", businessAccountDetailInfo.get("order_id"));
+        businessAccountDetailInfo.put("objId", businessAccountDetailInfo.get("obj_id"));
+        businessAccountDetailInfo.put("detailId", businessAccountDetailInfo.get("detail_id"));
+        businessAccountDetailInfo.put("acctId", businessAccountDetailInfo.get("acct_id"));
+        businessAccountDetailInfo.put("relAcctId", businessAccountDetailInfo.get("rel_acct_id"));
+        businessAccountDetailInfo.put("remark", businessAccountDetailInfo.get("remark"));
+        businessAccountDetailInfo.put("objType", businessAccountDetailInfo.get("obj_type"));
+        businessAccountDetailInfo.remove("bId");
+        businessAccountDetailInfo.put("statusCd", statusCd);
+    }
+
+
+    /**
+     * 褰撲慨鏀规暟鎹椂锛屾煡璇nstance琛ㄤ腑鐨勬暟鎹� 鑷姩淇濆瓨鍒犻櫎鏁版嵁鍒癰usiness涓�
+     *
+     * @param businessAccountDetail 璐︽埛浜ゆ槗淇℃伅
+     */
+    protected void autoSaveDelBusinessAccountDetail(Business business, JSONObject businessAccountDetail) {
+//鑷姩鎻掑叆DEL
+        Map info = new HashMap();
+        info.put("detailId", businessAccountDetail.getString("detailId"));
+        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
+        List<Map> currentAccountDetailInfos = getAccountDetailServiceDaoImpl().getAccountDetailInfo(info);
+        if (currentAccountDetailInfos == null || currentAccountDetailInfos.size() != 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "鏈壘鍒伴渶瑕佷慨鏀规暟鎹俊鎭紝鍏ュ弬閿欒鎴栨暟鎹湁闂锛岃妫�鏌�" + info);
+        }
+
+        Map currentAccountDetailInfo = currentAccountDetailInfos.get(0);
+
+        currentAccountDetailInfo.put("bId", business.getbId());
+
+        currentAccountDetailInfo.put("detailType", currentAccountDetailInfo.get("detail_type"));
+        currentAccountDetailInfo.put("amount", currentAccountDetailInfo.get("amount"));
+        currentAccountDetailInfo.put("operate", currentAccountDetailInfo.get("operate"));
+        currentAccountDetailInfo.put("orderId", currentAccountDetailInfo.get("order_id"));
+        currentAccountDetailInfo.put("objId", currentAccountDetailInfo.get("obj_id"));
+        currentAccountDetailInfo.put("detailId", currentAccountDetailInfo.get("detail_id"));
+        currentAccountDetailInfo.put("acctId", currentAccountDetailInfo.get("acct_id"));
+        currentAccountDetailInfo.put("relAcctId", currentAccountDetailInfo.get("rel_acct_id"));
+        currentAccountDetailInfo.put("remark", currentAccountDetailInfo.get("remark"));
+        currentAccountDetailInfo.put("objType", currentAccountDetailInfo.get("obj_type"));
+
+
+        currentAccountDetailInfo.put("operate", StatusConstant.OPERATE_DEL);
+        getAccountDetailServiceDaoImpl().saveBusinessAccountDetailInfo(currentAccountDetailInfo);
+        for (Object key : currentAccountDetailInfo.keySet()) {
+            if (businessAccountDetail.get(key) == null) {
+                businessAccountDetail.put(key.toString(), currentAccountDetailInfo.get(key));
+            }
+        }
+    }
+
+
+}
diff --git a/service-acct/src/main/java/com/java110/acct/listener/accountDetail/DeleteAccountDetailInfoListener.java b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/DeleteAccountDetailInfoListener.java
new file mode 100644
index 0000000..0485924
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/DeleteAccountDetailInfoListener.java
@@ -0,0 +1,176 @@
+package com.java110.acct.listener.accountDetail;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.po.accountDetail.AccountDetailPo;
+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.acct.dao.IAccountDetailServiceDao;
+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銆乥usinessAccountDetail:{} 璐︽埛浜ゆ槗鍩烘湰淇℃伅鑺傜偣
+ * 2銆乥usinessAccountDetailAttr:[{}] 璐︽埛浜ゆ槗灞炴�т俊鎭妭鐐�
+ * 3銆乥usinessAccountDetailPhoto:[{}] 璐︽埛浜ゆ槗鐓х墖淇℃伅鑺傜偣
+ * 4銆乥usinessAccountDetailCerdentials:[{}] 璐︽埛浜ゆ槗璇佷欢淇℃伅鑺傜偣
+ * 鍗忚鍦板潃 锛歨ttps://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("deleteAccountDetailInfoListener")
+@Transactional
+public class DeleteAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener {
+
+    private final static Logger logger = LoggerFactory.getLogger(DeleteAccountDetailInfoListener.class);
+    @Autowired
+    IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 3;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ACCT_DETAIL;
+    }
+
+    /**
+     * 鏍规嵁鍒犻櫎淇℃伅 鏌ュ嚭Instance琛ㄤ腑鏁版嵁 淇濆瓨鑷砨usiness琛� 锛堢姸鎬佸啓DEL锛� 鏂逛究鎾ゅ崟鏃剁洿鎺ユ洿鏂板洖鍘�
+     * @param dataFlowContext 鏁版嵁瀵硅薄
+     * @param business 褰撳墠涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data,"娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+            //澶勭悊 businessAccountDetail 鑺傜偣
+            if(data.containsKey(AccountDetailPo.class.getSimpleName())){
+                Object _obj = data.get(AccountDetailPo.class.getSimpleName());
+                JSONArray businessAccountDetails = null;
+                if(_obj instanceof JSONObject){
+                    businessAccountDetails = new JSONArray();
+                    businessAccountDetails.add(_obj);
+                }else {
+                    businessAccountDetails = (JSONArray)_obj;
+                }
+                //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+                for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetails.size();_accountDetailIndex++) {
+                    JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(_accountDetailIndex);
+                    doBusinessAccountDetail(business, businessAccountDetail);
+                    if(_obj instanceof JSONObject) {
+                        dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                    }
+                }
+
+        }
+
+
+    }
+
+    /**
+     * 鍒犻櫎 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> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if( businessAccountDetailInfos != null && businessAccountDetailInfos.size() >0) {
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_INVALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+                dataFlowContext.addParamOut("detailId",businessAccountDetailInfo.get("detail_id"));
+            }
+        }
+
+    }
+
+    /**
+     * 鎾ゅ崟
+     * 浠巄usiness琛ㄤ腑鏌ヨ鍒癉EL鐨勬暟鎹� 灏唅nstance涓殑鏁版嵁鏇存柊鍥炴潵
+     * @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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if(accountDetailInfo != null && accountDetailInfo.size() > 0){
+
+            //璐︽埛浜ゆ槗淇℃伅
+            List<Map> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(delInfo);
+            //闄ら潪绋嬪簭鍑洪敊浜嗭紝杩欓噷涓嶄細涓虹┖
+            if(businessAccountDetailInfos == null ||  businessAccountDetailInfos.size() == 0){
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"鎾ゅ崟澶辫触锛坅ccountDetail锛夛紝绋嬪簭鍐呴儴寮傚父,璇锋鏌ワ紒 "+delInfo);
+            }
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size();_accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo,StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+            }
+        }
+    }
+
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     * @param business 鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business,JSONObject businessAccountDetail){
+
+        Assert.jsonObjectHaveKey(businessAccountDetail,"detailId","businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if(businessAccountDetail.getString("detailId").startsWith("-")){
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"detailId 閿欒锛屼笉鑳借嚜鍔ㄧ敓鎴愶紙蹇呴』宸茬粡瀛樺湪鐨刣etailId锛�"+businessAccountDetail);
+        }
+        //鑷姩鎻掑叆DEL
+        autoSaveDelBusinessAccountDetail(business,businessAccountDetail);
+    }
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+}
diff --git a/service-acct/src/main/java/com/java110/acct/listener/accountDetail/SaveAccountDetailInfoListener.java b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/SaveAccountDetailInfoListener.java
new file mode 100644
index 0000000..396b056
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/SaveAccountDetailInfoListener.java
@@ -0,0 +1,176 @@
+package com.java110.acct.listener.accountDetail;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.po.accountDetail.AccountDetailPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.constant.StatusConstant;
+import com.java110.utils.util.Assert;
+import com.java110.acct.dao.IAccountDetailServiceDao;
+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("saveAccountDetailInfoListener")
+@Transactional
+public class SaveAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener{
+
+    private static Logger logger = LoggerFactory.getLogger(SaveAccountDetailInfoListener.class);
+
+    @Autowired
+    private IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 0;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ACCT_DETAIL;
+    }
+
+    /**
+     * 淇濆瓨璐︽埛浜ゆ槗淇℃伅 business 琛ㄤ腑
+     * @param dataFlowContext 鏁版嵁瀵硅薄
+     * @param business 褰撳墠涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+        JSONObject data = business.getDatas();
+        Assert.notEmpty(data,"娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+        //澶勭悊 businessAccountDetail 鑺傜偣
+        if(data.containsKey(AccountDetailPo.class.getSimpleName())){
+            Object bObj = data.get(AccountDetailPo.class.getSimpleName());
+            JSONArray businessAccountDetails = null;
+            if(bObj instanceof JSONObject){
+                businessAccountDetails = new JSONArray();
+                businessAccountDetails.add(bObj);
+            }else {
+                businessAccountDetails = (JSONArray)bObj;
+            }
+            //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+            for (int bAccountDetailIndex = 0; bAccountDetailIndex < businessAccountDetails.size();bAccountDetailIndex++) {
+                JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(bAccountDetailIndex);
+                doBusinessAccountDetail(business, businessAccountDetail);
+                if(bObj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                }
+            }
+        }
+    }
+
+    /**
+     * 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> businessAccountDetailInfo = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if( businessAccountDetailInfo != null && businessAccountDetailInfo.size() >0) {
+            reFreshShareColumn(info, businessAccountDetailInfo.get(0));
+            accountDetailServiceDaoImpl.saveAccountDetailInfoInstance(info);
+            if(businessAccountDetailInfo.size() == 1) {
+                dataFlowContext.addParamOut("detailId", businessAccountDetailInfo.get(0).get("detail_id"));
+            }
+        }
+    }
+
+
+    /**
+     * 鍒� 鍒嗙墖瀛楁
+     *
+     * @param info         鏌ヨ瀵硅薄
+     * @param businessInfo 灏忓尯ID
+     */
+    private void reFreshShareColumn(Map info, Map businessInfo) {
+
+        if (info.containsKey("objId")) {
+            return;
+        }
+
+        if (!businessInfo.containsKey("obj_id")) {
+            return;
+        }
+
+        info.put("objId", businessInfo.get("obj_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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if(accountDetailInfo != null && accountDetailInfo.size() > 0){
+            reFreshShareColumn(paramIn, accountDetailInfo.get(0));
+            accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(paramIn);
+        }
+    }
+
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     * @param business 鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business,JSONObject businessAccountDetail){
+
+        Assert.jsonObjectHaveKey(businessAccountDetail,"detailId","businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if(businessAccountDetail.getString("detailId").startsWith("-")){
+            //鍒锋柊缂撳瓨
+            //flushAccountDetailId(business.getDatas());
+
+            businessAccountDetail.put("detailId",GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId));
+
+        }
+
+        businessAccountDetail.put("bId",business.getbId());
+        businessAccountDetail.put("operate", StatusConstant.OPERATE_ADD);
+        //淇濆瓨璐︽埛浜ゆ槗淇℃伅
+        accountDetailServiceDaoImpl.saveBusinessAccountDetailInfo(businessAccountDetail);
+
+    }
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+}
diff --git a/service-acct/src/main/java/com/java110/acct/listener/accountDetail/UpdateAccountDetailInfoListener.java b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/UpdateAccountDetailInfoListener.java
new file mode 100644
index 0000000..354d304
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/listener/accountDetail/UpdateAccountDetailInfoListener.java
@@ -0,0 +1,190 @@
+package com.java110.acct.listener.accountDetail;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.acct.dao.IAccountDetailServiceDao;
+import com.java110.core.annotation.Java110Listener;
+import com.java110.core.context.DataFlowContext;
+import com.java110.entity.center.Business;
+import com.java110.po.accountDetail.AccountDetailPo;
+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 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;
+
+/**
+ * 淇敼璐︽埛浜ゆ槗淇℃伅 渚﹀惉
+ * <p>
+ * 澶勭悊鑺傜偣
+ * 1銆乥usinessAccountDetail:{} 璐︽埛浜ゆ槗鍩烘湰淇℃伅鑺傜偣
+ * 2銆乥usinessAccountDetailAttr:[{}] 璐︽埛浜ゆ槗灞炴�т俊鎭妭鐐�
+ * 3銆乥usinessAccountDetailPhoto:[{}] 璐︽埛浜ゆ槗鐓х墖淇℃伅鑺傜偣
+ * 4銆乥usinessAccountDetailCerdentials:[{}] 璐︽埛浜ゆ槗璇佷欢淇℃伅鑺傜偣
+ * 鍗忚鍦板潃 锛歨ttps://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("updateAccountDetailInfoListener")
+@Transactional
+public class UpdateAccountDetailInfoListener extends AbstractAccountDetailBusinessServiceDataFlowListener {
+
+    private static Logger logger = LoggerFactory.getLogger(UpdateAccountDetailInfoListener.class);
+    @Autowired
+    private IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public int getOrder() {
+        return 2;
+    }
+
+    @Override
+    public String getBusinessTypeCd() {
+        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ACCT_DETAIL;
+    }
+
+    /**
+     * business杩囩▼
+     *
+     * @param dataFlowContext 涓婁笅鏂囧璞�
+     * @param business        涓氬姟瀵硅薄
+     */
+    @Override
+    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
+
+        JSONObject data = business.getDatas();
+
+        Assert.notEmpty(data, "娌℃湁datas 鑺傜偣锛屾垨娌℃湁瀛愯妭鐐归渶瑕佸鐞�");
+
+
+        //澶勭悊 businessAccountDetail 鑺傜偣
+        if (data.containsKey(AccountDetailPo.class.getSimpleName())) {
+            Object _obj = data.get(AccountDetailPo.class.getSimpleName());
+            JSONArray businessAccountDetails = null;
+            if (_obj instanceof JSONObject) {
+                businessAccountDetails = new JSONArray();
+                businessAccountDetails.add(_obj);
+            } else {
+                businessAccountDetails = (JSONArray) _obj;
+            }
+            //JSONObject businessAccountDetail = data.getJSONObject(AccountDetailPo.class.getSimpleName());
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetails.size(); _accountDetailIndex++) {
+                JSONObject businessAccountDetail = businessAccountDetails.getJSONObject(_accountDetailIndex);
+                doBusinessAccountDetail(business, businessAccountDetail);
+                if (_obj instanceof JSONObject) {
+                    dataFlowContext.addParamOut("detailId", businessAccountDetail.getString("detailId"));
+                }
+            }
+        }
+    }
+
+
+    /**
+     * 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> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(info);
+        if (businessAccountDetailInfos != null && businessAccountDetailInfos.size() > 0) {
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size(); _accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo, StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+                if (businessAccountDetailInfo.size() == 1) {
+                    dataFlowContext.addParamOut("detailId", businessAccountDetailInfo.get("detail_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> accountDetailInfo = accountDetailServiceDaoImpl.getAccountDetailInfo(info);
+        if (accountDetailInfo != null && accountDetailInfo.size() > 0) {
+
+            //璐︽埛浜ゆ槗淇℃伅
+            List<Map> businessAccountDetailInfos = accountDetailServiceDaoImpl.getBusinessAccountDetailInfo(delInfo);
+            //闄ら潪绋嬪簭鍑洪敊浜嗭紝杩欓噷涓嶄細涓虹┖
+            if (businessAccountDetailInfos == null || businessAccountDetailInfos.size() == 0) {
+                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "鎾ゅ崟澶辫触锛坅ccountDetail锛夛紝绋嬪簭鍐呴儴寮傚父,璇锋鏌ワ紒 " + delInfo);
+            }
+            for (int _accountDetailIndex = 0; _accountDetailIndex < businessAccountDetailInfos.size(); _accountDetailIndex++) {
+                Map businessAccountDetailInfo = businessAccountDetailInfos.get(_accountDetailIndex);
+                flushBusinessAccountDetailInfo(businessAccountDetailInfo, StatusConstant.STATUS_CD_VALID);
+                accountDetailServiceDaoImpl.updateAccountDetailInfoInstance(businessAccountDetailInfo);
+            }
+        }
+
+    }
+
+
+    /**
+     * 澶勭悊 businessAccountDetail 鑺傜偣
+     *
+     * @param business              鎬荤殑鏁版嵁鑺傜偣
+     * @param businessAccountDetail 璐︽埛浜ゆ槗鑺傜偣
+     */
+    private void doBusinessAccountDetail(Business business, JSONObject businessAccountDetail) {
+
+        Assert.jsonObjectHaveKey(businessAccountDetail, "detailId", "businessAccountDetail 鑺傜偣涓嬫病鏈夊寘鍚� detailId 鑺傜偣");
+
+        if (businessAccountDetail.getString("detailId").startsWith("-")) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "detailId 閿欒锛屼笉鑳借嚜鍔ㄧ敓鎴愶紙蹇呴』宸茬粡瀛樺湪鐨刣etailId锛�" + businessAccountDetail);
+        }
+        //鑷姩淇濆瓨DEL
+        autoSaveDelBusinessAccountDetail(business, businessAccountDetail);
+
+        businessAccountDetail.put("bId", business.getbId());
+        businessAccountDetail.put("operate", StatusConstant.OPERATE_ADD);
+        //淇濆瓨璐︽埛浜ゆ槗淇℃伅
+        accountDetailServiceDaoImpl.saveBusinessAccountDetailInfo(businessAccountDetail);
+
+    }
+
+
+    @Override
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+
+
+}
diff --git a/service-acct/src/main/java/com/java110/acct/smo/impl/AccountDetailInnerServiceSMOImpl.java b/service-acct/src/main/java/com/java110/acct/smo/impl/AccountDetailInnerServiceSMOImpl.java
new file mode 100644
index 0000000..b5cf4fb
--- /dev/null
+++ b/service-acct/src/main/java/com/java110/acct/smo/impl/AccountDetailInnerServiceSMOImpl.java
@@ -0,0 +1,91 @@
+package com.java110.acct.smo.impl;
+
+
+import com.java110.acct.dao.IAccountDetailServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.accountDetail.AccountDetailDto;
+import com.java110.dto.user.UserDto;
+import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
+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 AccountDetailInnerServiceSMOImpl extends BaseServiceSMO implements IAccountDetailInnerServiceSMO {
+
+    @Autowired
+    private IAccountDetailServiceDao accountDetailServiceDaoImpl;
+
+    @Override
+    public List<AccountDetailDto> queryAccountDetails(@RequestBody AccountDetailDto accountDetailDto) {
+
+        //鏍¢獙鏄惁浼犱簡 鍒嗛〉淇℃伅
+
+        int page = accountDetailDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            accountDetailDto.setPage((page - 1) * accountDetailDto.getRow());
+        }
+
+        List<AccountDetailDto> accountDetails = BeanConvertUtil.covertBeanList(accountDetailServiceDaoImpl.getAccountDetailInfo(BeanConvertUtil.beanCovertMap(accountDetailDto)), AccountDetailDto.class);
+
+
+        return accountDetails;
+    }
+
+    /**
+     * 浠庣敤鎴峰垪琛ㄤ腑鏌ヨ鐢ㄦ埛锛屽皢鐢ㄦ埛涓殑淇℃伅 鍒锋柊鍒� floor瀵硅薄涓�
+     *
+     * @param accountDetail 灏忓尯璐︽埛浜ゆ槗淇℃伅
+     * @param users         鐢ㄦ埛鍒楄〃
+     */
+    private void refreshAccountDetail(AccountDetailDto accountDetail, List<UserDto> users) {
+        for (UserDto user : users) {
+            if (accountDetail.getDetailId().equals(user.getUserId())) {
+                BeanConvertUtil.covertBean(user, accountDetail);
+            }
+        }
+    }
+
+    /**
+     * 鑾峰彇鎵归噺userId
+     *
+     * @param accountDetails 灏忓尯妤间俊鎭�
+     * @return 鎵归噺userIds 淇℃伅
+     */
+    private String[] getUserIds(List<AccountDetailDto> accountDetails) {
+        List<String> userIds = new ArrayList<String>();
+        for (AccountDetailDto accountDetail : accountDetails) {
+            userIds.add(accountDetail.getDetailId());
+        }
+
+        return userIds.toArray(new String[userIds.size()]);
+    }
+
+    @Override
+    public int queryAccountDetailsCount(@RequestBody AccountDetailDto accountDetailDto) {
+        return accountDetailServiceDaoImpl.queryAccountDetailsCount(BeanConvertUtil.beanCovertMap(accountDetailDto));
+    }
+
+    public IAccountDetailServiceDao getAccountDetailServiceDaoImpl() {
+        return accountDetailServiceDaoImpl;
+    }
+
+    public void setAccountDetailServiceDaoImpl(IAccountDetailServiceDao accountDetailServiceDaoImpl) {
+        this.accountDetailServiceDaoImpl = accountDetailServiceDaoImpl;
+    }
+
+}
diff --git a/service-api/src/main/java/com/java110/api/bmo/account/IAccountDetailBMO.java b/service-api/src/main/java/com/java110/api/bmo/account/IAccountDetailBMO.java
new file mode 100644
index 0000000..6e90a59
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/bmo/account/IAccountDetailBMO.java
@@ -0,0 +1,38 @@
+package com.java110.api.bmo.account;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.IApiBaseBMO;
+import com.java110.core.context.DataFlowContext;
+
+public interface IAccountDetailBMO extends IApiBaseBMO {
+
+
+    /**
+     * 娣诲姞璐︽埛浜ゆ槗
+     * @param paramInJson
+     * @param dataFlowContext
+     * @return
+     */
+     void addAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 娣诲姞璐︽埛浜ゆ槗淇℃伅
+     *
+     * @param paramInJson     鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+     * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+     * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+     */
+     void updateAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+    /**
+     * 鍒犻櫎璐︽埛浜ゆ槗
+     *
+     * @param paramInJson     鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+     * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+     * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+     */
+     void deleteAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext);
+
+
+
+}
diff --git a/service-api/src/main/java/com/java110/api/bmo/account/impl/AccountDetailBMOImpl.java b/service-api/src/main/java/com/java110/api/bmo/account/impl/AccountDetailBMOImpl.java
new file mode 100644
index 0000000..f0b1e2f
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/bmo/account/impl/AccountDetailBMOImpl.java
@@ -0,0 +1,61 @@
+package com.java110.api.bmo.account.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.ApiBaseBMO;
+import com.java110.api.bmo.account.IAccountDetailBMO;
+import com.java110.core.context.DataFlowContext;
+import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
+import com.java110.po.accountDetail.AccountDetailPo;
+import com.java110.utils.constant.BusinessTypeConstant;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service("accountDetailBMOImpl")
+public class AccountDetailBMOImpl extends ApiBaseBMO implements IAccountDetailBMO {
+
+    @Autowired
+    private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
+
+    /**
+     * 娣诲姞灏忓尯淇℃伅
+     *
+     * @param paramInJson     鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+     * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+     * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+     */
+    public void addAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        paramInJson.put("detailId", "-1");
+        AccountDetailPo accountDetailPo = BeanConvertUtil.covertBean(paramInJson, AccountDetailPo.class);
+        super.insert(dataFlowContext, accountDetailPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ACCT_DETAIL);
+    }
+
+
+    /**
+     * 娣诲姞娲诲姩淇℃伅
+     *
+     * @param paramInJson     鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+     * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+     * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+     */
+    public void updateAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+        AccountDetailPo accountDetailPo = BeanConvertUtil.covertBean(paramInJson, AccountDetailPo.class);
+        super.update(dataFlowContext, accountDetailPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ACCT_DETAIL);
+    }
+
+
+    /**
+     * 娣诲姞灏忓尯淇℃伅
+     *
+     * @param paramInJson     鎺ュ彛璋冪敤鏀句紶鍏ュ叆鍙�
+     * @param dataFlowContext 鏁版嵁涓婁笅鏂�
+     * @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
+     */
+    public void deleteAccountDetail(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+
+        AccountDetailPo accountDetailPo = BeanConvertUtil.covertBean(paramInJson, AccountDetailPo.class);
+        super.update(dataFlowContext, accountDetailPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ACCT_DETAIL);
+    }
+
+}
diff --git a/service-api/src/main/java/com/java110/api/listener/account/DeleteAccountDetailListener.java b/service-api/src/main/java/com/java110/api/listener/account/DeleteAccountDetailListener.java
new file mode 100644
index 0000000..0ec67c2
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/listener/account/DeleteAccountDetailListener.java
@@ -0,0 +1,49 @@
+package com.java110.api.listener.account;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.account.IAccountDetailBMO;
+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.ServiceCodeAccountDetailConstant;
+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("deleteAccountDetailListener")
+public class DeleteAccountDetailListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAccountDetailBMO accountDetailBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "detailId", "detailId涓嶈兘涓虹┖");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        accountDetailBMOImpl.deleteAccountDetail(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAccountDetailConstant.DELETE_ACCOUNTDETAIL;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}
diff --git a/service-api/src/main/java/com/java110/api/listener/account/ListAccountDetailsListener.java b/service-api/src/main/java/com/java110/api/listener/account/ListAccountDetailsListener.java
new file mode 100644
index 0000000..41b429a
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/listener/account/ListAccountDetailsListener.java
@@ -0,0 +1,82 @@
+package com.java110.api.listener.account;
+
+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.dto.accountDetail.AccountDetailDto;
+import com.java110.intf.acct.IAccountDetailInnerServiceSMO;
+import com.java110.utils.constant.ServiceCodeAccountDetailConstant;
+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("listAccountDetailsListener")
+public class ListAccountDetailsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAccountDetailConstant.LIST_ACCOUNTDETAILS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IAccountDetailInnerServiceSMO getAccountDetailInnerServiceSMOImpl() {
+        return accountDetailInnerServiceSMOImpl;
+    }
+
+    public void setAccountDetailInnerServiceSMOImpl(IAccountDetailInnerServiceSMO accountDetailInnerServiceSMOImpl) {
+        this.accountDetailInnerServiceSMOImpl = accountDetailInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        AccountDetailDto accountDetailDto = BeanConvertUtil.covertBean(reqJson, AccountDetailDto.class);
+
+        int count = accountDetailInnerServiceSMOImpl.queryAccountDetailsCount(accountDetailDto);
+
+        List<AccountDetailDto> accountDetailDtos = null;
+
+        if (count > 0) {
+            accountDetailDtos = accountDetailInnerServiceSMOImpl.queryAccountDetails(accountDetailDto);
+        } else {
+            accountDetailDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, accountDetailDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}
diff --git a/service-api/src/main/java/com/java110/api/listener/account/SaveAccountDetailListener.java b/service-api/src/main/java/com/java110/api/listener/account/SaveAccountDetailListener.java
new file mode 100644
index 0000000..96aac7a
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/listener/account/SaveAccountDetailListener.java
@@ -0,0 +1,50 @@
+package com.java110.api.listener.account;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.account.IAccountDetailBMO;
+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.ServiceCodeAccountDetailConstant;
+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("saveAccountDetailListener")
+public class SaveAccountDetailListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAccountDetailBMO accountDetailBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "acctId", "璇锋眰鎶ユ枃涓湭鍖呭惈acctId");
+        Assert.hasKeyAndValue(reqJson, "detailType", "璇锋眰鎶ユ枃涓湭鍖呭惈detailType");
+        Assert.hasKeyAndValue(reqJson, "amount", "璇锋眰鎶ユ枃涓湭鍖呭惈amount");
+        Assert.hasKeyAndValue(reqJson, "objId", "璇锋眰鎶ユ枃涓湭鍖呭惈objId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+        accountDetailBMOImpl.addAccountDetail(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAccountDetailConstant.ADD_ACCOUNTDETAIL;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+}
diff --git a/service-api/src/main/java/com/java110/api/listener/account/UpdateAccountDetailListener.java b/service-api/src/main/java/com/java110/api/listener/account/UpdateAccountDetailListener.java
new file mode 100644
index 0000000..12459e3
--- /dev/null
+++ b/service-api/src/main/java/com/java110/api/listener/account/UpdateAccountDetailListener.java
@@ -0,0 +1,51 @@
+package com.java110.api.listener.account;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.api.bmo.account.IAccountDetailBMO;
+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.ServiceCodeAccountDetailConstant;
+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("updateAccountDetailListener")
+public class UpdateAccountDetailListener extends AbstractServiceApiPlusListener {
+
+    @Autowired
+    private IAccountDetailBMO accountDetailBMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "detailId", "detailId涓嶈兘涓虹┖");
+        Assert.hasKeyAndValue(reqJson, "acctId", "璇锋眰鎶ユ枃涓湭鍖呭惈acctId");
+        Assert.hasKeyAndValue(reqJson, "detailType", "璇锋眰鎶ユ枃涓湭鍖呭惈detailType");
+        Assert.hasKeyAndValue(reqJson, "amount", "璇锋眰鎶ユ枃涓湭鍖呭惈amount");
+        Assert.hasKeyAndValue(reqJson, "objId", "璇锋眰鎶ユ枃涓湭鍖呭惈objId");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        accountDetailBMOImpl.updateAccountDetail(reqJson, context);
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeAccountDetailConstant.UPDATE_ACCOUNTDETAIL;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+}

--
Gitblit v1.8.0