Переглянути джерело

完成商户服务的商户管理和产品管理

wuxw7 9 роки тому
батько
коміт
d5859f4dc6
22 змінених файлів з 3212 додано та 627 видалено
  1. 316 449
      .idea/workspace.xml
  2. 38 38
      MerchantService/src/main/java/com/java110/merchant/dao/IProductServiceDao.java
  3. 23 23
      MerchantService/src/main/java/com/java110/merchant/dao/impl/MerchantServiceDaoImpl.java
  4. 81 81
      MerchantService/src/main/java/com/java110/merchant/dao/impl/ProductServiceDaoImpl.java
  5. 309 0
      MerchantService/src/main/java/com/java110/merchant/rest/MerchantServiceRest.java
  6. 309 0
      MerchantService/src/main/java/com/java110/merchant/rest/ProductServiceRest.java
  7. 77 0
      MerchantService/src/main/java/com/java110/merchant/smo/IMerchantServiceSMO.java
  8. 77 0
      MerchantService/src/main/java/com/java110/merchant/smo/IProductServiceSMO.java
  9. 638 0
      MerchantService/src/main/java/com/java110/merchant/smo/impl/MerchantServiceSMOImpl.java
  10. 638 0
      MerchantService/src/main/java/com/java110/merchant/smo/impl/ProductServiceSMOImpl.java
  11. 44 9
      bean/src/main/java/com/java110/entity/merchant/BoMerchant.java
  12. 24 1
      bean/src/main/java/com/java110/entity/merchant/BoMerchantAttr.java
  13. 9 9
      bean/src/main/java/com/java110/entity/merchant/Merchant.java
  14. 29 1
      bean/src/main/java/com/java110/entity/product/BoProduct.java
  15. 22 1
      bean/src/main/java/com/java110/entity/product/BoProductAttr.java
  16. 8 0
      bean/src/main/java/com/java110/entity/product/ProductAttr.java
  17. 13 15
      config/src/main/resources/mapper/merchant/MerchantServiceDaoImplMapper.xml
  18. 123 0
      config/src/main/resources/mapper/product/ProductServiceDaoImplMapper.xml
  19. 172 0
      feign/src/main/java/com/java110/feign/merchant/IMerchantService.java
  20. 45 0
      feign/src/main/java/com/java110/feign/merchant/MerchantServiceFallback.java
  21. 172 0
      feign/src/main/java/com/java110/feign/product/IProductService.java
  22. 45 0
      feign/src/main/java/com/java110/feign/product/ProductServiceFallback.java

Різницю між файлами не показано, бо вона завелика
+ 316 - 449
.idea/workspace.xml


+ 38 - 38
MerchantService/src/main/java/com/java110/merchant/dao/IProductServiceDao.java

@@ -1,9 +1,9 @@
 package com.java110.merchant.dao;
 
-import com.java110.entity.user.BoCust;
-import com.java110.entity.user.BoCustAttr;
-import com.java110.entity.user.Cust;
-import com.java110.entity.user.CustAttr;
+import com.java110.entity.product.BoProduct;
+import com.java110.entity.product.BoProductAttr;
+import com.java110.entity.product.Product;
+import com.java110.entity.product.ProductAttr;
 
 import java.util.List;
 
@@ -18,139 +18,139 @@ public interface IProductServiceDao {
 
     /**
      * 保存用户基本信息(过程表)
-     * @param boCust 用户基本信息
+     * @param boProduct 用户基本信息
      * @return
      */
-    public int saveDataToBoCust(BoCust boCust) throws RuntimeException;
+    public int saveDataToBoProduct(BoProduct boProduct) throws RuntimeException;
 
     /**
      * 保存用户属性(过程表)
-     * @param boCustAttr 用户属性
+     * @param boProductAttr 用户属性
      * @return
      * @throws RuntimeException
      */
-    public int saveDataToBoCustAttr(BoCustAttr boCustAttr) throws RuntimeException ;
+    public int saveDataToBoProductAttr(BoProductAttr boProductAttr) throws RuntimeException ;
 
     /**
      *  同事保存用户基本信息和属性(过程表)
-     * @param boCustInfo 用户信息
+     * @param boProductInfo 用户信息
      * @return
      * @throws RuntimeException
      */
-    public String saveDataToBoCustAndBoCustAttr(String boCustInfo) throws RuntimeException;
+    public String saveDataToBoProductAndBoProductAttr(String boProductInfo) throws RuntimeException;
 
     /**
      * 保存用户基本信息
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
-    public int saveDataToCust(Cust cust) throws RuntimeException;
+    public int saveDataToProduct(Product product) throws RuntimeException;
 
     /**
      *  保存用户属性
-     * @param custAttr
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
-    public int saveDataToCustAttr(CustAttr custAttr) throws RuntimeException;
+    public int saveDataToProductAttr(ProductAttr productAttr) throws RuntimeException;
 
     /**
      * 删除用户基本信息(实例数据)
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
-    public int deleteDataToCust(Cust cust) throws RuntimeException;
+    public int deleteDataToProduct(Product product) throws RuntimeException;
 
     /**
      *  删除用户属性(实例数据)
-     * @param custAttr
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
-    public int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException;
+    public int deleteDataToProductAttr(ProductAttr productAttr) throws RuntimeException;
 
     /**
      * 同事保存用户基本信息和属性
-     * @param custInfo
+     * @param productInfo
      * @return
      * @throws RuntimeException
      */
-    public String saveDataToCustAndCustAttr(String custInfo) throws RuntimeException;
+    public String saveDataToProductAndProductAttr(String productInfo) throws RuntimeException;
 
 
     /**
      * 更新用户基本信息
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
-    public String updateDataToCust(String cust) throws RuntimeException;
+    public String updateDataToProduct(String product) throws RuntimeException;
 
     /**
      *  更新用户属性
-     * @param custAttr
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
-    public String updateDataToCustAttr(String custAttr) throws RuntimeException;
+    public String updateDataToProductAttr(String productAttr) throws RuntimeException;
 
     /**
      * 同事更新用户基本信息和属性
-     * @param custInfo
+     * @param productInfo
      * @return
      * @throws RuntimeException
      */
-    public String updateDataToCustAndCustAttr(String custInfo) throws RuntimeException;
+    public String updateDataToProductAndProductAttr(String productInfo) throws RuntimeException;
 
 
 
     /**
      * 查询用户基本信息(一般没用,就算有用)
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
-    public Cust queryDataToCust(Cust cust) throws RuntimeException ;
+    public Product queryDataToProduct(Product product) throws RuntimeException ;
 
 
 
     /**
      *  查询用户属性
-     * @param custAttr
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
-    public List<CustAttr> queryDataToCustAttr(CustAttr custAttr) throws RuntimeException;
+    public List<ProductAttr> queryDataToProductAttr(ProductAttr productAttr) throws RuntimeException;
 
     /**
      * 查询保存用户基本信息和属性
-     * @param custInfo
+     * @param productInfo
      * @return
      * @throws RuntimeException
      */
-    public String queryDataToCustAndCustAttr(String custInfo) throws RuntimeException;
+    public String queryDataToProductAndProductAttr(String productInfo) throws RuntimeException;
 
     /**
      *
-     * 查询 客户基本信息(过程表bo_cust)
+     * 查询 客户基本信息(过程表bo_product)
      *
-     * @param boCust
+     * @param boProduct
      * @return
      * @throws Exception
      */
-    public List<BoCust> queryBoCust(BoCust boCust) throws Exception;
+    public List<BoProduct> queryBoProduct(BoProduct boProduct) throws Exception;
 
     /**
      *
-     * 查询 客户属性信息(过程表 bo_cust_attr)
+     * 查询 客户属性信息(过程表 bo_product_attr)
      *
-     * @param boCustAttr
+     * @param boProductAttr
      * @return
      * @throws Exception
      */
-    public List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception;
+    public List<BoProductAttr> queryBoProductAttr(BoProductAttr boProductAttr) throws Exception;
 
 
 }

+ 23 - 23
MerchantService/src/main/java/com/java110/merchant/dao/impl/MerchantServiceDaoImpl.java

@@ -32,17 +32,17 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
     @Override
     public int saveDataToBoMerchant(BoMerchant boMerchant) throws RuntimeException{
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchant】保存数据入参 : " + boMerchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchant】保存数据入参 : " + boMerchant);
         int saveFlag = 0;
         try {
 
             saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToBoMerchant",boMerchant);
 
         }catch(RuntimeException e){
-            LoggerEngine.error("----【UserServiceDAOImpl.saveDataToBoMerchant】保存数据异常 : " ,e);
+            LoggerEngine.error("----【MerchantServiceDAOImpl.saveDataToBoMerchant】保存数据异常 : " ,e);
             return saveFlag;
         }finally {
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchant】保存数据出参 : saveFlag:" + saveFlag);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchant】保存数据出参 : saveFlag:" + saveFlag);
             return saveFlag;
         }
 
@@ -58,16 +58,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
     @Override
     public int saveDataToBoMerchantAttr(BoMerchantAttr boMerchantAttr) throws RuntimeException {
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchantAttr】保存数据入参 : " + boMerchantAttr);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchantAttr】保存数据入参 : " + boMerchantAttr);
         //为了保险起见,再测检测reqList 是否有值
         if(boMerchantAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchantAttr】保存数据出错 : " + boMerchantAttr);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchantAttr】保存数据出错 : " + boMerchantAttr);
             return 0;
         }
         int saveFlag = 0;
 
         saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToBoMerchantAttr",boMerchantAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchantAttr】保存数据出参 :saveFlag " + saveFlag);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchantAttr】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
 
@@ -81,16 +81,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      */
     @Override
     public int saveDataToMerchant(Merchant merchant) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据入参 : " + merchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据入参 : " + merchant);
         //为了保险起见,再测检测reqList 是否有值
         if(merchant == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据出错 : " + merchant);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据出错 : " + merchant);
             throw new IllegalArgumentException("请求参数错误,merchant : " + merchant);
         }
         int saveFlag = 0;
 
         saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToMerchant",merchant);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
@@ -103,16 +103,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      */
     @Override
     public int saveDataToMerchantAttr(MerchantAttr merchantAttr) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据入参 : " + merchantAttr);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据入参 : " + merchantAttr);
         //为了保险起见,再测检测reqList 是否有值
         if(merchantAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据出错 : " + merchantAttr);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据出错 : " + merchantAttr);
             throw new IllegalArgumentException("请求参数错误,merchantAttr : " + merchantAttr);
         }
         int saveFlag = 0;
 
         saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToMerchantAttr",merchantAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
@@ -124,16 +124,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      * @throws RuntimeException
      */
     public int deleteDataToMerchant(Merchant merchant) throws RuntimeException{
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchant】保存数据入参 : " + merchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchant】保存数据入参 : " + merchant);
         //为了保险起见,再测检测reqList 是否有值
         if(merchant == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchant】保存数据出错 : " + merchant);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchant】保存数据出错 : " + merchant);
             throw new IllegalArgumentException("请求参数错误,merchant : " + merchant);
         }
         int saveFlag = 0;
 
         saveFlag = sqlSessionTemplate.update("userServiceDAOImpl.deleteDataToMerchant",merchant);
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchant】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
@@ -145,16 +145,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      * @throws RuntimeException
      */
     public int deleteDataToMerchantAttr(MerchantAttr merchantAttr) throws RuntimeException{
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchantAttr】保存数据入参 : " + merchantAttr);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchantAttr】保存数据入参 : " + merchantAttr);
         //为了保险起见,再测检测reqList 是否有值
         if(merchantAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchantAttr】保存数据出错 : " + merchantAttr);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchantAttr】保存数据出错 : " + merchantAttr);
             throw new IllegalArgumentException("请求参数错误,merchantAttr : " + merchantAttr);
         }
         int saveFlag = 0;
 
         saveFlag = sqlSessionTemplate.update("userServiceDAOImpl.deleteDataToMerchantAttr",merchantAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToMerchantAttr】保存数据出参 :saveFlag " + saveFlag);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.deleteDataToMerchantAttr】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
@@ -170,7 +170,7 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
     @Override
     public String saveDataToBoMerchantAndBoMerchantAttr(String boMerchantInfo) throws RuntimeException {
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoMerchantAndBoMerchantAttr】保存数据入参"+boMerchantInfo);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.saveDataToBoMerchantAndBoMerchantAttr】保存数据入参"+boMerchantInfo);
 
         return null;
     }
@@ -203,16 +203,16 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      */
     @Override
     public Merchant queryDataToMerchant(Merchant merchant) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToMerchant】保存数据入参 : " + merchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.queryDataToMerchant】保存数据入参 : " + merchant);
         //为了保险起见,再测检测reqList 是否有值
         if(merchant == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToMerchant】保存数据出错 : " + merchant);
+            LoggerEngine.debug("----【MerchantServiceDAOImpl.queryDataToMerchant】保存数据出错 : " + merchant);
             throw new IllegalArgumentException("请求参数错误,merchant : " + merchant);
         }
 
         Merchant newMerchant  = sqlSessionTemplate.selectOne("userServiceDAOImpl.queryDataToMerchant",merchant);
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToMerchant】保存数据出参 :newMerchant " + newMerchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.queryDataToMerchant】保存数据出参 :newMerchant " + newMerchant);
 
         return newMerchant;
     }
