Browse Source

加入费用中心,费用模块 数据模型设计完成

wuxw 6 years ago
parent
commit
dd82200b18
27 changed files with 7447 additions and 2901 deletions
  1. 0 11
      FeeService/README.md
  2. 10 0
      FeeService/docker/Dockerfile
  3. 14 0
      FeeService/docker/bin/start_fee.sh
  4. 19 0
      FeeService/docker/docker-compose.yml
  5. 11 0
      FeeService/docker/onStart.sh
  6. 52 3
      FeeService/pom.xml
  7. 58 0
      FeeService/src/main/java/com/java110/fee/FeeServiceApplicationStart.java
  8. 104 0
      FeeService/src/main/java/com/java110/fee/api/FeeApi.java
  9. 222 0
      FeeService/src/main/java/com/java110/fee/dao/IFeeServiceDao.java
  10. 436 0
      FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java
  11. 16 0
      FeeService/src/main/java/com/java110/fee/kafka/FeeServiceBean.java
  12. 92 0
      FeeService/src/main/java/com/java110/fee/kafka/FeeServiceKafka.java
  13. 17 0
      FeeService/src/main/java/com/java110/fee/smo/IFeeServiceSMO.java
  14. 112 0
      FeeService/src/main/java/com/java110/fee/smo/impl/FeeServiceSMOImpl.java
  15. 96 0
      FeeService/src/main/resources/application-dev.yml
  16. 94 0
      FeeService/src/main/resources/application-prod.yml
  17. 61 0
      FeeService/src/main/resources/application-share.yml
  18. 94 0
      FeeService/src/main/resources/application-test.yml
  19. 3 0
      FeeService/src/main/resources/application.yml
  20. 15 0
      FeeService/src/main/resources/banner.txt
  21. 125 0
      FeeService/src/main/resources/dataSource.yml
  22. 0 38
      FeeService/src/test/java/com/java110/pay/AppTest.java
  23. 0 145
      SaveFloorListener.java
  24. 2606 1349
      docs/hc小区管理系统数据库模型v1.0.pdb
  25. 2606 1349
      docs/hc小区管理系统数据库模型v1.0.pdm
  26. 126 6
      java110-db/db/FeeService/create.sql
  27. 458 0
      pom.xml.bak

+ 0 - 11
FeeService/README.md

@@ -1,11 +0,0 @@
-PayService模块
-
-1.0 支付模块
-
-1.1.1 微信支付
-
-1.1.2 支付宝支付
-
-1.1.3 微信退款
-
-1.1.4 支付宝退款

+ 10 - 0
FeeService/docker/Dockerfile

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

+ 14 - 0
FeeService/docker/bin/start_fee.sh

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

+ 19 - 0
FeeService/docker/docker-compose.yml

@@ -0,0 +1,19 @@
+version: '2'
+services:
+   feeserivce:
+       container_name: feeserivce-1
+       build:
+          context: .
+          dockerfile: Dockerfile
+       restart: always
+       ports:
+       - "8009:8009"
+       volumes:
+       - ../target/FeeService.jar:/root/target/FeeService.jar
+#       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"

+ 11 - 0
FeeService/docker/onStart.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+cp -r ../bin .
+
+cp  -r ../target .
+
+docker build -t java110/fee .
+
+docker run -ti --name fee_test -p8006:8006 -idt java110/fee:latest
+
+docker logs -f fee_test

+ 52 - 3
FeeService/pom.xml

@@ -1,3 +1,5 @@
+<?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>
@@ -10,17 +12,64 @@
     <artifactId>FeeService</artifactId>
     <packaging>jar</packaging>
 
-    <name>PayService</name>
-    <url>http://maven.apache.org</url>
+    <name>FeeService</name>
+    <!-- FIXME change it to the project's website -->
+    <url>http://www.example.com</url>
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
     </properties>
 
     <dependencies>
         <dependency>
             <groupId>com.java110</groupId>
-            <artifactId>java110-common</artifactId>
+            <artifactId>java110-service</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.java110</groupId>
+            <artifactId>java110-event</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <finalName>FeeService</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.community.FeeServiceApplicationStart</mainClass>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>

+ 58 - 0
FeeService/src/main/java/com/java110/fee/FeeServiceApplicationStart.java

