java110 лет назад: 6
Родитель
Сommit
86636b58d0
52 измененных файлов с 0 добавлено и 5892 удалено
  1. 0 49
      ShopService/doc/deleteShopInfo.json
  2. 0 37
      ShopService/doc/savaBuyShop.json
  3. 0 33
      ShopService/doc/savaShopCatalog.json
  4. 0 70
      ShopService/doc/savaShopInfo.json
  5. 0 14
      ShopService/doc/start_shopService.sh
  6. 0 70
      ShopService/doc/updateShopInfo.json
  7. 0 9
      ShopService/docker/Dockerfile
  8. 0 14
      ShopService/docker/bin/start_shop.sh
  9. 0 25
      ShopService/docker/docker-compose.yml
  10. 0 11
      ShopService/docker/onStart.sh
  11. 0 71
      ShopService/pom.xml
  12. 0 64
      ShopService/src/main/java/com/java110/shop/ShopServiceApplicationStart.java
  13. 0 104
      ShopService/src/main/java/com/java110/shop/api/ShopApi.java
  14. 0 334
      ShopService/src/main/java/com/java110/shop/dao/IShopServiceDao.java
  15. 0 703
      ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java
  16. 0 16
      ShopService/src/main/java/com/java110/shop/kafka/ShopServiceBean.java
  17. 0 90
      ShopService/src/main/java/com/java110/shop/kafka/ShopServiceKafka.java
  18. 0 303
      ShopService/src/main/java/com/java110/shop/listener/AbstractShopBusinessServiceDataFlowListener.java
  19. 0 200
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopAttrAndAttrParamListener.java
  20. 0 148
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopCatalogListener.java
  21. 0 148
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopDescListener.java
  22. 0 148
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopInfoListener.java
  23. 0 153
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopPhotoListener.java
  24. 0 148
      ShopService/src/main/java/com/java110/shop/listener/DeleteShopPreferentialListener.java
  25. 0 94
      ShopService/src/main/java/com/java110/shop/listener/FlushAboutBuyIdListener.java
  26. 0 152
      ShopService/src/main/java/com/java110/shop/listener/FlushAboutShopIdListener.java
  27. 0 71
      ShopService/src/main/java/com/java110/shop/listener/FlushShopCatalogIdListener.java
  28. 0 109
      ShopService/src/main/java/com/java110/shop/listener/SaveBuyShopAttrListener.java
  29. 0 127
      ShopService/src/main/java/com/java110/shop/listener/SaveBuyShopListener.java
  30. 0 147
      ShopService/src/main/java/com/java110/shop/listener/SaveShopAttrAndAttrParamListener.java
  31. 0 137
      ShopService/src/main/java/com/java110/shop/listener/SaveShopCatalogListener.java
  32. 0 137
      ShopService/src/main/java/com/java110/shop/listener/SaveShopDescListener.java
  33. 0 155
      ShopService/src/main/java/com/java110/shop/listener/SaveShopInfoListener.java
  34. 0 113
      ShopService/src/main/java/com/java110/shop/listener/SaveShopPhotoListener.java
  35. 0 154
      ShopService/src/main/java/com/java110/shop/listener/SaveShopPreferentialListener.java
  36. 0 221
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopAttrAndAttrParamListener.java
  37. 0 156
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopCatalogListener.java
  38. 0 156
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopDescListener.java
  39. 0 157
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopInfoListener.java
  40. 0 164
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopPhotoListener.java
  41. 0 156
      ShopService/src/main/java/com/java110/shop/listener/UpdateShopPreferentialListener.java
  42. 0 17
      ShopService/src/main/java/com/java110/shop/smo/IShopServiceSMO.java
  43. 0 110
      ShopService/src/main/java/com/java110/shop/smo/impl/ShopServiceSMOImpl.java
  44. 0 96
      ShopService/src/main/resources/application-dev.yml
  45. 0 96
      ShopService/src/main/resources/application-prod.yml
  46. 0 97
      ShopService/src/main/resources/application-test.yml
  47. 0 3
      ShopService/src/main/resources/application.yml
  48. 0 9
      ShopService/src/main/resources/banner.txt
  49. 0 75
      ShopService/src/main/resources/dataSource.yml
  50. 0 3
      ShopService/src/main/resources/java110.properties
  51. 0 17
      ShopService/src/test/java/com/java110/AppTest.java
  52. 0 1
      pom.xml

+ 0 - 49
ShopService/doc/deleteShopInfo.json

@@ -1,49 +0,0 @@
-{
-  "orders": {
-    "appId": "外系统ID,分配得到",
-    "transactionId": "100000000020180409224736000001",
-    "userId": "用户ID",
-    "orderTypeCd": "订单类型,查询,受理",
-    "requestTime": "20180409224736",
-    "remark": "备注",
-    "sign": "这个服务是否要求MD5签名",
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  },
-  "business": [{
-    "serviceCode": "delete.shop.info",
-    "serviceName": "删除商品信息",
-    "remark": "备注",
-    "datas": {
-      "businessShop": {
-        "shopId": "123456"
-      },
-      "businessShopAttr": [{
-        "shopId": "123456",
-        "attrId":"123123"
-      }],
-      "businessShopPhoto":[{
-        "shopPhotoId":"123123",
-        "shopId":"123456"
-      }],
-      "businessShopAttrParam":[{
-        "attrParamId":"123123",
-        "shopId":"123456"
-      }],
-      "businessShopPreferential":{
-        "shopPreferentialId":"23213",
-        "shopId":"123456"
-      },
-      "businessShopDesc":{
-        "shopDescId":"343434",
-        "shopId":"123456"
-      }
-    },
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  }]
-}

+ 0 - 37
ShopService/doc/savaBuyShop.json

@@ -1,37 +0,0 @@
-{
-  "orders": {
-    "appId": "外系统ID,分配得到",
-    "transactionId": "100000000020180409224736000001",
-    "userId": "用户ID",
-    "orderTypeCd": "订单类型,查询,受理",
-    "requestTime": "20180409224736",
-    "remark": "备注",
-    "sign": "这个服务是否要求MD5签名",
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  },
-  "business": [{
-    "serviceCode": "buy.shop.info",
-    "serviceName": "购买",
-    "remark": "备注",
-    "datas": {
-      "businessBuyShop": {
-        "shopId": "123",
-        "buyId": "-1",
-        "buyCount":"10"
-      },
-      "businessBuyShopAttr": [{
-        "buyId": "-1",
-        "attrId":"-1",
-        "specCd":"1001",
-        "value":"01"
-      }]
-    },
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  }]
-}

+ 0 - 33
ShopService/doc/savaShopCatalog.json

@@ -1,33 +0,0 @@
-{
-  "orders": {
-    "appId": "外系统ID,分配得到",
-    "transactionId": "100000000020180409224736000001",
-    "userId": "用户ID",
-    "orderTypeCd": "订单类型,查询,受理",
-    "requestTime": "20180409224736",
-    "remark": "备注",
-    "sign": "这个服务是否要求MD5签名",
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  },
-  "business": [{
-    "serviceCode": "save.shop.catalog",
-    "serviceName": "保存商品目录",
-    "remark": "备注",
-    "datas": {
-      "businessShopCatalog":{
-        "catalogId":"-1",
-        "storeId":"123",
-        "name":"盖浇饭",
-        "level":"1",
-        "parentCatalogId":"-1"
-      }
-    },
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  }]
-}

+ 0 - 70
ShopService/doc/savaShopInfo.json

@@ -1,70 +0,0 @@
-{
-  "orders": {
-    "appId": "外系统ID,分配得到",
-    "transactionId": "100000000020180409224736000001",
-    "userId": "用户ID",
-    "orderTypeCd": "订单类型,查询,受理",
-    "requestTime": "20180409224736",
-    "remark": "备注",
-    "sign": "这个服务是否要求MD5签名",
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  },
-  "business": [{
-    "serviceCode": "save.shop.info",
-    "serviceName": "保存商品信息",
-    "remark": "备注",
-    "datas": {
-      "businessShop": {
-        "shopId": "-1",
-        "storeId": "123",
-        "catalogId":"-1",
-        "name": "西红柿鸡蛋盖浇饭",
-        "hotBuy": "Y",
-        "salePrice": "12.00",
-        "openShopCount": "N",
-        "shopCount": "1",
-        "startDate": "2018-07-07 11:04:00",
-        "endDate": "2019-07-07 11:04:00"
-      },
-      "businessShopAttr": [{
-        "shopId": "-1",
-        "attrId":"-1",
-        "specCd":"1001",
-        "value":"01"
-      }],
-      "businessShopPhoto":[{
-        "shopPhotoId":"-1",
-        "shopId":"-1",
-        "shopPhotoTypeCd":"L",
-        "photo":"123.jpg"
-      }],
-      "businessShopAttrParam":[{
-        "attrParamId":"-1",
-        "shopId":"-1",
-        "specCd":"123",
-        "param":"加米"
-      }],
-      "businessShopPreferential":{
-        "shopPreferentialId":"-1",
-        "shopId":"-1",
-        "originalPrice":"12.00",
-        "discountRate":"1.00",
-        "showOriginalPrice":"N",
-        "preferentialStartDate":"2018-07-07 12:17:00",
-        "preferentialEndDate":"2018-07-08 12:17:00"
-      },
-      "businessShopDesc":{
-        "shopDescId":"-1",
-        "shopId":"-1",
-        "shopDescribe":""
-      }
-    },
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  }]
-}

+ 0 - 14
ShopService/doc/start_shopService.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-#### debug model prod
-#nohup java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar -Dspring.profiles.active=dev ShopService.jar > shop.log 2>&1 &
-
-#### normal prod model
-#nohup java -jar -Dspring.profiles.active=prod ShopService.jar > shop.log 2>&1 &
-
-#### normal test model
-#nohup java -jar -Dspring.profiles.active=test ShopService.jar > shop.log 2>&1 &
-
-#### normal dev model
-nohup java -jar -Dspring.profiles.active=dev ShopService.jar > shop.log 2>&1 &
-
-tail -100f shop.log

+ 0 - 70
ShopService/doc/updateShopInfo.json

@@ -1,70 +0,0 @@
-{
-  "orders": {
-    "appId": "外系统ID,分配得到",
-    "transactionId": "100000000020180409224736000001",
-    "userId": "用户ID",
-    "orderTypeCd": "订单类型,查询,受理",
-    "requestTime": "20180409224736",
-    "remark": "备注",
-    "sign": "这个服务是否要求MD5签名",
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  },
-  "business": [{
-    "serviceCode": "update.shop.info",
-    "serviceName": "修改商品信息",
-    "remark": "备注",
-    "datas": {
-      "businessShop": {
-        "shopId": "123456",
-        "storeId": "123",
-        "catalogId":"-1",
-        "name": "西红柿鸡蛋盖浇饭",
-        "hotBuy": "Y",
-        "salePrice": "12.00",
-        "openShopCount": "N",
-        "shopCount": "1",
-        "startDate": "2018-07-07 11:04:00",
-        "endDate": "2019-07-07 11:04:00"
-      },
-      "businessShopAttr": [{
-        "shopId": "123456",
-        "attrId":"123123",
-        "specCd":"1001",
-        "value":"01"
-      }],
-      "businessShopPhoto":[{
-        "shopPhotoId":"123123",
-        "shopId":"123456",
-        "shopPhotoTypeCd":"L",
-        "photo":"123.jpg"
-      }],
-      "businessShopAttrParam":[{
-        "attrParamId":"123123",
-        "shopId":"123456",
-        "specCd":"123",
-        "param":"加米"
-      }],
-      "businessShopPreferential":{
-        "shopPreferentialId":"23213",
-        "shopId":"123456",
-        "originalPrice":"12.00",
-        "discountRate":"1.00",
-        "showOriginalPrice":"N",
-        "preferentialStartDate":"2018-07-07 12:17:00",
-        "preferentialEndDate":"2018-07-08 12:17:00"
-      },
-      "businessShopDesc":{
-        "shopDescId":"343434",
-        "shopId":"123456",
-        "shopDescribe":""
-      }
-    },
-    "attrs": [{
-      "specCd": "配置的字段ID",
-      "value": "具体值"
-    }]
-  }]
-}

+ 0 - 9
ShopService/docker/Dockerfile

@@ -1,9 +0,0 @@
-FROM registry.cn-beijing.aliyuncs.com/sxd/ubuntu-java8:1.0
-MAINTAINER wuxw <928255095@qq.com>
-
-ADD bin/start_shop.sh /root/
-
-
-RUN chmod u+x /root/start_shop.sh
-
-CMD ["/root/start_shop.sh","dev"]

+ 0 - 14
ShopService/docker/bin/start_shop.sh

@@ -1,14 +0,0 @@
-#!/bin/bash
-#### debug model prod
-#nohup java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=n -jar -Dspring.profiles.active=dev target/ShopService.jar > shop.log 2>&1 &
-
-#### normal prod model
-#nohup java -jar -Dspring.profiles.active=prod target/ShopService.jar > shop.log 2>&1 &
-
-#### normal test model
-#nohup java -jar -Dspring.profiles.active=test target/ShopService.jar > shop.log 2>&1 &
-
-#### normal dev model
-nohup java -jar -Dspring.profiles.active=$1 target/ShopService.jar > shop.log 2>&1 &
-
-tail -100f shop.log

+ 0 - 25
ShopService/docker/docker-compose.yml

@@ -1,25 +0,0 @@
-version: '2'
-services:
-   shopserivce:
-       container_name: shopserivce-1
-       build:
-          context: .
-          dockerfile: Dockerfile
-       restart: always
-       ports:
-       - "8007:8007"
-       volumes:
-       - ../target/ShopService.jar:/root/target/ShopService.jar
-       networks:
-       - java110-net
-#       mem_limit: 1024m
-#       extra_hosts:
-#       - "dev.java110.com:192.168.1.18"
-#       - "dev.db.java110.com:192.168.1.18"
-#       - "dev.zk.java110.com:192.168.1.18"
-#       - "dev.kafka.java110.com:192.168.1.18"
-#       - "dev.redis.java110.com:192.168.1.18"
-#       - "api.java110.com:92.168.1.18"
-networks:
-  java110-net:
-    external: true

+ 0 - 11
ShopService/docker/onStart.sh

@@ -1,11 +0,0 @@
-#!/bin/bash
-
-cp -r ../bin .
-
-cp  -r ../target .
-
-docker build -t java110/shop .
-
-docker run -ti --name shop_test -p8007:8007 -idt java110/shop:latest
-
-docker logs -f shop_test

+ 0 - 71
ShopService/pom.xml

@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>MicroCommunity</artifactId>
-        <groupId>com.java110</groupId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>ShopService</artifactId>
-    <packaging>jar</packaging>
-    <name>ShopService</name>
-    <!-- FIXME change it to the project's website -->
-    <url>http://www.example.com</url>
-
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.java110</groupId>
-            <artifactId>java110-service</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.java110</groupId>
-            <artifactId>java110-event</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <finalName>ShopService</finalName>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-dependency-plugin</artifactId>
-                    <version>2.10</version>
-                    <executions>
-                        <execution>
-                            <id>unpack</id>
-                            <phase>generate-resources</phase>
-                            <goals>
-                                <goal>unpack</goal>
-                            </goals>
-                            <configuration>
-                                <artifactItems>
-                                    <artifactItem>
-                                        <groupId>com.java110</groupId>
-                                        <artifactId>java110-config</artifactId>
-                                        <version>${microcommunity.version}</version>
-                                        <type>jar</type>
-                                        <overWrite>true</overWrite>
-                                        <outputDirectory>${project.build.directory}/classes</outputDirectory>
-                                    </artifactItem>
-                                </artifactItems>
-                            </configuration>
-                        </execution>
-                    </executions>
-                </plugin>
-                <plugin>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-maven-plugin</artifactId>
-                    <configuration>
-                        <mainClass>com.java110.shop.ShopServiceApplicationStart</mainClass>
-                    </configuration>
-                </plugin>
-            </plugins>
-    </build>
-</project>

+ 0 - 64
ShopService/src/main/java/com/java110/shop/ShopServiceApplicationStart.java

@@ -1,64 +0,0 @@
-package com.java110.shop;
-
-import com.java110.core.annotation.Java110ListenerDiscovery;
-import com.java110.event.service.BusinessServiceDataFlowEventPublishing;
-import com.java110.service.init.ServiceStartInit;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.web.client.RestTemplateBuilder;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.client.loadbalancer.LoadBalanced;
-import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.converter.StringHttpMessageConverter;
-import org.springframework.web.client.RestTemplate;
-
-import java.nio.charset.Charset;
-
-
-/**
- * spring boot 初始化启动类
- *
- * @version v0.1
- * @auther com.java110.wuxw
- * @mail 928255095@qq.com
- * @date 2016年8月6日
- * @tag
- */
-@SpringBootApplication(scanBasePackages = {"com.java110.service", "com.java110.shop", "com.java110.config.properties.code","com.java110.core", "com.java110.cache", "com.java110.db"})
-@EnableDiscoveryClient
-@Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class,
-        basePackages = {"com.java110.shop.listener"})
-@EnableFeignClients(basePackages = {"com.java110.core.smo"})
-public class ShopServiceApplicationStart {
-
-    private final static Logger logger = LoggerFactory.getLogger(ShopServiceApplicationStart.class);
-    private final static String LISTENER_PATH = "java110.ShopService.listeners";
-
-    /**
-     * 实例化RestTemplate,通过@LoadBalanced注解开启均衡负载能力.
-     *
-     * @return restTemplate
-     */
-    @Bean
-    @LoadBalanced
-    public RestTemplate restTemplate() {
-        StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8"));
-        RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build();
-        return restTemplate;
-    }
-
-    public static void main(String[] args) throws Exception {
-        try{
-            ApplicationContext context = SpringApplication.run(ShopServiceApplicationStart.class, args);
-            ServiceStartInit.initSystemConfig(context);
-            //加载业务侦听
-            //SystemStartLoadBusinessConfigure.initSystemConfig(LISTENER_PATH);
-        }catch (Throwable e){
-            logger.error("系统启动失败",e);
-        }
-    }
-}