@@ -236,7 +236,7 @@ public class MerchantServiceDaoImpl extends BaseServiceDao implements IMerchantS
      * @throws Exception
      */
     public List<BoMerchant> queryBoMerchant(BoMerchant boMerchant) throws Exception{
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryBoMerchantAttr】:"+boMerchant);
+        LoggerEngine.debug("----【MerchantServiceDAOImpl.queryBoMerchantAttr】:"+boMerchant);
 
         Assert.isNull(boMerchant,"查询bo_merchant 入参为空");
 

+ 81 - 81
MerchantService/src/main/java/com/java110/merchant/dao/impl/ProductServiceDaoImpl.java

@@ -3,10 +3,10 @@ package com.java110.merchant.dao.impl;
 import com.java110.common.log.LoggerEngine;
 import com.java110.common.util.Assert;
 import com.java110.core.base.dao.BaseServiceDao;
-import com.java110.entity.user.BoCust;
-import com.java110.entity.user.BoCustAttr;
-import com.java110.entity.user.Cust;
-import com.java110.entity.user.CustAttr;
+import com.java110.entity.product.BoProduct;
+import com.java110.entity.product.BoProductAttr;
+import com.java110.entity.product.Product;
+import com.java110.entity.product.ProductAttr;
 import com.java110.merchant.dao.IMerchantServiceDao;
 import com.java110.merchant.dao.IProductServiceDao;
 import org.springframework.stereotype.Service;
@@ -32,23 +32,23 @@ public class ProductServiceDaoImpl extends BaseServiceDao implements IProductSer
     /**
      * 保存用户基本信息
      * 功能只用与保存用户处理
-     * @param boCust 用户基本信息
+     * @param boProduct 用户基本信息
      * @return
      */
     @Override
-    public int saveDataToBoCust(BoCust boCust) throws RuntimeException{
+    public int saveDataToBoProduct(BoProduct boProduct) throws RuntimeException{
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCust】保存数据入参 : " + boCust);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProduct】保存数据入参 : " + boProduct);
         int saveFlag = 0;
         try {
 
-            saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToBoCust",boCust);
+            saveFlag = sqlSessionTemplate.insert("productServiceDAOImpl.saveDataToBoProduct",boProduct);
 
         }catch(RuntimeException e){
-            LoggerEngine.error("----【UserServiceDAOImpl.saveDataToBoCust】保存数据异常 : " ,e);
+            LoggerEngine.error("----【ProductServiceDAOImpl.saveDataToBoProduct】保存数据异常 : " ,e);
             return saveFlag;
         }finally {
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCust】保存数据出参 : saveFlag:" + saveFlag);
+            LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProduct】保存数据出参 : saveFlag:" + saveFlag);
             return saveFlag;
         }
 
@@ -57,110 +57,110 @@ public class ProductServiceDaoImpl extends BaseServiceDao implements IProductSer
     /**
      * 保存用户属性(过程表)
      *
-     * @param boCustAttr 用户属性
+     * @param boProductAttr 用户属性
      * @return
      * @throws RuntimeException
      */
     @Override
-    public int saveDataToBoCustAttr(BoCustAttr boCustAttr) throws RuntimeException {
+    public int saveDataToBoProductAttr(BoProductAttr boProductAttr) throws RuntimeException {
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCustAttr】保存数据入参 : " + boCustAttr);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProductAttr】保存数据入参 : " + boProductAttr);
         //为了保险起见,再测检测reqList 是否有值
-        if(boCustAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCustAttr】保存数据出错 : " + boCustAttr);
+        if(boProductAttr == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProductAttr】保存数据出错 : " + boProductAttr);
             return 0;
         }
         int saveFlag = 0;
 
-        saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToBoCustAttr",boCustAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCustAttr】保存数据出参 :saveFlag " + saveFlag);
+        saveFlag = sqlSessionTemplate.insert("productServiceDAOImpl.saveDataToBoProductAttr",boProductAttr);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProductAttr】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
 
     }
 
     /**
-     * 保存实例数据 客户信息至Cust表中
-     * @param cust
+     * 保存实例数据 客户信息至Product表中
+     * @param product
      * @return
      * @throws RuntimeException
      */
     @Override
-    public int saveDataToCust(Cust cust) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据入参 : " + cust);
+    public int saveDataToProduct(Product product) throws RuntimeException {
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据入参 : " + product);
         //为了保险起见,再测检测reqList 是否有值
-        if(cust == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据出错 : " + cust);
-            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
+        if(product == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据出错 : " + product);
+            throw new IllegalArgumentException("请求参数错误,product : " + product);
         }
         int saveFlag = 0;
 
-        saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToCust",cust);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据出参 :saveFlag " + saveFlag);
+        saveFlag = sqlSessionTemplate.insert("productServiceDAOImpl.saveDataToProduct",product);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
 
     /**
-     * 保存实例数据 客户属性信息至CustAttr表中
-     * @param custAttr
+     * 保存实例数据 客户属性信息至ProductAttr表中
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
     @Override
-    public int saveDataToCustAttr(CustAttr custAttr) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据入参 : " + custAttr);
+    public int saveDataToProductAttr(ProductAttr productAttr) throws RuntimeException {
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据入参 : " + productAttr);
         //为了保险起见,再测检测reqList 是否有值
-        if(custAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据出错 : " + custAttr);
-            throw new IllegalArgumentException("请求参数错误,custAttr : " + custAttr);
+        if(productAttr == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据出错 : " + productAttr);
+            throw new IllegalArgumentException("请求参数错误,productAttr : " + productAttr);
         }
         int saveFlag = 0;
 
-        saveFlag = sqlSessionTemplate.insert("userServiceDAOImpl.saveDataToCustAttr",custAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToCust】保存数据出参 :saveFlag " + saveFlag);
+        saveFlag = sqlSessionTemplate.insert("productServiceDAOImpl.saveDataToProductAttr",productAttr);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToProduct】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
 
     /**
      * 删除用户基本信息(实例数据)
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
-    public int deleteDataToCust(Cust cust) throws RuntimeException{
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCust】保存数据入参 : " + cust);
+    public int deleteDataToProduct(Product product) throws RuntimeException{
+        LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProduct】保存数据入参 : " + product);
         //为了保险起见,再测检测reqList 是否有值
-        if(cust == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCust】保存数据出错 : " + cust);
-            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
+        if(product == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProduct】保存数据出错 : " + product);
+            throw new IllegalArgumentException("请求参数错误,product : " + product);
         }
         int saveFlag = 0;
 
-        saveFlag = sqlSessionTemplate.update("userServiceDAOImpl.deleteDataToCust",cust);
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCust】保存数据出参 :saveFlag " + saveFlag);
+        saveFlag = sqlSessionTemplate.update("productServiceDAOImpl.deleteDataToProduct",product);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProduct】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
 
     /**
      *  删除用户属性(实例数据)
-     * @param custAttr
+     * @param productAttr
      * @return
      * @throws RuntimeException
      */
-    public int deleteDataToCustAttr(CustAttr custAttr) throws RuntimeException{
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCustAttr】保存数据入参 : " + custAttr);
+    public int deleteDataToProductAttr(ProductAttr productAttr) throws RuntimeException{
+        LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProductAttr】保存数据入参 : " + productAttr);
         //为了保险起见,再测检测reqList 是否有值
-        if(custAttr == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCustAttr】保存数据出错 : " + custAttr);
-            throw new IllegalArgumentException("请求参数错误,custAttr : " + custAttr);
+        if(productAttr == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProductAttr】保存数据出错 : " + productAttr);
+            throw new IllegalArgumentException("请求参数错误,productAttr : " + productAttr);
         }
         int saveFlag = 0;
 
-        saveFlag = sqlSessionTemplate.update("userServiceDAOImpl.deleteDataToCustAttr",custAttr);
-        LoggerEngine.debug("----【UserServiceDAOImpl.deleteDataToCustAttr】保存数据出参 :saveFlag " + saveFlag);
+        saveFlag = sqlSessionTemplate.update("productServiceDAOImpl.deleteDataToProductAttr",productAttr);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.deleteDataToProductAttr】保存数据出参 :saveFlag " + saveFlag);
 
         return saveFlag;
     }
@@ -169,101 +169,101 @@ public class ProductServiceDaoImpl extends BaseServiceDao implements IProductSer
      * 同时保存客户基本信息和客户属性
      * 入参为:
      *
-     * @param boCustInfo 用户信息
+     * @param boProductInfo 用户信息
      * @return
      * @throws RuntimeException
      */
     @Override
-    public String saveDataToBoCustAndBoCustAttr(String boCustInfo) throws RuntimeException {
+    public String saveDataToBoProductAndBoProductAttr(String boProductInfo) throws RuntimeException {
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.saveDataToBoCustAndBoCustAttr】保存数据入参"+boCustInfo);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.saveDataToBoProductAndBoProductAttr】保存数据入参"+boProductInfo);
 
         return null;
     }
 
     @Override
-    public String saveDataToCustAndCustAttr(String custInfo) throws RuntimeException {
+    public String saveDataToProductAndProductAttr(String productInfo) throws RuntimeException {
         return null;
     }
 
     @Override
-    public String updateDataToCust(String cust) throws RuntimeException {
+    public String updateDataToProduct(String product) throws RuntimeException {
         return null;
     }
 
     @Override
-    public String updateDataToCustAttr(String custAttr) throws RuntimeException {
+    public String updateDataToProductAttr(String productAttr) throws RuntimeException {
         return null;
     }
 
     @Override
-    public String updateDataToCustAndCustAttr(String custInfo) throws RuntimeException {
+    public String updateDataToProductAndProductAttr(String productInfo) throws RuntimeException {
         return null;
     }
 
     /**
      * 根据客户ID查询客户信息,包括基本信息和属性信息
-     * @param cust
+     * @param product
      * @return
      * @throws RuntimeException
      */
     @Override
-    public Cust queryDataToCust(Cust cust) throws RuntimeException {
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToCust】保存数据入参 : " + cust);
+    public Product queryDataToProduct(Product product) throws RuntimeException {
+        LoggerEngine.debug("----【ProductServiceDAOImpl.queryDataToProduct】保存数据入参 : " + product);
         //为了保险起见,再测检测reqList 是否有值
-        if(cust == null){
-            LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToCust】保存数据出错 : " + cust);
-            throw new IllegalArgumentException("请求参数错误,cust : " + cust);
+        if(product == null){
+            LoggerEngine.debug("----【ProductServiceDAOImpl.queryDataToProduct】保存数据出错 : " + product);
+            throw new IllegalArgumentException("请求参数错误,product : " + product);
         }
 
-        Cust newCust  = sqlSessionTemplate.selectOne("userServiceDAOImpl.queryDataToCust",cust);
+        Product newProduct  = sqlSessionTemplate.selectOne("productServiceDAOImpl.queryDataToProduct",product);
 
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryDataToCust】保存数据出参 :newCust " + newCust);
+        LoggerEngine.debug("----【ProductServiceDAOImpl.queryDataToProduct】保存数据出参 :newProduct " + newProduct);
 
-        return newCust;
+        return newProduct;
     }
 
     @Override
-    public List<CustAttr> queryDataToCustAttr(CustAttr custAttr) throws RuntimeException {
+    public List<ProductAttr> queryDataToProductAttr(ProductAttr productAttr) throws RuntimeException {
         return null;
     }
 
     @Override
-    public String queryDataToCustAndCustAttr(String custInfo) throws RuntimeException {
+    public String queryDataToProductAndProductAttr(String productInfo) throws RuntimeException {
         return null;
     }
 
     /**
      *
-     * 查询 客户基本信息(过程表bo_cust)
+     * 查询 客户基本信息(过程表bo_product)
      *
-     * @param boCust
+     * @param boProduct
      * @return
      * @throws Exception
      */
-    public List<BoCust> queryBoCust(BoCust boCust) throws Exception{
-        LoggerEngine.debug("----【UserServiceDAOImpl.queryBoCustAttr】:"+boCust);
+    public List<BoProduct> queryBoProduct(BoProduct boProduct) throws Exception{
+        LoggerEngine.debug("----【ProductServiceDAOImpl.queryBoProductAttr】:"+boProduct);
 
-        Assert.isNull(boCust,"查询bo_cust 入参为空");
+        Assert.isNull(boProduct,"查询bo_product 入参为空");
 
-        return sqlSessionTemplate.selectList("userServiceDAOImpl.queryBoCust",boCust);
+        return sqlSessionTemplate.selectList("productServiceDAOImpl.queryBoProduct",boProduct);
     }
 
     /**
      *
-     * 查询 客户属性信息(过程表 bo_cust_attr)
+     * 查询 客户属性信息(过程表 bo_product_attr)
      *
-     * @param boCustAttr
+     * @param boProductAttr
      * @return
      * @throws Exception
      */
-    public List<BoCustAttr> queryBoCustAttr(BoCustAttr boCustAttr) throws Exception{
+    public List<BoProductAttr> queryBoProductAttr(BoProductAttr boProductAttr) throws Exception{
 
-        LoggerEngine.debug("【userServiceDAOImpl.queryBoCustAttr】:"+boCustAttr);
+        LoggerEngine.debug("【productServiceDAOImpl.queryBoProductAttr】:"+boProductAttr);
 
-        Assert.isNull(boCustAttr,"查询bo_cust_attr 入参为空");
+        Assert.isNull(boProductAttr,"查询bo_product_attr 入参为空");
 
-        return sqlSessionTemplate.selectList("userServiceDAOImpl.queryBoCustAttr",boCustAttr);
+        return sqlSessionTemplate.selectList("productServiceDAOImpl.queryBoProductAttr",boProductAttr);
 
     }
 }

+ 309 - 0
MerchantService/src/main/java/com/java110/merchant/rest/MerchantServiceRest.java

@@ -0,0 +1,309 @@
+package com.java110.merchant.rest;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.log.LoggerEngine;
+import com.java110.common.util.Assert;
+import com.java110.common.util.ProtocolUtil;
+import com.java110.core.base.controller.BaseController;
+import com.java110.entity.merchant.Merchant;
+import com.java110.feign.merchant.IMerchantService;
+import com.java110.merchant.smo.IMerchantServiceSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 用户服务提供类
+ * Created by wuxw on 2017/4/5.
+ */
+@RestController
+public class MerchantServiceRest extends BaseController implements IMerchantService {
+
+    @Autowired
+    IMerchantServiceSMO iMerchantServiceSMO;
+
+    /**
+     * 通过Merchant对象中数据查询用户信息
+     * 如,用户ID,名称
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/queryMerchantInfo")
+    public String queryMerchantInfo(@RequestParam("data") String data){
+        LoggerEngine.debug("queryMerchantInfo入参:" + data);
+
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(data);
+            Merchant oldMerchant = new Merchant();
+            oldMerchant.setMerchantId(reqMerchantJSON.getString("merchantId"));
+            resultMerchantInfo = iMerchantServiceSMO.queryMerchant(oldMerchant);
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+
+    /**
+     * 用户服务信息受理
+     * 协议:
+     * {
+     *     'boMerchant':[{}],
+     *     'boMerchantAttr':[{}]
+     * }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/soMerchantService")
+    public String soMerchantService(@RequestParam("data") String data){
+
+        LoggerEngine.debug("soMerchantService入参:" + data);
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(data);
+            //1.0规则校验,报文是否合法
+
+
+            //2.0 受理客户信息
+            resultMerchantInfo = iMerchantServiceSMO.soMerchantService(reqMerchantJSON);
+
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+    /**
+     * 这个接口专门用于订单服务受理用,入参为 JSONObject
+     *
+     * 支持 多个 客户信息 受理
+     *
+     * 请求协议:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boMerchant": [
+     {
+     "merchantId": "-1",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "merchantAdress": "青海省西宁市城中区格兰小镇",
+     "merchantType": "1",
+     "openId": "",
+     "state": "ADD"
+     },
+     {
+     "merchantId": "123",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "merchantAdress": "青海省西宁市城中区格兰小镇",
+     "merchantType": "1",
+     "openId": "",
+     "state": "DEL"
+     }
+     ],
+     "boMerchantAttr": [
+     {
+     "merchantId": "123",
+     "prodId": "-1",
+     "attrCd": "123344",
+     "value": "1",
+     "state": "ADD"
+     },
+     {
+     "merchantId": "123",
+     "prodId": "-1",
+     "attrCd": "123345",
+     "value": "1",
+     "state": "DEL"
+     }
+     ]
+     }
+     ]
+     }
+
+     *
+     * 返回协议:
+     *
+     * {
+     'RESULT_CODE': '0000',
+     'RESULT_MSG': '成功',
+     'RESULT_INFO': {}
+     }
+     * @param data
+     * @return
+     */
+    @Override
+    @RequestMapping("/merchantService/soMerchantServiceForOrderService")
+    public String soMerchantServiceForOrderService(@RequestParam("data") String data) {
+        LoggerEngine.debug("soMerchantService入参:" + data);
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(data);
+            //1.0规则校验,报文是否合法
+
+
+            //2.0 受理客户信息
+            resultMerchantInfo = iMerchantServiceSMO.soMerchantServiceForOrderService(reqMerchantJSON);
+
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boMerchant:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/merchantService/soBoMerchant")
+    public String soBoMerchant(@RequestParam("data") String data ) {
+        LoggerEngine.debug("soBoMerchant入参:" + data);
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(data);
+            resultMerchantInfo = iMerchantServiceSMO.soBoMerchant(data);
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常:"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boMerchantAttr:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/merchantService/soBoMerchantAttr")
+    public String soBoMerchantAttr(@RequestParam("data") String data) {
+        LoggerEngine.debug("soBoMerchantAttr入参:" + data);
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(data);
+            resultMerchantInfo = iMerchantServiceSMO.soBoMerchantAttr(data);
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+
+    /**
+     * 作废订单,根据boId作废订单
+     *
+     * 接口协议:
+     *
+     * { 'data': [
+
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     }
+     ] }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/soDeleteMerchantService")
+    public String soDeleteMerchantService(@RequestParam("data") String data){
+
+        LoggerEngine.debug("作废订单入参:"+data);
+
+        String resultMerchantInfo = null;
+
+        JSONObject reqParam = null;
+
+        try{
+            reqParam = this.simpleValidateJSON(data);
+
+            Assert.isNull(reqParam,"data","传入报文错误,没有包含data节点"+reqParam);
+
+            resultMerchantInfo = iMerchantServiceSMO.soDeleteMerchantInfo(reqParam.getJSONArray("data"));
+
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultMerchantInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e+data,null);
+        }finally {
+            LoggerEngine.debug("作废订单出参:" + resultMerchantInfo);
+            return resultMerchantInfo;
+        }
+    }
+
+
+    public IMerchantServiceSMO getiMerchantServiceSMO() {
+        return iMerchantServiceSMO;
+    }
+
+    public void setiMerchantServiceSMO(IMerchantServiceSMO iMerchantServiceSMO) {
+        this.iMerchantServiceSMO = iMerchantServiceSMO;
+    }
+}

+ 309 - 0
MerchantService/src/main/java/com/java110/merchant/rest/ProductServiceRest.java

@@ -0,0 +1,309 @@
+package com.java110.merchant.rest;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.log.LoggerEngine;
+import com.java110.common.util.Assert;
+import com.java110.common.util.ProtocolUtil;
+import com.java110.core.base.controller.BaseController;
+import com.java110.entity.product.Product;
+import com.java110.feign.product.IProductService;
+import com.java110.merchant.smo.IProductServiceSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 用户服务提供类
+ * Created by wuxw on 2017/4/5.
+ */
+@RestController
+public class ProductServiceRest extends BaseController implements IProductService {
+
+    @Autowired
+    IProductServiceSMO iProductServiceSMO;
+
+    /**
+     * 通过Product对象中数据查询用户信息
+     * 如,用户ID,名称
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/queryProductInfo")
+    public String queryProductInfo(@RequestParam("data") String data){
+        LoggerEngine.debug("queryProductInfo入参:" + data);
+
+
+        String resultProductInfo = null;
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(data);
+            Product oldProduct = new Product();
+            oldProduct.setProductId(reqProductJSON.getString("productId"));
+            resultProductInfo = iProductServiceSMO.queryProduct(oldProduct);
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+
+    /**
+     * 用户服务信息受理
+     * 协议:
+     * {
+     *     'boProduct':[{}],
+     *     'boProductAttr':[{}]
+     * }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/soProductService")
+    public String soProductService(@RequestParam("data") String data){
+
+        LoggerEngine.debug("soProductService入参:" + data);
+
+        String resultProductInfo = null;
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(data);
+            //1.0规则校验,报文是否合法
+
+
+            //2.0 受理客户信息
+            resultProductInfo = iProductServiceSMO.soProductService(reqProductJSON);
+
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+    /**
+     * 这个接口专门用于订单服务受理用,入参为 JSONObject
+     *
+     * 支持 多个 客户信息 受理
+     *
+     * 请求协议:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boProduct": [
+     {
+     "productId": "-1",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "productAdress": "青海省西宁市城中区格兰小镇",
+     "productType": "1",
+     "openId": "",
+     "state": "ADD"
+     },
+     {
+     "productId": "123",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "productAdress": "青海省西宁市城中区格兰小镇",
+     "productType": "1",
+     "openId": "",
+     "state": "DEL"
+     }
+     ],
+     "boProductAttr": [
+     {
+     "productId": "123",
+     "prodId": "-1",
+     "attrCd": "123344",
+     "value": "1",
+     "state": "ADD"
+     },
+     {
+     "productId": "123",
+     "prodId": "-1",
+     "attrCd": "123345",
+     "value": "1",
+     "state": "DEL"
+     }
+     ]
+     }
+     ]
+     }
+
+     *
+     * 返回协议:
+     *
+     * {
+     'RESULT_CODE': '0000',
+     'RESULT_MSG': '成功',
+     'RESULT_INFO': {}
+     }
+     * @param data
+     * @return
+     */
+    @Override
+    @RequestMapping("/productService/soProductServiceForOrderService")
+    public String soProductServiceForOrderService(@RequestParam("data") String data) {
+        LoggerEngine.debug("soProductService入参:" + data);
+
+        String resultProductInfo = null;
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(data);
+            //1.0规则校验,报文是否合法
+
+
+            //2.0 受理客户信息
+            resultProductInfo = iProductServiceSMO.soProductServiceForOrderService(reqProductJSON);
+
+
+        } catch (Exception e) {
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boProduct:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/productService/soBoProduct")
+    public String soBoProduct(@RequestParam("data") String data ) {
+        LoggerEngine.debug("soBoProduct入参:" + data);
+
+        String resultProductInfo = null;
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(data);
+            resultProductInfo = iProductServiceSMO.soBoProduct(data);
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常:"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boProductAttr:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/productService/soBoProductAttr")
+    public String soBoProductAttr(@RequestParam("data") String data) {
+        LoggerEngine.debug("soBoProductAttr入参:" + data);
+
+        String resultProductInfo = null;
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(data);
+            resultProductInfo = iProductServiceSMO.soBoProductAttr(data);
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e,null);
+        } finally {
+            LoggerEngine.debug("用户服务操作客户出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+
+    /**
+     * 作废订单,根据boId作废订单
+     *
+     * 接口协议:
+     *
+     * { 'data': [
+
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     }
+     ] }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/soDeleteProductService")
+    public String soDeleteProductService(@RequestParam("data") String data){
+
+        LoggerEngine.debug("作废订单入参:"+data);
+
+        String resultProductInfo = null;
+
+        JSONObject reqParam = null;
+
+        try{
+            reqParam = this.simpleValidateJSON(data);
+
+            Assert.isNull(reqParam,"data","传入报文错误,没有包含data节点"+reqParam);
+
+            resultProductInfo = iProductServiceSMO.soDeleteProductInfo(reqParam.getJSONArray("data"));
+
+        }catch (Exception e){
+            LoggerEngine.error("服务处理出现异常:", e);
+            resultProductInfo = ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"服务处理出现异常"+e+data,null);
+        }finally {
+            LoggerEngine.debug("作废订单出参:" + resultProductInfo);
+            return resultProductInfo;
+        }
+    }
+
+
+    public IProductServiceSMO getiProductServiceSMO() {
+        return iProductServiceSMO;
+    }
+
+    public void setiProductServiceSMO(IProductServiceSMO iProductServiceSMO) {
+        this.iProductServiceSMO = iProductServiceSMO;
+    }
+}

+ 77 - 0
MerchantService/src/main/java/com/java110/merchant/smo/IMerchantServiceSMO.java

@@ -0,0 +1,77 @@
+package com.java110.merchant.smo;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.entity.merchant.Merchant;
+
+/**
+ *
+ * 用户信息管理,服务
+ * Created by wuxw on 2017/4/5.
+ */
+public interface IMerchantServiceSMO {
+
+    /**
+     * 新建用户
+     * @param merchantInfoJson
+     * @return
+     */
+    public String saveMerchant(String merchantInfoJson) throws Exception;
+
+    /**
+     * 所有服务类(增删改查用户)
+     * @param merchantInfoJson
+     * @return
+     */
+    public String soMerchantService(JSONObject merchantInfoJson) throws Exception;
+
+    /**
+     * 所有服务类(增删改查用户)
+     * @param merchantInfoJson
+     * @return
+     */
+    public String soMerchantServiceForOrderService(JSONObject merchantInfoJson) throws Exception;
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boMerchant:[{},{}]
+     * }
+     * @param boMerchants
+     * @return
+     * @throws Exception
+     */
+    public String soBoMerchant(String boMerchants) throws Exception;
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boMerchantAttr:[{},{}]
+     * }
+     * @param boMerchantAttrs
+     * @return
+     * @throws Exception
+     */
+    public String soBoMerchantAttr(String boMerchantAttrs) throws Exception;
+
+    /**
+     * 作废客户信息
+     * [{},{},{}]
+     * @param datas
+     * @return
+     * @throws Exception
+     */
+    public String soDeleteMerchantInfo(JSONArray datas) throws Exception;
+
+
+    /**
+     * 查询客户信息
+     * 包括 基本信息merchant 和 属性信息 merchantAttr
+     * @param merchant
+     * @return
+     * @throws Exception
+     */
+    public String queryMerchant(Merchant merchant) throws Exception;
+}

+ 77 - 0
MerchantService/src/main/java/com/java110/merchant/smo/IProductServiceSMO.java

@@ -0,0 +1,77 @@
+package com.java110.merchant.smo;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.entity.product.Product;
+
+/**
+ *
+ * 用户信息管理,服务
+ * Created by wuxw on 2017/4/5.
+ */
+public interface IProductServiceSMO {
+
+    /**
+     * 新建用户
+     * @param productInfoJson
+     * @return
+     */
+    public String saveProduct(String productInfoJson) throws Exception;
+
+    /**
+     * 所有服务类(增删改查用户)
+     * @param productInfoJson
+     * @return
+     */
+    public String soProductService(JSONObject productInfoJson) throws Exception;
+
+    /**
+     * 所有服务类(增删改查用户)
+     * @param productInfoJson
+     * @return
+     */
+    public String soProductServiceForOrderService(JSONObject productInfoJson) throws Exception;
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boProduct:[{},{}]
+     * }
+     * @param boProducts
+     * @return
+     * @throws Exception
+     */
+    public String soBoProduct(String boProducts) throws Exception;
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boProductAttr:[{},{}]
+     * }
+     * @param boProductAttrs
+     * @return
+     * @throws Exception
+     */
+    public String soBoProductAttr(String boProductAttrs) throws Exception;
+
+    /**
+     * 作废客户信息
+     * [{},{},{}]
+     * @param datas
+     * @return
+     * @throws Exception
+     */
+    public String soDeleteProductInfo(JSONArray datas) throws Exception;
+
+
+    /**
+     * 查询客户信息
+     * 包括 基本信息product 和 属性信息 productAttr
+     * @param product
+     * @return
+     * @throws Exception
+     */
+    public String queryProduct(Product product) throws Exception;
+}

+ 638 - 0
MerchantService/src/main/java/com/java110/merchant/smo/impl/MerchantServiceSMOImpl.java

@@ -0,0 +1,638 @@
+package com.java110.merchant.smo.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONPath;
+import com.java110.common.log.LoggerEngine;
+import com.java110.common.util.Assert;
+import com.java110.common.util.ProtocolUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+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 com.java110.feign.base.IPrimaryKeyService;
+import com.java110.merchant.dao.IMerchantServiceDao;
+import com.java110.merchant.smo.IMerchantServiceSMO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
+import java.util.*;
+
+/**
+ * 用户服务信息管理业务信息实现
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("merchantServiceSMOImpl")
+@Transactional
+public class MerchantServiceSMOImpl extends BaseServiceSMO implements IMerchantServiceSMO {
+
+    @Autowired
+    IPrimaryKeyService iPrimaryKeyService;
+
+    @Autowired
+    IMerchantServiceDao iMerchantServiceDao;
+
+    //新增用户
+    private final static String MERCHANT_ACTION_ADD = "ADD";
+
+    //新增用户
+    private final static String MERCHANT_ACTION_KIP = "KIP";
+
+    //新增用户
+    private final static String MERCHANT_ACTION_DEL = "DEL";
+
+    /**
+     * 保存用户信息
+     *
+     * @param merchantInfoJson 入参为用户信息json传
+     * @return
+     */
+    public String saveMerchant(String merchantInfoJson) throws Exception{
+
+        JSONObject reqMerchantJSON = null;
+        try {
+            reqMerchantJSON = this.simpleValidateJSON(merchantInfoJson);
+            //boMerchant增加Action (动作)
+            if (reqMerchantJSON.containsKey("boMerchant")) {
+                JSONObject boMerchant = reqMerchantJSON.getJSONObject("boMerchant");
+                boMerchant.put("state", MERCHANT_ACTION_ADD);
+            }
+            //boMerchantAttr增加Action(动作)
+            if (reqMerchantJSON.containsKey("boMerchantAttr")) {
+                JSONArray boMerchantAttrs = reqMerchantJSON.getJSONArray("boMerchantAttr");
+
+                for (int attrIndex = 0; attrIndex < boMerchantAttrs.size(); attrIndex++) {
+                    JSONObject boMerchantAttr = boMerchantAttrs.getJSONObject(attrIndex);
+                    boMerchantAttr.put("state", MERCHANT_ACTION_ADD);
+                }
+            }
+        } catch (RuntimeException e) {
+            //返回异常信息
+            return e.getMessage();
+        }
+        return soMerchantService(reqMerchantJSON);
+    }
+
+
+    /**
+     * 所有服务处理类
+     * {
+     *
+     *     'boMerchant':[{}],
+     *     'boMerchantAttr':[{}]
+     * }
+     *
+     * 返回报文:
+     *
+     * {'RESULT_CODE':'0000','RESULT_MSG':'成功','RESULT_INFO':{'merchantId':'7000123,718881991'}}
+     * @param merchantInfoJson
+     * @return
+     */
+    public String soMerchantService(JSONObject merchantInfoJson) throws Exception{
+        LoggerEngine.debug("用户服务操作客户入参:" + merchantInfoJson);
+        JSONObject paramJson = new JSONObject();
+
+        JSONObject resultInfo = null;
+
+        //存放生成的merchantId 主键为 merchantId-1 71000010100
+        Map merchantIdKey = new HashMap();
+
+        if (merchantInfoJson == null){
+            throw new IllegalArgumentException("soMerchantService 入参 为空"+merchantInfoJson);
+        }
+         // 客户信息处理 处理boMerchant节点
+        doProcessBoMerchant(merchantInfoJson,paramJson,merchantIdKey,resultInfo);
+
+        //客户属性信息处理 处理boMerchantAttr节点
+        doProcessBoMerchantAttr(merchantInfoJson,paramJson,merchantIdKey,resultInfo);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",resultInfo);
+
+    }
+
+    /**
+     *
+     * 请求报文为:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boMerchant": [{},{}],
+     "boMerchantAttr": [{ }, {}]
+     },
+     {
+     "actionTypeCd": "C1",
+     "boMerchant": [{},{}],
+     "boMerchantAttr": [{ }, {}]
+     }
+     ]
+     }
+
+     返回报文 :
+
+     { 'RESULT_CODE': '0000', 'RESULT_MSG': '成功', 'RESULT_INFO': {'merchant':[{'oldMerchantId':'-1','merchantId':'12345678'},{'oldMerchantId':'-2','merchantId':'12345678'}]} }
+     * @param mInfoJson
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soMerchantServiceForOrderService(JSONObject mInfoJson) throws Exception {
+
+        Assert.isNull(mInfoJson,"data","请求报文缺少 data 节点,请检查");
+
+        JSONArray merchantInfos = mInfoJson.getJSONArray("data");
+
+        Assert.isNull(merchantInfos,"请求报文中data节点,没有子节点,data子节点应该为JSONArray,merchantInfos="+merchantInfos);
+
+        JSONObject merchantInfoJ = new JSONObject();
+        JSONArray resultMerchantIdArray = new JSONArray();
+        for(int merchantInfoIndex = 0 ;merchantInfoIndex < merchantInfos.size();merchantInfoIndex ++){
+            JSONObject merchantInfoJson = merchantInfos.getJSONObject(merchantInfoIndex);
+            String soMerchantServiceResult = this.soMerchantService(merchantInfoJson);
+            JSONObject resultInfo = new JSONObject();
+
+            if(!ProtocolUtil.validateReturnJson(soMerchantServiceResult,resultInfo)){
+                throw new RuntimeException("客户信息受理失败,原因为:"+resultInfo.getString(ProtocolUtil.RESULT_MSG));
+            }
+            if(resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO) != null
+                    && resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO).containsKey("merchantId")) {
+
+                String merchantIds = merchantInfoJ.getString("merchantId");
+//                merchantIds += "," + resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO).getString("merchantId");
+
+//                merchantIds = merchantIds.startsWith(",") && merchantIds.length()>1 ? merchantIds.substring(1,merchantIds.length()):merchantIds;
+                //merchantInfoJ.put("merchantId", merchantIds);
+                JSONArray boMerchants = merchantInfoJson.getJSONArray("boMerchant");
+
+                Object merchantIdObj = JSONPath.eval(merchantInfoJson,"$.boMerchant[merchantId < '0'][0].merchantId");
+                if(StringUtils.isNotBlank(merchantIds) && !ObjectUtils.isEmpty(merchantIdObj)) {
+
+                    String[] allNewMerchantIds = merchantIds.split(",");
+                    JSONObject newMerchantIdJson = null;
+                    for (String merchantId : allNewMerchantIds) {
+                        newMerchantIdJson = new JSONObject();
+                        newMerchantIdJson.put("oldMerchantId",merchantIdObj);
+                        newMerchantIdJson.put("merchantId",merchantId);
+                        resultMerchantIdArray.add(newMerchantIdJson);
+                    }
+
+                }
+            }
+
+        }
+
+        merchantInfoJ.put("merchant",resultMerchantIdArray);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",merchantInfoJ);
+    }
+
+    /**
+     * {
+     *     boMerchant:[{},{}]
+     * }
+     * 客户信心处理
+     *
+     *
+     * @param boMerchants
+     * @return 成功 会带上处理客户的客户ID
+     * {'RESULT_CODE':'0000','RESULT_MSG':'成功','RESULT_INFO':{'merchantId':'7000123,718881991'}}
+     * @throws Exception
+     */
+    public String soBoMerchant(String boMerchants) throws Exception{
+        return soBoMerchant(boMerchants,null);
+    }
+
+    /**
+     * 将生成的merchantId 封装在map中返回
+     * ...
+     * merchantIdKey.put("merchantId-1","710020404040");
+     *
+     * ...
+     *
+     * key 为 merchantId 加原前的值
+     *
+     * merchantIdKey 如果为空不做处理
+     * @param boMerchants 客户信息
+     * @param merchantIdKey merchantIdKeymap
+     * @return
+     * @throws Exception
+     */
+    public String soBoMerchant(String boMerchants,Map merchantIdKey) throws Exception{
+        // 将 jsonArray 转为list<BoMerchant> 对象
+        JSONObject jsonObject = JSONObject.parseObject(boMerchants);
+
+        JSONObject resultInfo = new JSONObject();
+
+        String merchantIds = "";
+
+        List<BoMerchant> boMerchantList = JSONObject.parseArray(jsonObject.getJSONArray("boMerchant").toJSONString(), BoMerchant.class);
+
+        Collections.sort(boMerchantList);
+        //保存数据
+
+        for(BoMerchant boMerchant : boMerchantList){
+//        for(int boMerchantIndex = 0 ; boMerchantIndex < boMerchantList.size();boMerchantIndex++){
+//            BoMerchant boMerchant = boMerchantList.get(boMerchantIndex);
+            String merchantId = boMerchant.getBoId();
+            //如果客户ID小于0 ,则自己生成客户ID,这个只有在有 主键生成服务时使用,否则为了防止出错,需要前段调用时需要生成merchantId
+            if(StringUtils.isBlank(merchantId) || merchantId.startsWith("-") ){
+                /*JSONObject data = new JSONObject();
+                data.put("type","CUST_ID");
+                //要求接口返回 {"RESULT_CODE":"0000","RESULT_INFO":{"merchant_id":"7020170411000041"},"RESULT_MSG":"成功"}
+                String merchantIdJSONStr = iPrimaryKeyService.queryPrimaryKey(data.toJSONString());
+                JSONObject merchantIdJSONTmp = JSONObject.parseObject(merchantIdJSONStr);
+                if(merchantIdJSONTmp.containsKey("RESULT_CODE")
+                        && ProtocolUtil.RETURN_MSG_SUCCESS.equals(merchantIdJSONTmp.getString("RESULT_CODE"))
+                        && merchantIdJSONTmp.containsKey("RESULT_INFO")){
+                    //从接口生成merchantId
+                    merchantId = NumberUtils.toInt(merchantIdJSONTmp.getJSONObject("RESULT_INFO").getString("CUST_ID"),-1);
+                }*/
+
+                merchantId = this.queryPrimaryKey(iPrimaryKeyService,"CUST_ID");
+
+                //将 新生成的merchantId保存至 map中 merchantId-1 merchantId-2 主键方式存入
+                if(merchantIdKey != null){
+                    merchantIdKey.put("merchantId"+boMerchant.getMerchantId(),merchantId);
+                }
+            }
+
+            boMerchant.setMerchantId(merchantId);
+
+            //保存数据至 bo_merchant 表中
+            int saveBoMerchantFlag = iMerchantServiceDao.saveDataToBoMerchant(boMerchant);
+
+            if(saveBoMerchantFlag < 1){ // 如果没有保存成功,抛出异常,有事物 回退事物
+                throw new RuntimeException("保存过程[bo_merchant]数据失败,印象记录数为"+saveBoMerchantFlag+",boMerchant : "+boMerchant);
+            }
+            //建档 处理 实例数据
+            int saveMerchantFlag = 0;
+            if("ADD".equals(boMerchant.getState())){
+               /* List<BoMerchant> boMerchantsTmp = boMerchantList;
+                //在增加之间首先要判断是否有相应删的动作
+//                for(BoMerchant boMerchantTmp : boMerchantsTmp){
+                for(int boMerchantTmpIndex = boMerchantIndex+1;boMerchantTmpIndex < boMerchantsTmp.size();boMerchantTmpIndex++){
+                    BoMerchant boMerchantTmp = boMerchantsTmp.get(boMerchantTmpIndex);
+                    if(StringUtils.isNotBlank(boMerchant.getMerchantId())
+                            && boMerchant.getMerchantId().equals(boMerchantTmp.getMerchantId())
+                            &&"DEL".equals(boMerchantTmp.getState())){
+                        //先调用删除客户信息
+                        saveMerchantFlag = iMerchantServiceDao.deleteDataToMerchant(boMerchant.convert());
+
+                        if(saveMerchantFlag < 1){
+                            throw new RuntimeException("删除实例[merchant]数据失败,影响记录数为"+saveMerchantFlag+", merchant : "+boMerchant.convert());
+                        }
+
+                        //则把已经删除过的从list中删除,以防重复删除
+                        boMerchantList.remove(boMerchantTmp);
+
+                    }
+                }*/
+
+                saveMerchantFlag  = iMerchantServiceDao.saveDataToMerchant(boMerchant.convert());
+            }else if("DEL".equals(boMerchant.getState())){
+                saveMerchantFlag = iMerchantServiceDao.deleteDataToMerchant(boMerchant.convert());
+            }else if("KIP".equals(boMerchant.getState())){
+                //按理这里到不了,KIP表示实例数据不变,所以这里默认写成1 认为是成功
+                saveMerchantFlag = 1;
+            }else{
+                //这里单独抛出异常,不走下面统一异常抛出,是为了说明更具体点
+                throw new RuntimeException("入参错误boMerchant 的 state 目前只支持 [ADD,DEL,KIP] , boMerchant : " +boMerchant);
+            }
+
+
+            if(saveMerchantFlag < 1){
+                throw new RuntimeException("保存实例[merchant]数据失败,影响记录数为"+saveMerchantFlag+", merchant : "+boMerchant.convert());
+            }
+
+            merchantIds +=","+merchantId;
+
+        }
+
+        //去除第一个逗号
+        if (merchantIds.length()>0){
+            merchantIds = merchantIds.substring(1);
+        }
+
+        resultInfo.put("merchantId",merchantIds);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",resultInfo);
+    }
+
+    /**
+     * 注意在调用这个接口时,相应的客户信息必须存在
+     *
+     *
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boMerchantAttr:[{},{}]
+     * }
+     * @param boMerchantAttrs
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soBoMerchantAttr(String boMerchantAttrs) throws Exception {
+
+        //这里可以加入基本客户信息是否存在的校验,暂时没有必要实现
+
+        // 将 jsonArray 转为list<BoMerchant> 对象
+        JSONObject jsonObject = JSONObject.parseObject(boMerchantAttrs);
+
+        List<BoMerchantAttr> boMerchantAttrList = JSONObject.parseArray(jsonObject.getJSONArray("boMerchantAttr").toJSONString(), BoMerchantAttr.class);
+
+        //先拍个序 先处理DEL 再处理ADD
+        Collections.sort(boMerchantAttrList);
+        //保存数据
+
+        for(BoMerchantAttr boMerchantAttr : boMerchantAttrList) {
+
+            //保存数据至 bo_merchant_attr 表中
+            int saveBoMerchantAttrFlag = iMerchantServiceDao.saveDataToBoMerchantAttr(boMerchantAttr);
+
+            if(saveBoMerchantAttrFlag < 1){ // 如果没有保存成功,抛出异常,有事物 回退事物
+                throw new RuntimeException("保存过程[bo_merchant_attr]数据失败,印象记录数为"+saveBoMerchantAttrFlag+",boMerchantAttr : "+boMerchantAttr);
+            }
+
+            //建档 处理 实例数据
+            int saveMerchantAttrFlag = 0;
+            if("ADD".equals(boMerchantAttr.getState())){
+                saveMerchantAttrFlag  = iMerchantServiceDao.saveDataToMerchantAttr(boMerchantAttr.convert());
+            }else if("DEL".equals(boMerchantAttr.getState())){
+                saveMerchantAttrFlag = iMerchantServiceDao.deleteDataToMerchantAttr(boMerchantAttr.convert());
+            }else if("KIP".equals(boMerchantAttr.getState())){
+                //按理这里到不了,KIP表示实例数据不变,所以这里默认写成1 认为是成功
+                saveMerchantAttrFlag = 1;
+            }else{
+                //这里单独抛出异常,不走下面统一异常抛出,是为了说明更具体点
+                throw new RuntimeException("入参错误boMerchantAttr 的 state 目前只支持 [ADD,DEL,KIP] , boMerchant : " +boMerchantAttr);
+            }
+
+            if(saveMerchantAttrFlag < 1){
+                throw new RuntimeException("保存实例[merchant_attr]数据失败,影响记录数为"+saveMerchantAttrFlag+", merchant : "+boMerchantAttr.convert());
+            }
+        }
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",null);
+    }
+
+    /**
+     * 作废客户信息
+     * [{},{},{}]
+     *
+     * @param datas
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soDeleteMerchantInfo(JSONArray datas) throws Exception {
+
+        Assert.isNull(datas,"传入的data节点下没有任何内容");
+
+        for(int boIdIndex = 0 ; boIdIndex < datas.size(); boIdIndex++){
+            JSONObject data = datas.getJSONObject(boIdIndex);
+
+            Assert.isNull(data,"boId","当前节点中没有包含boId节点格式错误"+data);
+
+            // 复原Merchant
+            doDeleteBoMerchant(data);
+
+            // 复原MerchantAttr
+            doDeleteBoMerchantAttr(data);
+
+        }
+
+
+        return null;
+    }
+
+
+    /**
+     * 查询客户信息
+     * 包括 基本信息merchant 和 属性信息 merchantAttr
+     * @param merchant
+     * @return
+     * @throws Exception
+     */
+    public String queryMerchant(Merchant merchant) throws Exception{
+        LoggerEngine.debug("客户信息查询入参:" + merchant);
+        if(merchant == null || StringUtils.isBlank(merchant.getMerchantId()) ){
+            throw new IllegalArgumentException("客户信息查询入参为空,merchantId 为空 "+merchant);
+        }
+        Merchant newMerchant = iMerchantServiceDao.queryDataToMerchant(merchant);
+
+        if(newMerchant == null){
+            return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"未找到用户信息",null);
+        }
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",JSONObject.parseObject(JSONObject.toJSONString(newMerchant)));
+    }
+
+    /**
+     * 处理boMerchant 节点
+     * @throws Exception
+     */
+    public void doProcessBoMerchant(JSONObject merchantInfoJson,JSONObject paramJson,Map merchantIdKey, JSONObject resultInfo) throws Exception{
+
+        if(merchantInfoJson.containsKey("boMerchant")){
+            JSONArray boMerchants = merchantInfoJson.getJSONArray("boMerchant");
+            JSONObject boMerchantObj = new JSONObject();
+            boMerchantObj.put("boMerchant",boMerchants);
+            String returnSaveBoMerchant = this.soBoMerchant(boMerchantObj.toJSONString(),merchantIdKey);
+
+            if(!ProtocolUtil.validateReturnJson(returnSaveBoMerchant,paramJson)){
+
+                throw new RuntimeException("保存 bo_merchant 失败:"+boMerchantObj+(paramJson != null
+                        && paramJson.containsKey("RESULT_MSG")?paramJson.getString("RESULT_MSG"):"未知异常"));
+            }
+
+            resultInfo = paramJson.getJSONObject("RESULT_INFO");
+        }
+    }
+
+    /**
+     * 处理boMerchantAttr 节点
+     * @param merchantInfoJson
+     * @param paramJson
+     * @param merchantIdKey
+     * @param resultInfo
+     */
+    public void doProcessBoMerchantAttr(JSONObject merchantInfoJson,JSONObject paramJson,Map merchantIdKey, JSONObject resultInfo) throws Exception{
+        if(merchantInfoJson.containsKey("boMerchantAttr")){
+
+            JSONArray boMerchantAttrs = merchantInfoJson.getJSONArray("boMerchantAttr");
+            //首先对merchantId 进行处理
+            if(merchantIdKey != null && merchantIdKey.size() > 0 ){
+                for(int boMerchantAttrIndex = 0 ; boMerchantAttrIndex < boMerchantAttrs.size();boMerchantAttrIndex++){
+                    JSONObject boMerchantAttr = boMerchantAttrs.getJSONObject(boMerchantAttrIndex);
+                    boMerchantAttr.put("merchantId",merchantIdKey.get("merchantId"+boMerchantAttr.getString("merchantId")));
+                }
+            }
+            JSONObject boMerchantAttrObj = new JSONObject();
+            boMerchantAttrObj.put("boMerchantAttr",boMerchantAttrs);
+            String returnSaveBoMerchantAttr = soBoMerchantAttr(boMerchantAttrObj.toJSONString());
+
+            if(!ProtocolUtil.validateReturnJson(returnSaveBoMerchantAttr,paramJson)){
+
+                throw new RuntimeException("保存 bo_merchant 失败:"+boMerchantAttrObj+(paramJson != null
+                        && paramJson.containsKey("RESULT_MSG")?paramJson.getString("RESULT_MSG"):"未知异常"));
+            }
+        }
+    }
+
+    /**
+     * 作废 boMerchant 信息
+     * @param data
+     * @throws Exception
+     */
+    public void doDeleteBoMerchant(JSONObject data) throws Exception{
+
+
+        Merchant deleteMerchant = null;
+        //根据boId 查询bo_merchant 表,是否有数据,没数据直接返回
+        BoMerchant boMerchant = new BoMerchant();
+
+        boMerchant.setBoId(data.getString("boId"));
+
+       List<BoMerchant> boMerchants =  iMerchantServiceDao.queryBoMerchant(boMerchant);
+
+       //Assert.isOne(boMerchants,"在表bo_merchant中未找到boId 为["+data.getString("boId")+"]的数据 或有多条数据,请检查");
+        if(boMerchants == null || boMerchants.size() < 1){
+            LoggerEngine.error("当前没有查到数为 "+data+"请检查数据");
+            return;
+        }
+       //在过程表中补一条作废的数据,然后根据boId的动作对实例数据进行处理
+
+        boMerchant.setMerchantId(boMerchants.get(0).getMerchantId());
+        boMerchant.setBoId("");
+        //查询出所有merchantId 一样的数据
+        List<BoMerchant> boMerchantAll =  iMerchantServiceDao.queryBoMerchant(boMerchant);
+
+        Assert.isNull(boMerchantAll,"当前没有查到merchantId 为 "+boMerchants.get(0).getMerchantId()+"请检查数据");
+
+        boMerchant = boMerchants.get(0);
+
+        BoMerchant newBoMerchant = new BoMerchant();
+        newBoMerchant.setBoId(data.getString("newBoId"));
+        newBoMerchant.setMerchantId(boMerchant.getMerchantId());
+        newBoMerchant.setState("DEL");
+        int saveBoMerchantFlag = iMerchantServiceDao.saveDataToBoMerchant(newBoMerchant);
+
+        if(saveBoMerchantFlag < 1){
+            throw new RuntimeException("向bo_merchant表中保存数据失败,boMerchant="+JSONObject.toJSONString(newBoMerchant));
+        }
+
+        //首先删除实例数据
+        deleteMerchant = new Merchant();
+        deleteMerchant.setMerchantId(boMerchant.getMerchantId());
+        if(iMerchantServiceDao.deleteDataToMerchant(deleteMerchant) < 1){
+            throw new RuntimeException("删除merchant实例数据失败"+JSONObject.toJSONString(deleteMerchant));
+        }
+        //如果有多条数据,则恢复 前一条数据信息,这边存在bug 如果上一条的数据没有分装以前数据的情况下会有问题,
+        // 所以我们的原则是再更新或删除数据时一定要在过程表中保存完整是实例数据信息
+        if(boMerchantAll.size() > 1){
+            Merchant oldMerchant = boMerchantAll.get(1).convert();
+            if(iMerchantServiceDao.saveDataToMerchant(oldMerchant)<1 ){
+                throw new RuntimeException("merchant 表恢复老数据信息失败,merchant 为:"+JSONObject.toJSONString(oldMerchant));
+            }
+        }
+    }
+
+    /**
+     * 删除 bo_merchant_attr
+     * @param data
+     * @throws Exception
+     */
+    public void doDeleteBoMerchantAttr(JSONObject data) throws Exception{
+
+        BoMerchantAttr boMerchantAttrTmp = new BoMerchantAttr();
+
+        boMerchantAttrTmp.setBoId(data.getString("boId"));
+
+        List<BoMerchantAttr> boMerchantAttrs = iMerchantServiceDao.queryBoMerchantAttr(boMerchantAttrTmp);
+
+        if(boMerchantAttrs == null || boMerchantAttrs.size() < 1){
+            LoggerEngine.error("当前没有查到数为 "+data+"请检查数据");
+            return;
+        }
+
+        boMerchantAttrTmp.setBoId("");
+        boMerchantAttrTmp.setMerchantId(boMerchantAttrs.get(0).getMerchantId());
+
+        List<BoMerchantAttr> boMerchantAttrsTmps = iMerchantServiceDao.queryBoMerchantAttr(boMerchantAttrTmp);
+
+        Assert.isNull(boMerchantAttrsTmps,"当前没有查到merchantId 为 "+boMerchantAttrs.get(0).getMerchantId()+"请检查数据");
+
+        //获取上一次所有的属性
+
+        List<BoMerchantAttr> preBoMerchantAttrTmps = getPreBoMerchantAttrs(boMerchantAttrsTmps);
+
+        //保存过程表
+        for(BoMerchantAttr boMerchantAttr : boMerchantAttrs){
+            boMerchantAttr.setBoId("newBoId");
+            boMerchantAttr.setState("DEL");
+            if(iMerchantServiceDao.saveDataToBoMerchantAttr(boMerchantAttr) < 1){
+                throw new RuntimeException("保存数据失败,保存数据为boMerchantAttr = "+ JSONObject.toJSONString(boMerchantAttr));
+            }
+        }
+
+        //删除实例数据 这里思路是,删除实例数据中数据,将上一次ADD数据重新写一遍
+        MerchantAttr merchantAttrTmp = new MerchantAttr();
+        merchantAttrTmp.setMerchantId(boMerchantAttrs.get(0).getMerchantId());
+        if(iMerchantServiceDao.deleteDataToMerchantAttr(merchantAttrTmp) < 1){
+            throw new RuntimeException("删除MerchantAttr 实例数据失败,数据为:"+JSONObject.toJSONString(merchantAttrTmp));
+        }
+
+        for(BoMerchantAttr boMerchantAttr : preBoMerchantAttrTmps){
+            if("ADD".equals(boMerchantAttr.getState())){
+                if(iMerchantServiceDao.deleteDataToMerchantAttr(boMerchantAttr.convert()) < 1){
+                    throw new  RuntimeException("复原原始数据失败,数据为:" + JSONObject.toJSONString(boMerchantAttr));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 获取上上一次的操作
+     * @param boMerchantAttrs
+     * @return
+     */
+    private List<BoMerchantAttr> getPreBoMerchantAttrs(List<BoMerchantAttr> boMerchantAttrs){
+
+        String firstBoId = boMerchantAttrs.get(0).getBoId();
+        String preBoId = "";
+        List<BoMerchantAttr> preBoMerchantAttrs = new ArrayList<BoMerchantAttr>();
+        for(BoMerchantAttr boMerchantAttr : boMerchantAttrs){
+            if(!firstBoId.equals(boMerchantAttr.getBoId())){
+                if(!preBoId.equals(boMerchantAttr.getBoId()) && !"".equals(preBoId)){
+                    break;
+                }
+                preBoId = boMerchantAttr.getBoId();
+                preBoMerchantAttrs.add(boMerchantAttr);
+            }
+        }
+        return preBoMerchantAttrs;
+    }
+
+    public IPrimaryKeyService getiPrimaryKeyService() {
+        return iPrimaryKeyService;
+    }
+
+    public void setiPrimaryKeyService(IPrimaryKeyService iPrimaryKeyService) {
+        this.iPrimaryKeyService = iPrimaryKeyService;
+    }
+
+    public IMerchantServiceDao getiMerchantServiceDao() {
+        return iMerchantServiceDao;
+    }
+
+    public void setiMerchantServiceDao(IMerchantServiceDao iMerchantServiceDao) {
+        this.iMerchantServiceDao = iMerchantServiceDao;
+    }
+}

+ 638 - 0
MerchantService/src/main/java/com/java110/merchant/smo/impl/ProductServiceSMOImpl.java

@@ -0,0 +1,638 @@
+package com.java110.merchant.smo.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.JSONPath;
+import com.java110.common.log.LoggerEngine;
+import com.java110.common.util.Assert;
+import com.java110.common.util.ProtocolUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.entity.product.BoProduct;
+import com.java110.entity.product.BoProductAttr;
+import com.java110.entity.product.Product;
+import com.java110.entity.product.ProductAttr;
+import com.java110.feign.base.IPrimaryKeyService;
+import com.java110.merchant.dao.IProductServiceDao;
+import com.java110.merchant.smo.IProductServiceSMO;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
+import java.util.*;
+
+/**
+ * 用户服务信息管理业务信息实现
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("productServiceSMOImpl")
+@Transactional
+public class ProductServiceSMOImpl extends BaseServiceSMO implements IProductServiceSMO {
+
+    @Autowired
+    IPrimaryKeyService iPrimaryKeyService;
+
+    @Autowired
+    IProductServiceDao iProductServiceDao;
+
+    //新增用户
+    private final static String MERCHANT_ACTION_ADD = "ADD";
+
+    //新增用户
+    private final static String MERCHANT_ACTION_KIP = "KIP";
+
+    //新增用户
+    private final static String MERCHANT_ACTION_DEL = "DEL";
+
+    /**
+     * 保存用户信息
+     *
+     * @param productInfoJson 入参为用户信息json传
+     * @return
+     */
+    public String saveProduct(String productInfoJson) throws Exception{
+
+        JSONObject reqProductJSON = null;
+        try {
+            reqProductJSON = this.simpleValidateJSON(productInfoJson);
+            //boProduct增加Action (动作)
+            if (reqProductJSON.containsKey("boProduct")) {
+                JSONObject boProduct = reqProductJSON.getJSONObject("boProduct");
+                boProduct.put("state", MERCHANT_ACTION_ADD);
+            }
+            //boProductAttr增加Action(动作)
+            if (reqProductJSON.containsKey("boProductAttr")) {
+                JSONArray boProductAttrs = reqProductJSON.getJSONArray("boProductAttr");
+
+                for (int attrIndex = 0; attrIndex < boProductAttrs.size(); attrIndex++) {
+                    JSONObject boProductAttr = boProductAttrs.getJSONObject(attrIndex);
+                    boProductAttr.put("state", MERCHANT_ACTION_ADD);
+                }
+            }
+        } catch (RuntimeException e) {
+            //返回异常信息
+            return e.getMessage();
+        }
+        return soProductService(reqProductJSON);
+    }
+
+
+    /**
+     * 所有服务处理类
+     * {
+     *
+     *     'boProduct':[{}],
+     *     'boProductAttr':[{}]
+     * }
+     *
+     * 返回报文:
+     *
+     * {'RESULT_CODE':'0000','RESULT_MSG':'成功','RESULT_INFO':{'productId':'7000123,718881991'}}
+     * @param productInfoJson
+     * @return
+     */
+    public String soProductService(JSONObject productInfoJson) throws Exception{
+        LoggerEngine.debug("用户服务操作客户入参:" + productInfoJson);
+        JSONObject paramJson = new JSONObject();
+
+        JSONObject resultInfo = null;
+
+        //存放生成的productId 主键为 productId-1 71000010100
+        Map productIdKey = new HashMap();
+
+        if (productInfoJson == null){
+            throw new IllegalArgumentException("soProductService 入参 为空"+productInfoJson);
+        }
+         // 客户信息处理 处理boProduct节点
+        doProcessBoProduct(productInfoJson,paramJson,productIdKey,resultInfo);
+
+        //客户属性信息处理 处理boProductAttr节点
+        doProcessBoProductAttr(productInfoJson,paramJson,productIdKey,resultInfo);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",resultInfo);
+
+    }
+
+    /**
+     *
+     * 请求报文为:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boProduct": [{},{}],
+     "boProductAttr": [{ }, {}]
+     },
+     {
+     "actionTypeCd": "C1",
+     "boProduct": [{},{}],
+     "boProductAttr": [{ }, {}]
+     }
+     ]
+     }
+
+     返回报文 :
+
+     { 'RESULT_CODE': '0000', 'RESULT_MSG': '成功', 'RESULT_INFO': {'product':[{'oldProductId':'-1','productId':'12345678'},{'oldProductId':'-2','productId':'12345678'}]} }
+     * @param mInfoJson
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soProductServiceForOrderService(JSONObject mInfoJson) throws Exception {
+
+        Assert.isNull(mInfoJson,"data","请求报文缺少 data 节点,请检查");
+
+        JSONArray productInfos = mInfoJson.getJSONArray("data");
+
+        Assert.isNull(productInfos,"请求报文中data节点,没有子节点,data子节点应该为JSONArray,productInfos="+productInfos);
+
+        JSONObject productInfoJ = new JSONObject();
+        JSONArray resultProductIdArray = new JSONArray();
+        for(int productInfoIndex = 0 ;productInfoIndex < productInfos.size();productInfoIndex ++){
+            JSONObject productInfoJson = productInfos.getJSONObject(productInfoIndex);
+            String soProductServiceResult = this.soProductService(productInfoJson);
+            JSONObject resultInfo = new JSONObject();
+
+            if(!ProtocolUtil.validateReturnJson(soProductServiceResult,resultInfo)){
+                throw new RuntimeException("客户信息受理失败,原因为:"+resultInfo.getString(ProtocolUtil.RESULT_MSG));
+            }
+            if(resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO) != null
+                    && resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO).containsKey("productId")) {
+
+                String productIds = productInfoJ.getString("productId");
+//                productIds += "," + resultInfo.getJSONObject(ProtocolUtil.RESULT_INFO).getString("productId");
+
+//                productIds = productIds.startsWith(",") && productIds.length()>1 ? productIds.substring(1,productIds.length()):productIds;
+                //productInfoJ.put("productId", productIds);
+                JSONArray boProducts = productInfoJson.getJSONArray("boProduct");
+
+                Object productIdObj = JSONPath.eval(productInfoJson,"$.boProduct[productId < '0'][0].productId");
+                if(StringUtils.isNotBlank(productIds) && !ObjectUtils.isEmpty(productIdObj)) {
+
+                    String[] allNewProductIds = productIds.split(",");
+                    JSONObject newProductIdJson = null;
+                    for (String productId : allNewProductIds) {
+                        newProductIdJson = new JSONObject();
+                        newProductIdJson.put("oldProductId",productIdObj);
+                        newProductIdJson.put("productId",productId);
+                        resultProductIdArray.add(newProductIdJson);
+                    }
+
+                }
+            }
+
+        }
+
+        productInfoJ.put("product",resultProductIdArray);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",productInfoJ);
+    }
+
+    /**
+     * {
+     *     boProduct:[{},{}]
+     * }
+     * 客户信心处理
+     *
+     *
+     * @param boProducts
+     * @return 成功 会带上处理客户的客户ID
+     * {'RESULT_CODE':'0000','RESULT_MSG':'成功','RESULT_INFO':{'productId':'7000123,718881991'}}
+     * @throws Exception
+     */
+    public String soBoProduct(String boProducts) throws Exception{
+        return soBoProduct(boProducts,null);
+    }
+
+    /**
+     * 将生成的productId 封装在map中返回
+     * ...
+     * productIdKey.put("productId-1","710020404040");
+     *
+     * ...
+     *
+     * key 为 productId 加原前的值
+     *
+     * productIdKey 如果为空不做处理
+     * @param boProducts 客户信息
+     * @param productIdKey productIdKeymap
+     * @return
+     * @throws Exception
+     */
+    public String soBoProduct(String boProducts,Map productIdKey) throws Exception{
+        // 将 jsonArray 转为list<BoProduct> 对象
+        JSONObject jsonObject = JSONObject.parseObject(boProducts);
+
+        JSONObject resultInfo = new JSONObject();
+
+        String productIds = "";
+
+        List<BoProduct> boProductList = JSONObject.parseArray(jsonObject.getJSONArray("boProduct").toJSONString(), BoProduct.class);
+
+        Collections.sort(boProductList);
+        //保存数据
+
+        for(BoProduct boProduct : boProductList){
+//        for(int boProductIndex = 0 ; boProductIndex < boProductList.size();boProductIndex++){
+//            BoProduct boProduct = boProductList.get(boProductIndex);
+            String productId = boProduct.getBoId();
+            //如果客户ID小于0 ,则自己生成客户ID,这个只有在有 主键生成服务时使用,否则为了防止出错,需要前段调用时需要生成productId
+            if(StringUtils.isBlank(productId) || productId.startsWith("-") ){
+                /*JSONObject data = new JSONObject();
+                data.put("type","CUST_ID");
+                //要求接口返回 {"RESULT_CODE":"0000","RESULT_INFO":{"product_id":"7020170411000041"},"RESULT_MSG":"成功"}
+                String productIdJSONStr = iPrimaryKeyService.queryPrimaryKey(data.toJSONString());
+                JSONObject productIdJSONTmp = JSONObject.parseObject(productIdJSONStr);
+                if(productIdJSONTmp.containsKey("RESULT_CODE")
+                        && ProtocolUtil.RETURN_MSG_SUCCESS.equals(productIdJSONTmp.getString("RESULT_CODE"))
+                        && productIdJSONTmp.containsKey("RESULT_INFO")){
+                    //从接口生成productId
+                    productId = NumberUtils.toInt(productIdJSONTmp.getJSONObject("RESULT_INFO").getString("CUST_ID"),-1);
+                }*/
+
+                productId = this.queryPrimaryKey(iPrimaryKeyService,"CUST_ID");
+
+                //将 新生成的productId保存至 map中 productId-1 productId-2 主键方式存入
+                if(productIdKey != null){
+                    productIdKey.put("productId"+boProduct.getProductId(),productId);
+                }
+            }
+
+            boProduct.setProductId(productId);
+
+            //保存数据至 bo_product 表中
+            int saveBoProductFlag = iProductServiceDao.saveDataToBoProduct(boProduct);
+
+            if(saveBoProductFlag < 1){ // 如果没有保存成功,抛出异常,有事物 回退事物
+                throw new RuntimeException("保存过程[bo_product]数据失败,印象记录数为"+saveBoProductFlag+",boProduct : "+boProduct);
+            }
+            //建档 处理 实例数据
+            int saveProductFlag = 0;
+            if("ADD".equals(boProduct.getState())){
+               /* List<BoProduct> boProductsTmp = boProductList;
+                //在增加之间首先要判断是否有相应删的动作
+//                for(BoProduct boProductTmp : boProductsTmp){
+                for(int boProductTmpIndex = boProductIndex+1;boProductTmpIndex < boProductsTmp.size();boProductTmpIndex++){
+                    BoProduct boProductTmp = boProductsTmp.get(boProductTmpIndex);
+                    if(StringUtils.isNotBlank(boProduct.getProductId())
+                            && boProduct.getProductId().equals(boProductTmp.getProductId())
+                            &&"DEL".equals(boProductTmp.getState())){
+                        //先调用删除客户信息
+                        saveProductFlag = iProductServiceDao.deleteDataToProduct(boProduct.convert());
+
+                        if(saveProductFlag < 1){
+                            throw new RuntimeException("删除实例[product]数据失败,影响记录数为"+saveProductFlag+", product : "+boProduct.convert());
+                        }
+
+                        //则把已经删除过的从list中删除,以防重复删除
+                        boProductList.remove(boProductTmp);
+
+                    }
+                }*/
+
+                saveProductFlag  = iProductServiceDao.saveDataToProduct(boProduct.convert());
+            }else if("DEL".equals(boProduct.getState())){
+                saveProductFlag = iProductServiceDao.deleteDataToProduct(boProduct.convert());
+            }else if("KIP".equals(boProduct.getState())){
+                //按理这里到不了,KIP表示实例数据不变,所以这里默认写成1 认为是成功
+                saveProductFlag = 1;
+            }else{
+                //这里单独抛出异常,不走下面统一异常抛出,是为了说明更具体点
+                throw new RuntimeException("入参错误boProduct 的 state 目前只支持 [ADD,DEL,KIP] , boProduct : " +boProduct);
+            }
+
+
+            if(saveProductFlag < 1){
+                throw new RuntimeException("保存实例[product]数据失败,影响记录数为"+saveProductFlag+", product : "+boProduct.convert());
+            }
+
+            productIds +=","+productId;
+
+        }
+
+        //去除第一个逗号
+        if (productIds.length()>0){
+            productIds = productIds.substring(1);
+        }
+
+        resultInfo.put("productId",productIds);
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",resultInfo);
+    }
+
+    /**
+     * 注意在调用这个接口时,相应的客户信息必须存在
+     *
+     *
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boProductAttr:[{},{}]
+     * }
+     * @param boProductAttrs
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soBoProductAttr(String boProductAttrs) throws Exception {
+
+        //这里可以加入基本客户信息是否存在的校验,暂时没有必要实现
+
+        // 将 jsonArray 转为list<BoProduct> 对象
+        JSONObject jsonObject = JSONObject.parseObject(boProductAttrs);
+
+        List<BoProductAttr> boProductAttrList = JSONObject.parseArray(jsonObject.getJSONArray("boProductAttr").toJSONString(), BoProductAttr.class);
+
+        //先拍个序 先处理DEL 再处理ADD
+        Collections.sort(boProductAttrList);
+        //保存数据
+
+        for(BoProductAttr boProductAttr : boProductAttrList) {
+
+            //保存数据至 bo_product_attr 表中
+            int saveBoProductAttrFlag = iProductServiceDao.saveDataToBoProductAttr(boProductAttr);
+
+            if(saveBoProductAttrFlag < 1){ // 如果没有保存成功,抛出异常,有事物 回退事物
+                throw new RuntimeException("保存过程[bo_product_attr]数据失败,印象记录数为"+saveBoProductAttrFlag+",boProductAttr : "+boProductAttr);
+            }
+
+            //建档 处理 实例数据
+            int saveProductAttrFlag = 0;
+            if("ADD".equals(boProductAttr.getState())){
+                saveProductAttrFlag  = iProductServiceDao.saveDataToProductAttr(boProductAttr.convert());
+            }else if("DEL".equals(boProductAttr.getState())){
+                saveProductAttrFlag = iProductServiceDao.deleteDataToProductAttr(boProductAttr.convert());
+            }else if("KIP".equals(boProductAttr.getState())){
+                //按理这里到不了,KIP表示实例数据不变,所以这里默认写成1 认为是成功
+                saveProductAttrFlag = 1;
+            }else{
+                //这里单独抛出异常,不走下面统一异常抛出,是为了说明更具体点
+                throw new RuntimeException("入参错误boProductAttr 的 state 目前只支持 [ADD,DEL,KIP] , boProduct : " +boProductAttr);
+            }
+
+            if(saveProductAttrFlag < 1){
+                throw new RuntimeException("保存实例[product_attr]数据失败,影响记录数为"+saveProductAttrFlag+", product : "+boProductAttr.convert());
+            }
+        }
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",null);
+    }
+
+    /**
+     * 作废客户信息
+     * [{},{},{}]
+     *
+     * @param datas
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public String soDeleteProductInfo(JSONArray datas) throws Exception {
+
+        Assert.isNull(datas,"传入的data节点下没有任何内容");
+
+        for(int boIdIndex = 0 ; boIdIndex < datas.size(); boIdIndex++){
+            JSONObject data = datas.getJSONObject(boIdIndex);
+
+            Assert.isNull(data,"boId","当前节点中没有包含boId节点格式错误"+data);
+
+            // 复原Product
+            doDeleteBoProduct(data);
+
+            // 复原ProductAttr
+            doDeleteBoProductAttr(data);
+
+        }
+
+
+        return null;
+    }
+
+
+    /**
+     * 查询客户信息
+     * 包括 基本信息product 和 属性信息 productAttr
+     * @param product
+     * @return
+     * @throws Exception
+     */
+    public String queryProduct(Product product) throws Exception{
+        LoggerEngine.debug("客户信息查询入参:" + product);
+        if(product == null || StringUtils.isBlank(product.getProductId()) ){
+            throw new IllegalArgumentException("客户信息查询入参为空,productId 为空 "+product);
+        }
+        Product newProduct = iProductServiceDao.queryDataToProduct(product);
+
+        if(newProduct == null){
+            return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"未找到用户信息",null);
+        }
+
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_SUCCESS,"成功",JSONObject.parseObject(JSONObject.toJSONString(newProduct)));
+    }
+
+    /**
+     * 处理boProduct 节点
+     * @throws Exception
+     */
+    public void doProcessBoProduct(JSONObject productInfoJson,JSONObject paramJson,Map productIdKey, JSONObject resultInfo) throws Exception{
+
+        if(productInfoJson.containsKey("boProduct")){
+            JSONArray boProducts = productInfoJson.getJSONArray("boProduct");
+            JSONObject boProductObj = new JSONObject();
+            boProductObj.put("boProduct",boProducts);
+            String returnSaveBoProduct = this.soBoProduct(boProductObj.toJSONString(),productIdKey);
+
+            if(!ProtocolUtil.validateReturnJson(returnSaveBoProduct,paramJson)){
+
+                throw new RuntimeException("保存 bo_product 失败:"+boProductObj+(paramJson != null
+                        && paramJson.containsKey("RESULT_MSG")?paramJson.getString("RESULT_MSG"):"未知异常"));
+            }
+
+            resultInfo = paramJson.getJSONObject("RESULT_INFO");
+        }
+    }
+
+    /**
+     * 处理boProductAttr 节点
+     * @param productInfoJson
+     * @param paramJson
+     * @param productIdKey
+     * @param resultInfo
+     */
+    public void doProcessBoProductAttr(JSONObject productInfoJson,JSONObject paramJson,Map productIdKey, JSONObject resultInfo) throws Exception{
+        if(productInfoJson.containsKey("boProductAttr")){
+
+            JSONArray boProductAttrs = productInfoJson.getJSONArray("boProductAttr");
+            //首先对productId 进行处理
+            if(productIdKey != null && productIdKey.size() > 0 ){
+                for(int boProductAttrIndex = 0 ; boProductAttrIndex < boProductAttrs.size();boProductAttrIndex++){
+                    JSONObject boProductAttr = boProductAttrs.getJSONObject(boProductAttrIndex);
+                    boProductAttr.put("productId",productIdKey.get("productId"+boProductAttr.getString("productId")));
+                }
+            }
+            JSONObject boProductAttrObj = new JSONObject();
+            boProductAttrObj.put("boProductAttr",boProductAttrs);
+            String returnSaveBoProductAttr = soBoProductAttr(boProductAttrObj.toJSONString());
+
+            if(!ProtocolUtil.validateReturnJson(returnSaveBoProductAttr,paramJson)){
+
+                throw new RuntimeException("保存 bo_product 失败:"+boProductAttrObj+(paramJson != null
+                        && paramJson.containsKey("RESULT_MSG")?paramJson.getString("RESULT_MSG"):"未知异常"));
+            }
+        }
+    }
+
+    /**
+     * 作废 boProduct 信息
+     * @param data
+     * @throws Exception
+     */
+    public void doDeleteBoProduct(JSONObject data) throws Exception{
+
+
+        Product deleteProduct = null;
+        //根据boId 查询bo_product 表,是否有数据,没数据直接返回
+        BoProduct boProduct = new BoProduct();
+
+        boProduct.setBoId(data.getString("boId"));
+
+       List<BoProduct> boProducts =  iProductServiceDao.queryBoProduct(boProduct);
+
+       //Assert.isOne(boProducts,"在表bo_product中未找到boId 为["+data.getString("boId")+"]的数据 或有多条数据,请检查");
+        if(boProducts == null || boProducts.size() < 1){
+            LoggerEngine.error("当前没有查到数为 "+data+"请检查数据");
+            return;
+        }
+       //在过程表中补一条作废的数据,然后根据boId的动作对实例数据进行处理
+
+        boProduct.setProductId(boProducts.get(0).getProductId());
+        boProduct.setBoId("");
+        //查询出所有productId 一样的数据
+        List<BoProduct> boProductAll =  iProductServiceDao.queryBoProduct(boProduct);
+
+        Assert.isNull(boProductAll,"当前没有查到productId 为 "+boProducts.get(0).getProductId()+"请检查数据");
+
+        boProduct = boProducts.get(0);
+
+        BoProduct newBoProduct = new BoProduct();
+        newBoProduct.setBoId(data.getString("newBoId"));
+        newBoProduct.setProductId(boProduct.getProductId());
+        newBoProduct.setState("DEL");
+        int saveBoProductFlag = iProductServiceDao.saveDataToBoProduct(newBoProduct);
+
+        if(saveBoProductFlag < 1){
+            throw new RuntimeException("向bo_product表中保存数据失败,boProduct="+JSONObject.toJSONString(newBoProduct));
+        }
+
+        //首先删除实例数据
+        deleteProduct = new Product();
+        deleteProduct.setProductId(boProduct.getProductId());
+        if(iProductServiceDao.deleteDataToProduct(deleteProduct) < 1){
+            throw new RuntimeException("删除product实例数据失败"+JSONObject.toJSONString(deleteProduct));
+        }
+        //如果有多条数据,则恢复 前一条数据信息,这边存在bug 如果上一条的数据没有分装以前数据的情况下会有问题,
+        // 所以我们的原则是再更新或删除数据时一定要在过程表中保存完整是实例数据信息
+        if(boProductAll.size() > 1){
+            Product oldProduct = boProductAll.get(1).convert();
+            if(iProductServiceDao.saveDataToProduct(oldProduct)<1 ){
+                throw new RuntimeException("product 表恢复老数据信息失败,product 为:"+JSONObject.toJSONString(oldProduct));
+            }
+        }
+    }
+
+    /**
+     * 删除 bo_product_attr
+     * @param data
+     * @throws Exception
+     */
+    public void doDeleteBoProductAttr(JSONObject data) throws Exception{
+
+        BoProductAttr boProductAttrTmp = new BoProductAttr();
+
+        boProductAttrTmp.setBoId(data.getString("boId"));
+
+        List<BoProductAttr> boProductAttrs = iProductServiceDao.queryBoProductAttr(boProductAttrTmp);
+
+        if(boProductAttrs == null || boProductAttrs.size() < 1){
+            LoggerEngine.error("当前没有查到数为 "+data+"请检查数据");
+            return;
+        }
+
+        boProductAttrTmp.setBoId("");
+        boProductAttrTmp.setProductId(boProductAttrs.get(0).getProductId());
+
+        List<BoProductAttr> boProductAttrsTmps = iProductServiceDao.queryBoProductAttr(boProductAttrTmp);
+
+        Assert.isNull(boProductAttrsTmps,"当前没有查到productId 为 "+boProductAttrs.get(0).getProductId()+"请检查数据");
+
+        //获取上一次所有的属性
+
+        List<BoProductAttr> preBoProductAttrTmps = getPreBoProductAttrs(boProductAttrsTmps);
+
+        //保存过程表
+        for(BoProductAttr boProductAttr : boProductAttrs){
+            boProductAttr.setBoId("newBoId");
+            boProductAttr.setState("DEL");
+            if(iProductServiceDao.saveDataToBoProductAttr(boProductAttr) < 1){
+                throw new RuntimeException("保存数据失败,保存数据为boProductAttr = "+ JSONObject.toJSONString(boProductAttr));
+            }
+        }
+
+        //删除实例数据 这里思路是,删除实例数据中数据,将上一次ADD数据重新写一遍
+        ProductAttr productAttrTmp = new ProductAttr();
+        productAttrTmp.setProductId(boProductAttrs.get(0).getProductId());
+        if(iProductServiceDao.deleteDataToProductAttr(productAttrTmp) < 1){
+            throw new RuntimeException("删除ProductAttr 实例数据失败,数据为:"+JSONObject.toJSONString(productAttrTmp));
+        }
+
+        for(BoProductAttr boProductAttr : preBoProductAttrTmps){
+            if("ADD".equals(boProductAttr.getState())){
+                if(iProductServiceDao.deleteDataToProductAttr(boProductAttr.convert()) < 1){
+                    throw new  RuntimeException("复原原始数据失败,数据为:" + JSONObject.toJSONString(boProductAttr));
+                }
+            }
+        }
+
+    }
+
+    /**
+     * 获取上上一次的操作
+     * @param boProductAttrs
+     * @return
+     */
+    private List<BoProductAttr> getPreBoProductAttrs(List<BoProductAttr> boProductAttrs){
+
+        String firstBoId = boProductAttrs.get(0).getBoId();
+        String preBoId = "";
+        List<BoProductAttr> preBoProductAttrs = new ArrayList<BoProductAttr>();
+        for(BoProductAttr boProductAttr : boProductAttrs){
+            if(!firstBoId.equals(boProductAttr.getBoId())){
+                if(!preBoId.equals(boProductAttr.getBoId()) && !"".equals(preBoId)){
+                    break;
+                }
+                preBoId = boProductAttr.getBoId();
+                preBoProductAttrs.add(boProductAttr);
+            }
+        }
+        return preBoProductAttrs;
+    }
+
+    public IPrimaryKeyService getiPrimaryKeyService() {
+        return iPrimaryKeyService;
+    }
+
+    public void setiPrimaryKeyService(IPrimaryKeyService iPrimaryKeyService) {
+        this.iPrimaryKeyService = iPrimaryKeyService;
+    }
+
+    public IProductServiceDao getiProductServiceDao() {
+        return iProductServiceDao;
+    }
+
+    public void setiProductServiceDao(IProductServiceDao iProductServiceDao) {
+        this.iProductServiceDao = iProductServiceDao;
+    }
+}

+ 44 - 9
bean/src/main/java/com/java110/entity/merchant/BoMerchant.java

@@ -1,5 +1,6 @@
 package com.java110.entity.merchant;
 
+
 import java.util.Date;
 import java.util.List;
 
@@ -7,11 +8,11 @@ import java.util.List;
  * 对应商户 过程表 bo_merchant
  * Created by wuxw on 2017/5/20.
  */
-public class BoMerchant {
+public class BoMerchant implements Comparable{
 
     private String boId;
 
-    private String merchatId;
+    private String merchantId;
 
     private String logoImg;
 
@@ -27,7 +28,7 @@ public class BoMerchant {
 
     private String state;
 
-    private String create_dt;
+    private Date create_dt;
 
     private List<BoMerchantAttr> boMerchantAttrs;
 
@@ -40,12 +41,12 @@ public class BoMerchant {
         this.boId = boId;
     }
 
-    public String getMerchatId() {
-        return merchatId;
+    public String getMerchantId() {
+        return merchantId;
     }
 
-    public void setMerchatId(String merchatId) {
-        this.merchatId = merchatId;
+    public void setMerchantId(String merchantId) {
+        this.merchantId = merchantId;
     }
 
     public String getLogoImg() {
@@ -104,11 +105,11 @@ public class BoMerchant {
         this.state = state;
     }
 
-    public String getCreate_dt() {
+    public Date getCreate_dt() {
         return create_dt;
     }
 
-    public void setCreate_dt(String create_dt) {
+    public void setCreate_dt(Date create_dt) {
         this.create_dt = create_dt;
     }
 
@@ -120,4 +121,38 @@ public class BoMerchant {
     public void setBoMerchantAttrs(List<BoMerchantAttr> boMerchantAttrs) {
         this.boMerchantAttrs = boMerchantAttrs;
     }
+
+    /**
+     * 转为实例数据
+     * @return
+     */
+    public Merchant convert(){
+
+        Merchant merchant = new Merchant();
+        merchant.setMerchantId(this.getMerchantId());
+        merchant.setName(this.getName());
+        merchant.setAddress(this.getAddress());
+        merchant.setStart_dt(this.getStart_dt());
+        merchant.setLogoImg(this.getLogoImg());
+        merchant.setEnd_dt(this.getEnd_dt());
+      
+
+        return merchant;
+    }
+
+
+    /**
+     * 排序
+     * @param o
+     * @return
+     */
+    @Override
+    public int compareTo(Object o) {
+
+        BoMerchant otherBoMerchant = (BoMerchant)o;
+        if("DEL".equals(this.getState()) && "ADD".equals(otherBoMerchant.getState())) {
+            return -1;
+        }
+        return 0;
+    }
 }

+ 24 - 1
bean/src/main/java/com/java110/entity/merchant/BoMerchantAttr.java

@@ -1,12 +1,13 @@
 package com.java110.entity.merchant;
 
+
 import java.util.Date;
 
 /**
  * 商户属性表 bo_merchant_type
  * Created by wuxw on 2017/5/20.
  */
-public class BoMerchantAttr {
+public class BoMerchantAttr implements Comparable {
 
     private String boId;
 
@@ -68,4 +69,26 @@ public class BoMerchantAttr {
     public void setCreate_dt(Date create_dt) {
         this.create_dt = create_dt;
     }
+
+    /**
+     * 将过程数据转为实例数据
+     * @return
+     */
+    public MerchantAttr convert(){
+        MerchantAttr merchantAttr = new MerchantAttr();
+
+        merchantAttr.setMerchantId(this.getMerchantId());
+        merchantAttr.setAttrCd(this.getAttrCd());
+        merchantAttr.setValue(this.getValue());
+        return merchantAttr;
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        BoMerchantAttr otherBoMerchant = (BoMerchantAttr)o;
+        if("DEL".equals(this.getState()) && "ADD".equals(otherBoMerchant.getState())) {
+            return -1;
+        }
+        return 0;
+    }
 }

+ 9 - 9
bean/src/main/java/com/java110/entity/merchant/Merchant.java

@@ -8,7 +8,7 @@ import java.util.List;
  */
 public class Merchant {
 
-    private String merchatId;
+    private String merchantId;
 
     private String logoImg;
 
@@ -24,7 +24,7 @@ public class Merchant {
 
     private String status_cd;
 
-    private String create_dt;
+    private Date create_dt;
 
     private List<MerchantAttr> merchantAttrs ;
 
@@ -40,7 +40,7 @@ public class Merchant {
         merchant.setCreate_dt(boMerchant.getCreate_dt());
         merchant.setEnd_dt(boMerchant.getEnd_dt());
         merchant.setLogoImg(boMerchant.getLogoImg());
-        merchant.setMerchatId(boMerchant.getMerchatId());
+        merchant.setMerchantId(boMerchant.getMerchantId());
         merchant.setName(boMerchant.getName());
         merchant.setStart_dt(boMerchant.getStart_dt());
 
@@ -48,12 +48,12 @@ public class Merchant {
     }
 
 
-    public String getMerchatId() {
-        return merchatId;
+    public String getMerchantId() {
+        return merchantId;
     }
 
-    public void setMerchatId(String merchatId) {
-        this.merchatId = merchatId;
+    public void setMerchantId(String merchantId) {
+        this.merchantId = merchantId;
     }
 
     public String getLogoImg() {
@@ -112,11 +112,11 @@ public class Merchant {
         this.status_cd = status_cd;
     }
 
-    public String getCreate_dt() {
+    public Date getCreate_dt() {
         return create_dt;
     }
 
-    public void setCreate_dt(String create_dt) {
+    public void setCreate_dt(Date create_dt) {
         this.create_dt = create_dt;
     }
 

+ 29 - 1
bean/src/main/java/com/java110/entity/product/BoProduct.java

@@ -1,11 +1,12 @@
 package com.java110.entity.product;
 
+
 import java.util.List;
 
 /**
  * Created by wuxw on 2017/5/20.
  */
-public class BoProduct extends Product {
+public class BoProduct extends Product implements Comparable{
 
     private String boId;
 
@@ -36,4 +37,31 @@ public class BoProduct extends Product {
     public void setBoProductAttrs(List<BoProductAttr> boProductAttrs) {
         this.boProductAttrs = boProductAttrs;
     }
+
+
+    /**
+     * 转为实例数据
+     * @return
+     */
+    public Product convert(){
+
+        Product product = new BoProduct();
+        return product;
+    }
+
+
+    /**
+     * 排序
+     * @param o
+     * @return
+     */
+    @Override
+    public int compareTo(Object o) {
+
+        BoProduct otherBoProduct = (BoProduct)o;
+        if("DEL".equals(this.getState()) && "ADD".equals(otherBoProduct.getState())) {
+            return -1;
+        }
+        return 0;
+    }
 }

+ 22 - 1
bean/src/main/java/com/java110/entity/product/BoProductAttr.java

@@ -1,12 +1,15 @@
 package com.java110.entity.product;
 
+import com.java110.entity.product.BoProductAttr;
+import com.java110.entity.product.ProductAttr;
+
 /**
  *
  * 产品属性 (过程表)
  *
  * Created by wuxw on 2017/5/20.
  */
-public class BoProductAttr extends ProductAttr {
+public class BoProductAttr extends ProductAttr implements Comparable{
 
     private String boId;
 
@@ -27,4 +30,22 @@ public class BoProductAttr extends ProductAttr {
     public void setState(String state) {
         this.state = state;
     }
+
+    /**
+     * 将过程数据转为实例数据
+     * @return
+     */
+    public ProductAttr convert(){
+        ProductAttr productAttr = new BoProductAttr();
+        return productAttr;
+    }
+
+    @Override
+    public int compareTo(Object o) {
+        BoProductAttr otherBoProduct = (BoProductAttr)o;
+        if("DEL".equals(this.getState()) && "ADD".equals(otherBoProduct.getState())) {
+            return -1;
+        }
+        return 0;
+    }
 }

+ 8 - 0
bean/src/main/java/com/java110/entity/product/ProductAttr.java

@@ -8,4 +8,12 @@ import com.java110.entity.DefaultEntity;
  */
 public class ProductAttr extends DefaultAttrEntity {
     private String productId;
+
+    public String getProductId() {
+        return productId;
+    }
+
+    public void setProductId(String productId) {
+        this.productId = productId;
+    }
 }

+ 13 - 15
config/src/main/resources/mapper/merchant/MerchantServiceDaoImplMapper.xml

@@ -6,16 +6,14 @@
 
     <resultMap type="com.java110.entity.merchant.Merchant" id="merchantMap">
         <id column="merchantId" jdbcType="VARCHAR" property="merchantId"/>
+        <result column="logoImg" jdbcType="VARCHAR" property="logoImg"/>
         <result column="name" jdbcType="VARCHAR" property="name"/>
-        <result column="email" jdbcType="VARCHAR" property="email"/>
-        <result column="cellphone" jdbcType="VARCHAR" property="cellphone"/>
-        <result column="realName" jdbcType="VARCHAR" property="realName"/>
-        <result column="sex" jdbcType="VARCHAR" property="sex"/>
-        <result column="password" jdbcType="VARCHAR" property="password"/>
-        <result column="lanId" jdbcType="VARCHAR" property="lanId"/>
-        <result column="merchantAdress" jdbcType="VARCHAR" property="merchantAdress"/>
-        <result column="merchantType" jdbcType="VARCHAR" property="merchantType"/>
-        <result column="openId" jdbcType="VARCHAR" property="openId"/>
+        <result column="address" jdbcType="VARCHAR" property="address"/>
+        <result column="type" jdbcType="VARCHAR" property="type"/>
+        <result column="start_dt" jdbcType="DATE" property="start_dt"/>
+        <result column="end_dt" jdbcType="DATE" property="end_dt"/>
+        <result column="status_cd" jdbcType="VARCHAR" property="status_cd"/>
+        <result column="create_dt" jdbcType="DATE" property="create_dt"/>
         <!-- 一对多关系 -->
         <!-- <collection property="stus" resultMap="Student.StudentResult"></collection>  -->
         <collection property="merchantAttrs" javaType="com.java110.entity.merchant.MerchantAttr">
@@ -40,8 +38,8 @@
     <!--保存数据至过程表 bo_merchant 中 -->
     <insert id="saveDataToBoMerchant" parameterType="com.java110.entity.merchant.BoMerchant">
         <![CDATA[
-            insert into bo_merchant(boId,merchantId,name,email,cellphone,realName,sex,password,lanId,merchantAdress,merchantType,openId,state)
-            values(#{boId},#{merchantId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{merchantAdress},#{merchantType},#{openId},#{state})
+            insert into bo_merchant(boId,merchantId,logoImg,name,address,type,start_dt,end_dt,state)
+            values(#{boId},#{merchantId},#{logoImg},#{name},#{address},#{type},#{start_dt},#{end_dt},#{state})
         ]]>
     </insert>
     <!-- 保存数据至过程表bo_merchant_attr 中-->
@@ -54,8 +52,8 @@
     <!-- 保存 实例客户信息 merchant -->
     <insert id="saveDataToMerchant" parameterType="com.java110.entity.merchant.Merchant">
         <![CDATA[
-            insert into merchant(merchantId,name,email,cellphone,realName,sex,password,lanId,merchantAdress,merchantType,openId,status_cd)
-            values(#{merchantId},#{name},#{email},#{cellphone},#{realName},#{sex},#{password},#{lanId},#{merchantAdress},#{merchantType},#{openId},#{status_cd})
+            insert into merchant(merchantId,logoImg,name,address,type,start_dt,end_dt,status_cd)
+            values(#{merchantId},#{logoImg},#{name},#{address},#{type},#{start_dt},#{end_dt},#{status_cd})
         ]]>
     </insert>
     <!-- 删除实例客户信息 merchant -->
@@ -85,7 +83,7 @@
     <!--根据客户ID 查询客户信息,其中包括 merchant 和merchantAttr 数据-->
     <select id="queryDataToMerchant" parameterType="com.java110.entity.merchant.Merchant" resultMap="merchantMap">
         <![CDATA[
-            select c.merchantId,c.name,c.email,c.cellphone,c.realName,c.sex,c.password,c.lanId,c.merchantAdress,c.merchantType,c.openId,
+            select c.merchantId,c.logoImg,c.name,c.address,c.type,c.start_dt,c.end_dt,c.status_cd,c.create_dt,
             ca.merchantId,ca.attrCd,ca.value
              from merchant c, merchant_attr ca where c.merchantId= ca.merchantId
             and c.merchantId = #{merchantId}
@@ -95,7 +93,7 @@
 
     <!-- 查询客户过程数据 -->
     <select id="queryBoMerchant" parameterType="com.java110.entity.merchant.BoMerchant" resultType="com.java110.entity.merchant.BoMerchant">
-        select bc.boId,bc.merchantId,bc.name,bc.email,bc.cellphone,bc.realName,bc.sex,bc.password,bc.lanId,bc.merchantAdress,bc.merchantType,bc.openId,bc.create_dt
+        select bc.boId,bc.merchantId,bc.logoImg,bc.name,bc.address,bc.type,bc.start_dt,bc.end_dt,bc.state,bc.create_dt,
         from bo_merchant bc where 1=1
         <if test="boId != null and boId != ''">
             and bc.boId = #{boId}

+ 123 - 0
config/src/main/resources/mapper/product/ProductServiceDaoImplMapper.xml

@@ -0,0 +1,123 @@
+<?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="productServiceDAOImpl">
+
+    <resultMap type="com.java110.entity.product.Product" id="productMap">
+        <id column="productId" jdbcType="VARCHAR" property="productId"/>
+        <result column="productImg" jdbcType="VARCHAR" property="productImg"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
+        <result column="productTypeCd" jdbcType="VARCHAR" property="productTypeCd"/>
+        <result column="productDesc" jdbcType="VARCHAR" property="productDesc"/>
+        <result column="start_dt" jdbcType="DATE" property="start_dt"/>
+        <result column="end_dt" jdbcType="DATE" property="end_dt"/>
+        <result column="status_cd" jdbcType="VARCHAR" property="status_cd"/>
+        <result column="create_dt" jdbcType="DATE" property="create_dt"/>
+        <!-- 一对多关系 -->
+        <!-- <collection property="stus" resultMap="Student.StudentResult"></collection>  -->
+        <collection property="productAttrs" javaType="com.java110.entity.product.ProductAttr">
+            <id property="productId" column="productId"/>
+            <result property="attrCd" column="attrCd"/>
+            <result property="value" column="value"/>
+        </collection>
+    </resultMap>
+
+    <!--根据用户Id查询用户角色
+    <select id="findRolesByUserId" resultType="SysRole">
+        SELECT
+        r.*
+        FROM
+        t_role r,
+        t_product_role ur
+        WHERE ur.uid = #{productId}
+        AND ur.roleId = r.roleId
+        AND ur.status_cd = '1'
+    </select>
+-->
+    <!--保存数据至过程表 bo_product 中 -->
+    <insert id="saveDataToBoProduct" parameterType="com.java110.entity.product.BoProduct">
+        <![CDATA[
+            insert into bo_product(boId,productId,productImg,name,productTypeCd,productDesc,start_dt,end_dt,state)
+            values(#{boId},#{productId},#{productImg},#{name},#{productTypeCd},#{productDesc},#{start_dt},#{end_dt},#{state})
+        ]]>
+    </insert>
+    <!-- 保存数据至过程表bo_product_attr 中-->
+    <insert id="saveDataToBoProductAttr" parameterType="com.java110.entity.product.BoProductAttr">
+        <![CDATA[
+            insert into bo_product_attr(boId,productId,attrCd,value,state)
+            values(#{boId},#{productId},#{attrCd},#{value},#{state})
+        ]]>
+    </insert>
+    <!-- 保存 实例客户信息 product -->
+    <insert id="saveDataToProduct" parameterType="com.java110.entity.product.Product">
+        <![CDATA[
+            insert into product(productId,productImg,name,productTypeCd,productDesc,start_dt,end_dt,status_cd)
+            values(#{productId},#{productImg},#{name},#{productTypeCd},#{productDesc},#{start_dt},#{end_dt},#{status_cd})
+        ]]>
+    </insert>
+    <!-- 删除实例客户信息 product -->
+    <insert id="deleteDataToProduct" parameterType="com.java110.entity.product.Product">
+        <![CDATA[
+           delete * from product c where c.productId = #{productId}
+        ]]>
+    </insert>
+
+    <!-- 保存 实例客户属性信息 product_attr -->
+    <insert id="saveDataToProduct" parameterType="com.java110.entity.product.ProductAttr">
+        <![CDATA[
+            insert into product_attr(productId,attrCd,value,status_cd)
+            values(#{productId},#{attrCd},#{value},#{status_cd})
+        ]]>
+    </insert>
+    <!-- 删除实例客户信息 product -->
+    <update id="deleteDataToProductAttr" parameterType="com.java110.entity.product.ProductAttr">
+           delete * from product_attr ct where 1=1
+           <if test="productId != null and productId != ''">
+               and ct.productId = #{productId}
+           </if>
+            <if test="attrCd != null and attrCd != ''">
+                and ct.attrCd = #{attrCd}
+            </if>
+    </update>
+    <!--根据客户ID 查询客户信息,其中包括 product 和productAttr 数据-->
+    <select id="queryDataToProduct" parameterType="com.java110.entity.product.Product" resultMap="productMap">
+        <![CDATA[
+            select c.productId,c.productImg,c.name,c.productTypeCd,c.productDesc,c.start_dt,c.end_dt,c.status_cd,c.create_dt,
+            ca.productId,ca.attrCd,ca.value
+             from product c, product_attr ca where c.productId= ca.productId
+            and c.productId = #{productId}
+            and c.status_cd = '0'
+        ]]>
+    </select>
+
+    <!-- 查询客户过程数据 -->
+    <select id="queryBoProduct" parameterType="com.java110.entity.product.BoProduct" resultType="com.java110.entity.product.BoProduct">
+        select bc.boId,bc.productId,bc.productImg,bc.name,bc.productTypeCd,bc.productDesc,bc.start_dt,bc.end_dt,bc.state,bc.create_dt,
+        from bo_product bc where 1=1
+        <if test="boId != null and boId != ''">
+            and bc.boId = #{boId}
+        </if>
+        <if test="productId != null and productId != ''">
+            and bc.productId = #{productId}
+        </if>
+        and bc.state in ('ADD','DEL')
+        <if test="create_dt != null and create_dt != ''">
+            order by bc.create_dt desc
+        </if>
+    </select>
+    <!-- 查询客户属性过程表-->
+    <select id="queryBoProductAttr" parameterType="com.java110.entity.product.BoProductAttr" resultType="com.java110.entity.product.BoProductAttr">
+        select bca.boId,bca.productId,bca.attrCd,bca.value,bca.state,bca.create_dt from bo_product_attr bca where 1=1
+        <if test="boId !=null and boId != ''">
+            and bca.boId = #{boId}
+        </if>
+        <if test="productId != null and productId != ''">
+            and bca.productId = #{productId}
+        </if>
+        <if test="create_dt != null and create_dt != ''">
+            order by bc.create_dt desc
+        </if>
+    </select>
+
+</mapper>

+ 172 - 0
feign/src/main/java/com/java110/feign/merchant/IMerchantService.java

@@ -0,0 +1,172 @@
+package com.java110.feign.merchant;
+
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ *
+ * 用户服务接口
+ * 用户查询,修改,删除 实现
+ * Created by wuxw on 2017/4/5.
+ */
+@FeignClient(name = "merchant-service", fallback = MerchantServiceFallback.class)
+public interface IMerchantService {
+
+    /**
+     * 通过Merchant对象中数据查询用户信息
+     * 如,用户ID,名称
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/queryMerchantInfo")
+    public String queryMerchantInfo(@RequestParam("data") String data);
+
+
+    /**
+     * 用户服务信息受理
+     * 协议:
+     * {
+     *     'boMerchant':[{}],
+     *     'boMerchantAttr':[{}]
+     * }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/soMerchantService")
+    public String soMerchantService(@RequestParam("data") String data);
+
+
+    /**
+     * 这个接口专门用于订单服务受理用,入参为 JSONArray
+     *
+     * 支持 多个 客户信息 受理
+     *
+     * 请求协议:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boMerchant": [
+     {
+     "merchantId": "-1",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "merchantAdress": "青海省西宁市城中区格兰小镇",
+     "merchantType": "1",
+     "openId": "",
+     "state": "ADD"
+     },
+     {
+     "merchantId": "123",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "merchantAdress": "青海省西宁市城中区格兰小镇",
+     "merchantType": "1",
+     "openId": "",
+     "state": "DEL"
+     }
+     ],
+     "boMerchantAttr": [
+     {
+     "merchantId": "123",
+     "prodId": "-1",
+     "attrCd": "123344",
+     "value": "1",
+     "state": "ADD"
+     },
+     {
+     "merchantId": "123",
+     "prodId": "-1",
+     "attrCd": "123345",
+     "value": "1",
+     "state": "DEL"
+     }
+     ]
+     }
+     ]
+     }
+
+     *
+     * 返回协议:
+     *
+     * {
+     'RESULT_CODE': '0000',
+     'RESULT_MSG': '成功',
+     'RESULT_INFO': {}
+     }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/soMerchantServiceForOrderService")
+    public String soMerchantServiceForOrderService(@RequestParam("data") String data);
+
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boMerchant:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/merchantService/soBoMerchant")
+    public String soBoMerchant(@RequestParam("data") String data) ;
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boMerchantAttr:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/merchantService/soBoMerchantAttr")
+    public String soBoMerchantAttr(@RequestParam("data") String data) ;
+
+
+    /**
+     * 作废订单,根据boId作废订单
+     *
+     * 接口协议:
+     *
+     * { 'data': [
+
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     }
+     ] }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/merchantService/soDeleteMerchantService")
+    public String soDeleteMerchantService(@RequestParam("data") String data);
+
+}

+ 45 - 0
feign/src/main/java/com/java110/feign/merchant/MerchantServiceFallback.java

@@ -0,0 +1,45 @@
+package com.java110.feign.merchant;
+
+import com.java110.common.util.ProtocolUtil;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * 调用用户服务失败时,返回
+ * Created by wuxw on 2017/4/5.
+ */
+public class MerchantServiceFallback implements IMerchantService {
+    /**
+     * 查询用户信息失败
+     * @param data
+     * @return
+     */
+    @Override
+    public String queryMerchantInfo(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soMerchantService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soMerchantServiceForOrderService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soBoMerchant(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soBoMerchantAttr(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soDeleteMerchantService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+}

+ 172 - 0
feign/src/main/java/com/java110/feign/product/IProductService.java

@@ -0,0 +1,172 @@
+package com.java110.feign.product;
+
+import org.springframework.cloud.netflix.feign.FeignClient;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ *
+ * 用户服务接口
+ * 用户查询,修改,删除 实现
+ * Created by wuxw on 2017/4/5.
+ */
+@FeignClient(name = "product-service", fallback = ProductServiceFallback.class)
+public interface IProductService {
+
+    /**
+     * 通过Product对象中数据查询用户信息
+     * 如,用户ID,名称
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/queryProductInfo")
+    public String queryProductInfo(@RequestParam("data") String data);
+
+
+    /**
+     * 用户服务信息受理
+     * 协议:
+     * {
+     *     'boProduct':[{}],
+     *     'boProductAttr':[{}]
+     * }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/soProductService")
+    public String soProductService(@RequestParam("data") String data);
+
+
+    /**
+     * 这个接口专门用于订单服务受理用,入参为 JSONArray
+     *
+     * 支持 多个 客户信息 受理
+     *
+     * 请求协议:
+     *
+     * {
+     "data": [
+     {
+     "actionTypeCd": "C1",
+     "boProduct": [
+     {
+     "productId": "-1",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "productAdress": "青海省西宁市城中区格兰小镇",
+     "productType": "1",
+     "openId": "",
+     "state": "ADD"
+     },
+     {
+     "productId": "123",
+     "name": "S",
+     "email": "-52",
+     "cellphone": "17797173942",
+     "realName": "wuxw",
+     "sex": "1",
+     "password": "123456",
+     "lanId": "863010",
+     "productAdress": "青海省西宁市城中区格兰小镇",
+     "productType": "1",
+     "openId": "",
+     "state": "DEL"
+     }
+     ],
+     "boProductAttr": [
+     {
+     "productId": "123",
+     "prodId": "-1",
+     "attrCd": "123344",
+     "value": "1",
+     "state": "ADD"
+     },
+     {
+     "productId": "123",
+     "prodId": "-1",
+     "attrCd": "123345",
+     "value": "1",
+     "state": "DEL"
+     }
+     ]
+     }
+     ]
+     }
+
+     *
+     * 返回协议:
+     *
+     * {
+     'RESULT_CODE': '0000',
+     'RESULT_MSG': '成功',
+     'RESULT_INFO': {}
+     }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/soProductServiceForOrderService")
+    public String soProductServiceForOrderService(@RequestParam("data") String data);
+
+
+    /**
+     * 客户信息处理
+     * 协议:
+     *{
+     *     boProduct:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/productService/soBoProduct")
+    public String soBoProduct(@RequestParam("data") String data) ;
+
+    /**
+     * 客户信息属性处理
+     * 协议:
+     *{
+     *     boProductAttr:[{},{}]
+     * }
+     * @param data
+     * @return
+     * @throws Exception
+     */
+    @RequestMapping("/productService/soBoProductAttr")
+    public String soBoProductAttr(@RequestParam("data") String data) ;
+
+
+    /**
+     * 作废订单,根据boId作废订单
+     *
+     * 接口协议:
+     *
+     * { 'data': [
+
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     },
+     {
+     'olId': '123456',
+     'boId': '222222',
+     'actionTypeCd': 'C1'
+     }
+     ] }
+     * @param data
+     * @return
+     */
+    @RequestMapping("/productService/soDeleteProductService")
+    public String soDeleteProductService(@RequestParam("data") String data);
+
+}

+ 45 - 0
feign/src/main/java/com/java110/feign/product/ProductServiceFallback.java

@@ -0,0 +1,45 @@
+package com.java110.feign.product;
+
+import com.java110.common.util.ProtocolUtil;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * 调用用户服务失败时,返回
+ * Created by wuxw on 2017/4/5.
+ */
+public class ProductServiceFallback implements IProductService {
+    /**
+     * 查询用户信息失败
+     * @param data
+     * @return
+     */
+    @Override
+    public String queryProductInfo(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soProductService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soProductServiceForOrderService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soBoProduct(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soBoProductAttr(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+
+    @Override
+    public String soDeleteProductService(@RequestParam("data") String data) {
+        return ProtocolUtil.createResultMsg(ProtocolUtil.RETURN_MSG_ERROR,"调用服务超时",null);
+    }
+}