wuxw
2019-06-01 dd82200b18ba648a6007ba32df34cad9c07bfb7f
加入费用中心,费用模块 数据模型设计完成
3个文件已删除
4个文件已修改
20个文件已添加
11284 ■■■■ 已修改文件
FeeService/README.md 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/docker/Dockerfile 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/docker/bin/start_fee.sh 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/docker/docker-compose.yml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/docker/onStart.sh 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/pom.xml 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/FeeServiceApplicationStart.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/api/FeeApi.java 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/dao/IFeeServiceDao.java 222 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java 436 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceBean.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceKafka.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/smo/IFeeServiceSMO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/smo/impl/FeeServiceSMOImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/application-dev.yml 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/application-prod.yml 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/application-share.yml 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/application-test.yml 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/application.yml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/banner.txt 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/resources/dataSource.yml 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/test/java/com/java110/pay/AppTest.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SaveFloorListener.java 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/hc小区管理系统数据库模型v1.0.pdb 4423 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/hc小区管理系统数据库模型v1.0.pdm 4423 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/db/FeeService/create.sql 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml.bak 458 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/README.md
File was deleted
FeeService/docker/Dockerfile
New file
@@ -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"]
FeeService/docker/bin/start_fee.sh
New file
@@ -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
FeeService/docker/docker-compose.yml
New file
@@ -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"
FeeService/docker/onStart.sh
New file
@@ -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
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>
FeeService/src/main/java/com/java110/fee/FeeServiceApplicationStart.java
New file
@@ -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);
    }
}
FeeService/src/main/java/com/java110/fee/api/FeeApi.java
New file
@@ -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;
    }
}
FeeService/src/main/java/com/java110/fee/dao/IFeeServiceDao.java
New file
@@ -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);
}
FeeService/src/main/java/com/java110/fee/dao/impl/FeeServiceDaoImpl.java
New file
@@ -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());
    }
}
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceBean.java
New file
@@ -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();
    }
}
FeeService/src/main/java/com/java110/fee/kafka/FeeServiceKafka.java
New file
@@ -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;
    }
}
FeeService/src/main/java/com/java110/fee/smo/IFeeServiceSMO.java
New file
@@ -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;
}
FeeService/src/main/java/com/java110/fee/smo/impl/FeeServiceSMOImpl.java
New file
@@ -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);
        }
    }
}
FeeService/src/main/resources/application-dev.yml
New file
@@ -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
FeeService/src/main/resources/application-prod.yml
New file
@@ -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
FeeService/src/main/resources/application-share.yml
New file
@@ -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
FeeService/src/main/resources/application-test.yml
New file
@@ -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
FeeService/src/main/resources/application.yml
New file
@@ -0,0 +1,3 @@
spring:
  profiles:
    active: dev
FeeService/src/main/resources/banner.txt
New file
@@ -0,0 +1,15 @@
${AnsiColor.BRIGHT_RED}
     __                    ____ ___________
    |__|____ ___  _______ /_   /_   \   _  \
    |  \__  \\  \/ /\__  \ |   ||   /  /_\  \
    |  |/ __ \\   /  / __ \|   ||   \  \_/   \
/\__|  (____  /\_/  (____  /___||___|\_____  /
\______|    \/           \/                \/
 ____ ___                    _________                  .__
|    |   \______ ___________/   _____/ ______________  _|__| ____  ____
|    |   /  ___// __ \_  __ \_____  \_/ __ \_  __ \  \/ /  |/ ___\/ __ \
|    |  /\___ \\  ___/|  | \/        \  ___/|  | \/\   /|  \  \__\  ___/
|______//____  >\___  >__| /_______  /\___  >__|    \_/ |__|\___  >___  >
             \/     \/             \/     \/                    \/    \/
 java110 UserService starting, more information scan https://github.com/java110/MicroCommunity
FeeService/src/main/resources/dataSource.yml
New file
@@ -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
FeeService/src/test/java/com/java110/pay/AppTest.java
File was deleted
SaveFloorListener.java
File was deleted
docs/hcÐ¡Çø¹ÜÀíϵͳÊý¾Ý¿âÄ£ÐÍv1.0.pdb
Diff too large
docs/hcÐ¡Çø¹ÜÀíϵͳÊý¾Ý¿âÄ£ÐÍv1.0.pdm
Diff too large
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);
pom.xml.bak
New file
@@ -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>