+ 0 - 104
ShopService/src/main/java/com/java110/shop/api/ShopApi.java

@@ -1,104 +0,0 @@
-package com.java110.shop.api;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.exception.InitConfigDataException;
-import com.java110.utils.exception.InitDataFlowContextException;
-import com.java110.core.base.controller.BaseController;
-import com.java110.core.context.BusinessServiceDataFlow;
-import com.java110.core.factory.DataTransactionFactory;
-import com.java110.shop.smo.IShopServiceSMO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 用户服务类
- * Created by wuxw on 2018/5/14.
- */
-@RestController
-public class ShopApi extends BaseController {
-    private final static Logger logger = LoggerFactory.getLogger(ShopApi.class);
-
-    @Autowired
-    IShopServiceSMO shopServiceSMOImpl;
-
-    @RequestMapping(path = "/shopApi/service",method= RequestMethod.GET)
-    public String serviceGet(HttpServletRequest request) {
-        return DataTransactionFactory.createBusinessResponseJson(ResponseConstant.RESULT_CODE_ERROR,"不支持Get方法请求").toJSONString();
-    }
-
-    /**
-     * 用户服务统一处理接口
-     * @param orderInfo
-     * @param request
-     * @return
-     */
-    @RequestMapping(path = "/shopApi/service",method= RequestMethod.POST)
-    public String servicePost(@RequestBody String orderInfo, HttpServletRequest request) {
-        BusinessServiceDataFlow businessServiceDataFlow = null;
-        JSONObject responseJson = null;
-        try {
-            Map<String, String> headers = new HashMap<String, String>();
-            getRequestInfo(request, headers);
-            //预校验
-            preValiateOrderInfo(orderInfo);
-            businessServiceDataFlow = this.writeDataToDataFlowContext(orderInfo, headers);
-            responseJson = shopServiceSMOImpl.service(businessServiceDataFlow);
-        }catch (InitDataFlowContextException e){
-            logger.error("请求报文错误,初始化 BusinessServiceDataFlow失败"+orderInfo,e);
-            responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
-        }catch (InitConfigDataException e){
-            logger.error("请求报文错误,加载配置信息失败"+orderInfo,e);
-            responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
-        }catch (Exception e){
-            logger.error("请求订单异常",e);
-            responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e,
-                    null);
-        }finally {
-            return responseJson.toJSONString();
-        }
-    }
-
-    /**
-     * 这里预校验,请求报文中不能有 dataFlowId
-     * @param orderInfo
-     */
-    private void preValiateOrderInfo(String orderInfo) {
-       /* if(JSONObject.parseObject(orderInfo).getJSONObject("orders").containsKey("dataFlowId")){
-            throw new BusinessException(ResponseConstant.RESULT_CODE_ERROR,"报文中不能存在dataFlowId节点");
-        }*/
-    }
-
-    /**
-     * 获取请求信息
-     * @param request
-     * @param headers
-     * @throws RuntimeException
-     */
-    private void getRequestInfo(HttpServletRequest request,Map headers) throws Exception{
-        try{
-            super.initHeadParam(request,headers);
-            super.initUrlParam(request,headers);
-        }catch (Exception e){
-            logger.error("加载头信息失败",e);
-            throw new InitConfigDataException(ResponseConstant.RESULT_PARAM_ERROR,"加载头信息失败");
-        }
-    }
-
-    public IShopServiceSMO getShopServiceSMOImpl() {
-        return shopServiceSMOImpl;
-    }
-
-    public void setShopServiceSMOImpl(IShopServiceSMO shopServiceSMOImpl) {
-        this.shopServiceSMOImpl = shopServiceSMOImpl;
-    }
-}

+ 0 - 334
ShopService/src/main/java/com/java110/shop/dao/IShopServiceDao.java