@@ -0,0 +1,58 @@
+package com.java110.fee;
+
+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.netflix.feign.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.fee", "com.java110.core", "com.java110.cache", "com.java110.db"})
+@EnableDiscoveryClient
+@Java110ListenerDiscovery(listenerPublishClass = BusinessServiceDataFlowEventPublishing.class,
+        basePackages = {"com.java110.fee.listener"})
+@EnableFeignClients(basePackages = {"com.java110.core.smo.user"})
+public class FeeServiceApplicationStart {
+
+    private static Logger logger = LoggerFactory.getLogger(FeeServiceApplicationStart.class);
+
+
+    /**
+     * 实例化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 {
+        ApplicationContext context = SpringApplication.run(FeeServiceApplicationStart.class, args);
+        ServiceStartInit.initSystemConfig(context);
+    }
+}

+ 104 - 0
FeeService/src/main/java/com/java110/fee/api/FeeApi.java

@@ -0,0 +1,104 @@
+package com.java110.fee.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.exception.InitConfigDataException;
+import com.java110.common.exception.InitDataFlowContextException;
+import com.java110.core.base.controller.BaseController;
+import com.java110.core.context.BusinessServiceDataFlow;
+import com.java110.core.factory.DataTransactionFactory;
+import com.java110.fee.smo.IFeeServiceSMO;
+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 FeeApi extends BaseController {
+    private final static Logger logger = LoggerFactory.getLogger(FeeApi.class);
+
+    @Autowired
+    IFeeServiceSMO feeServiceSMOImpl;
+
+    @RequestMapping(path = "/feeApi/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 = "/feeApi/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 = feeServiceSMOImpl.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 IFeeServiceSMO getFeeServiceSMOImpl() {
+        return feeServiceSMOImpl;
+    }
+
+    public void setFeeServiceSMOImpl(IFeeServiceSMO feeServiceSMOImpl) {
+        this.feeServiceSMOImpl = feeServiceSMOImpl;
+    }
+}

+ 222 - 0
FeeService/src/main/java/com/java110/fee/dao/IFeeServiceDao.java

@@ -0,0 +1,222 @@
+package com.java110.fee.dao;
+
+
+import com.java110.common.exception.DAOException;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 小区组件内部之间使用,没有给外围系统提供服务能力
+ * 小区服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IFeeServiceDao {
+
+    /**
+     * 保存 小区信息
+     * @param businessFeeInfo 小区信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+     void saveBusinessFeeInfo(Map businessFeeInfo) throws DAOException;
+
+    /**
+     * 保存小区属性
+     * @param businessFeeAttr 小区属性信息封装
+     * @throws DAOException 操作数据库异常
+     */
+     void saveBusinessFeeAttr(Map businessFeeAttr) throws DAOException;
+
+
+    /**
+     * 保存小区照片信息
+     * @param businessFeePhoto 小区照片
+     * @throws DAOException 操作数据库异常
+     */
+     void saveBusinessFeePhoto(Map businessFeePhoto) throws DAOException;
+
+    /**
+     * 保存小区证件信息
+     * @param businessFeeCerdentials 小区证件
+     * @throws DAOException 操作数据库异常
+     */
+     void saveBusinessFeeCerdentials(Map businessFeeCerdentials) throws DAOException;
+
+    /**
+     * 查询小区信息(business过程)
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     Map getBusinessFeeInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区属性信息(business过程)
+     * @param info bId 信息
+     * @return 小区属性
+     * @throws DAOException
+     */
+     List<Map> getBusinessFeeAttrs(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区照片
+     * @param info bId 信息
+     * @return 小区照片
+     * @throws DAOException
+     */
+     List<Map> getBusinessFeePhoto(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区证件信息
+     * @param info bId 信息
+     * @return 小区照片
+     * @throws DAOException
+     */
+     List<Map> getBusinessFeeCerdentials(Map info) throws DAOException;
+
+    /**
+     * 保存 小区信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+     void saveFeeInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 保存 小区属性信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+     void saveFeeAttrsInstance(Map info) throws DAOException;
+
+    /**
+     * 保存 小区照片信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+     void saveFeePhotoInstance(Map info) throws DAOException;
+
+
+
+
+
+
+    /**
+     * 查询小区信息(instance过程)
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     Map getFeeInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区属性信息(instance过程)
+     * @param info bId 信息
+     * @return 小区属性
+     * @throws DAOException
+     */
+     List<Map> getFeeAttrs(Map info) throws DAOException;
+
+
+    /**
+     * 查询小区照片(instance 过程)
+     * @param info bId 信息
+     * @return 小区照片
+     * @throws DAOException
+     */
+     List<Map> getFeePhoto(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改小区信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+     void updateFeeInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 修改小区属性信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+     void updateFeeAttrInstance(Map info) throws DAOException;
+
+
+    /**
+     * 修改小区照片信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+     void updateFeePhotoInstance(Map info) throws DAOException;
+
+    
+
+
+    /**
+     * 小区成员加入信息
+     * @param businessFeeMember 小区成员信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+     void saveBusinessFeeMember(Map businessFeeMember) throws DAOException;
+
+    /**
+     * 成员加入 保存信息至instance
+     * @param info
+     * @throws DAOException
+     */
+     void saveFeeMemberInstance(Map info) throws DAOException;
+
+    /**
+     * 查询小区成员加入信息(business过程)
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     Map getBusinessFeeMember(Map info) throws DAOException;
+
+    /**
+     * 查询小区成员加入信息(instance过程)
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     Map getFeeMember(Map info) throws DAOException;
+
+    /**
+     * 修改小区成员加入信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+     void updateFeeMemberInstance(Map info) throws DAOException;
+
+    /**
+     * 查询小区成员加入信息(instance过程)
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     List<Map> getFeeMembers(Map info) throws DAOException;
+
+    /**
+     * 查询小区成员个数
+     * 根据bId 查询小区信息
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+     int getFeeMemberCount(Map info);
+
+}

+ 436 - 0
FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java

@@ -0,0 +1,436 @@
+package com.java110.fee.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.exception.DAOException;
+import com.java110.common.util.DateUtil;
+import com.java110.fee.dao.IFeeServiceDao;
+import com.java110.core.base.dao.BaseServiceDao;
+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("feeServiceDaoImpl")
+//@Transactional
+public class FeeServiceDaoImpl extends BaseServiceDao implements IFeeServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(FeeServiceDaoImpl.class);
+
+    /**
+     * 小区信息封装
+     *
+     * @param businessFeeInfo 小区信息 封装
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessFeeInfo(Map businessFeeInfo) throws DAOException {
+        businessFeeInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存小区信息 入参 businessFeeInfo : {}", businessFeeInfo);
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeInfo", businessFeeInfo);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区数据失败:" + JSONObject.toJSONString(businessFeeInfo));
+        }
+    }
+
+    /**
+     * 小区属性信息分装
+     *
+     * @param businessFeeAttr 小区属性信息封装
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessFeeAttr(Map businessFeeAttr) throws DAOException {
+        businessFeeAttr.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存小区属性信息 入参 businessFeeAttr : {}", businessFeeAttr);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeAttr", businessFeeAttr);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区属性数据失败:" + JSONObject.toJSONString(businessFeeAttr));
+        }
+    }
+
+    /**
+     * 保存小区照片信息
+     *
+     * @param businessFeePhoto 小区照片
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessFeePhoto(Map businessFeePhoto) throws DAOException {
+        businessFeePhoto.put("month", DateUtil.getCurrentMonth());
+        logger.debug("保存小区照片信息 入参 businessFeePhoto : {}", businessFeePhoto);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeePhoto", businessFeePhoto);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区照片数据失败:" + JSONObject.toJSONString(businessFeePhoto));
+        }
+    }
+
+    /**
+     * 保存小区证件信息
+     *
+     * @param businessFeeCerdentials 小区证件
+     * @throws DAOException
+     */
+    @Override
+    public void saveBusinessFeeCerdentials(Map businessFeeCerdentials) throws DAOException {
+        businessFeeCerdentials.put("month", DateUtil.getCurrentMonth());
+        logger.debug("保存小区证件信息 入参 businessFeeCerdentials : {}", businessFeeCerdentials);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeCerdentials", businessFeeCerdentials);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区证件数据失败:" + JSONObject.toJSONString(businessFeeCerdentials));
+        }
+    }
+
+    /**
+     * 查询小区信息
+     *
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+    @Override
+    public Map getBusinessFeeInfo(Map info) throws DAOException {
+
+        logger.debug("查询小区信息 入参 info : {}", info);
+
+        List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeInfo", info);
+        if (businessFeeInfos == null) {
+            return null;
+        }
+        if (businessFeeInfos.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:businessFeeInfos," + JSONObject.toJSONString(info));
+        }
+
+        return businessFeeInfos.get(0);
+    }
+
+    /**
+     * 查询小区属性
+     *
+     * @param info bId 信息
+     * @return 小区属性
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getBusinessFeeAttrs(Map info) throws DAOException {
+        logger.debug("查询小区属性信息 入参 info : {}", info);
+
+        List<Map> businessFeeAttrs = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeAttrs", info);
+
+        return businessFeeAttrs;
+    }
+
+    /**
+     * 查询小区照片
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getBusinessFeePhoto(Map info) throws DAOException {
+        logger.debug("查询小区照片信息 入参 info : {}", info);
+
+        List<Map> businessFeePhotos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeePhoto", info);
+
+        return businessFeePhotos;
+    }
+
+    /**
+     * 查询小区证件
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getBusinessFeeCerdentials(Map info) throws DAOException {
+        logger.debug("查询小区证件信息 入参 info : {}", info);
+
+        List<Map> businessFeeCerdentialses = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeCerdentials", info);
+
+        return businessFeeCerdentialses;
+    }
+
+    /**
+     * 保存小区信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException
+     */
+    @Override
+    public void saveFeeInfoInstance(Map info) throws DAOException {
+        logger.debug("保存小区信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    @Override
+    public void saveFeeAttrsInstance(Map info) throws DAOException {
+        logger.debug("保存小区属性信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeAttrsInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区属性信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    @Override
+    public void saveFeePhotoInstance(Map info) throws DAOException {
+        logger.debug("保存小区照片信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeePhotoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区照片信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询小区信息(instance)
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public Map getFeeInfo(Map info) throws DAOException {
+        logger.debug("查询小区信息 入参 info : {}", info);
+
+        List<Map> businessFeeInfos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeInfo", info);
+        if (businessFeeInfos == null || businessFeeInfos.size() == 0) {
+            return null;
+        }
+        if (businessFeeInfos.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:getFeeInfo," + JSONObject.toJSONString(info));
+        }
+
+        return businessFeeInfos.get(0);
+    }
+
+    /**
+     * 小区属性查询(instance)
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getFeeAttrs(Map info) throws DAOException {
+        logger.debug("查询小区属性信息 入参 info : {}", info);
+
+        List<Map> feeAttrs = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeAttrs", info);
+
+        return feeAttrs;
+    }
+
+    /**
+     * 小区照片查询(instance)
+     *
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getFeePhoto(Map info) throws DAOException {
+        logger.debug("查询小区照片信息 入参 info : {}", info);
+
+        List<Map> feePhotos = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeePhoto", info);
+
+        return feePhotos;
+    }
+
+
+    /**
+     * 修改小区信息
+     *
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    @Override
+    public void updateFeeInfoInstance(Map info) throws DAOException {
+        logger.debug("修改小区信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeInfoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 修改小区属性信息(instance)
+     *
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    @Override
+    public void updateFeeAttrInstance(Map info) throws DAOException {
+        logger.debug("修改小区属性信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeAttrInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区属性信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 修改 小区照片信息
+     *
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    @Override
+    public void updateFeePhotoInstance(Map info) throws DAOException {
+        logger.debug("修改小区照片信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeePhotoInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区照片信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 小区成员加入信息
+     *
+     * @param businessFeeMember 小区成员信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    public void saveBusinessFeeMember(Map businessFeeMember) throws DAOException {
+        logger.debug("小区成员加入 入参 businessFeeMember : {}", businessFeeMember);
+        businessFeeMember.put("month", DateUtil.getCurrentMonth());
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveBusinessFeeMember", businessFeeMember);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "小区成员加入失败:" + JSONObject.toJSONString(businessFeeMember));
+        }
+    }
+
+    /**
+     * 成员加入 保存信息至instance
+     *
+     * @param info
+     * @throws DAOException
+     */
+    @Override
+    public void saveFeeMemberInstance(Map info) throws DAOException {
+        logger.debug("小区成员加入Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("feeServiceDaoImpl.saveFeeMemberInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存小区照片信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * 查询小区成员加入信息(business过程)
+     * 根据bId 查询小区信息
+     *
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+    public Map getBusinessFeeMember(Map info) throws DAOException {
+        logger.debug("查询小区成员加入信息 入参 info : {}", info);
+
+        List<Map> businessFeeMembers = sqlSessionTemplate.selectList("feeServiceDaoImpl.getBusinessFeeMember", info);
+        if (businessFeeMembers == null || businessFeeMembers.size() == 0) {
+            return null;
+        }
+        if (businessFeeMembers.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:businessFeeMember," + JSONObject.toJSONString(info));
+        }
+
+        return businessFeeMembers.get(0);
+    }
+
+    /**
+     * 查询小区成员加入信息(instance过程)
+     * 根据bId 查询小区信息
+     *
+     * @param info bId 信息
+     * @return 小区信息
+     * @throws DAOException
+     */
+    public Map getFeeMember(Map info) throws DAOException {
+        logger.debug("查询小区成员加入信息 入参 info : {}", info);
+
+        List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMember", info);
+        if (memberFees == null || memberFees.size() == 0) {
+            return null;
+        }
+        if (memberFees.size() > 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "根据条件查询有多条数据,数据异常,请检查:getFeeMember," + JSONObject.toJSONString(info));
+        }
+
+        return memberFees.get(0);
+    }
+
+    /**
+     * 修改小区成员加入信息
+     *
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    public void updateFeeMemberInstance(Map info) throws DAOException {
+        logger.debug("修改小区成员加入信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("feeServiceDaoImpl.updateFeeMemberInstance", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改小区成员加入信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
+     * @param info bId 信息
+     * @return
+     * @throws DAOException
+     */
+    @Override
+    public List<Map> getFeeMembers(Map info) throws DAOException {
+        logger.debug("查询小区成员加入信息 入参 info : {}", info);
+
+        List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMember", info);
+
+        return memberFees;
+    }
+
+    @Override
+    public int getFeeMemberCount(Map info) {
+        logger.debug("查询小区成员加入信息 入参 info : {}", info);
+
+        List<Map> memberFees = sqlSessionTemplate.selectList("feeServiceDaoImpl.getFeeMemberCount", info);
+
+        if (memberFees.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(memberFees.get(0).get("count").toString());
+    }
+}

+ 16 - 0
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceBean.java

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

+ 92 - 0
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceKafka.java

@@ -0,0 +1,92 @@
+package com.java110.fee.kafka;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.constant.KafkaConstant;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.exception.InitConfigDataException;
+import com.java110.common.exception.InitDataFlowContextException;
+import com.java110.common.kafka.KafkaFactory;
+import com.java110.core.base.controller.BaseController;
+import com.java110.core.context.BusinessServiceDataFlow;
+import com.java110.core.factory.DataTransactionFactory;
+import com.java110.fee.smo.IFeeServiceSMO;
+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 FeeServiceKafka extends BaseController {
+
+    private final static Logger logger = LoggerFactory.getLogger(FeeServiceKafka.class);
+
+
+    @Autowired
+    private IFeeServiceSMO feeServiceSMOImpl;
+
+    @KafkaListener(topics = {"feeServiceTopic"})
+    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 = feeServiceSMOImpl.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 IFeeServiceSMO getFeeServiceSMOImpl() {
+        return feeServiceSMOImpl;
+    }
+
+    public void setFeeServiceSMOImpl(IFeeServiceSMO feeServiceSMOImpl) {
+        this.feeServiceSMOImpl = feeServiceSMOImpl;
+    }
+}

+ 17 - 0
FeeService/src/main/java/com/java110/fee/smo/IFeeServiceSMO.java

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

+ 112 - 0
FeeService/src/main/java/com/java110/fee/smo/impl/FeeServiceSMOImpl.java

@@ -0,0 +1,112 @@
+package com.java110.fee.smo.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.common.cache.MappingCache;
+import com.java110.common.constant.KafkaConstant;
+import com.java110.common.constant.MappingConstant;
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.exception.SMOException;
+import com.java110.common.kafka.KafkaFactory;
+import com.java110.common.util.Assert;
+import com.java110.common.util.DateUtil;
+import com.java110.fee.smo.IFeeServiceSMO;
+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 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("feeServiceSMOImpl")
+@Transactional
+public class FeeServiceSMOImpl extends BaseServiceSMO implements IFeeServiceSMO {
+
+    private static Logger logger = LoggerFactory.getLogger(FeeServiceSMOImpl.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);
+        }
+    }
+}

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

@@ -0,0 +1,96 @@
+jedis:
+  pool:
+    config:
+      maxTotal: 100
+      maxIdle: 20
+      maxWaitMillis: 20000
+    host: dev.redis.java110.com
+    port: 6379
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    leaseExpirationDurationInSeconds: 30
+    preferIpAddress: true
+    instanceId: ${spring.cloud.client.ipAddress}:${server.port}
+  client:
+    serviceUrl:
+      defaultZone: http://dev.java110.com:8761/eureka/
+      #defaultZone: http://localhost:8761/eureka/
+server:
+  port: 8009
+  tomcat:
+    uri-encoding: UTF-8
+
+spring:
+  profiles:
+    active: share
+  http:
+    encoding:
+      charset: UTF-8
+      enabled: true
+      force: true
+  application:
+    name: community-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: communityBusinessStatus
+    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

+ 94 - 0
FeeService/src/main/resources/application-prod.yml

@@ -0,0 +1,94 @@
+jedis:
+  pool:
+    config:
+      maxTotal: 100
+      maxIdle: 20
+      maxWaitMillis: 20000
+    host: prod.redis.java110.com
+    port: 6379
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    leaseExpirationDurationInSeconds: 30
+    preferIpAddress: true
+    instanceId: ${spring.cloud.client.ipAddress}:${server.port}
+  client:
+    serviceUrl:
+      defaultZone: http://prod.java110.com:8761/eureka/
+      #defaultZone: http://localhost:8761/eureka/
+server:
+  port: 8009
+  tomcat:
+    uri-encoding: UTF-8
+
+spring:
+  http:
+    encoding:
+      charset: UTF-8
+      enabled: true
+      force: true
+  application:
+    name: community-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: communityBusinessStatus
+    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

+ 61 - 0
FeeService/src/main/resources/application-share.yml

@@ -0,0 +1,61 @@
+spring:
+  shardingsphere:
+    datasource:
+#      names: ds_master_0,ds_master_1,ds_master_0_slave_0,ds_master_0_slave_1,ds_master_1_slave_0,ds_master_1_slave_1
+      names: ds_master_0,ds_master_1
+#      ds_master_0_slave_0:
+#        jdbc-url: jdbc:mysql://localhost:3306/demo_ds_master_0_slave_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
+#        password:
+#        type: com.zaxxer.hikari.HikariDataSource
+#        driver-class-name: com.mysql.jdbc.Driver
+#        username: root
+      ds_master_0:
+        driver-class-name: com.mysql.jdbc.Driver
+        type: com.alibaba.druid.pool.DruidDataSource
+        jdbc-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
+      ds_master_1:
+        driver-class-name: com.mysql.jdbc.Driver
+        type: com.alibaba.druid.pool.DruidDataSource
+        jdbc-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
+    sharding:
+      tables:
+        business_community:
+          actual-data-nodes: ds_master_$->{0..1}.business_community
+          database-strategy:
+            inline:
+              sharding-column: community_id
+              algorithm-expression: ds_master_$->{Long.parseLong(community_id) % 2}
+        community:
+          actual-data-nodes: ds_master_$->{0..1}.community
+          database-strategy:
+            inline:
+              sharding-column: community_id
+              algorithm-expression: ds_master_$->{Long.parseLong(community_id) % 2}
+      default-database-strategy:
+        none:
+      default-table-strategy:
+        none:
+      default-datasource-name: ds_master_0
+#      master-slave-rules:
+#        ds_1:
+#          slave-data-source-names: ds_master_1_slave_0, ds_master_1_slave_1
+#          master-data-source-name: ds_master_1
+#        ds_0:
+#          slave-data-source-names: ds_master_0_slave_0, ds_master_0_slave_1
+#          master-data-source-name: ds_master_0

+ 94 - 0
FeeService/src/main/resources/application-test.yml

@@ -0,0 +1,94 @@
+jedis:
+  pool:
+    config:
+      maxTotal: 100
+      maxIdle: 20
+      maxWaitMillis: 20000
+    host: test.redis.java110.com
+    port: 6379
+
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    leaseExpirationDurationInSeconds: 30
+    preferIpAddress: true
+    instanceId: ${spring.cloud.client.ipAddress}:${server.port}
+  client:
+    serviceUrl:
+      defaultZone: http://test.java110.com:8761/eureka/
+      #defaultZone: http://localhost:8761/eureka/
+server:
+  port: 8009
+  tomcat:
+    uri-encoding: UTF-8
+
+spring:
+  http:
+    encoding:
+      charset: UTF-8
+      enabled: true
+      force: true
+  application:
+    name: community-service
+  redis:
+    database: 0
+    host: test.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://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: communityBusinessStatus
+    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

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

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

+ 15 - 0
FeeService/src/main/resources/banner.txt

@@ -0,0 +1,15 @@
+${AnsiColor.BRIGHT_RED}
+     __                    ____ ___________
+    |__|____ ___  _______ /_   /_   \   _  \
+    |  \__  \\  \/ /\__  \ |   ||   /  /_\  \
+    |  |/ __ \\   /  / __ \|   ||   \  \_/   \
+/\__|  (____  /\_/  (____  /___||___|\_____  /
+\______|    \/           \/                \/
+ ____ ___                    _________                  .__
+|    |   \______ ___________/   _____/ ______________  _|__| ____  ____
+|    |   /  ___// __ \_  __ \_____  \_/ __ \_  __ \  \/ /  |/ ___\/ __ \
+|    |  /\___ \\  ___/|  | \/        \  ___/|  | \/\   /|  \  \__\  ___/
+|______//____  >\___  >__| /_______  /\___  >__|    \_/ |__|\___  >___  >
+             \/     \/             \/     \/                    \/    \/
+
+ java110 UserService starting, more information scan https://github.com/java110/MicroCommunity

+ 125 - 0
FeeService/src/main/resources/dataSource.yml

@@ -0,0 +1,125 @@
+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_community:
+      actualDataNodes: ds${0..1}.business_community
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    s_community:
+      actualDataNodes: ds${0..1}.s_community
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    business_community_attr:
+      actualDataNodes: ds${0..1}.business_community_attr
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    s_community_attr:
+      actualDataNodes: ds${0..1}.s_community_attr
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    business_community_member:
+      actualDataNodes: ds${0..1}.business_community_member
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    business_community_photo:
+      actualDataNodes: ds${0..1}.business_community_photo
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    s_community_member:
+      actualDataNodes: ds${0..1}.s_community_member
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+    s_community_photo:
+      actualDataNodes: ds${0..1}.s_community_photo
+      databaseStrategy:
+        inline:
+          shardingColumn: community_id
+          algorithmExpression: ds${Long.parseLong(community_id) % 2}
+  bindingTables:
+    - business_community
+    - s_community
+    - business_community_member
+    - business_community_photo
+    - s_community_member
+    - s_community_photo
+    - business_community_attr
+    - s_community_attr
+
+  defaultDataSourceName: ds1
+  defaultDatabaseStrategy:
+    inline:
+      shardingColumn: community_id
+      algorithmExpression: ds${Long.parseLong(community_id) % 2}
+  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 - 38
FeeService/src/test/java/com/java110/pay/AppTest.java

@@ -1,38 +0,0 @@
-package com.java110.pay;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}

+ 0 - 145
SaveFloorListener.java

@@ -1,145 +0,0 @@
-package com.java110.floor.listener;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.java110.common.constant.BusinessTypeConstant;
-import com.java110.common.constant.ResponseConstant;
-import com.java110.common.constant.ServiceCodeConstant;
-import com.java110.common.constant.StatusConstant;
-import com.java110.common.exception.ListenerExecuteException;
-import com.java110.common.util.Assert;
-import com.java110.common.util.DateUtil;
-import com.java110.common.util.StringUtil;
-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.floor.dao.IFloorServiceDao;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.text.ParseException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 保存 小区楼信息 侦听
- * Created by wuxw on 2018/5/18.
- */
-@Java110Listener("saveFloorInfoListener")
-@Transactional
-public class SaveFloorInfoListener extends AbstractFloorBusinessServiceDataFlowListener{
-
-    private final static Logger logger = LoggerFactory.getLogger(SaveFloorInfoListener.class);
-
-    @Autowired
-    IFloorServiceDao floorServiceDaoImpl;
-
-    @Override
-    public int getOrder() {
-        return 0;
-    }
-
-    @Override
-    public String getBusinessTypeCd() {
-        return BusinessTypeConstant.sdddfff;
-    }
-
-    /**
-     * 保存小区楼信息 business 表中
-     * @param dataFlowContext 数据对象
-     * @param business 当前业务对象
-     */
-    @Override
-    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
-        JSONObject data = business.getDatas();
-        Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
-
-        //处理 businessFloor 节点
-        if(data.containsKey("businessFloor")){
-            JSONObject businessFloor = data.getJSONObject("businessFloor");
-            doBusinessFloor(business,businessFloor);
-            dataFlowContext.addParamOut("floorId",businessFloor.getString("floorId"));
-        }
-    }
-
-    /**
-     * 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 businessFloorInfo = floorServiceDaoImpl.getBusinessFloorInfo(info);
-        if( businessFloorInfo != null && !businessFloorInfo.isEmpty()) {
-            floorServiceDaoImpl.saveFloorInfoInstance(info);
-            dataFlowContext.addParamOut("floorId",businessFloorInfo.get("floor_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 floorInfo = floorServiceDaoImpl.getFloorInfo(info);
-        if(floorInfo != null && !floorInfo.isEmpty()){
-            paramIn.put("floorId",floorInfo.get("floor_id").toString());
-            floorServiceDaoImpl.updateFloorInfoInstance(paramIn);
-            dataFlowContext.addParamOut("floorId",floorInfo.get("floor_id"));
-        }
-    }
-
-
-
-    /**
-     * 处理 businessFloor 节点
-     * @param business 总的数据节点
-     * @param businessFloor 小区楼节点
-     */
-    private void doBusinessFloor(Business business,JSONObject businessFloor){
-
-        Assert.jsonObjectHaveKey(businessFloor,"floorId","businessFloor 节点下没有包含 floorId 节点");
-
-        if(businessFloor.getString("floorId").startsWith("-")){
-            //刷新缓存
-            flushFloorId(business.getDatas());
-        }
-
-        businessFloor.put("bId",business.getbId());
-        businessFloor.put("operate", StatusConstant.OPERATE_ADD);
-        //保存小区楼信息
-        floorServiceDaoImpl.saveBusinessFloorInfo(businessFloor);
-
-    }
-
-    public IFloorServiceDao getFloorServiceDaoImpl() {
-        return floorServiceDaoImpl;
-    }
-
-    public void setFloorServiceDaoImpl(IFloorServiceDao floorServiceDaoImpl) {
-        this.floorServiceDaoImpl = floorServiceDaoImpl;
-    }
-}

File diff suppressed because it is too large
+ 2606 - 1349
docs/hc小区管理系统数据库模型v1.0.pdb


File diff suppressed because it is too large
+ 2606 - 1349
docs/hc小区管理系统数据库模型v1.0.pdm


+ 126 - 6
java110-db/db/FeeService/create.sql

@@ -1,13 +1,133 @@
-create table fee(
+-- 费用主表
+
+create table business_pay_fee(
   fee_id varchar(30) not null comment '费用ID',
+  b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
   fee_type_cd varchar(12) not null comment '费用类型,物业费,停车费',
   community_id varchar(30) not null comment '小区ID',
   payer_obj_id varchar(30) not null comment '付款方ID',
-  income_obj_id varchar(30) not null comment '收入方ID',
-  cycle int not null comment '周期数,以月为单位',
-  price DECIMAL(7,2) not null comment '金额',
-  remark VARCHAR(300) NOT NULL COMMENT '用户ID',
+  income_obj_id varchar(30) not null comment '收款方ID',
+  start_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
+  end_time TIMESTAMP NOT NULL COMMENT '结束时间',
+  amount decimal(7,2) not null default -1.00 comment '总金额,如物业费,停车费等没有总金额的,填写为-1.00',
+  user_id varchar(30) not null comment '创建用户ID',
+  create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+  operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+CREATE INDEX idx_bpf_fee_id ON business_pay_fee(fee_id);
+CREATE INDEX idx_bpf_b_id ON business_pay_fee(b_id);
+
+create table pay_fee(
+  fee_id varchar(30) not null comment '费用ID',
+  b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+  fee_type_cd varchar(12) not null comment '费用类型,物业费,停车费',
+  community_id varchar(30) not null comment '小区ID',
+  payer_obj_id varchar(30) not null comment '付款方ID',
+  income_obj_id varchar(30) not null comment '收款方ID',
+  start_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
+  end_time TIMESTAMP NOT NULL COMMENT '结束时间',
+  amount decimal(7,2) not null default -1.00 comment '总金额,如物业费,停车费等没有总金额的,填写为-1.00',
+  user_id varchar(30) not null comment '创建用户ID',
   create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
   status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
   UNIQUE KEY (fee_id)
-);
+);
+CREATE INDEX idx_pf_fee_id ON business_pay_fee(fee_id);
+CREATE INDEX idx_pf_b_id ON business_pay_fee(b_id);
+
+--
+
+CREATE TABLE business_pay_fee_attrs(
+    fee_id VARCHAR(30) NOT NULL COMMENT '费用ID',
+    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+    community_id varchar(30) not null comment '小区ID',
+    attr_id VARCHAR(30) NOT NULL COMMENT '属性id',
+    spec_cd VARCHAR(12) NOT NULL COMMENT '规格id,参考spec表',
+    `value` VARCHAR(50) NOT NULL COMMENT '属性值',
+      operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+
+CREATE INDEX idx_bpfa_fee_id ON business_pay_fee_attrs(fee_id);
+CREATE INDEX idx_bpfa_b_id ON business_pay_fee_attrs(b_id);
+
+-- c_orders_attrs
+
+CREATE TABLE pay_fee_attrs(
+    fee_id VARCHAR(30) NOT NULL COMMENT '费用ID',
+    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+    community_id varchar(30) not null comment '小区ID',
+    attr_id VARCHAR(30) NOT NULL COMMENT '属性id',
+    spec_cd VARCHAR(12) NOT NULL COMMENT '规格id,参考spec表',
+    `value` VARCHAR(50) NOT NULL COMMENT '属性值',
+     status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
+     UNIQUE KEY (attr_id)
+);
+CREATE INDEX idx_pfa_fee_id ON business_pay_fee_attrs(fee_id);
+CREATE INDEX idx_pfa_b_id ON business_pay_fee_attrs(b_id);
+
+-- 费用明细表
+create table business_pay_fee_detail(
+    detail_id varchar(30) not null comment '费用明细ID',
+    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+    fee_id varchar(30) not null comment '费用ID',
+    community_id varchar(30) not null comment '小区ID',
+    cycles int not null comment '周期,以月为单位',
+    receivable_amount decimal(7,2) not null comment '应收金额',
+    received_amount decimal(7,2) not null comment '实收金额',
+    prime_rate decimal(3,2) not null comment '打折率',
+    remark VARCHAR(200) NOT NULL COMMENT '备注',
+    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+CREATE INDEX idx_bpfd_detail_id ON business_pay_fee_detail(detail_id);
+CREATE INDEX idx_bpfd_b_id ON business_pay_fee_detail(b_id);
+
+
+-- 费用明细表
+create table pay_fee_detail(
+    detail_id varchar(30) not null comment '费用明细ID',
+    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+    fee_id varchar(30) not null comment '费用ID',
+    community_id varchar(30) not null comment '小区ID',
+    cycles int not null comment '周期,以月为单位',
+    receivable_amount decimal(7,2) not null comment '应收金额',
+    received_amount decimal(7,2) not null comment '实收金额',
+    prime_rate decimal(3,2) not null comment '打折率',
+    remark VARCHAR(200) NOT NULL COMMENT '备注',
+    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
+    UNIQUE KEY (detail_id)
+);
+CREATE INDEX idx_pfd_detail_id ON business_pay_fee_detail(detail_id);
+CREATE INDEX idx_pfd_b_id ON business_pay_fee_detail(b_id);
+
+
+-- 费用配置表
+create table business_pay_fee_config(
+      config_id varchar(30) not null comment '费用ID',
+      b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+      community_id varchar(30) not null comment '小区ID',
+      fee_type_cd varchar(12) not null comment '费用类型,物业费,停车费',
+      square_price decimal(7,2) not null comment '每平米收取的单价',
+      additional_amount decimal(7,2) not null comment '附加费用',
+      create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+      operate VARCHAR(4) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
+);
+CREATE INDEX idx_bpfc_config_id ON business_pay_fee_config(config_id);
+CREATE INDEX idx_bpfc_b_id ON business_pay_fee_config(b_id);
+
+-- 费用配置表
+create table pay_fee_config(
+      config_id varchar(30) not null comment '费用ID',
+      b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
+      community_id varchar(30) not null comment '小区ID',
+      fee_type_cd varchar(12) not null comment '费用类型,物业费,停车费',
+      square_price decimal(7,2) not null comment '每平米收取的单价',
+      additional_amount decimal(7,2) not null comment '附加费用',
+      create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+      status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效',
+      UNIQUE KEY (config_id)
+);
+CREATE INDEX idx_pfc_config_id ON business_pay_fee_config(config_id);
+CREATE INDEX idx_pfc_b_id ON business_pay_fee_config(b_id);
+

+ 458 - 0
pom.xml.bak

@@ -0,0 +1,458 @@
+<?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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.java110</groupId>
+    <artifactId>MicroCommunity</artifactId>
+    <packaging>pom</packaging>
+    <version>1.0-SNAPSHOT</version>
+    <modules>
+        <module>java110-bean</module>
+        <module>java110-config</module>
+        <module>java110-common</module>
+        <module>UserService</module>
+        <module>LogService</module>
+        
+        <module>eureka</module>
+        <module>java110-core</module>
+        <module>java110-service</module>
+        <module>CodeService</module>
+        <module>StoreService</module>
+        <module>RuleService</module>
+        <module>java110-event</module>
+        <module>OrderService</module>
+        <module>java110-cacheAgent</module>
+        <module>WebService</module>
+        <module>java110-logAgent</module>
+        <module>zipkin</module>
+        <module>ShopService</module>
+        <module>CommentService</module>
+        <module>Api</module>
+        <module>CommunityService</module>
+        <module>java110-code-generator</module>
+        <module>java110-db</module>
+    </modules>
+
+    <parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>1.4.0.RELEASE</version>
+        <relativePath/> <!-- lookup parent from repository -->
+    </parent>
+
+    <properties>
+        <maven.compile.target>1.8</maven.compile.target>
+        <sourceEncoding>UTF-8</sourceEncoding>
+        <spring-boot>1.3.2.RELEASE</spring-boot>
+        <shiro.version>1.2.4</shiro.version>
+        <mybatis.version>3.3.0</mybatis.version>
+        <microcommunity.version>1.0-SNAPSHOT</microcommunity.version>
+        <dubbo.version>2.5.4-SNAPSHOT</dubbo.version>
+        <logback.vaersion>1.1.3</logback.vaersion>
+
+        <apache.common.lang3.version>3.4</apache.common.lang3.version>
+        <mybatis.version>3.4.1</mybatis.version>
+        <log4j.version>1.2.17</log4j.version>
+        <tomcat.servlet.version>6.0.37</tomcat.servlet.version>
+        <druid.version>1.0.18</druid.version>
+        <mybatis-spring.version>1.3.1</mybatis-spring.version>
+        <mysql.version>5.1.39</mysql.version>
+        <commons-pool2.version>2.2</commons-pool2.version>
+        <commons-collections.version>3.2.1</commons-collections.version>
+        <commons-fileupload.version>1.3.3</commons-fileupload.version>
+        <commons-codec.version>1.6</commons-codec.version>
+        <commons-logging.version>1.1.1</commons-logging.version>
+        <commons-lang.version>2.5</commons-lang.version>
+        <commons-beanutils.version>1.8.0</commons-beanutils.version>
+        <slf4j.version>1.7.7</slf4j.version>
+        <logback.version>1.1.2</logback.version>
+        <activemq.version>5.7.0</activemq.version>
+        <xbean.version>3.18</xbean.version>
+        <axis.version>1.4</axis.version>
+        <httpclient.verion>3.1</httpclient.verion>
+        <spring.version>4.3.2.RELEASE</spring.version>
+        <zookeeper.version>3.4.14</zookeeper.version>
+        <swagger.version>2.5.0</swagger.version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Brixton.SR5</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-context-support</artifactId>
+                <version>4.2.7.RELEASE</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.kafka</groupId>
+                <artifactId>spring-kafka</artifactId>
+                <version>1.1.1.RELEASE</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>1.2.28</version>
+            </dependency>
+            <dependency>
+                <groupId>org.mybatis.spring.boot</groupId>
+                <artifactId>mybatis-spring-boot-starter</artifactId>
+                <version>1.1.1</version>
+            </dependency>
+
+            <!--mapper-->
+            <dependency>
+                <groupId>tk.mybatis</groupId>
+                <artifactId>mapper-spring-boot-starter</artifactId>
+                <version>1.1.0</version>
+            </dependency>
+            <!--pagehelper-->
+            <dependency>
+                <groupId>com.github.pagehelper</groupId>
+                <artifactId>pagehelper-spring-boot-starter</artifactId>
+                <version>1.1.0</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.auth0</groupId>
+                <artifactId>java-jwt</artifactId>
+                <version>3.3.0</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-common</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-bean</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-event</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-core</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-service</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-config</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-cacheAgent</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-logAgent</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.java110</groupId>
+                <artifactId>java110-db</artifactId>
+                <version>${microcommunity.version}</version>
+            </dependency>
+            <!-- logback 日志组件支持  -->
+
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-api</artifactId>
+                <version>1.7.7</version>
+            </dependency>
+            <dependency>
+                <groupId>ch.qos.logback</groupId>
+                <artifactId>logback-core</artifactId>
+                <version>${logback.vaersion}</version>
+            </dependency>
+            <dependency>
+                <groupId>ch.qos.logback</groupId>
+                <artifactId>logback-access</artifactId>
+                <version>${logback.vaersion}</version>
+            </dependency>
+            <dependency>
+                <groupId>ch.qos.logback</groupId>
+                <artifactId>logback-classic</artifactId>
+                <version>${logback.vaersion}</version>
+            </dependency>
+
+            <!-- https://mvnrepository.com/artifact/com.mchange/c3p0 -->
+            <dependency>
+                <groupId>com.mchange</groupId>
+                <artifactId>c3p0</artifactId>
+                <version>0.9.5.4</version>
+            </dependency>
+
+
+
+
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-core</artifactId>
+                <version>${activemq.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.activemq</groupId>
+                <artifactId>activemq-pool</artifactId>
+                <version>${activemq.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.springframework</groupId>
+                <artifactId>spring-jms</artifactId>
+                <version>${spring.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.xbean</groupId>
+                <artifactId>xbean-spring</artifactId>
+                <version>${xbean.version}</version>
+            </dependency>
+
+
+            <!-- apache commons 包 主要使用一些工具类 -->
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${apache.common.lang3.version}</version>
+            </dependency>
+
+            <!-- mybatis 依赖包 -->
+            <dependency>
+                <groupId>org.mybatis</groupId>
+                <artifactId>mybatis</artifactId>
+                <version>${mybatis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.mybatis</groupId>
+                <artifactId>mybatis-spring</artifactId>
+                <version>${mybatis-spring.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>mysql</groupId>
+                <artifactId>mysql-connector-java</artifactId>
+                <version>${mysql.version}</version>
+            </dependency>
+
+            <!-- 阿里 数据源相关jar  -->
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>druid</artifactId>
+                <version>${druid.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-validator</groupId>
+                <artifactId>commons-validator</artifactId>
+                <version>1.3.1</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-pool2</artifactId>
+                <version>${commons-pool2.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-fileupload</groupId>
+                <artifactId>commons-fileupload</artifactId>
+                <version>${commons-fileupload.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-codec</groupId>
+                <artifactId>commons-codec</artifactId>
+                <version>${commons-codec.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-net</groupId>
+                <artifactId>commons-net</artifactId>
+                <version>3.3</version>
+            </dependency>
+
+            <dependency>
+                <groupId>commons-httpclient</groupId>
+                <artifactId>commons-httpclient</artifactId>
+                <version>${httpclient.verion}</version>
+            </dependency>
+
+            <!--<dependency>
+                <groupId>io.shardingsphere</groupId>
+                <artifactId>sharding-jdbc</artifactId>
+                <version>3.0.0.M3</version>
+            </dependency>-->
+
+            <!--<dependency>
+                <groupId>io.shardingsphere</groupId>
+                <artifactId>sharding-jdbc-core</artifactId>
+                <version>3.1.0</version>
+            </dependency>-->
+
+            <dependency>
+                <groupId>org.apache.shardingsphere</groupId>
+                <artifactId>sharding-jdbc-core</artifactId>
+                <version>4.0.0-RC1</version>
+            </dependency>
+
+
+            <!-- https://mvnrepository.com/artifact/org.apache.axis2/axis2
+            <dependency>
+                <groupId>org.apache.axis</groupId>
+                <artifactId>axis</artifactId>
+                <version>${axis.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>org.apache.axis</groupId>
+                <artifactId>axis-jaxrpc</artifactId>
+                <version>${axis.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.axis</groupId>
+                <artifactId>axis-saaj</artifactId>
+                <version>${axis.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>wsdl4j</groupId>
+                <artifactId>wsdl4j</artifactId>
+                <version>${axis.version}</version>
+            </dependency>
+            -->
+
+            <dependency>
+                <groupId>net.sf.ehcache</groupId>
+                <artifactId>ehcache</artifactId>
+                <version>2.10.2</version>
+            </dependency>
+
+            <dependency>
+                <groupId>redis.clients</groupId>
+                <artifactId>jedis</artifactId>
+                <version>2.8.2</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.quartz-scheduler</groupId>
+                <artifactId>quartz</artifactId>
+                <version>2.3.0</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.springframework.session</groupId>
+                <artifactId>spring-session-data-redis</artifactId>
+                <version>1.0.1.RELEASE</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.beanshell</groupId>
+                <artifactId>bsh-core</artifactId>
+                <version>2.0b4</version>
+            </dependency>
+
+
+            <dependency>
+                <groupId>org.apache.zookeeper</groupId>
+                <artifactId>zookeeper</artifactId>
+                <version>${zookeeper.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger2</artifactId>
+                <version>${swagger.version}</version>
+            </dependency>
+            <!-- swagger-ui -->
+            <dependency>
+                <groupId>io.springfox</groupId>
+                <artifactId>springfox-swagger-ui</artifactId>
+                <version>${swagger.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>net.sourceforge.nekohtml</groupId>
+                <artifactId>nekohtml</artifactId>
+                <version>1.9.22</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.aliyun</groupId>
+                <artifactId>aliyun-java-sdk-core</artifactId>
+                <version>4.0.3</version>
+            </dependency>
+
+        </dependencies>
+
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+            <optional>true</optional>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>2.10.4</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>