@@ -1,334 +0,0 @@
-package com.java110.shop.dao;
-
-
-import com.java110.utils.exception.DAOException;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 商品组件内部之间使用,没有给外围系统提供服务能力
- * 商品服务接口类,要求全部以字符串传输,方便微服务化
- * 新建客户,修改客户,删除客户,查询客户等功能
- *
- * Created by wuxw on 2016/12/27.
- */
-public interface IShopServiceDao {
-
-    /**
-     * 保存 商品信息
-     * @param businessShopInfo 商品信息 封装
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessShopInfo(Map businessShopInfo) throws DAOException;
-
-    /**
-     * 保存商品属性
-     * @param businessShopAttr 商品属性信息封装
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessShopAttr(Map businessShopAttr) throws DAOException;
-
-    /**
-     * 保存 商品属性参数
-     * @param businessShopAttrParam 商品属性参数信息封装
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessShopAttrParam(Map businessShopAttrParam) throws DAOException;
-
-
-    /**
-     * 保存商品照片信息
-     * @param businessShopPhoto 商品照片
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessShopPhoto(Map businessShopPhoto) throws DAOException;
-
-    /**
-     * 保存商品证件信息
-     * @param businessShopPreferential 商品证件
-     * @throws DAOException 操作数据库异常
-     */
-    public void saveBusinessShopPreferential(Map businessShopPreferential) throws DAOException;
-
-    /**
-     * 保存商品 描述 信息
-     * @param businessShopDesc 商品 描述信息
-     * @throws DAOException
-     */
-    public void saveBusinessShopDesc(Map businessShopDesc) throws DAOException;
-
-    /**
-     * 保存商品目录信息 add by wuxw 2018-09-08
-     * @param businessShopCatalog 商品目录
-     * @throws DAOException
-     */
-    public void saveBusinessShopCatalog(Map businessShopCatalog) throws DAOException;
-
-
-    /**
-     * 查询商品信息(business过程)
-     * 根据bId 查询商品信息
-     * @param info bId 信息
-     * @return 商品信息
-     * @throws DAOException
-     */
-    public Map getBusinessShopInfo(Map info) throws DAOException;
-
-
-    /**
-     * 查询商品属性信息(business过程)
-     * @param info bId 信息
-     * @return 商品属性
-     * @throws DAOException
-     */
-    public List<Map> getBusinessShopAttrs(Map info) throws DAOException;
-
-    /**
-     * 查询商品属性参数信息(business过程)
-     * @param info bId 信息
-     * @return 商品属性参数
-     * @throws DAOException
-     */
-    public List<Map> getBusinessShopAttrParams(Map info) throws DAOException;
-
-
-    /**
-     * 查询商品照片
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public List<Map> getBusinessShopPhoto(Map info) throws DAOException;
-
-
-    /**
-     * 查询商品优惠信息
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public Map getBusinessShopPreferential(Map info) throws DAOException;
-
-    /**
-     * 查询商品描述信息
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public Map getBusinessShopDesc(Map info) throws DAOException;
-
-    /**
-     * 查询商品目录信息
-     * @param info bId 信息
-     * @return 商品目录
-     * @throws DAOException
-     */
-    public Map getBusinessShopCatalog(Map info) throws DAOException;
-
-    /**
-     * 保存 商品信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopInfoInstance(Map info) throws DAOException;
-
-
-    /**
-     * 保存 商品属性信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopAttrsInstance(Map info) throws DAOException;
-
-    /**
-     * 保存 商户属性参数 business 数据到 Instance 中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopAttrParamsInstance(Map info) throws DAOException;
-
-    /**
-     * 保存 商品照片信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopPhotoInstance(Map info) throws DAOException;
-
-
-    /**
-     * 保存 商品证件信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopPreferentialInstance(Map info) throws DAOException;
-
-    /**
-     * 保存 商品描述信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopDescInstance(Map info) throws DAOException;
-
-    /**
-     * 保存 商品目录信息 Business数据到 Instance中
-     * @param info
-     * @throws DAOException
-     */
-    public void saveShopCatalogInstance(Map info) throws DAOException;
-
-    /**
-     * 保存购买记录
-     * @param businessBuyShop
-     * @throws DAOException
-     */
-    public void saveBuyShopInstance(Map businessBuyShop) throws DAOException;
-
-    /**
-     * 保存商品购买记录属性
-     * @param businessBuyShopAttr
-     * @throws DAOException
-     */
-    public void saveBuyShopAttrInstance(Map businessBuyShopAttr) throws DAOException;
-
-    /**
-     * 查询商品信息(instance过程)
-     * 根据bId 查询商品信息
-     * @param info bId 信息
-     * @return 商品信息
-     * @throws DAOException
-     */
-    public Map getShopInfo(Map info) throws DAOException;
-
-
-    /**
-     * 查询商品属性信息(instance过程)
-     * @param info bId 信息
-     * @return 商品属性
-     * @throws DAOException
-     */
-    public List<Map> getShopAttrs(Map info) throws DAOException;
-
-    /**
-     * 查询商品属性参数信息 (instance过程)
-     * @param info bId 信息
-     * @return 商品属性参数
-     * @throws DAOException
-     */
-    public List<Map> getShopAttrParams(Map info) throws DAOException;
-
-
-    /**
-     * 查询商品照片(instance 过程)
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public List<Map> getShopPhoto(Map info) throws DAOException;
-
-    /**
-     * 查询商品优惠信息(instance 过程)
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public Map getShopPreferential(Map info) throws DAOException;
-
-    /**
-     * 查询商品描述信息(instance 过程)
-     * @param info bId 信息
-     * @return 商品照片
-     * @throws DAOException
-     */
-    public Map getShopDesc(Map info) throws DAOException;
-
-    /**
-     * 查询商品目录信息(instance 过程)
-     * @param info bId 信息
-     * @return 商品目录
-     * @throws DAOException
-     */
-    public Map getShopCatalog(Map info) throws DAOException;
-
-    /**
-     * 商品购买查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    public Map getBuyShop(Map info) throws DAOException;
-
-    /**
-     * 商品属性查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    public List<Map> getBuyShopAttrs(Map info) throws DAOException;
-
-    /**
-     * 修改商品信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopInfoInstance(Map info) throws DAOException;
-
-
-    /**
-     * 修改商品属性信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopAttrInstance(Map info) throws DAOException;
-
-    /**
-     * 修改商品属性参数信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopAttrParamInstance(Map info) throws DAOException;
-
-
-    /**
-     * 修改商品照片信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopPhotoInstance(Map info) throws DAOException;
-
-    /**
-     * 修改商品优惠信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopPreferentialInstance(Map info) throws DAOException;
-
-    /**
-     * 修改商品描述信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopDescInstance(Map info) throws DAOException;
-
-    /**
-     * 修改商品目录信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateShopCatalogInstance(Map info) throws DAOException;
-
-
-    /**
-     * 修改商品购买信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateBuyShopInstance(Map info) throws DAOException;
-
-    /**
-     * 修改商品购买属性信息(instance)
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    public void updateBuyShopAttrInstance(Map info) throws DAOException;
-}

+ 0 - 703
ShopService/src/main/java/com/java110/shop/dao/impl/ShopServiceDaoImpl.java

@@ -1,703 +0,0 @@
-package com.java110.shop.dao.impl;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.exception.DAOException;
-import com.java110.utils.util.DateUtil;
-import com.java110.core.base.dao.BaseServiceDao;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * 商品服务 与数据库交互
- * Created by wuxw on 2017/4/5.
- */
-@Service("shopServiceDaoImpl")
-//@Transactional
-public class ShopServiceDaoImpl extends BaseServiceDao implements IShopServiceDao {
-
-    private final static Logger logger = LoggerFactory.getLogger(ShopServiceDaoImpl.class);
-
-    /**
-     * 商品信息封装
-     * @param businessShopInfo 商品信息 封装
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopInfo(Map businessShopInfo) throws DAOException {
-        businessShopInfo.put("month", DateUtil.getCurrentMonth());
-        // 查询business_user 数据是否已经存在
-        logger.debug("保存商品信息 入参 businessShopInfo : {}",businessShopInfo);
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopInfo",businessShopInfo);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品数据失败:"+ JSONObject.toJSONString(businessShopInfo));
-        }
-    }
-
-    /**
-     * 商品属性信息分装
-     * @param businessShopAttr 商品属性信息封装
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopAttr(Map businessShopAttr) throws DAOException {
-        businessShopAttr.put("month", DateUtil.getCurrentMonth());
-        // 查询business_user 数据是否已经存在
-        logger.debug("保存商品属性信息 入参 businessShopAttr : {}",businessShopAttr);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopAttr",businessShopAttr);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品属性数据失败:"+ JSONObject.toJSONString(businessShopAttr));
-        }
-    }
-
-    /**
-     * 商品属性参数保存
-     * @param businessShopAttrParam 商品属性参数信息封装
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopAttrParam(Map businessShopAttrParam) throws DAOException {
-        businessShopAttrParam.put("month", DateUtil.getCurrentMonth());
-        // 查询business_user 数据是否已经存在
-        logger.debug("保存商品属性参数信息 入参 businessShopAttr : {}",businessShopAttrParam);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopAttrParam",businessShopAttrParam);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品属性参数数据失败:"+ JSONObject.toJSONString(businessShopAttrParam));
-        }
-    }
-
-    /**
-     * 保存商品照片信息
-     * @param businessShopPhoto 商品照片
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopPhoto(Map businessShopPhoto) throws DAOException {
-        businessShopPhoto.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品照片信息 入参 businessShopPhoto : {}",businessShopPhoto);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopPhoto",businessShopPhoto);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品照片数据失败:"+ JSONObject.toJSONString(businessShopPhoto));
-        }
-    }
-
-    /**
-     * 保存商品证件信息
-     * @param businessShopPreferential 商品证件
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopPreferential(Map businessShopPreferential) throws DAOException {
-        businessShopPreferential.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品优惠信息 入参 businessShopPreferential : {}",businessShopPreferential);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopPreferential",businessShopPreferential);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品证件数据失败:"+ JSONObject.toJSONString(businessShopPreferential));
-        }
-    }
-
-    /**
-     * 保存 商品描述信息
-     * @param businessShopDesc 商品 描述信息
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopDesc(Map businessShopDesc) throws DAOException {
-        businessShopDesc.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品描述信息 入参 businessShopDesc : {}",businessShopDesc);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopDesc",businessShopDesc);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品描述数据失败:"+ JSONObject.toJSONString(businessShopDesc));
-        }
-    }
-
-    /**
-     * 保存商品目录
-     * @param businessShopCatalog 商品目录
-     * @throws DAOException
-     */
-    @Override
-    public void saveBusinessShopCatalog(Map businessShopCatalog) throws DAOException {
-        businessShopCatalog.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品目录信息 入参 businessShopCatalog : {}",businessShopCatalog);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBusinessShopCatalog",businessShopCatalog);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品目录数据失败:"+ JSONObject.toJSONString(businessShopCatalog));
-        }
-    }
-
-    /**
-     * 查询商品信息
-     * @param info bId 信息
-     * @return 商品信息
-     * @throws DAOException
-     */
-    @Override
-    public Map getBusinessShopInfo(Map info) throws DAOException {
-
-        logger.debug("查询商品信息 入参 info : {}",info);
-
-        List<Map> businessShopInfos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopInfo",info);
-        if(businessShopInfos == null){
-            return null;
-        }
-        if(businessShopInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:businessShopInfos,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessShopInfos.get(0);
-    }
-
-    /**
-     * 查询商品属性
-     * @param info bId 信息
-     * @return 商品属性
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getBusinessShopAttrs(Map info) throws DAOException {
-        logger.debug("查询商品属性信息 入参 info : {}",info);
-
-        List<Map> businessShopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopAttrs",info);
-
-        return businessShopAttrs;
-    }
-
-    /**
-     * 查询商品属性参数信息
-     * @param info bId 信息
-     * @return 商品属性参数信息
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getBusinessShopAttrParams(Map info) throws DAOException {
-        logger.debug("查询商品属性参数信息 入参 info : {}",info);
-
-        List<Map> businessShopAttrParams = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopAttrParams",info);
-
-        return businessShopAttrParams;
-    }
-
-    /**
-     * 查询商品照片
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getBusinessShopPhoto(Map info) throws DAOException {
-        logger.debug("查询商品照片信息 入参 info : {}",info);
-
-        List<Map> businessShopPhotos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopPhoto",info);
-
-        return businessShopPhotos;
-    }
-
-    /**
-     * 查询商品优惠
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getBusinessShopPreferential(Map info) throws DAOException {
-        logger.debug("查询商品证件信息 入参 info : {}",info);
-
-        List<Map> businessShopPreferentiales = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopPreferential",info);
-        if(businessShopPreferentiales == null){
-            return null;
-        }
-        if(businessShopPreferentiales.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:businessShopPreferentiales,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessShopPreferentiales.get(0);
-    }
-
-    /**
-     * 查询商品描述
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getBusinessShopDesc(Map info) throws DAOException {
-        logger.debug("查询商品证件信息 入参 info : {}",info);
-
-        List<Map> businessShopDesces = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopDesc",info);
-        if(businessShopDesces == null){
-            return null;
-        }
-        if(businessShopDesces.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:businessShopDesces,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessShopDesces.get(0);
-    }
-
-    /**
-     * 查询商品目录
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getBusinessShopCatalog(Map info) throws DAOException {
-        logger.debug("查询商品证件信息 入参 info : {}",info);
-
-        List<Map> businessShopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBusinessShopCatalog",info);
-        if(businessShopCatalogs == null){
-            return null;
-        }
-        if(businessShopCatalogs.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:businessShopCatalogs,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessShopCatalogs.get(0);
-    }
-
-    /**
-     * 保存商品信息 到 instance
-     * @param info   bId 信息
-     * @throws DAOException
-     */
-    @Override
-    public void saveShopInfoInstance(Map info) throws DAOException {
-        logger.debug("保存商品信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopInfoInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    @Override
-    public void saveShopAttrsInstance(Map info) throws DAOException {
-        logger.debug("保存商品属性信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopAttrsInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品属性信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 保存 商品属性 参数 至 business
-     * @param info b_id
-     * @throws DAOException
-     */
-    @Override
-    public void saveShopAttrParamsInstance(Map info) throws DAOException {
-        logger.debug("保存商品属性参数信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopAttrParamsInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品属性参数信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    @Override
-    public void saveShopPhotoInstance(Map info) throws DAOException {
-        logger.debug("保存商品照片信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopPhotoInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品照片信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    @Override
-    public void saveShopPreferentialInstance(Map info) throws DAOException {
-        logger.debug("保存商品证件信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopPreferentialInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品证件信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    @Override
-    public void saveShopDescInstance(Map info) throws DAOException {
-        logger.debug("保存商品描述信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopDescInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品证件信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    @Override
-    public void saveShopCatalogInstance(Map info) throws DAOException {
-        logger.debug("保存商品目录信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveShopCatalogInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品目录信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-
-    /**
-     * 保存购买记录
-     * @param businessBuyShop
-     * @throws DAOException
-     */
-    @Override
-    public void saveBuyShopInstance(Map businessBuyShop) throws DAOException {
-        businessBuyShop.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品购买记录信息 入参 businessBuyShop : {}",businessBuyShop);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopInstance",businessBuyShop);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品购买记录数据失败:"+ JSONObject.toJSONString(businessBuyShop));
-        }
-    }
-
-    /**
-     * 购买商品属性保存
-     * @param businessBuyShopAttr
-     * @throws DAOException
-     */
-    @Override
-    public void saveBuyShopAttrInstance(Map businessBuyShopAttr) throws DAOException {
-        businessBuyShopAttr.put("month", DateUtil.getCurrentMonth());
-        logger.debug("保存商品购买记录属性信息 入参 businessBuyShopAttr : {}",businessBuyShopAttr);
-
-        int saveFlag = sqlSessionTemplate.insert("shopServiceDaoImpl.saveBuyShopAttrInstance",businessBuyShopAttr);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存商品购买记录属性数据失败:"+ JSONObject.toJSONString(businessBuyShopAttr));
-        }
-    }
-
-    /**
-     * 查询商品信息(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getShopInfo(Map info) throws DAOException {
-        logger.debug("查询商品信息 入参 info : {}",info);
-
-        List<Map> businessShopInfos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopInfo",info);
-        if(businessShopInfos == null || businessShopInfos.size() == 0){
-            return null;
-        }
-        if(businessShopInfos.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getShopInfo,"+ JSONObject.toJSONString(info));
-        }
-
-        return businessShopInfos.get(0);
-    }
-
-    /**
-     * 商品属性查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getShopAttrs(Map info) throws DAOException {
-        logger.debug("查询商品属性信息 入参 info : {}",info);
-
-        List<Map> shopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopAttrs",info);
-
-        return shopAttrs;
-    }
-
-    /**
-     * 商品属性参数查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getShopAttrParams(Map info) throws DAOException {
-        logger.debug("查询商品属性参数信息 入参 info : {}",info);
-
-        List<Map> shopAttrParams = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopAttrParams",info);
-
-        return shopAttrParams;
-    }
-
-    /**
-     * 商品照片查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getShopPhoto(Map info) throws DAOException {
-        logger.debug("查询商品照片信息 入参 info : {}",info);
-
-        List<Map> shopPhotos = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopPhoto",info);
-
-        return shopPhotos;
-    }
-
-    /**
-     * 商品优惠查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getShopPreferential(Map info) throws DAOException {
-        logger.debug("查询商品证件信息 入参 info : {}",info);
-
-        List<Map> shopPreferentiales = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopPreferential",info);
-        if(shopPreferentiales == null || shopPreferentiales.size() == 0){
-            return null;
-        }
-        if(shopPreferentiales.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getShopInfo,"+ JSONObject.toJSONString(info));
-        }
-        return shopPreferentiales.get(0);
-    }
-
-    /**
-     * 商品描述查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getShopDesc(Map info) throws DAOException {
-        logger.debug("查询商品证件信息 入参 info : {}",info);
-
-        List<Map> shopDesces = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopDesc",info);
-        if(shopDesces == null || shopDesces.size() == 0){
-            return null;
-        }
-        if(shopDesces.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getShopInfo,"+ JSONObject.toJSONString(info));
-        }
-        return shopDesces.get(0);
-    }
-
-    /**
-     * 商品目录查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getShopCatalog(Map info) throws DAOException {
-        logger.debug("查询商品目录信息 入参 info : {}",info);
-
-        List<Map> shopCatalogs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getShopCatalog",info);
-        if(shopCatalogs == null || shopCatalogs.size() == 0){
-            return null;
-        }
-        if(shopCatalogs.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getShopCatalog,"+ JSONObject.toJSONString(info));
-        }
-        return shopCatalogs.get(0);
-    }
-
-    /**
-     * 商品描述查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public Map getBuyShop(Map info) throws DAOException {
-        logger.debug("查询商品购买信息 入参 info : {}",info);
-
-        List<Map> getBuyShops = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShop",info);
-        if(getBuyShops == null || getBuyShops.size() == 0){
-            return null;
-        }
-        if(getBuyShops.size() >1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"根据条件查询有多条数据,数据异常,请检查:getShopCatalog,"+ JSONObject.toJSONString(info));
-        }
-        return getBuyShops.get(0);
-    }
-
-    /**
-     * 商品属性查询(instance)
-     * @param info bId 信息
-     * @return
-     * @throws DAOException
-     */
-    @Override
-    public List<Map> getBuyShopAttrs(Map info) throws DAOException {
-        logger.debug("查询商品购买属性信息 入参 info : {}",info);
-
-        List<Map> buyShopAttrs = sqlSessionTemplate.selectList("shopServiceDaoImpl.getBuyShopAttrs",info);
-
-        return buyShopAttrs;
-    }
-
-    /**
-     * 修改商品信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopInfoInstance(Map info) throws DAOException {
-        logger.debug("修改商品信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopInfoInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品属性信息(instance)
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopAttrInstance(Map info) throws DAOException {
-        logger.debug("修改商品属性信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopAttrInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品属性信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品属性参数(instance)
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopAttrParamInstance(Map info) throws DAOException {
-        logger.debug("修改商品属性参数信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopAttrParamInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品属性参数信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改 商品照片信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopPhotoInstance(Map info) throws DAOException {
-        logger.debug("修改商品照片信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopPhotoInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品照片信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品证件信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopPreferentialInstance(Map info) throws DAOException {
-        logger.debug("修改商品证件信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopPreferentialInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品证件信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品描述信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopDescInstance(Map info) throws DAOException {
-        logger.debug("修改商品描述信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopDescInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品描述信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品描述信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateShopCatalogInstance(Map info) throws DAOException {
-        logger.debug("修改商品目录信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateShopCatalogInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品目录信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品购买信息
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateBuyShopInstance(Map info) throws DAOException {
-        logger.debug("修改商品购买信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品购买信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-
-    /**
-     * 修改商品购买属性信息(instance)
-     * @param info 修改信息
-     * @throws DAOException
-     */
-    @Override
-    public void updateBuyShopAttrInstance(Map info) throws DAOException {
-        logger.debug("修改商品购买属性信息Instance 入参 info : {}",info);
-
-        int saveFlag = sqlSessionTemplate.update("shopServiceDaoImpl.updateBuyShopAttrInstance",info);
-
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改商品购买属性信息Instance数据失败:"+ JSONObject.toJSONString(info));
-        }
-    }
-}

+ 0 - 16
ShopService/src/main/java/com/java110/shop/kafka/ShopServiceBean.java

@@ -1,16 +0,0 @@
-package com.java110.shop.kafka;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * Created by wuxw on 2018/4/15.
- */
-@Configuration
-public class ShopServiceBean {
-    @Bean
-    public ShopServiceKafka listener() {
-        return new ShopServiceKafka();
-    }
-
-}

+ 0 - 90
ShopService/src/main/java/com/java110/shop/kafka/ShopServiceKafka.java

@@ -1,90 +0,0 @@
-package com.java110.shop.kafka;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.KafkaConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.InitConfigDataException;
-import com.java110.utils.exception.InitDataFlowContextException;
-import com.java110.utils.kafka.KafkaFactory;
-import com.java110.core.base.controller.BaseController;
-import com.java110.core.context.BusinessServiceDataFlow;
-import com.java110.core.factory.DataTransactionFactory;
-import com.java110.shop.smo.IShopServiceSMO;
-import org.apache.kafka.clients.consumer.ConsumerRecord;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.kafka.annotation.KafkaListener;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * kafka侦听
- * Created by wuxw on 2018/4/15.
- */
-public class ShopServiceKafka extends BaseController {
-    private final static Logger logger = LoggerFactory.getLogger(ShopServiceKafka.class);
-
-    @Autowired
-    private IShopServiceSMO shopServiceSMOImpl;
-
-    @KafkaListener(topics = {"shopServiceTopic"})
-    public void listen(ConsumerRecord<?, ?> record) {
-        logger.info("kafka的key: " + record.key());
-        logger.info("kafka的value: " + record.value().toString());
-        String orderInfo = record.value().toString();
-        BusinessServiceDataFlow businessServiceDataFlow = null;
-        JSONObject responseJson = null;
-        try {
-            Map<String, String> headers = new HashMap<String, String>();
-            //预校验
-            preValiateOrderInfo(orderInfo);
-            businessServiceDataFlow = this.writeDataToDataFlowContext(orderInfo, headers);
-            responseJson = shopServiceSMOImpl.service(businessServiceDataFlow);
-        }catch (InitDataFlowContextException e){
-            logger.error("请求报文错误,初始化 BusinessServiceDataFlow失败"+orderInfo,e);
-            responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
-        }catch (InitConfigDataException e){
-            logger.error("请求报文错误,加载配置信息失败"+orderInfo,e);
-            responseJson = DataTransactionFactory.createNoBusinessTypeBusinessResponseJson(orderInfo,ResponseConstant.RESULT_PARAM_ERROR,e.getMessage(),null);
-        }catch (Exception e){
-            logger.error("请求订单异常",e);
-            responseJson = DataTransactionFactory.createBusinessResponseJson(businessServiceDataFlow,ResponseConstant.RESULT_CODE_ERROR,e.getMessage()+e,
-                    null);
-        }finally {
-            logger.debug("当前请求报文:" + orderInfo +", 当前返回报文:" +responseJson.toJSONString());
-            //只有business 和 instance 过程才做通知消息
-            if(!StatusConstant.REQUEST_BUSINESS_TYPE_BUSINESS.equals(responseJson.getString("businessType"))
-                    && !StatusConstant.REQUEST_BUSINESS_TYPE_INSTANCE.equals(responseJson.getString("businessType"))){
-                return ;
-            }
-            try {
-                KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_NOTIFY_CENTER_SERVICE_NAME, "", responseJson.toJSONString());
-            }catch (Exception e){
-                logger.error("用户服务通知centerService失败"+responseJson,e);
-                //这里保存异常信息
-            }
-        }
-    }
-
-
-    /**
-     * 这里预校验,请求报文中不能有 dataFlowId
-     * @param orderInfo
-     */
-    private void preValiateOrderInfo(String orderInfo) {
-       /* if(JSONObject.parseObject(orderInfo).getJSONObject("orders").containsKey("dataFlowId")){
-            throw new BusinessException(ResponseConstant.RESULT_CODE_ERROR,"报文中不能存在dataFlowId节点");
-        }*/
-    }
-
-    public IShopServiceSMO getShopServiceSMOImpl() {
-        return shopServiceSMOImpl;
-    }
-
-    public void setShopServiceSMOImpl(IShopServiceSMO shopServiceSMOImpl) {
-        this.shopServiceSMOImpl = shopServiceSMOImpl;
-    }
-}

+ 0 - 303
ShopService/src/main/java/com/java110/shop/listener/AbstractShopBusinessServiceDataFlowListener.java

@@ -1,303 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.entity.center.Business;
-import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- *
- * 商户 服务侦听 父类
- * Created by wuxw on 2018/7/4.
- */
-public abstract class AbstractShopBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener{
-    private final static Logger logger = LoggerFactory.getLogger(AbstractShopBusinessServiceDataFlowListener.class);
-
-
-    /**
-     * 获取 DAO工具类
-     * @return
-     */
-    public abstract IShopServiceDao getShopServiceDaoImpl();
-
-    /**
-     * 刷新 businessShopInfo 数据
-     * 主要将 数据库 中字段和 接口传递字段建立关系
-     * @param businessShopInfo
-     */
-    protected void flushBusinessShopInfo(Map businessShopInfo,String statusCd){
-        businessShopInfo.put("newBId",businessShopInfo.get("b_id"));
-        businessShopInfo.put("shopId",businessShopInfo.get("shop_id"));
-        businessShopInfo.put("storeId",businessShopInfo.get("store_id"));
-        businessShopInfo.put("catalogId",businessShopInfo.get("catalog_id"));
-        businessShopInfo.put("hotBuy",businessShopInfo.get("hot_buy"));
-        businessShopInfo.put("salePrice",businessShopInfo.get("sale_price"));
-        businessShopInfo.put("openShopCount",businessShopInfo.get("open_shop_count"));
-        businessShopInfo.put("shopCount",businessShopInfo.get("shop_count"));
-        businessShopInfo.put("startDate",businessShopInfo.get("start_date"));
-        businessShopInfo.put("endDate",businessShopInfo.get("end_date"));
-        businessShopInfo.put("statusCd", statusCd);
-    }
-
-    /**
-        刷新 businessShopAttr 数据
-     * 主要将 数据库 中字段和 接口传递字段建立关系
-     * @param businessShopAttr
-     * @param statusCd
-     */
-    protected void flushBusinessShopAttr(Map businessShopAttr,String statusCd){
-        businessShopAttr.put("attrId",businessShopAttr.get("attr_id"));
-        businessShopAttr.put("specCd",businessShopAttr.get("spec_cd"));
-        businessShopAttr.put("shopId",businessShopAttr.get("shop_id"));
-        businessShopAttr.put("newBId",businessShopAttr.get("b_id"));
-        businessShopAttr.put("statusCd",statusCd);
-    }
-
-    /**
-     * 刷新 businessShopAttrParam 数据
-     * @param businessShopAttrParam
-     * @param statusCd
-     */
-    protected void flushBusinessShopAttrParam(Map businessShopAttrParam,String statusCd){
-        businessShopAttrParam.put("newBId",businessShopAttrParam.get("b_id"));
-        businessShopAttrParam.put("attrParamId",businessShopAttrParam.get("attr_param_id"));
-        businessShopAttrParam.put("shopId",businessShopAttrParam.get("shop_id"));
-        businessShopAttrParam.put("specCd",businessShopAttrParam.get("spec_cd"));
-        businessShopAttrParam.put("statusCd",statusCd);
-    }
-
-    /**
-     * 刷新 businessShopPhoto 数据
-     * @param businessShopPhoto
-     * @param statusCd
-     */
-    protected void flushBusinessShopPhoto(Map businessShopPhoto,String statusCd){
-        businessShopPhoto.put("shopId",businessShopPhoto.get("shop_id"));
-        businessShopPhoto.put("shopPhotoId",businessShopPhoto.get("shop_photo_id"));
-        businessShopPhoto.put("shopPhotoTypeCd",businessShopPhoto.get("shop_photo_type_cd"));
-        businessShopPhoto.put("newBId",businessShopPhoto.get("b_id"));
-        businessShopPhoto.put("statusCd",statusCd);
-    }
-
-    /**
-     * 刷新 businessShopPreferential 数据
-     * @param businessShopPreferential
-     * @param statusCd
-     */
-    protected void flushBusinessShopPreferential(Map businessShopPreferential ,String statusCd){
-        businessShopPreferential.put("shopPreferentialId",businessShopPreferential.get("shop_preferential_id"));
-        businessShopPreferential.put("shopId",businessShopPreferential.get("shop_id"));
-        businessShopPreferential.put("originalPrice",businessShopPreferential.get("original_price"));
-        businessShopPreferential.put("discountRate",businessShopPreferential.get("discount_rate"));
-        businessShopPreferential.put("showOriginalPrice",businessShopPreferential.get("show_original_price"));
-        businessShopPreferential.put("preferentialStartDate",businessShopPreferential.get("preferential_start_date"));
-        businessShopPreferential.put("preferentialEndDate",businessShopPreferential.get("preferential_end_date"));
-        businessShopPreferential.put("newBId",businessShopPreferential.get("b_id"));
-        businessShopPreferential.put("statusCd",statusCd);
-    }
-
-
-    /**
-     * 刷新 businessShopDesc 数据
-     * @param businessShopDesc
-     * @param statusCd
-     */
-    protected void flushBusinessShopDesc(Map businessShopDesc ,String statusCd){
-        businessShopDesc.put("shopDescId",businessShopDesc.get("shop_desc_id"));
-        businessShopDesc.put("shopId",businessShopDesc.get("shop_id"));
-        businessShopDesc.put("shopDescribe",businessShopDesc.get("shop_describe"));
-        businessShopDesc.put("newBId",businessShopDesc.get("b_id"));
-        businessShopDesc.put("statusCd",statusCd);
-    }
-
-    /**
-     * 刷新 businessShopCatalog 数据
-     * @param businessShopCatalog
-     * @param statusCd
-     */
-    protected void flushBusinessShopCatalog(Map businessShopCatalog ,String statusCd){
-        businessShopCatalog.put("catalogId",businessShopCatalog.get("catalog_id"));
-        businessShopCatalog.put("storeId",businessShopCatalog.get("store_id"));
-        businessShopCatalog.put("parentCatalogId",businessShopCatalog.get("parent_catalog_id"));
-        businessShopCatalog.put("newBId",businessShopCatalog.get("b_id"));
-        businessShopCatalog.put("statusCd",statusCd);
-    }
-
-
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param businessShop 商户信息
-     */
-    protected void autoSaveDelBusinessShop(Business business, JSONObject businessShop){
-//自动插入DEL
-        Map info = new HashMap();
-        info.put("shopId",businessShop.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map currentShopInfo = getShopServiceDaoImpl().getShopInfo(info);
-        if(currentShopInfo == null || currentShopInfo.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-        currentShopInfo.put("bId",business.getbId());
-        currentShopInfo.put("shopId",currentShopInfo.get("shop_id"));
-        currentShopInfo.put("storeId",currentShopInfo.get("store_id"));
-        currentShopInfo.put("catalogId",currentShopInfo.get("catalog_id"));
-        currentShopInfo.put("hotBuy",currentShopInfo.get("hot_buy"));
-        currentShopInfo.put("salePrice",currentShopInfo.get("sale_price"));
-        currentShopInfo.put("openShopCount",currentShopInfo.get("open_shop_count"));
-        currentShopInfo.put("shopCount",currentShopInfo.get("shop_count"));
-        currentShopInfo.put("startDate",currentShopInfo.get("start_date"));
-        currentShopInfo.put("endDate",currentShopInfo.get("end_date"));
-        currentShopInfo.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopInfo(currentShopInfo);
-    }
-
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param business 当前业务
-     * @param shopAttr 商户属性
-     */
-    protected void autoSaveDelBusinessShopAttr(Business business, JSONObject shopAttr){
-        Map info = new HashMap();
-        info.put("attrId",shopAttr.getString("attrId"));
-        info.put("shopId",shopAttr.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        List<Map> currentShopAttrs = getShopServiceDaoImpl().getShopAttrs(info);
-        if(currentShopAttrs == null || currentShopAttrs.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-        Map currentShopAttr = currentShopAttrs.get(0);
-        currentShopAttr.put("bId",business.getbId());
-        currentShopAttr.put("attrId",currentShopAttr.get("attr_id"));
-        currentShopAttr.put("shopId",currentShopAttr.get("shop_id"));
-        currentShopAttr.put("specCd",currentShopAttr.get("spec_cd"));
-        currentShopAttr.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopAttr(currentShopAttr);
-    }
-
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param business 当前业务
-     * @param shopAttrParam 商品属性参数
-     */
-    protected void autoSaveDelBusinessShopAttrParam(Business business,JSONObject shopAttrParam){
-        Map info = new HashMap();
-        info.put("attrParamId",shopAttrParam.getString("attrParamId"));
-        info.put("shopId",shopAttrParam.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        List<Map> currentShopAttrParams = getShopServiceDaoImpl().getShopAttrParams(info);
-        if(currentShopAttrParams == null || currentShopAttrParams.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-        Map currentShopAttrParam = currentShopAttrParams.get(0);
-        currentShopAttrParam.put("bId",business.getbId());
-        currentShopAttrParam.put("attrParamId",currentShopAttrParam.get("attr_param_id"));
-        currentShopAttrParam.put("shopId",currentShopAttrParam.get("shop_id"));
-        currentShopAttrParam.put("specCd",currentShopAttrParam.get("spec_cd"));
-        currentShopAttrParam.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopAttrParam(currentShopAttrParam);
-    }
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param business
-     * @param businessShopPhoto 商户照片
-     */
-    protected void autoSaveDelBusinessShopPhoto(Business business,JSONObject businessShopPhoto){
-       Map info = new HashMap();
-        info.put("shopPhotoId",businessShopPhoto.getString("shopPhotoId"));
-        info.put("shopId",businessShopPhoto.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        List<Map> currentShopPhotos = getShopServiceDaoImpl().getShopPhoto(info);
-        if(currentShopPhotos == null || currentShopPhotos.size() != 1){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-        Map currentShopPhoto = currentShopPhotos.get(0);
-        currentShopPhoto.put("bId",business.getbId());
-        currentShopPhoto.put("shopPhotoId",currentShopPhoto.get("shop_photo_id"));
-        currentShopPhoto.put("shopId",currentShopPhoto.get("shop_id"));
-        currentShopPhoto.put("shopPhotoTypeCd",currentShopPhoto.get("shop_photo_type_cd"));
-        currentShopPhoto.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopPhoto(currentShopPhoto);
-    }
-
-    /**
-     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
-     * @param business
-     * @param businessShopPreferentials 商品优惠
-     */
-    protected void autoSaveDelBusinessShopPreferential(Business business,JSONObject businessShopPreferentials){
-        Map info = new HashMap();
-        info.put("shopPreferentialId",businessShopPreferentials.getString("shopPreferentialId"));
-        info.put("shopId",businessShopPreferentials.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map currentShopPreferential = getShopServiceDaoImpl().getShopPreferential(info);
-        if(currentShopPreferential == null || currentShopPreferential.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-
-        currentShopPreferential.put("bId",business.getbId());
-        currentShopPreferential.put("shopPreferentialId",currentShopPreferential.get("shop_preferential_id"));
-        currentShopPreferential.put("shopId",currentShopPreferential.get("shop_id"));
-        currentShopPreferential.put("originalPrice",currentShopPreferential.get("original_price"));
-        currentShopPreferential.put("discountRate",currentShopPreferential.get("discount_rate"));
-        currentShopPreferential.put("showOriginalPrice",currentShopPreferential.get("show_original_price"));
-        currentShopPreferential.put("preferentialStartDate",currentShopPreferential.get("preferential_start_date"));
-        currentShopPreferential.put("preferentialEndDate",currentShopPreferential.get("preferential_end_date"));
-        currentShopPreferential.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopPreferential(currentShopPreferential);
-    }
-
-    /**
-     *
-     * @param business
-     * @param businessShopDesc
-     */
-    protected void autoSaveDelBusinessShopDesc(Business business,JSONObject businessShopDesc){
-        Map info = new HashMap();
-        info.put("shopDescId",businessShopDesc.getString("shopDescId"));
-        info.put("shopId",businessShopDesc.getString("shopId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map currentShopDesc = getShopServiceDaoImpl().getShopDesc(info);
-        if(currentShopDesc == null || currentShopDesc.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-
-        currentShopDesc.put("bId",business.getbId());
-        currentShopDesc.put("shopDescId",currentShopDesc.get("shop_desc_id"));
-        currentShopDesc.put("shopId",currentShopDesc.get("shop_id"));
-        currentShopDesc.put("shopDescribe",currentShopDesc.get("shop_describe"));
-        currentShopDesc.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopDesc(currentShopDesc);
-    }
-
-    /**
-     * 商品目录 自动刷 DEL数据
-     * @param business
-     * @param businessShopCalalog
-     */
-    protected void autoSaveDelBusinessShopCatalog(Business business,JSONObject businessShopCalalog){
-        Map info = new HashMap();
-        info.put("catalogId",businessShopCalalog.getString("catalogId"));
-        info.put("storeId",businessShopCalalog.getString("storeId"));
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map currentShopCatalog = getShopServiceDaoImpl().getShopCatalog(info);
-        if(currentShopCatalog == null || currentShopCatalog.isEmpty()){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"未找到需要修改数据信息,入参错误或数据有问题,请检查"+info);
-        }
-
-        currentShopCatalog.put("bId",business.getbId());
-        currentShopCatalog.put("catalogId",currentShopCatalog.get("catalog_id"));
-        currentShopCatalog.put("storeId",currentShopCatalog.get("store_id"));
-        currentShopCatalog.put("parentCatalogId",currentShopCatalog.get("parent_catalog_id"));
-        currentShopCatalog.put("operate",StatusConstant.OPERATE_DEL);
-        getShopServiceDaoImpl().saveBusinessShopCatalog(currentShopCatalog);
-    }
-}

+ 0 - 200
ShopService/src/main/java/com/java110/shop/listener/DeleteShopAttrAndAttrParamListener.java

@@ -1,200 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 删除商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopAttrAndAttrParamListener")
-@Transactional
-public class DeleteShopAttrAndAttrParamListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopAttrAndAttrParamListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 2;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_INFO;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopAttr")){
-            JSONArray businessShopAttrs = data.getJSONArray("businessShopAttr");
-            doSaveBusinessShopAttrs(business,businessShopAttrs);
-        }
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopAttrParam")){
-            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
-            doSaveBusinessShopAttrParams(business,businessShopAttrParams);
-        }
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商品属性
-        List<Map> businessShopAttrs = shopServiceDaoImpl.getBusinessShopAttrs(info);
-        if(businessShopAttrs != null && businessShopAttrs.size() > 0) {
-            for(Map businessShopAttr : businessShopAttrs) {
-                flushBusinessShopAttr(businessShopAttr,StatusConstant.STATUS_CD_INVALID);
-                shopServiceDaoImpl.updateShopAttrInstance(businessShopAttr);
-            }
-        }
-
-        //商品属性参数
-        List<Map> businessShopAttrParams = shopServiceDaoImpl.getBusinessShopAttrParams(info);
-        if(businessShopAttrParams != null && businessShopAttrParams.size() > 0) {
-            for(Map businessShopAttrParam : businessShopAttrParams) {
-                flushBusinessShopAttrParam(businessShopAttrParam,StatusConstant.STATUS_CD_INVALID);
-                shopServiceDaoImpl.updateShopAttrParamInstance(businessShopAttrParam);
-            }
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商品属性
-        List<Map> shopAttrs = shopServiceDaoImpl.getShopAttrs(info);
-        if(shopAttrs != null && shopAttrs.size()>0){
-
-            List<Map> businessShopAttrs = shopServiceDaoImpl.getBusinessShopAttrs(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopAttrs == null || businessShopAttrs.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_attr),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopAttr : businessShopAttrs) {
-                flushBusinessShopAttr(businessShopAttr,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrInstance(businessShopAttr);
-            }
-        }
-
-        //商品属性参数
-        List<Map> shopAttrParams = shopServiceDaoImpl.getShopAttrParams(info);
-        if(shopAttrParams != null && shopAttrParams.size()>0){
-
-            List<Map> businessShopAttrParams = shopServiceDaoImpl.getBusinessShopAttrParams(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopAttrParams == null || businessShopAttrParams.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_attr_param),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopAttrParam : businessShopAttrParams) {
-                flushBusinessShopAttrParam(businessShopAttrParam,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrParamInstance(businessShopAttrParam);
-            }
-        }
-    }
-
-
-    /**
-     * 保存商户属性信息
-     * @param business 当前业务
-     * @param businessShopAttrs 商户属性
-     */
-    private void doSaveBusinessShopAttrs(Business business,JSONArray businessShopAttrs){
-        JSONObject data = business.getDatas();
-
-        for(int shopAttrIndex = 0 ; shopAttrIndex < businessShopAttrs.size();shopAttrIndex ++){
-            JSONObject shopAttr = businessShopAttrs.getJSONObject(shopAttrIndex);
-            Assert.jsonObjectHaveKey(shopAttr,"attrId","businessShopAttr 节点下没有包含 attrId 节点");
-            if(shopAttr.getString("attrId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+shopAttr);
-            }
-
-            autoSaveDelBusinessShopAttr(business,shopAttr);
-        }
-    }
-
-    /**
-     * 保存商品属性信息
-     * @param business 当前业务
-     * @param businessShopAttrParams 商品属性 参数
-     */
-    private void doSaveBusinessShopAttrParams(Business business,JSONArray businessShopAttrParams){
-        JSONObject data = business.getDatas();
-
-        for(int shopAttrParamIndex = 0 ; shopAttrParamIndex < businessShopAttrParams.size();shopAttrParamIndex ++){
-            JSONObject shopAttrParam = businessShopAttrParams.getJSONObject(shopAttrParamIndex);
-            Assert.jsonObjectHaveKey(shopAttrParam,"attrParamId","businessShopAttrParam 节点下没有包含 attrParamId 节点");
-            if(shopAttrParam.getString("attrParamId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrParamId 错误,不能自动生成(必须已经存在的attrParamId)"+shopAttrParam);
-            }
-
-            autoSaveDelBusinessShopAttrParam(business,shopAttrParam);
-        }
-    }
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 148
ShopService/src/main/java/com/java110/shop/listener/DeleteShopCatalogListener.java

@@ -1,148 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 删除商品目录 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopCatalogListener")
-@Transactional
-public class DeleteShopCatalogListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopCatalogListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_CATALOG;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopCatalog")){
-            JSONObject businessShopCatalog = data.getJSONObject("businessShopCatalog");
-            doBusinessShopCatalog(business,businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.getString("catalogId"));
-        }
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商品目录
-        Map businessShopCatalog = shopServiceDaoImpl.getBusinessShopCatalog(info);
-        if( businessShopCatalog != null && !businessShopCatalog.isEmpty()) {
-            flushBusinessShopCatalog(businessShopCatalog,StatusConstant.STATUS_CD_INVALID);
-            shopServiceDaoImpl.updateShopCatalogInstance(businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.get("catalog_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopCatalog = shopServiceDaoImpl.getShopCatalog(info);
-        if(shopCatalog != null && !shopCatalog.isEmpty()){
-
-            //商户信息
-            Map businessShopCatalog = shopServiceDaoImpl.getBusinessShopCatalog(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopCatalog == null || businessShopCatalog.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_catalog),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopCatalog(businessShopCatalog,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopCatalogInstance(businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",shopCatalog.get("catalog_id"));
-        }
-    }
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopCatalog 商品优惠节点
-     */
-    private void doBusinessShopCatalog(Business business,JSONObject businessShopCatalog){
-
-        Assert.jsonObjectHaveKey(businessShopCatalog,"catalogId","businessShopCatalog 节点下没有包含 catalogId 节点");
-
-        if(businessShopCatalog.getString("catalogId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"catalogId 错误,不能自动生成(必须已经存在的catalogId)"+businessShopCatalog);
-        }
-        //自动插入DEL
-        autoSaveDelBusinessShopCatalog(business,businessShopCatalog);
-    }
-
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 148
ShopService/src/main/java/com/java110/shop/listener/DeleteShopDescListener.java

@@ -1,148 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 删除商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopDescListener")
-@Transactional
-public class DeleteShopDescListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopDescListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 5;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_INFO;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopDesc")){
-            JSONObject businessShopDesc = data.getJSONObject("businessShopDesc");
-            doBusinessShopDesc(business,businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.getString("shopDescId"));
-        }
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商户信息
-        Map businessShopDesc = shopServiceDaoImpl.getBusinessShopDesc(info);
-        if( businessShopDesc != null && !businessShopDesc.isEmpty()) {
-            flushBusinessShopDesc(businessShopDesc,StatusConstant.STATUS_CD_INVALID);
-            shopServiceDaoImpl.updateShopDescInstance(businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.get("shop_desc_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopDesc = shopServiceDaoImpl.getShopDesc(info);
-        if(shopDesc != null && !shopDesc.isEmpty()){
-
-            //商户信息
-            Map businessShopDesc = shopServiceDaoImpl.getBusinessShopDesc(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopDesc == null || businessShopDesc.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_desc),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopDesc(businessShopDesc,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopDescInstance(businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",shopDesc.get("shop_desc_id"));
-        }
-    }
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopDesc 商品优惠节点
-     */
-    private void doBusinessShopDesc(Business business,JSONObject businessShopDesc){
-
-        Assert.jsonObjectHaveKey(businessShopDesc,"shopDescId","businessShopDesc 节点下没有包含 shopDescId 节点");
-
-        if(businessShopDesc.getString("shopDescId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopDescId 错误,不能自动生成(必须已经存在的shopDescId)"+businessShopDesc);
-        }
-        //自动插入DEL
-        autoSaveDelBusinessShopDesc(business,businessShopDesc);
-    }
-
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 148
ShopService/src/main/java/com/java110/shop/listener/DeleteShopInfoListener.java

@@ -1,148 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 删除商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopInfoListener")
-@Transactional
-public class DeleteShopInfoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopInfoListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_INFO;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShop")){
-            JSONObject businessShop = data.getJSONObject("businessShop");
-            doBusinessShop(business,businessShop);
-            dataFlowContext.addParamOut("shopId",businessShop.getString("shopId"));
-        }
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商户信息
-        Map businessShopInfo = shopServiceDaoImpl.getBusinessShopInfo(info);
-        if( businessShopInfo != null && !businessShopInfo.isEmpty()) {
-            flushBusinessShopInfo(businessShopInfo,StatusConstant.STATUS_CD_INVALID);
-            shopServiceDaoImpl.updateShopInfoInstance(businessShopInfo);
-            dataFlowContext.addParamOut("shopId",businessShopInfo.get("shop_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopInfo = shopServiceDaoImpl.getShopInfo(info);
-        if(shopInfo != null && !shopInfo.isEmpty()){
-
-            //商户信息
-            Map businessShopInfo = shopServiceDaoImpl.getBusinessShopInfo(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopInfo == null || businessShopInfo.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopInfo(businessShopInfo,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopInfoInstance(businessShopInfo);
-            dataFlowContext.addParamOut("shopId",shopInfo.get("shop_id"));
-        }
-    }
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShop 商户节点
-     */
-    private void doBusinessShop(Business business,JSONObject businessShop){
-
-        Assert.jsonObjectHaveKey(businessShop,"shopId","businessShop 节点下没有包含 shopId 节点");
-
-        if(businessShop.getString("shopId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopId 错误,不能自动生成(必须已经存在的shopId)"+businessShop);
-        }
-        //自动插入DEL
-        autoSaveDelBusinessShop(business,businessShop);
-    }
-
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 153
ShopService/src/main/java/com/java110/shop/listener/DeleteShopPhotoListener.java

@@ -1,153 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 删除商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopPhotoListener")
-@Transactional
-public class DeleteShopPhotoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopPhotoListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 3;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_INFO;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopPhoto")){
-            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
-            doSaveBusinessShopPhotos(business,businessShopPhotos);
-        }
-
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商品属性
-        List<Map> businessShopPhotos = shopServiceDaoImpl.getBusinessShopPhoto(info);
-        if(businessShopPhotos != null && businessShopPhotos.size() > 0) {
-            for(Map businessShopPhoto : businessShopPhotos) {
-                flushBusinessShopPhoto(businessShopPhoto,StatusConstant.STATUS_CD_INVALID);
-                shopServiceDaoImpl.updateShopPhotoInstance(businessShopPhoto);
-            }
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商品属性
-        List<Map> shopPhotos = shopServiceDaoImpl.getShopPhoto(info);
-        if(shopPhotos != null && shopPhotos.size()>0){
-
-            List<Map> businessShopPhotos = shopServiceDaoImpl.getBusinessShopPhoto(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopPhotos == null || businessShopPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_photo),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopPhoto : businessShopPhotos) {
-                flushBusinessShopPhoto(businessShopPhoto,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopPhotoInstance(businessShopPhoto);
-            }
-        }
-    }
-
-
-    /**
-     * 保存商户属性信息
-     * @param business 当前业务
-     * @param businessShopPhotos 商户属性
-     */
-    private void doSaveBusinessShopPhotos(Business business,JSONArray businessShopPhotos){
-        JSONObject data = business.getDatas();
-
-        for(int shopPhotoIndex = 0 ; shopPhotoIndex < businessShopPhotos.size();shopPhotoIndex ++){
-            JSONObject shopPhoto = businessShopPhotos.getJSONObject(shopPhotoIndex);
-            Assert.jsonObjectHaveKey(shopPhoto,"shopPhotoId","businessShopPhoto 节点下没有包含 shopPhotoId 节点");
-            if(shopPhoto.getString("shopPhotoId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopPhotoId 错误,不能自动生成(必须已经存在的shopPhotoId)"+shopPhoto);
-            }
-
-            autoSaveDelBusinessShopPhoto(business,shopPhoto);
-        }
-    }
-
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 148
ShopService/src/main/java/com/java110/shop/listener/DeleteShopPreferentialListener.java

@@ -1,148 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 删除商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商户基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("deleteShopPreferentialListener")
-@Transactional
-public class DeleteShopPreferentialListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(DeleteShopPreferentialListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 4;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_SHOP_INFO;
-    }
-
-    /**
-     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点 按理这里不应该处理,程序上支持,以防真有这种业务
-        if(data.containsKey("businessShopPreferential")){
-            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
-            doBusinessShopPreferential(business,businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.getString("shopPreferentialId"));
-        }
-    }
-
-    /**
-     * 删除 instance数据
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-
-        //商户信息
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_DEL);
-
-        //商户信息
-        Map businessShopPreferential = shopServiceDaoImpl.getBusinessShopPreferential(info);
-        if( businessShopPreferential != null && !businessShopPreferential.isEmpty()) {
-            flushBusinessShopPreferential(businessShopPreferential,StatusConstant.STATUS_CD_INVALID);
-            shopServiceDaoImpl.updateShopPreferentialInstance(businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.get("shop_preferential_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * 从business表中查询到DEL的数据 将instance中的数据更新回来
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopPreferential = shopServiceDaoImpl.getShopPreferential(info);
-        if(shopPreferential != null && !shopPreferential.isEmpty()){
-
-            //商户信息
-            Map businessShopPreferential = shopServiceDaoImpl.getBusinessShopPreferential(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopPreferential == null || businessShopPreferential.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_preferential),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopPreferential(businessShopPreferential,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopPreferentialInstance(businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",shopPreferential.get("shop_preferential_id"));
-        }
-    }
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopPreferential 商品优惠节点
-     */
-    private void doBusinessShopPreferential(Business business,JSONObject businessShopPreferential){
-
-        Assert.jsonObjectHaveKey(businessShopPreferential,"shopPreferentialId","businessShopPreferential 节点下没有包含 shopPreferentialId 节点");
-
-        if(businessShopPreferential.getString("shopPreferentialId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopPreferentialId 错误,不能自动生成(必须已经存在的shopPreferentialId)"+businessShopPreferential);
-        }
-        //自动插入DEL
-        autoSaveDelBusinessShopPreferential(business,businessShopPreferential);
-    }
-
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 94
ShopService/src/main/java/com/java110/shop/listener/FlushAboutBuyIdListener.java

@@ -1,94 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 如果buyId  buyAttrId 填写的值为-1,则重新生成
- *
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name="flushAboutBuyIdListener")
-public class FlushAboutBuyIdListener extends AbstractShopBusinessServiceDataFlowListener {
-    private final static Logger logger = LoggerFactory.getLogger(FlushAboutBuyIdListener.class);
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_BUY_SHOP_INFO;
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return null;
-    }
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //刷新shopId
-        if(data.containsKey("businessBuyShop")){
-            JSONObject businessBuyShop = data.getJSONObject("businessBuyShop");
-            if(!businessBuyShop.containsKey("buyId") || businessBuyShop.getString("buyId").startsWith("-")){
-                flushShopBuyId(data);
-            }
-        }
-
-        //刷新 attrId
-        if(data.containsKey("businessBuyShopAttr")){
-            JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr");
-            for(int businessBuyShopAttrIndex = 0 ; businessBuyShopAttrIndex < businessBuyShopAttrs.size();businessBuyShopAttrIndex++){
-                JSONObject attrObj = businessBuyShopAttrs.getJSONObject(businessBuyShopAttrIndex);
-                if(attrObj.containsKey("attrId") && !attrObj.getString("attrId").startsWith("-")){
-                    continue;
-                }
-                attrObj.put("attrId",GenerateCodeFactory.getShopBuyAttrId());
-            }
-        }
-
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    /**
-     * 刷新 商品目录ID
-     * @param data
-     */
-    private void flushShopBuyId(JSONObject data) {
-
-        String buyId = GenerateCodeFactory.getShopBuyId();
-        JSONObject businessBuyShop = data.getJSONObject("businessBuyShop");
-        businessBuyShop.put("buyId",buyId);
-
-        //刷商品属性
-        if(data.containsKey("businessBuyShopAttr")) {
-            JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr");
-            for(int businessBuyShopAttrIndex = 0;businessBuyShopAttrIndex < businessBuyShopAttrs.size();businessBuyShopAttrIndex++) {
-                JSONObject businessBuyShopAttr = businessBuyShopAttrs.getJSONObject(businessBuyShopAttrIndex);
-                businessBuyShopAttr.put("buyId", buyId);
-            }
-        }
-    }
-}

+ 0 - 152
ShopService/src/main/java/com/java110/shop/listener/FlushAboutShopIdListener.java

@@ -1,152 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 如果shopId填写的值为-1,则重新生成
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name="flushAboutShopIdListener")
-public class FlushAboutShopIdListener extends AbstractShopBusinessServiceDataFlowListener {
-    private final static Logger logger = LoggerFactory.getLogger(FlushAboutShopIdListener.class);
-
-    @Override
-    public int getOrder() {
-        return 0;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return null;
-    }
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //刷新shopId
-        if(data.containsKey("businessShop")){
-            JSONObject businessShop = data.getJSONObject("businessShop");
-            if(!businessShop.containsKey("shopId") || businessShop.getString("shopId").startsWith("-")){
-                flushShopId(data);
-            }
-        }
-        //刷新 attrId
-        if(data.containsKey("businessShopAttr")){
-            JSONArray businessShopAttrs = data.getJSONArray("businessShopAttr");
-            for(int businessShopAttrIndex = 0 ; businessShopAttrIndex < businessShopAttrs.size();businessShopAttrIndex++){
-                JSONObject attrObj = businessShopAttrs.getJSONObject(businessShopAttrIndex);
-                if(attrObj.containsKey("attrId") && !attrObj.getString("attrId").startsWith("-")){
-                    continue;
-                }
-                attrObj.put("attrId",GenerateCodeFactory.getShopAttrId());
-            }
-        }
-        //刷新 shopPhotoId
-        if(data.containsKey("businessShopPhoto")){
-            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
-            for (int businessShopPhotoIndex = 0;businessShopPhotoIndex < businessShopPhotos.size();businessShopPhotoIndex ++){
-                JSONObject photoObj = businessShopPhotos.getJSONObject(businessShopPhotoIndex);
-                if(photoObj.containsKey("shopPhotoId") && !photoObj.getString("shopPhotoId").startsWith("-")){
-                    continue;
-                }
-                photoObj.put("shopPhotoId",GenerateCodeFactory.getShopPhotoId());
-            }
-        }
-        //刷新 attrParamId
-        if(data.containsKey("businessShopAttrParam")){
-            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
-            for (int businessShopAttrParamIndex = 0;businessShopAttrParamIndex < businessShopAttrParams.size();businessShopAttrParamIndex ++){
-                JSONObject attrParamObj = businessShopAttrParams.getJSONObject(businessShopAttrParamIndex);
-                if(attrParamObj.containsKey("attrParamId") && !attrParamObj.getString("attrParamId").startsWith("-")){
-                    continue;
-                }
-                attrParamObj.put("attrParamId",GenerateCodeFactory.getShopAttrParamId());
-            }
-        }
-        //刷新 shopPreferentialId
-        if(data.containsKey("businessShopPreferential")){
-            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
-            if(!businessShopPreferential.containsKey("shopPreferentialId") || businessShopPreferential.getString("shopPreferentialId").startsWith("-")){
-                businessShopPreferential.put("shopPreferentialId",GenerateCodeFactory.getShopPreferentialId());
-            }
-        }
-        //刷新 商品描述Id
-        if(data.containsKey("businessShopDesc")){
-            JSONObject businessShopDesc = data.getJSONObject("businessShopDesc");
-            if(!businessShopDesc.containsKey("shopDescId") || businessShopDesc.getString("shopDescId").startsWith("-")){
-                businessShopDesc.put("shopDescId",GenerateCodeFactory.getShopDescId());
-            }
-        }
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    /**
-     * 刷新 商品ID
-     * @param data
-     */
-    private void flushShopId(JSONObject data) {
-
-        String shopId = GenerateCodeFactory.getShopId();
-        JSONObject businessShop = data.getJSONObject("businessShop");
-        businessShop.put("shopId",shopId);
-        //刷商品属性
-        if(data.containsKey("businessShopAttr")) {
-            JSONArray businessShopAttrs = data.getJSONArray("businessShopAttr");
-            for(int businessShopAttrIndex = 0;businessShopAttrIndex < businessShopAttrs.size();businessShopAttrIndex++) {
-                JSONObject businessStoreAttr = businessShopAttrs.getJSONObject(businessShopAttrIndex);
-                businessStoreAttr.put("shopId", shopId);
-            }
-        }
-        //刷商品属性
-        if(data.containsKey("businessShopAttrParam")) {
-            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
-            for(int businessShopAttrParamIndex = 0;businessShopAttrParamIndex < businessShopAttrParams.size();businessShopAttrParamIndex++) {
-                JSONObject businessStoreAttrParam = businessShopAttrParams.getJSONObject(businessShopAttrParamIndex);
-                businessStoreAttrParam.put("shopId", shopId);
-            }
-        }
-        //刷 是商品照片 的 shopId
-        if(data.containsKey("businessShopPhoto")) {
-            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
-            for(int businessShopPhotoIndex = 0;businessShopPhotoIndex < businessShopPhotos.size();businessShopPhotoIndex++) {
-                JSONObject businessStorePhoto = businessShopPhotos.getJSONObject(businessShopPhotoIndex);
-                businessStorePhoto.put("shopId", shopId);
-            }
-        }
-        //刷 商品优惠 的 shopId
-        if(data.containsKey("businessShopPreferential")) {
-            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
-            businessShopPreferential.put("shopId", shopId);
-        }
-        //商品描述
-        if(data.containsKey("businessShopDesc")){
-            JSONObject businessShopDesc = data.getJSONObject("businessShopDesc");
-            businessShopDesc.put("shopId", shopId);
-        }
-    }
-}

+ 0 - 71
ShopService/src/main/java/com/java110/shop/listener/FlushShopCatalogIdListener.java

@@ -1,71 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * 如果shopCatalogId填写的值为-1,则重新生成
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name="flushShopCatalogIdListener")
-public class FlushShopCatalogIdListener extends AbstractShopBusinessServiceDataFlowListener {
-    private final static Logger logger = LoggerFactory.getLogger(FlushShopCatalogIdListener.class);
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_CATALOG;
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return null;
-    }
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //刷新shopId
-        if(data.containsKey("businessShopCatalog")){
-            JSONObject businessShopCatalog = data.getJSONObject("businessShopCatalog");
-            if(!businessShopCatalog.containsKey("catalogId") || businessShopCatalog.getString("catalogId").startsWith("-")){
-                flushShopCatalogId(data);
-            }
-        }
-
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        // nothing to do
-    }
-
-    /**
-     * 刷新 商品目录ID
-     * @param data
-     */
-    private void flushShopCatalogId(JSONObject data) {
-
-        String catalogId = GenerateCodeFactory.getShopCatalogId();
-        JSONObject businessShopCatalog = data.getJSONObject("businessShopCatalog");
-        businessShopCatalog.put("catalogId",catalogId);
-    }
-}

+ 0 - 109
ShopService/src/main/java/com/java110/shop/listener/SaveBuyShopAttrListener.java

@@ -1,109 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 处理节点 businessBuyShopAttr
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name = "saveBuyShopAttrListener")
-@Transactional
-public class SaveBuyShopAttrListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveBuyShopAttrListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-
-    @Override
-    public int getOrder() {
-        return 3;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_BUY_SHOP_INFO;
-    }
-
-
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //处理商品属性
-        if(data.containsKey("businessBuyShopAttr")){
-            JSONArray businessBuyShopAttrs = data.getJSONArray("businessBuyShopAttr");
-            doBusinessBuyShopAttr(business,businessBuyShopAttrs);
-        }
-
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        //todo buy 没有business过程,所以这里不做处理
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-
-        //商品属性
-        List<Map> buyShopAttrs = shopServiceDaoImpl.getBuyShopAttrs(info);
-        if(buyShopAttrs != null && buyShopAttrs.size()>0){
-            shopServiceDaoImpl.updateBuyShopAttrInstance(paramIn);
-        }
-        
-    }
-
-
-    /**
-     * 处理商品 属性
-     * @param business 当前业务
-     * @param businessBuyShopAttrs 商品属性
-     */
-    private void doBusinessBuyShopAttr(Business business, JSONArray businessBuyShopAttrs) {
-
-        for(int shopAttrIndex = 0 ; shopAttrIndex < businessBuyShopAttrs.size();shopAttrIndex ++){
-            JSONObject shopAttr = businessBuyShopAttrs.getJSONObject(shopAttrIndex);
-            Assert.jsonObjectHaveKey(shopAttr,"attrId","businessBuyShopAttr 节点下没有包含 attrId 节点");
-            shopAttr.put("bId",business.getbId());
-            //shopAttr.put("operate", StatusConstant.OPERATE_ADD);
-            shopServiceDaoImpl.saveBuyShopAttrInstance(shopAttr);
-        }
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 127
ShopService/src/main/java/com/java110/shop/listener/SaveBuyShopListener.java

@@ -1,127 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 保存 商品信息 侦听
- * 处理 businessShop 节点
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveBuyShopListener")
-@Transactional
-public class SaveBuyShopListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveBuyShopListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 2;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_BUY_SHOP_INFO;
-    }
-
-    /**
-     * 保存商户信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessBuyShop")){
-            JSONObject businessBuyShop = data.getJSONObject("businessBuyShop");
-            doBusinessBuyShop(business,businessBuyShop);
-            dataFlowContext.addParamOut("buyId",businessBuyShop.getString("buyId"));
-        }
-
-    }
-
-    /**
-     * business 数据转移到 instance
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        //todo buy 没有business过程,所以这里不做处理
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //商户信息
-        Map buyShop = shopServiceDaoImpl.getBuyShop(info);
-        if(buyShop != null && !buyShop.isEmpty()){
-            paramIn.put("shopId",buyShop.get("shop_id").toString());
-            shopServiceDaoImpl.updateBuyShopInstance(paramIn);
-            dataFlowContext.addParamOut("buyId",buyShop.get("buy_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessBuyShop 商品节点
-     */
-    private void doBusinessBuyShop(Business business,JSONObject businessBuyShop){
-
-        Assert.jsonObjectHaveKey(businessBuyShop,"buyId","businessBuyShop 节点下没有包含 buyId 节点");
-
-        Assert.jsonObjectHaveKey(businessBuyShop,"shopId","businessBuyShop 节点下没有包含 shopId 节点");
-
-        businessBuyShop.put("bId",business.getbId());
-        //businessBuyShop.put("operate", StatusConstant.OPERATE_ADD);
-
-        //保存商户信息
-        shopServiceDaoImpl.saveBuyShopInstance(businessBuyShop);
-
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 147
ShopService/src/main/java/com/java110/shop/listener/SaveShopAttrAndAttrParamListener.java

@@ -1,147 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 处理节点 businessShopAttr
- * 和 businessShopAttrParam
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name = "saveShopAttrAndAttrParamListener")
-@Transactional
-public class SaveShopAttrAndAttrParamListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopAttrAndAttrParamListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-
-    @Override
-    public int getOrder() {
-        return 2;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //处理商品属性
-        if(data.containsKey("businessShopAttr")){
-            JSONArray businessShopAttrs = data.getJSONArray("businessShopAttr");
-            doBusinessShopAttr(business,businessShopAttrs);
-        }
-        //处理商品属性参数
-        if(data.containsKey("businessShopAttrParam")){
-            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
-            doBusinessShopAttrParams(business,businessShopAttrParams);
-        }
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-        //商品属性
-        List<Map> businessShopAttrs = shopServiceDaoImpl.getBusinessShopAttrs(info);
-        if(businessShopAttrs != null && businessShopAttrs.size() > 0) {
-            shopServiceDaoImpl.saveShopAttrsInstance(info);
-        }
-
-        //商品属性参数
-        List<Map> buinessShopAttrParams = shopServiceDaoImpl.getBusinessShopAttrParams(info);
-        if(buinessShopAttrParams != null && buinessShopAttrParams.size() > 0){
-            shopServiceDaoImpl.saveShopAttrParamsInstance(info);
-        }
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        Map info = new HashMap();
-        info.put("bId",bId);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        //商品属性
-        List<Map> shopAttrs = shopServiceDaoImpl.getShopAttrs(info);
-        if(shopAttrs != null && shopAttrs.size()>0){
-            shopServiceDaoImpl.updateShopAttrInstance(paramIn);
-        }
-
-        //商品属性参数
-        List<Map> shopAttrParams = shopServiceDaoImpl.getShopAttrParams(info);
-        if(shopAttrParams != null && shopAttrParams.size() >0){
-            shopServiceDaoImpl.updateShopAttrParamInstance(info);
-        }
-    }
-
-
-    /**
-     * 处理商品 属性
-     * @param business 当前业务
-     * @param businessShopAttrs 商品属性
-     */
-    private void doBusinessShopAttr(Business business, JSONArray businessShopAttrs) {
-
-        for(int shopAttrIndex = 0 ; shopAttrIndex < businessShopAttrs.size();shopAttrIndex ++){
-            JSONObject shopAttr = businessShopAttrs.getJSONObject(shopAttrIndex);
-            Assert.jsonObjectHaveKey(shopAttr,"attrId","businessShopAttr 节点下没有包含 attrId 节点");
-            shopAttr.put("bId",business.getbId());
-            shopAttr.put("operate", StatusConstant.OPERATE_ADD);
-            shopServiceDaoImpl.saveBusinessShopAttr(shopAttr);
-        }
-    }
-
-    /**
-     * 商品属性参数
-     * @param business 当前业务
-     * @param businessShopAttrParams 商品属性参数
-     */
-    private void doBusinessShopAttrParams(Business business, JSONArray businessShopAttrParams) {
-
-        for(int shopAttrParamIndex = 0 ; shopAttrParamIndex < businessShopAttrParams.size();shopAttrParamIndex ++){
-            JSONObject shopAttrParam = businessShopAttrParams.getJSONObject(shopAttrParamIndex);
-            Assert.jsonObjectHaveKey(shopAttrParam,"attrParamId","businessShopAttr 节点下没有包含 attrParamId 节点");
-            shopAttrParam.put("bId",business.getbId());
-            shopAttrParam.put("operate", StatusConstant.OPERATE_ADD);
-            shopServiceDaoImpl.saveBusinessShopAttrParam(shopAttrParam);
-        }
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 137
ShopService/src/main/java/com/java110/shop/listener/SaveShopCatalogListener.java

@@ -1,137 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 保存 商品信息 侦听
- * 处理 businessShop 节点
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveShopCatalogListener")
-@Transactional
-public class SaveShopCatalogListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopCatalogListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 2;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_CATALOG;
-    }
-
-    /**
-     * 保存商户信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShopCatalog")){
-            JSONObject businessShopCatalog = data.getJSONObject("businessShopCatalog");
-            doBusinessShopCatalog(business,businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.getString("catalogId"));
-        }
-
-    }
-
-    /**
-     * business 数据转移到 instance
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户信息
-        Map businessShopCatalog = shopServiceDaoImpl.getBusinessShopCatalog(info);
-        if( businessShopCatalog != null && !businessShopCatalog.isEmpty()) {
-            shopServiceDaoImpl.saveShopCatalogInstance(info);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.get("catalog_id"));
-        }
-
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //商户信息
-        Map storeCatalog = shopServiceDaoImpl.getShopCatalog(info);
-        if(storeCatalog != null && !storeCatalog.isEmpty()){
-            paramIn.put("storeId",storeCatalog.get("store_id").toString());
-            shopServiceDaoImpl.updateShopCatalogInstance(paramIn);
-            dataFlowContext.addParamOut("catalogId",storeCatalog.get("catalog_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopCatalog 商品节点
-     */
-    private void doBusinessShopCatalog(Business business,JSONObject businessShopCatalog){
-
-        Assert.jsonObjectHaveKey(businessShopCatalog,"storeId","businessShopCatalog 节点下没有包含 storeId 节点");
-
-        businessShopCatalog.put("bId",business.getbId());
-        businessShopCatalog.put("operate", StatusConstant.OPERATE_ADD);
-
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopCatalog(businessShopCatalog);
-
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 137
ShopService/src/main/java/com/java110/shop/listener/SaveShopDescListener.java

@@ -1,137 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 保存 商品信息 侦听
- * 处理 businessShop 节点
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveShopDescListener")
-@Transactional
-public class SaveShopDescListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopDescListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 5;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-    /**
-     * 保存商品信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 shopDescId 节点
-        if(data.containsKey("businessShopDesc")){
-            JSONObject businessShopDesc = data.getJSONObject("businessShopDesc");
-            doBusinessShopDesc(business,businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.getString("shop_desc_Id"));
-        }
-
-    }
-
-    /**
-     * business 数据转移到 instance
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户信息
-        Map businessShopDesc = shopServiceDaoImpl.getBusinessShopDesc(info);
-        if( businessShopDesc != null && !businessShopDesc.isEmpty()) {
-            shopServiceDaoImpl.saveShopDescInstance(info);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.get("shop_desc_id"));
-        }
-
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //商户信息
-        Map storeDesc = shopServiceDaoImpl.getShopDesc(info);
-        if(storeDesc != null && !storeDesc.isEmpty()){
-            paramIn.put("shopId",storeDesc.get("shop_id").toString());
-            shopServiceDaoImpl.updateShopDescInstance(paramIn);
-            dataFlowContext.addParamOut("shopDescId",storeDesc.get("shop_desc_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessShopDesc 节点
-     * @param business 总的数据节点
-     * @param businessShopDesc 商品节点
-     */
-    private void doBusinessShopDesc(Business business, JSONObject businessShopDesc){
-
-        Assert.jsonObjectHaveKey(businessShopDesc,"shopDescId","businessShop 节点下没有包含 shopDescId 节点");
-
-        businessShopDesc.put("bId",business.getbId());
-        businessShopDesc.put("operate", StatusConstant.OPERATE_ADD);
-
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopDesc(businessShopDesc);
-
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 155
ShopService/src/main/java/com/java110/shop/listener/SaveShopInfoListener.java

@@ -1,155 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 保存 商品信息 侦听
- * 处理 businessShop 节点
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveShopInfoListener")
-@Transactional
-public class SaveShopInfoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopInfoListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-    /**
-     * 保存商户信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShop")){
-            JSONObject businessShop = data.getJSONObject("businessShop");
-            doBusinessShop(business,businessShop);
-            dataFlowContext.addParamOut("shopId",businessShop.getString("shopId"));
-        }
-
-    }
-
-    /**
-     * business 数据转移到 instance
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户信息
-        Map businessShopInfo = shopServiceDaoImpl.getBusinessShopInfo(info);
-        if( businessShopInfo != null && !businessShopInfo.isEmpty()) {
-            shopServiceDaoImpl.saveShopInfoInstance(info);
-            dataFlowContext.addParamOut("storeId",businessShopInfo.get("store_id"));
-        }
-
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //商户信息
-        Map storeInfo = shopServiceDaoImpl.getShopInfo(info);
-        if(storeInfo != null && !storeInfo.isEmpty()){
-            paramIn.put("shopId",storeInfo.get("shop_id").toString());
-            shopServiceDaoImpl.updateShopInfoInstance(paramIn);
-            dataFlowContext.addParamOut("storeId",storeInfo.get("store_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShop 商品节点
-     */
-    private void doBusinessShop(Business business,JSONObject businessShop){
-
-        Assert.jsonObjectHaveKey(businessShop,"shopId","businessShop 节点下没有包含 storeId 节点");
-
-        Assert.jsonObjectHaveKey(businessShop,"startDate","businessShop 节点下没有包含 startDate 节点");
-        Assert.jsonObjectHaveKey(businessShop,"endDate","businessShop 节点下没有包含 endDate 节点");
-
-        businessShop.put("bId",business.getbId());
-        businessShop.put("operate", StatusConstant.OPERATE_ADD);
-        //对日期处理
-        Date startDate = null;
-        Date entDate = null;
-        try {
-            startDate = DateUtil.getDateFromString(businessShop.getString("startDate"), DateUtil.DATE_FORMATE_STRING_A);
-            entDate = DateUtil.getDateFromString(businessShop.getString("endDate"), DateUtil.DATE_FORMATE_STRING_A);
-            businessShop.put("startDate",startDate);
-            businessShop.put("endDate",entDate);
-        } catch (Exception e) {
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 startDate endDate 格式不正确,请填写 "
-                    +DateUtil.DATE_FORMATE_STRING_A +" 格式,"+businessShop);
-        }
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopInfo(businessShop);
-
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 113
ShopService/src/main/java/com/java110/shop/listener/SaveShopPhotoListener.java

@@ -1,113 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 处理节点 businessShopPhoto
- * Created by wuxw on 2018/7/7.
- */
-@Java110Listener(name = "saveShopPhotoListener")
-@Transactional
-public class SaveShopPhotoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopPhotoListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-
-    @Override
-    public int getOrder() {
-        return 3;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-
-
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-        //处理商品属性
-        if(data.containsKey("businessShopPhoto")){
-            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
-            doBusinessShopPhoto(business,businessShopPhotos);
-        }
-    }
-
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-        //商品属性
-        List<Map> businessShopPhotos = shopServiceDaoImpl.getBusinessShopPhoto(info);
-        if(businessShopPhotos != null && businessShopPhotos.size() > 0) {
-            shopServiceDaoImpl.saveShopPhotoInstance(info);
-        }
-    }
-
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        Map info = new HashMap();
-        info.put("bId",bId);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        //商品属性
-        List<Map> shopPhotos = shopServiceDaoImpl.getShopPhoto(info);
-        if(shopPhotos != null && shopPhotos.size()>0){
-            shopServiceDaoImpl.updateShopPhotoInstance(paramIn);
-        }
-    }
-
-
-    /**
-     * 处理商品 属性
-     * @param business 当前业务
-     * @param businessShopPhotos 商品照片
-     */
-    private void doBusinessShopPhoto(Business business, JSONArray businessShopPhotos) {
-
-        for(int shopPhotoIndex = 0 ; shopPhotoIndex < businessShopPhotos.size();shopPhotoIndex ++){
-            JSONObject shopPhoto = businessShopPhotos.getJSONObject(shopPhotoIndex);
-            Assert.jsonObjectHaveKey(shopPhoto,"shopPhotoId","businessShopPhoto 节点下没有包含 shopPhotoId 节点");
-            shopPhoto.put("bId",business.getbId());
-            shopPhoto.put("operate", StatusConstant.OPERATE_ADD);
-            shopServiceDaoImpl.saveBusinessShopPhoto(shopPhoto);
-        }
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 154
ShopService/src/main/java/com/java110/shop/listener/SaveShopPreferentialListener.java

@@ -1,154 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 保存 商品信息 侦听
- * 处理 businessShop 节点
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveShopPreferentialListener")
-@Transactional
-public class SaveShopPreferentialListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveShopPreferentialListener.class);
-
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 4;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_SHOP_INFO;
-    }
-
-    /**
-     * 保存商品信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShopPreferential 节点
-        if(data.containsKey("businessShopPreferential")){
-            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
-            doBusinessShopPreferential(business,businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.getString("shopPreferentialId"));
-        }
-
-    }
-
-    /**
-     * business 数据转移到 instance
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户信息
-        Map businessShopPreferential = shopServiceDaoImpl.getBusinessShopPreferential(info);
-        if( businessShopPreferential != null && !businessShopPreferential.isEmpty()) {
-            shopServiceDaoImpl.saveShopPreferentialInstance(info);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.get("shop_preferential_id"));
-        }
-
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map paramIn = new HashMap();
-        paramIn.put("bId",bId);
-        paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //商户信息
-        Map storePreferential = shopServiceDaoImpl.getShopPreferential(info);
-        if(storePreferential != null && !storePreferential.isEmpty()){
-            paramIn.put("shopId",storePreferential.get("shop_id").toString());
-            shopServiceDaoImpl.updateShopPreferentialInstance(paramIn);
-            dataFlowContext.addParamOut("shopPreferentialId",storePreferential.get("shop_preferential_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessShopPreferential 节点
-     * @param business 总的数据节点
-     * @param businessShopPreferential 商品节点
-     */
-    private void doBusinessShopPreferential(Business business, JSONObject businessShopPreferential){
-
-        Assert.jsonObjectHaveKey(businessShopPreferential,"shopPreferentialId","businessShop 节点下没有包含 shopPreferentialId 节点");
-        Assert.jsonObjectHaveKey(businessShopPreferential,"preferentialStartDate","businessShop 节点下没有包含 preferentialStartDate 节点");
-        Assert.jsonObjectHaveKey(businessShopPreferential,"preferentialEndDate","businessShop 节点下没有包含 preferentialEndDate 节点");
-
-        businessShopPreferential.put("bId",business.getbId());
-        businessShopPreferential.put("operate", StatusConstant.OPERATE_ADD);
-        //对日期处理
-        Date preferentialStartDate = null;
-        Date preferentialEndDate = null;
-        try {
-            preferentialStartDate = DateUtil.getDateFromString(businessShopPreferential.getString("preferentialStartDate"), DateUtil.DATE_FORMATE_STRING_A);
-            preferentialEndDate = DateUtil.getDateFromString(businessShopPreferential.getString("preferentialEndDate"), DateUtil.DATE_FORMATE_STRING_A);
-            businessShopPreferential.put("preferentialStartDate",preferentialStartDate);
-            businessShopPreferential.put("preferentialEndDate",preferentialEndDate);
-        } catch (Exception e) {
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 preferentialStartDate preferentialEndDate 格式不正确,请填写 "
-                    +DateUtil.DATE_FORMATE_STRING_A +" 格式,"+businessShopPreferential);
-        }
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopPreferential(businessShopPreferential);
-
-    }
-
-
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 221
ShopService/src/main/java/com/java110/shop/listener/UpdateShopAttrAndAttrParamListener.java

@@ -1,221 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 修改商户信息 侦听
- *
- * 处理节点
- * 1、businessShopAttr:{} 商品属性信息节点
- * 2、businessShopAttrParam:{} 商品属性参数节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopAttrAndAttrParamListener")
-@Transactional
-public class UpdateShopAttrAndAttrParamListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopAttrAndAttrParamListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 2;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_INFO;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShopAttr")){
-            JSONArray businessShopAttrs = data.getJSONArray("businessShopAttr");
-            doBusinessShopAttr(business,businessShopAttrs);
-        }
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShopAttrParam")){
-            JSONArray businessShopAttrParams = data.getJSONArray("businessShopAttrParam");
-            doBusinessShopAttrParam(business,businessShopAttrParams);
-        }
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户属性信息
-        List<Map> businessShopAttrs = shopServiceDaoImpl.getBusinessShopAttrs(info);
-        if(businessShopAttrs != null && businessShopAttrs.size() > 0) {
-            for(Map businessShopAttr : businessShopAttrs) {
-                flushBusinessShopAttr(businessShopAttr,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrInstance(businessShopAttr);
-            }
-        }
-
-        //商户属性参数信息
-        List<Map> businessShopAttrParams = shopServiceDaoImpl.getBusinessShopAttrParams(info);
-        if(businessShopAttrParams != null && businessShopAttrParams.size() > 0) {
-            for(Map businessShopAttrParam : businessShopAttrParams) {
-                flushBusinessShopAttrParam(businessShopAttrParam,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrParamInstance(businessShopAttrParam);
-            }
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        List<Map> shopAttrs = shopServiceDaoImpl.getShopAttrs(info);
-        if(shopAttrs != null && shopAttrs.size()>0){
-
-            List<Map> businessShopAttrs = shopServiceDaoImpl.getBusinessShopAttrs(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopAttrs == null || businessShopAttrs.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_attr),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopAttr : businessShopAttrs) {
-                flushBusinessShopAttr(businessShopAttr,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrInstance(businessShopAttr);
-            }
-        }
-
-        //商户属性参数信息
-        List<Map> shopAttrParams = shopServiceDaoImpl.getShopAttrParams(info);
-        if(shopAttrParams != null && shopAttrParams.size()>0){
-
-            List<Map> businessShopAttrParams = shopServiceDaoImpl.getBusinessShopAttrParams(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopAttrParams == null || businessShopAttrParams.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_attr_param),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopAttrParam : businessShopAttrParams) {
-                flushBusinessShopAttrParam(businessShopAttrParam,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopAttrParamInstance(businessShopAttrParam);
-            }
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShopAttr 节点
-     * @param business 总的数据节点
-     * @param businessShopAttrs 商品属性节点
-     */
-    private void doBusinessShopAttr(Business business,JSONArray businessShopAttrs){
-        JSONObject data = business.getDatas();
-
-
-        for(int shopAttrIndex = 0 ; shopAttrIndex < businessShopAttrs.size();shopAttrIndex ++){
-            JSONObject shopAttr = businessShopAttrs.getJSONObject(shopAttrIndex);
-            Assert.jsonObjectHaveKey(shopAttr,"attrId","businessShopAttr 节点下没有包含 attrId 节点");
-            if(shopAttr.getString("attrId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrId 错误,不能自动生成(必须已经存在的attrId)"+shopAttr);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessShopAttr(business,shopAttr);
-
-            shopAttr.put("bId",business.getbId());
-            shopAttr.put("shopId",shopAttr.getString("shopId"));
-            shopAttr.put("operate", StatusConstant.OPERATE_ADD);
-
-            shopServiceDaoImpl.saveBusinessShopAttr(shopAttr);
-        }
-
-    }
-
-    /**
-     * 处理 businessShopAttrParam 节点
-     * @param business 总的数据节点
-     * @param businessShopAttrParams 商品属性参数节点
-     */
-    private void doBusinessShopAttrParam(Business business,JSONArray businessShopAttrParams){
-        JSONObject data = business.getDatas();
-
-
-        for(int shopAttrParamIndex = 0 ; shopAttrParamIndex < businessShopAttrParams.size();shopAttrParamIndex ++){
-            JSONObject shopAttrParam = businessShopAttrParams.getJSONObject(shopAttrParamIndex);
-            Assert.jsonObjectHaveKey(shopAttrParam,"attrParamId","businessShopAttr 节点下没有包含 attrParamId 节点");
-            if(shopAttrParam.getString("attrParamId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"attrParamId 错误,不能自动生成(必须已经存在的attrId)"+shopAttrParam);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessShopAttrParam(business,shopAttrParam);
-
-            shopAttrParam.put("bId",business.getbId());
-            shopAttrParam.put("shopId",shopAttrParam.getString("shopId"));
-            shopAttrParam.put("operate", StatusConstant.OPERATE_ADD);
-
-            shopServiceDaoImpl.saveBusinessShopAttrParam(shopAttrParam);
-        }
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 156
ShopService/src/main/java/com/java110/shop/listener/UpdateShopCatalogListener.java

@@ -1,156 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 修改商品目录 侦听
- *
- * 处理节点
- * 1、businessShopCatalog:{} 商品优惠信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopCatalogListener")
-@Transactional
-public class UpdateShopCatalogListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopCatalogListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_CATALOG;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShopCatalog 节点
-        if(data.containsKey("businessShopCatalog")){
-            JSONObject businessShopCatalog = data.getJSONObject("businessShopCatalog");
-            doBusinessShopCatalog(business,businessShopCatalog);
-        }
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户优惠信息
-        Map businessShopCatalog = shopServiceDaoImpl.getBusinessShopCatalog(info);
-        if( businessShopCatalog != null && !businessShopCatalog.isEmpty()) {
-            flushBusinessShopCatalog(businessShopCatalog,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopCatalogInstance(businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.get("catalog_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopCatalog = shopServiceDaoImpl.getShopCatalog(info);
-        if(shopCatalog != null && !shopCatalog.isEmpty()){
-
-            //商户信息
-            Map businessShopCatalog = shopServiceDaoImpl.getBusinessShopCatalog(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopCatalog == null || businessShopCatalog.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_catalog),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopCatalog(businessShopCatalog,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopCatalogInstance(businessShopCatalog);
-            dataFlowContext.addParamOut("catalogId",businessShopCatalog.get("catalog_id"));
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShopCatalog 节点
-     * @param business 总的数据节点
-     * @param businessShopCatalog 商户节点
-     */
-    private void doBusinessShopCatalog(Business business,JSONObject businessShopCatalog){
-
-        Assert.jsonObjectHaveKey(businessShopCatalog,"catalogId","businessShop 节点下没有包含 catalogId 节点");
-
-        if(businessShopCatalog.getString("catalogId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"catalogId 错误,不能自动生成(必须已经存在的catalogId)"+businessShopCatalog);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessShopCatalog(business,businessShopCatalog);
-
-        businessShopCatalog.put("bId",business.getbId());
-        businessShopCatalog.put("operate", StatusConstant.OPERATE_ADD);
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopCatalog(businessShopCatalog);
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 156
ShopService/src/main/java/com/java110/shop/listener/UpdateShopDescListener.java

@@ -1,156 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 修改商户信息 侦听
- *
- * 处理节点
- * 1、businessShopDesc:{} 商品优惠信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopDescListener")
-@Transactional
-public class UpdateShopDescListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopDescListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 5;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_INFO;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShopDesc 节点
-        if(data.containsKey("businessShopDesc")){
-            JSONObject businessShopDesc = data.getJSONObject("businessShopDesc");
-            doBusinessShopDesc(business,businessShopDesc);
-        }
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户优惠信息
-        Map businessShopDesc = shopServiceDaoImpl.getBusinessShopDesc(info);
-        if( businessShopDesc != null && !businessShopDesc.isEmpty()) {
-            flushBusinessShopDesc(businessShopDesc,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopDescInstance(businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.get("shop_desc_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopDesc = shopServiceDaoImpl.getShopDesc(info);
-        if(shopDesc != null && !shopDesc.isEmpty()){
-
-            //商户信息
-            Map businessShopDesc = shopServiceDaoImpl.getBusinessShopDesc(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopDesc == null || businessShopDesc.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_desc),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopDesc(businessShopDesc,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopDescInstance(businessShopDesc);
-            dataFlowContext.addParamOut("shopDescId",businessShopDesc.get("shop_desc_id"));
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopDesc 商户节点
-     */
-    private void doBusinessShopDesc(Business business,JSONObject businessShopDesc){
-
-        Assert.jsonObjectHaveKey(businessShopDesc,"shopDescId","businessShop 节点下没有包含 shopDescId 节点");
-
-        if(businessShopDesc.getString("shopDescId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopDescId 错误,不能自动生成(必须已经存在的shopDescId)"+businessShopDesc);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessShopDesc(business,businessShopDesc);
-
-        businessShopDesc.put("bId",business.getbId());
-        businessShopDesc.put("operate", StatusConstant.OPERATE_ADD);
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopDesc(businessShopDesc);
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 157
ShopService/src/main/java/com/java110/shop/listener/UpdateShopInfoListener.java

@@ -1,157 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 修改商户信息 侦听
- *
- * 处理节点
- * 1、businessShop:{} 商品基本信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopInfoListener")
-@Transactional
-public class UpdateShopInfoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopInfoListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 1;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_INFO;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShop")){
-            JSONObject businessShop = data.getJSONObject("businessShop");
-            doBusinessShop(business,businessShop);
-            dataFlowContext.addParamOut("shopId",businessShop.getString("shopId"));
-        }
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户信息
-        Map businessShopInfo = shopServiceDaoImpl.getBusinessShopInfo(info);
-        if( businessShopInfo != null && !businessShopInfo.isEmpty()) {
-            flushBusinessShopInfo(businessShopInfo,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopInfoInstance(businessShopInfo);
-            dataFlowContext.addParamOut("shopId",businessShopInfo.get("shop_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopInfo = shopServiceDaoImpl.getShopInfo(info);
-        if(shopInfo != null && !shopInfo.isEmpty()){
-
-            //商户信息
-            Map businessShopInfo = shopServiceDaoImpl.getBusinessShopInfo(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopInfo == null || businessShopInfo.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopInfo(businessShopInfo,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopInfoInstance(businessShopInfo);
-            dataFlowContext.addParamOut("shopId",shopInfo.get("shop_id"));
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShop 商户节点
-     */
-    private void doBusinessShop(Business business,JSONObject businessShop){
-
-        Assert.jsonObjectHaveKey(businessShop,"shopId","businessShop 节点下没有包含 shopId 节点");
-
-        if(businessShop.getString("shopId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopId 错误,不能自动生成(必须已经存在的shopId)"+businessShop);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessShop(business,businessShop);
-
-        businessShop.put("bId",business.getbId());
-        businessShop.put("operate", StatusConstant.OPERATE_ADD);
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopInfo(businessShop);
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 164
ShopService/src/main/java/com/java110/shop/listener/UpdateShopPhotoListener.java

@@ -1,164 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 修改商户信息 侦听
- *
- * 处理节点
- * 1、businessShopPhoto:{} 商品照片信息
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopPhotoListener")
-@Transactional
-public class UpdateShopPhotoListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopPhotoListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 3;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_INFO;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShop 节点
-        if(data.containsKey("businessShopPhoto")){
-            JSONArray businessShopPhotos = data.getJSONArray("businessShopPhoto");
-            doBusinessShopPhoto(business,businessShopPhotos);
-        }
-
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户属性信息
-        List<Map> businessShopPhotos = shopServiceDaoImpl.getBusinessShopPhoto(info);
-        if(businessShopPhotos != null && businessShopPhotos.size() > 0) {
-            for(Map businessShopPhoto : businessShopPhotos) {
-                flushBusinessShopPhoto(businessShopPhoto,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopPhotoInstance(businessShopPhoto);
-            }
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        List<Map> shopPhotos = shopServiceDaoImpl.getShopPhoto(info);
-        if(shopPhotos != null && shopPhotos.size()>0){
-
-            List<Map> businessShopPhotos = shopServiceDaoImpl.getBusinessShopPhoto(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopPhotos == null || businessShopPhotos.size() ==0 ){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop_photo),程序内部异常,请检查! "+delInfo);
-            }
-            for(Map businessShopPhoto : businessShopPhotos) {
-                flushBusinessShopPhoto(businessShopPhoto,StatusConstant.STATUS_CD_VALID);
-                shopServiceDaoImpl.updateShopPhotoInstance(businessShopPhoto);
-            }
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShopPhoto 节点
-     * @param business 总的数据节点
-     * @param businessShopPhotos 商品属性节点
-     */
-    private void doBusinessShopPhoto(Business business,JSONArray businessShopPhotos){
-        JSONObject data = business.getDatas();
-
-
-        for(int shopPhotoIndex = 0 ; shopPhotoIndex < businessShopPhotos.size();shopPhotoIndex ++){
-            JSONObject shopPhoto = businessShopPhotos.getJSONObject(shopPhotoIndex);
-            Assert.jsonObjectHaveKey(shopPhoto,"shopPhotoId","businessShopPhoto 节点下没有包含 shopPhotoId 节点");
-            if(shopPhoto.getString("shopPhotoId").startsWith("-")){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopPhotoId 错误,不能自动生成(必须已经存在的shopPhotoId)"+shopPhoto);
-            }
-            //自动保存DEL数据
-            autoSaveDelBusinessShopPhoto(business,shopPhoto);
-
-            shopPhoto.put("bId",business.getbId());
-            shopPhoto.put("shopId",shopPhoto.getString("shopId"));
-            shopPhoto.put("operate", StatusConstant.OPERATE_ADD);
-
-            shopServiceDaoImpl.saveBusinessShopPhoto(shopPhoto);
-        }
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 156
ShopService/src/main/java/com/java110/shop/listener/UpdateShopPreferentialListener.java

@@ -1,156 +0,0 @@
-package com.java110.shop.listener;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.constant.StatusConstant;
-import com.java110.utils.exception.ListenerExecuteException;
-import com.java110.utils.util.Assert;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.entity.center.Business;
-import com.java110.shop.dao.IShopServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 修改商户信息 侦听
- *
- * 处理节点
- * 1、businessShopPreferential:{} 商品优惠信息节点
- * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E5%93%81%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("updateShopPreferentialListener")
-@Transactional
-public class UpdateShopPreferentialListener extends AbstractShopBusinessServiceDataFlowListener {
-
-    private final static Logger logger = LoggerFactory.getLogger(UpdateShopPreferentialListener.class);
-    @Autowired
-    IShopServiceDao shopServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 4;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_SHOP_INFO;
-    }
-
-    /**
-     * business过程
-     * @param dataFlowContext
-     * @param business
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-
-        JSONObject data = business.getDatas();
-
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessShopPreferential 节点
-        if(data.containsKey("businessShopPreferential")){
-            JSONObject businessShopPreferential = data.getJSONObject("businessShopPreferential");
-            doBusinessShopPreferential(business,businessShopPreferential);
-        }
-    }
-
-
-    /**
-     * business to instance 过程
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
-
-        //JSONObject data = business.getDatas();
-
-        Map info = new HashMap();
-        info.put("bId",business.getbId());
-        info.put("operate",StatusConstant.OPERATE_ADD);
-
-        //商户优惠信息
-        Map businessShopPreferential = shopServiceDaoImpl.getBusinessShopPreferential(info);
-        if( businessShopPreferential != null && !businessShopPreferential.isEmpty()) {
-            flushBusinessShopPreferential(businessShopPreferential,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopPreferentialInstance(businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.get("shop_preferential_id"));
-        }
-    }
-
-    /**
-     * 撤单
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
-
-        String bId = business.getbId();
-        //Assert.hasLength(bId,"请求报文中没有包含 bId");
-        Map info = new HashMap();
-        info.put("bId",bId);
-        info.put("statusCd",StatusConstant.STATUS_CD_VALID);
-        Map delInfo = new HashMap();
-        delInfo.put("bId",business.getbId());
-        delInfo.put("operate",StatusConstant.OPERATE_DEL);
-        //商户信息
-        Map shopPreferential = shopServiceDaoImpl.getShopPreferential(info);
-        if(shopPreferential != null && !shopPreferential.isEmpty()){
-
-            //商户信息
-            Map businessShopPreferential = shopServiceDaoImpl.getBusinessShopPreferential(delInfo);
-            //除非程序出错了,这里不会为空
-            if(businessShopPreferential == null || businessShopPreferential.isEmpty()){
-                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR,"撤单失败(shop),程序内部异常,请检查! "+delInfo);
-            }
-
-            flushBusinessShopPreferential(businessShopPreferential,StatusConstant.STATUS_CD_VALID);
-            shopServiceDaoImpl.updateShopPreferentialInstance(businessShopPreferential);
-            dataFlowContext.addParamOut("shopPreferentialId",businessShopPreferential.get("shop_preferential_id"));
-        }
-
-    }
-
-
-
-    /**
-     * 处理 businessShop 节点
-     * @param business 总的数据节点
-     * @param businessShopPreferential 商户节点
-     */
-    private void doBusinessShopPreferential(Business business,JSONObject businessShopPreferential){
-
-        Assert.jsonObjectHaveKey(businessShopPreferential,"shopPreferentialId","businessShop 节点下没有包含 shopPreferentialId 节点");
-
-        if(businessShopPreferential.getString("shopPreferentialId").startsWith("-")){
-            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"shopPreferentialId 错误,不能自动生成(必须已经存在的shopPreferentialId)"+businessShopPreferential);
-        }
-        //自动保存DEL
-        autoSaveDelBusinessShopPreferential(business,businessShopPreferential);
-
-        businessShopPreferential.put("bId",business.getbId());
-        businessShopPreferential.put("operate", StatusConstant.OPERATE_ADD);
-        //保存商户信息
-        shopServiceDaoImpl.saveBusinessShopPreferential(businessShopPreferential);
-
-    }
-
-    @Override
-    public IShopServiceDao getShopServiceDaoImpl() {
-        return shopServiceDaoImpl;
-    }
-
-    public void setShopServiceDaoImpl(IShopServiceDao shopServiceDaoImpl) {
-        this.shopServiceDaoImpl = shopServiceDaoImpl;
-    }
-}

+ 0 - 17
ShopService/src/main/java/com/java110/shop/smo/IShopServiceSMO.java

@@ -1,17 +0,0 @@
-package com.java110.shop.smo;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.exception.SMOException;
-import com.java110.core.context.BusinessServiceDataFlow;
-
-/**
- *
- * 用户信息管理,服务
- * Created by wuxw on 2017/4/5.
- */
-public interface IShopServiceSMO {
-
-
-    public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException;
-
-}

+ 0 - 110
ShopService/src/main/java/com/java110/shop/smo/impl/ShopServiceSMOImpl.java

@@ -1,110 +0,0 @@
-package com.java110.shop.smo.impl;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.utils.cache.MappingCache;
-import com.java110.utils.constant.KafkaConstant;
-import com.java110.utils.constant.MappingConstant;
-import com.java110.utils.constant.ResponseConstant;
-import com.java110.utils.exception.SMOException;
-import com.java110.utils.kafka.KafkaFactory;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.DateUtil;
-import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.core.context.BusinessServiceDataFlow;
-import com.java110.core.factory.DataFlowFactory;
-import com.java110.entity.center.DataFlowLinksCost;
-import com.java110.entity.center.DataFlowLog;
-import com.java110.event.service.BusinessServiceDataFlowEventPublishing;
-import com.java110.shop.smo.IShopServiceSMO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.util.Date;
-import java.util.List;
-
-/**
- * 用户服务信息管理业务信息实现
- * Created by wuxw on 2017/4/5.
- */
-@Service("shopServiceSMOImpl")
-@Transactional
-public class ShopServiceSMOImpl extends BaseServiceSMO implements IShopServiceSMO {
-
-    private final static Logger logger = LoggerFactory.getLogger(ShopServiceSMOImpl.class);
-
-        @Override
-        public JSONObject service(BusinessServiceDataFlow businessServiceDataFlow) throws SMOException {
-            try {
-                Assert.hasLength(businessServiceDataFlow.getbId(),"bId 不能为空");
-
-                BusinessServiceDataFlowEventPublishing.multicastEvent(businessServiceDataFlow);
-                Assert.notEmpty(businessServiceDataFlow.getResJson(),"商品服务["+businessServiceDataFlow.getCurrentBusiness().getServiceCode()+"]没有返回内容");
-            } catch (Exception e) {
-                logger.error("商品信息处理异常",e);
-                throw new SMOException(ResponseConstant.RESULT_PARAM_ERROR,"商品信息处理异常"+e.getMessage());
-            }finally {
-                if(businessServiceDataFlow == null){
-                    return null;
-                }
-
-                //这里记录日志
-                Date endDate = DateUtil.getCurrentDate();
-
-                businessServiceDataFlow.setEndDate(endDate);
-                //添加耗时
-                DataFlowFactory.addCostTime(businessServiceDataFlow, "service", "业务处理总耗时",
-                        businessServiceDataFlow.getStartDate(), businessServiceDataFlow.getEndDate());
-                //保存耗时
-                saveCostTimeLogMessage(businessServiceDataFlow);
-                //保存日志
-                saveLogMessage(businessServiceDataFlow);
-            }
-            return businessServiceDataFlow.getResJson();
-    }
-
-    /**
-     * 保存日志信息
-     * @param businessServiceDataFlow
-     */
-    private void saveLogMessage(BusinessServiceDataFlow businessServiceDataFlow){
-
-        try{
-            if(MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_LOG_ON_OFF))){
-                for(DataFlowLog dataFlowLog :businessServiceDataFlow.getLogDatas()) {
-                    KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_LOG_NAME, "", JSONObject.toJSONString(dataFlowLog));
-                }
-            }
-        }catch (Exception e){
-            logger.error("报错日志出错了,",e);
-        }
-    }
-
-    /**
-     * 保存耗时信息
-     * @param businessServiceDataFlow
-     */
-    private void saveCostTimeLogMessage(BusinessServiceDataFlow businessServiceDataFlow){
-        try{
-            if(MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_COST_TIME_ON_OFF))){
-                List<DataFlowLinksCost> dataFlowLinksCosts = businessServiceDataFlow.getLinksCostDates();
-                JSONObject costDate = new JSONObject();
-                JSONArray costDates = new JSONArray();
-                JSONObject newObj = null;
-                for(DataFlowLinksCost dataFlowLinksCost : dataFlowLinksCosts){
-                    newObj = JSONObject.parseObject(JSONObject.toJSONString(dataFlowLinksCost));
-                    newObj.put("dataFlowId",businessServiceDataFlow.getDataFlowId());
-                    newObj.put("transactionId",businessServiceDataFlow.getTransactionId());
-                    costDates.add(newObj);
-                }
-                costDate.put("costDates",costDates);
-
-                KafkaFactory.sendKafkaMessage(KafkaConstant.TOPIC_COST_TIME_LOG_NAME,"",costDate.toJSONString());
-            }
-        }catch (Exception e){
-            logger.error("报错日志出错了,",e);
-        }
-    }
-}

+ 0 - 96
ShopService/src/main/resources/application-dev.yml

@@ -1,96 +0,0 @@
-jedis:
-  pool:
-    config:
-      maxTotal: 100
-      maxIdle: 20
-      maxWaitMillis: 20000
-    host: dev.redis.java110.com
-    port: 6379
-    timeout: 3000
-    password:
-
-eureka:
-  instance:
-    leaseRenewalIntervalInSeconds: 10
-    leaseExpirationDurationInSeconds: 30
-    preferIpAddress: true
-    instanceId: ${spring.cloud.client.ip-address}:${server.port}
-  client:
-    serviceUrl:
-      defaultZone: http://dev.java110.com:8761/eureka/
-      #defaultZone: http://localhost:8761/eureka/
-server:
-  port: 8007
-  tomcat:
-    uri-encoding: UTF-8
-
-spring:
-  http:
-    encoding:
-      charset: UTF-8
-      enabled: true
-      force: true
-  application:
-    name: shop-service
-  redis:
-    database: 0
-    host: dev.redis.java110.com
-    port: 6379
-    pool:
-      max-active: 300
-      max-wait: 10000
-      max-idle: 100
-      min-idle: 0
-      timeout: 0
-  datasource:
-    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-    minIdle: 5
-    validationQuery: SELECT 1 FROM DUAL
-    initialSize: 5
-    maxWait: 60000
-    filters: stat,wall,log4j
-    poolPreparedStatements: true
-    type: com.alibaba.druid.pool.DruidDataSource
-    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-    maxPoolPreparedStatementPerConnectionSize: 20
-    password: TT@12345678
-    testOnBorrow: false
-    testWhileIdle: true
-    minEvictableIdleTimeMillis: 300000
-    timeBetweenEvictionRunsMillis: 60000
-    testOnReturn: false
-    driverClassName: com.mysql.jdbc.Driver
-    maxActive: 20
-    username: TT
-
-#============== kafka ===================
-kafka:
-  consumer:
-    zookeeper:
-      connect: dev.zk.java110.com:2181
-    servers: dev.kafka.java110.com:9092
-    enable:
-      auto:
-        commit: true
-    session:
-      timeout: 6000
-    auto:
-      commit:
-        interval: 100
-      offset:
-        reset: latest
-    topic: test
-    group:
-      id: shopBusinessStatus
-    concurrency: 10
-
-  producer:
-    zookeeper:
-      connect: dev.zk.java110.com:2181
-    servers: dev.kafka.java110.com:9092
-    retries: 0
-    batch:
-      size: 4096
-    linger: 1
-    buffer:
-      memory: 40960

+ 0 - 96
ShopService/src/main/resources/application-prod.yml

@@ -1,96 +0,0 @@
-jedis:
-  pool:
-    config:
-      maxTotal: 100
-      maxIdle: 20
-      maxWaitMillis: 20000
-    host: prod.redis.java110.com
-    port: 6379
-    timeout: 3000
-    password:
-
-eureka:
-  instance:
-    leaseRenewalIntervalInSeconds: 10
-    leaseExpirationDurationInSeconds: 30
-    preferIpAddress: true
-    instanceId: ${spring.cloud.client.ip-address}:${server.port}
-  client:
-    serviceUrl:
-      defaultZone: http://prod.java110.com:8761/eureka/
-      #defaultZone: http://localhost:8761/eureka/
-server:
-  port: 8007
-  tomcat:
-    uri-encoding: UTF-8
-
-spring:
-  http:
-    encoding:
-      charset: UTF-8
-      enabled: true
-      force: true
-  application:
-    name: shop-service
-  redis:
-    database: 0
-    host: prod.redis.java110.com
-    port: 6379
-    pool:
-      max-active: 300
-      max-wait: 10000
-      max-idle: 100
-      min-idle: 0
-      timeout: 0
-  datasource:
-    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-    minIdle: 5
-    validationQuery: SELECT 1 FROM DUAL
-    initialSize: 5
-    maxWait: 60000
-    filters: stat,wall,log4j
-    poolPreparedStatements: true
-    type: com.alibaba.druid.pool.DruidDataSource
-    url: jdbc:mysql://prod.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-    maxPoolPreparedStatementPerConnectionSize: 20
-    password: TT@12345678
-    testOnBorrow: false
-    testWhileIdle: true
-    minEvictableIdleTimeMillis: 300000
-    timeBetweenEvictionRunsMillis: 60000
-    testOnReturn: false
-    driverClassName: com.mysql.jdbc.Driver
-    maxActive: 20
-    username: TT
-
-#============== kafka ===================
-kafka:
-  consumer:
-    zookeeper:
-      connect: prod.zk.java110.com:2181
-    servers: prod.kafka.java110.com:9092
-    enable:
-      auto:
-        commit: true
-    session:
-      timeout: 6000
-    auto:
-      commit:
-        interval: 100
-      offset:
-        reset: latest
-    topic: test
-    group:
-      id: shopBusinessStatus
-    concurrency: 10
-
-  producer:
-    zookeeper:
-      connect: prod.zk.java110.com:2181
-    servers: prod.kafka.java110.com:9092
-    retries: 0
-    batch:
-      size: 4096
-    linger: 1
-    buffer:
-      memory: 40960

+ 0 - 97
ShopService/src/main/resources/application-test.yml

@@ -1,97 +0,0 @@
-jedis:
-  pool:
-    config:
-      maxTotal: 100
-      maxIdle: 20
-      maxWaitMillis: 20000
-    host: test.redis.java110.com
-    port: 6379
-    timeout: 3000
-    password: hc
-
-eureka:
-  instance:
-    leaseRenewalIntervalInSeconds: 10
-    leaseExpirationDurationInSeconds: 30
-    preferIpAddress: true
-    instanceId: ${spring.cloud.client.ip-address}:${server.port}
-  client:
-    serviceUrl:
-      defaultZone: http://test.java110.com:8761/eureka/
-      #defaultZone: http://localhost:8761/eureka/
-server:
-  port: 8007
-  tomcat:
-    uri-encoding: UTF-8
-
-spring:
-  http:
-    encoding:
-      charset: UTF-8
-      enabled: true
-      force: true
-  application:
-    name: shop-service
-  redis:
-    database: 0
-    host: test.redis.java110.com
-    port: 6379
-    password: hc
-    pool:
-      max-active: 300
-      max-wait: 10000
-      max-idle: 100
-      min-idle: 0
-      timeout: 0
-  datasource:
-    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
-    minIdle: 5
-    validationQuery: SELECT 1 FROM DUAL
-    initialSize: 5
-    maxWait: 60000
-    filters: stat,wall,log4j
-    poolPreparedStatements: true
-    type: com.alibaba.druid.pool.DruidDataSource
-    url: jdbc:mysql://test.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-    maxPoolPreparedStatementPerConnectionSize: 20
-    password: TT@12345678
-    testOnBorrow: false
-    testWhileIdle: true
-    minEvictableIdleTimeMillis: 300000
-    timeBetweenEvictionRunsMillis: 60000
-    testOnReturn: false
-    driverClassName: com.mysql.jdbc.Driver
-    maxActive: 20
-    username: TT
-
-#============== kafka ===================
-kafka:
-  consumer:
-    zookeeper:
-      connect: test.zk.java110.com:2181
-    servers: test.kafka.java110.com:9092
-    enable:
-      auto:
-        commit: true
-    session:
-      timeout: 6000
-    auto:
-      commit:
-        interval: 100
-      offset:
-        reset: latest
-    topic: test
-    group:
-      id: shopBusinessStatus
-    concurrency: 10
-
-  producer:
-    zookeeper:
-      connect: test.zk.java110.com:2181
-    servers: test.kafka.java110.com:9092
-    retries: 0
-    batch:
-      size: 4096
-    linger: 1
-    buffer:
-      memory: 40960

+ 0 - 3
ShopService/src/main/resources/application.yml

@@ -1,3 +0,0 @@
-spring:
-  profiles:
-    active: dev

+ 0 - 9
ShopService/src/main/resources/banner.txt

@@ -1,9 +0,0 @@
-${AnsiColor.BRIGHT_RED}
-       _                           ___   ___   ____           _____    __                            _____                         _
-      (_)  ____ _ _   __  ____ _  <  /  <  /  / __ \         / ___/   / /_   ____     ____          / ___/  ___    _____ _   __   (_)  _____  ___
-     / /  / __ `/| | / / / __ `/  / /   / /  / / / /         \__ \   / __ \ / __ \   / __ \         \__ \  / _ \  / ___/| | / /  / /  / ___/ / _ \
-    / /  / /_/ / | |/ / / /_/ /  / /   / /  / /_/ /         ___/ /  / / / // /_/ /  / /_/ /        ___/ / /  __/ / /    | |/ /  / /  / /__  /  __/
- __/ /   \__,_/  |___/  \__,_/  /_/   /_/   \____/         /____/  /_/ /_/ \____/  / .___/        /____/  \___/ /_/     |___/  /_/   \___/  \___/
-/___/                                                                             /_/
-
- java110 ShopService starting, more information scan https://github.com/java110/MicroCommunity

+ 0 - 75
ShopService/src/main/resources/dataSource.yml

@@ -1,75 +0,0 @@
-dataSources:
-  ds0: !!com.alibaba.druid.pool.DruidDataSource
-    driverClassName: com.mysql.jdbc.Driver
-    url: jdbc:mysql://dev.db.java110.com:3306/hc_community?useUnicode=true&characterEncoding=utf-8
-    username: hc_community
-    password: hc_community@12345678
-    minIdle: 5
-    validationQuery: SELECT 1 FROM DUAL
-    initialSize: 5
-    maxWait: 60000
-    filters: stat,wall,log4j
-    poolPreparedStatements: true
-#  ds0_slave0: !!com.alibaba.druid.pool.DruidDataSource
-#    driverClassName: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-#    username: TT
-#    password: TT@12345678
-#    connectionTimeoutMilliseconds: 30000
-#    idleTimeoutMilliseconds: 60000
-#    maxPoolSize: 50
-#    minPoolSize: 1
-#    maintenanceIntervalMilliseconds: 30000
-  ds1: !!com.alibaba.druid.pool.DruidDataSource
-    driverClassName: com.mysql.jdbc.Driver
-    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-    username: TT
-    password: TT@12345678
-    minIdle: 5
-    validationQuery: SELECT 1 FROM DUAL
-    initialSize: 5
-    maxWait: 60000
-    filters: stat,wall,log4j
-    poolPreparedStatements: true
-#  ds1_slave0: !!com.alibaba.druid.pool.DruidDataSource
-#    driverClassName: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-#    username: TT
-#    password: TT@12345678
-#    connectionTimeoutMilliseconds: 30000
-#    idleTimeoutMilliseconds: 60000
-#    maxPoolSize: 50
-#    minPoolSize: 1
-#    maintenanceIntervalMilliseconds: 30000
-
-shardingRule:
-  tables:
-    business_xxx:
-      actualDataNodes: ds${0..1}.business_community
-      databaseStrategy:
-        inline:
-          shardingColumn: community_id
-          algorithmExpression: ds${Long.parseLong(community_id) % 2}
-
-  bindingTables:
-    - business_xxx
-
-  defaultDataSourceName: ds1
-  defaultDatabaseStrategy:
-    none:
-  defaultTableStrategy:
-    none:
-
-#  masterSlaveRules:
-#    ms_ds0:
-#     masterDataSourceName: ds0
-#     slaveDataSourceNames:
-#       - ds0_slave0
-#     loadBalanceAlgorithmType: ROUND_ROBIN
-#   ms_ds1:
-#     masterDataSourceName: ds1
-#     slaveDataSourceNames:
-#       - ds1_slave0
-#     loadBalanceAlgorithmType: ROUND_ROBIN
-props:
-  sql.show: true

+ 0 - 3
ShopService/src/main/resources/java110.properties

@@ -1,3 +0,0 @@
-java110.mappingPath=classpath:mapper/*/*.xml
-
-

+ 0 - 17
ShopService/src/test/java/com/java110/AppTest.java

@@ -1,17 +0,0 @@
-package com.java110;
-
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-{
-    /**
-     * Rigorous Test :-)
-     */
-
-    public void shouldAnswerWithTrue()
-    {
-
-    }
-}

+ 0 - 1
pom.xml

@@ -25,7 +25,6 @@
         <module>OrderService</module>
         <module>java110-cacheAgent</module>
         <module>java110-logAgent</module>
-        <module>ShopService</module>
         <module>CommentService</module>
         <module>Api</module>
         <module>CommunityService</module>