曾成
2020-05-11 2436008e1fb47cce9b4b93e287cf99c8d1f70233
增加退费申请
3个文件已修改
20个文件已添加
2391 ■■■■■ 已修改文件
Api/src/main/java/com/java110/api/bmo/returnPayFee/IReturnPayFeeBMO.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/bmo/returnPayFee/impl/ReturnPayFeeBMOImpl.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/returnPayFee/DeleteReturnPayFeeListener.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/returnPayFee/ListReturnPayFeesListener.java 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/returnPayFee/SaveReturnPayFeeListener.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/returnPayFee/UpdateReturnPayFeeListener.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/dao/IReturnPayFeeServiceDao.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/dao/impl/ReturnPayFeeServiceDaoImpl.java 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/AbstractReturnPayFeeBusinessServiceDataFlowListener.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/DeleteReturnPayFeeInfoListener.java 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/SaveReturnPayFeeInfoListener.java 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/UpdateReturnPayFeeInfoListener.java 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
FeeService/src/main/java/com/java110/fee/smo/impl/ReturnPayFeeInnerServiceSMOImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/returnPayFee/SaveReturnPayFeeInfo.md 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/returnPayFee/ReturnPayFeeDto.java 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/returnPayFee/ApiReturnPayFeeDataVo.java 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/returnPayFee/ApiReturnPayFeeVo.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/resources/back/template_1.json 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/returnPayFee/IReturnPayFeeInnerServiceSMO.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/ReturnPayFeeServiceDaoImplMapper.xml 306 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeReturnPayFeeConstant.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/bmo/returnPayFee/IReturnPayFeeBMO.java
New file
@@ -0,0 +1,38 @@
package com.java110.api.bmo.returnPayFee;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.bmo.IApiBaseBMO;
import com.java110.core.context.DataFlowContext;
public interface IReturnPayFeeBMO extends IApiBaseBMO {
    /**
     * 添加退费表
     *
     * @param paramInJson
     * @param dataFlowContext
     * @return
     */
    JSONObject addReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext);
    /**
     * 添加退费表信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    JSONObject updateReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext);
    /**
     * 删除退费表
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    JSONObject deleteReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext);
}
Api/src/main/java/com/java110/api/bmo/returnPayFee/impl/ReturnPayFeeBMOImpl.java
New file
@@ -0,0 +1,101 @@
package com.java110.api.bmo.returnPayFee.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.bmo.ApiBaseBMO;
import com.java110.api.bmo.returnPayFee.IReturnPayFeeBMO;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.file.IFileInnerServiceSMO;
import com.java110.core.smo.file.IFileRelInnerServiceSMO;
import com.java110.core.smo.returnPayFee.IReturnPayFeeInnerServiceSMO;
import com.java110.dto.file.FileRelDto;
import com.java110.dto.returnPayFee.ReturnPayFeeDto;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("returnPayFeeBMOImpl")
public class ReturnPayFeeBMOImpl extends ApiBaseBMO implements IReturnPayFeeBMO {
    @Autowired
    private IReturnPayFeeInnerServiceSMO returnPayFeeInnerServiceSMOImpl;
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    public JSONObject addReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_RETURN_PAY_FEE);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessReturnPayFee = new JSONObject();
        businessReturnPayFee.putAll(paramInJson);
        businessReturnPayFee.put("returnFeeId", "-1");
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessReturnPayFee", businessReturnPayFee);
        return business;
    }
    /**
     * 添加活动信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    public JSONObject updateReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        ReturnPayFeeDto returnPayFeeDto = new ReturnPayFeeDto();
        returnPayFeeDto.setReturnFeeId(paramInJson.getString("returnFeeId"));
        List<ReturnPayFeeDto> returnPayFeeDtos = returnPayFeeInnerServiceSMOImpl.queryReturnPayFees(returnPayFeeDto);
        Assert.listOnlyOne(returnPayFeeDtos, "未找到需要修改的活动 或多条数据");
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RETURN_PAY_FEE);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessReturnPayFee = new JSONObject();
        businessReturnPayFee.putAll(BeanConvertUtil.beanCovertMap(returnPayFeeDtos.get(0)));
        businessReturnPayFee.putAll(paramInJson);
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessReturnPayFee", businessReturnPayFee);
        return business;
    }
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    public JSONObject deleteReturnPayFee(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_RETURN_PAY_FEE);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessReturnPayFee = new JSONObject();
        businessReturnPayFee.putAll(paramInJson);
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessReturnPayFee", businessReturnPayFee);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/returnPayFee/DeleteReturnPayFeeListener.java
New file
@@ -0,0 +1,67 @@
package com.java110.api.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.bmo.returnPayFee.IReturnPayFeeBMO;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodeReturnPayFeeConstant;
import com.java110.utils.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("deleteReturnPayFeeListener")
public class DeleteReturnPayFeeListener extends AbstractServiceApiListener {
    @Autowired
    private IReturnPayFeeBMO returnPayFeeBMOImpl;
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "returnFeeId", "returnFeeId不能为空");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(returnPayFeeBMOImpl.deleteReturnPayFee(reqJson, context));
        ResponseEntity<String> responseEntity = returnPayFeeBMOImpl.callService(context, service.getServiceCode(), businesses);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodeReturnPayFeeConstant.DELETE_RETURNPAYFEE;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
}
Api/src/main/java/com/java110/api/listener/returnPayFee/ListReturnPayFeesListener.java
New file
@@ -0,0 +1,88 @@
package com.java110.api.listener.returnPayFee;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.returnPayFee.IReturnPayFeeInnerServiceSMO;
import com.java110.dto.returnPayFee.ReturnPayFeeDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.ServiceCodeReturnPayFeeConstant;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.returnPayFee.ApiReturnPayFeeDataVo;
import com.java110.vo.api.returnPayFee.ApiReturnPayFeeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.List;
/**
 * 查询小区侦听类
 */
@Java110Listener("listReturnPayFeesListener")
public class ListReturnPayFeesListener extends AbstractServiceApiListener {
    @Autowired
    private IReturnPayFeeInnerServiceSMO returnPayFeeInnerServiceSMOImpl;
    @Override
    public String getServiceCode() {
        return ServiceCodeReturnPayFeeConstant.LIST_RETURNPAYFEES;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.GET;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    public IReturnPayFeeInnerServiceSMO getReturnPayFeeInnerServiceSMOImpl() {
        return returnPayFeeInnerServiceSMOImpl;
    }
    public void setReturnPayFeeInnerServiceSMOImpl(IReturnPayFeeInnerServiceSMO returnPayFeeInnerServiceSMOImpl) {
        this.returnPayFeeInnerServiceSMOImpl = returnPayFeeInnerServiceSMOImpl;
    }
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        ReturnPayFeeDto returnPayFeeDto = BeanConvertUtil.covertBean(reqJson, ReturnPayFeeDto.class);
        int count = returnPayFeeInnerServiceSMOImpl.queryReturnPayFeesCount(returnPayFeeDto);
        List<ApiReturnPayFeeDataVo> returnPayFees = null;
        if (count > 0) {
            returnPayFees = BeanConvertUtil.covertBeanList(returnPayFeeInnerServiceSMOImpl.queryReturnPayFees(returnPayFeeDto), ApiReturnPayFeeDataVo.class);
        } else {
            returnPayFees = new ArrayList<>();
        }
        ApiReturnPayFeeVo apiReturnPayFeeVo = new ApiReturnPayFeeVo();
        apiReturnPayFeeVo.setTotal(count);
        apiReturnPayFeeVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
        apiReturnPayFeeVo.setReturnPayFees(returnPayFees);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiReturnPayFeeVo), HttpStatus.OK);
        context.setResponseEntity(responseEntity);
    }
}
Api/src/main/java/com/java110/api/listener/returnPayFee/SaveReturnPayFeeListener.java
New file
@@ -0,0 +1,71 @@
package com.java110.api.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.bmo.returnPayFee.IReturnPayFeeBMO;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodeReturnPayFeeConstant;
import com.java110.utils.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("saveReturnPayFeeListener")
public class SaveReturnPayFeeListener extends AbstractServiceApiListener {
    @Autowired
    private IReturnPayFeeBMO returnPayFeeBMOImpl;
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "configId", "请求报文中未包含configId");
        Assert.hasKeyAndValue(reqJson, "feeId", "请求报文中未包含feeId");
        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
        Assert.hasKeyAndValue(reqJson, "detailId", "请求报文中未包含detailId");
        Assert.hasKeyAndValue(reqJson, "reason", "请求报文中未包含reason");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(returnPayFeeBMOImpl.addReturnPayFee(reqJson, context));
        ResponseEntity<String> responseEntity = returnPayFeeBMOImpl.callService(context, service.getServiceCode(), businesses);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodeReturnPayFeeConstant.ADD_RETURNPAYFEE;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
}
Api/src/main/java/com/java110/api/listener/returnPayFee/UpdateReturnPayFeeListener.java
New file
@@ -0,0 +1,66 @@
package com.java110.api.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.bmo.returnPayFee.IReturnPayFeeBMO;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodeReturnPayFeeConstant;
import com.java110.utils.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存退费表侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("updateReturnPayFeeListener")
public class UpdateReturnPayFeeListener extends AbstractServiceApiListener {
    @Autowired
    private IReturnPayFeeBMO returnPayFeeBMOImpl;
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        Assert.hasKeyAndValue(reqJson, "returnFeeId", "returnFeeId不能为空");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(returnPayFeeBMOImpl.updateReturnPayFee(reqJson, context));
        ResponseEntity<String> responseEntity = returnPayFeeBMOImpl.callService(context, service.getServiceCode(), businesses);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodeReturnPayFeeConstant.UPDATE_RETURNPAYFEE;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
}
FeeService/src/main/java/com/java110/fee/dao/IReturnPayFeeServiceDao.java
New file
@@ -0,0 +1,76 @@
package com.java110.fee.dao;
import com.java110.utils.exception.DAOException;
import java.util.List;
import java.util.Map;
/**
 * 退费表组件内部之间使用,没有给外围系统提供服务能力
 * 退费表服务接口类,要求全部以字符串传输,方便微服务化
 * 新建客户,修改客户,删除客户,查询客户等功能
 * <p>
 * Created by wuxw on 2016/12/27.
 */
public interface IReturnPayFeeServiceDao {
    /**
     * 保存 退费表信息
     *
     * @param businessReturnPayFeeInfo 退费表信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessReturnPayFeeInfo(Map businessReturnPayFeeInfo) throws DAOException;
    /**
     * 查询退费表信息(business过程)
     * 根据bId 查询退费表信息
     *
     * @param info bId 信息
     * @return 退费表信息
     * @throws DAOException DAO异常
     */
    List<Map> getBusinessReturnPayFeeInfo(Map info) throws DAOException;
    /**
     * 保存 退费表信息 Business数据到 Instance中
     *
     * @param info
     * @throws DAOException DAO异常
     */
    void saveReturnPayFeeInfoInstance(Map info) throws DAOException;
    /**
     * 查询退费表信息(instance过程)
     * 根据bId 查询退费表信息
     *
     * @param info bId 信息
     * @return 退费表信息
     * @throws DAOException DAO异常
     */
    List<Map> getReturnPayFeeInfo(Map info) throws DAOException;
    /**
     * 修改退费表信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updateReturnPayFeeInfoInstance(Map info) throws DAOException;
    /**
     * 查询退费表总数
     *
     * @param info 退费表信息
     * @return 退费表数量
     */
    int queryReturnPayFeesCount(Map info);
}
FeeService/src/main/java/com/java110/fee/dao/impl/ReturnPayFeeServiceDaoImpl.java
New file
@@ -0,0 +1,134 @@
package com.java110.fee.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
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("returnPayFeeServiceDaoImpl")
//@Transactional
public class ReturnPayFeeServiceDaoImpl extends BaseServiceDao implements IReturnPayFeeServiceDao {
    private static Logger logger = LoggerFactory.getLogger(ReturnPayFeeServiceDaoImpl.class);
    /**
     * 退费表信息封装
     *
     * @param businessReturnPayFeeInfo 退费表信息 封装
     * @throws DAOException DAO异常
     */
    @Override
    public void saveBusinessReturnPayFeeInfo(Map businessReturnPayFeeInfo) throws DAOException {
        businessReturnPayFeeInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存退费表信息 入参 businessReturnPayFeeInfo : {}", businessReturnPayFeeInfo);
        int saveFlag = sqlSessionTemplate.insert("returnPayFeeServiceDaoImpl.saveBusinessReturnPayFeeInfo", businessReturnPayFeeInfo);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存退费表数据失败:" + JSONObject.toJSONString(businessReturnPayFeeInfo));
        }
    }
    /**
     * 查询退费表信息
     *
     * @param info bId 信息
     * @return 退费表信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getBusinessReturnPayFeeInfo(Map info) throws DAOException {
        logger.debug("查询退费表信息 入参 info : {}", info);
        List<Map> businessReturnPayFeeInfos = sqlSessionTemplate.selectList("returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo", info);
        return businessReturnPayFeeInfos;
    }
    /**
     * 保存退费表信息 到 instance
     *
     * @param info bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public void saveReturnPayFeeInfoInstance(Map info) throws DAOException {
        logger.debug("保存退费表信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("returnPayFeeServiceDaoImpl.saveReturnPayFeeInfoInstance", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存退费表信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询退费表信息(instance)
     *
     * @param info bId 信息
     * @return List<Map>
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getReturnPayFeeInfo(Map info) throws DAOException {
        logger.debug("查询退费表信息 入参 info : {}", info);
        List<Map> businessReturnPayFeeInfos = sqlSessionTemplate.selectList("returnPayFeeServiceDaoImpl.getReturnPayFeeInfo", info);
        return businessReturnPayFeeInfos;
    }
    /**
     * 修改退费表信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updateReturnPayFeeInfoInstance(Map info) throws DAOException {
        logger.debug("修改退费表信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改退费表信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询退费表数量
     *
     * @param info 退费表信息
     * @return 退费表数量
     */
    @Override
    public int queryReturnPayFeesCount(Map info) {
        logger.debug("查询退费表数据 入参 info : {}", info);
        List<Map> businessReturnPayFeeInfos = sqlSessionTemplate.selectList("returnPayFeeServiceDaoImpl.queryReturnPayFeesCount", info);
        if (businessReturnPayFeeInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessReturnPayFeeInfos.get(0).get("count").toString());
    }
}
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/AbstractReturnPayFeeBusinessServiceDataFlowListener.java
New file
@@ -0,0 +1,99 @@
package com.java110.fee.listener.returnPayFee;
import com.alibaba.fastjson.JSONObject;
import com.java110.entity.center.Business;
import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 退费表 服务侦听 父类
 * Created by wuxw on 2018/7/4.
 */
public abstract class AbstractReturnPayFeeBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(AbstractReturnPayFeeBusinessServiceDataFlowListener.class);
    /**
     * 获取 DAO工具类
     *
     * @return
     */
    public abstract IReturnPayFeeServiceDao getReturnPayFeeServiceDaoImpl();
    /**
     * 刷新 businessReturnPayFeeInfo 数据
     * 主要将 数据库 中字段和 接口传递字段建立关系
     *
     * @param businessReturnPayFeeInfo
     */
    protected void flushBusinessReturnPayFeeInfo(Map businessReturnPayFeeInfo, String statusCd) {
        businessReturnPayFeeInfo.put("newBId", businessReturnPayFeeInfo.get("b_id"));
        businessReturnPayFeeInfo.put("reason", businessReturnPayFeeInfo.get("reason"));
        businessReturnPayFeeInfo.put("primeRate", businessReturnPayFeeInfo.get("prime_rate"));
        businessReturnPayFeeInfo.put("feeTypeCd", businessReturnPayFeeInfo.get("fee_type_cd"));
        businessReturnPayFeeInfo.put("payTime", businessReturnPayFeeInfo.get("pay_time"));
        businessReturnPayFeeInfo.put("detailId", businessReturnPayFeeInfo.get("detail_id"));
        businessReturnPayFeeInfo.put("receivableAmount", businessReturnPayFeeInfo.get("receivable_amount"));
        businessReturnPayFeeInfo.put("cycles", businessReturnPayFeeInfo.get("cycles"));
        businessReturnPayFeeInfo.put("remark", businessReturnPayFeeInfo.get("remark"));
        businessReturnPayFeeInfo.put("receivedAmount", businessReturnPayFeeInfo.get("received_amount"));
        businessReturnPayFeeInfo.put("feeId", businessReturnPayFeeInfo.get("fee_id"));
        businessReturnPayFeeInfo.put("returnFeeId", businessReturnPayFeeInfo.get("return_fee_id"));
        businessReturnPayFeeInfo.put("operate", businessReturnPayFeeInfo.get("operate"));
        businessReturnPayFeeInfo.put("configId", businessReturnPayFeeInfo.get("config_id"));
        businessReturnPayFeeInfo.put("state", businessReturnPayFeeInfo.get("state"));
        businessReturnPayFeeInfo.put("communityId", businessReturnPayFeeInfo.get("community_id"));
        businessReturnPayFeeInfo.remove("bId");
        businessReturnPayFeeInfo.put("statusCd", statusCd);
    }
    /**
     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
     *
     * @param businessReturnPayFee 退费表信息
     */
    protected void autoSaveDelBusinessReturnPayFee(Business business, JSONObject businessReturnPayFee) {
//自动插入DEL
        Map info = new HashMap();
        info.put("returnFeeId", businessReturnPayFee.getString("returnFeeId"));
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        List<Map> currentReturnPayFeeInfos = getReturnPayFeeServiceDaoImpl().getReturnPayFeeInfo(info);
        if (currentReturnPayFeeInfos == null || currentReturnPayFeeInfos.size() != 1) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
        }
        Map currentReturnPayFeeInfo = currentReturnPayFeeInfos.get(0);
        currentReturnPayFeeInfo.put("bId", business.getbId());
        currentReturnPayFeeInfo.put("reason", currentReturnPayFeeInfo.get("reason"));
        currentReturnPayFeeInfo.put("primeRate", currentReturnPayFeeInfo.get("prime_rate"));
        currentReturnPayFeeInfo.put("feeTypeCd", currentReturnPayFeeInfo.get("fee_type_cd"));
        currentReturnPayFeeInfo.put("payTime", currentReturnPayFeeInfo.get("pay_time"));
        currentReturnPayFeeInfo.put("detailId", currentReturnPayFeeInfo.get("detail_id"));
        currentReturnPayFeeInfo.put("receivableAmount", currentReturnPayFeeInfo.get("receivable_amount"));
        currentReturnPayFeeInfo.put("cycles", currentReturnPayFeeInfo.get("cycles"));
        currentReturnPayFeeInfo.put("remark", currentReturnPayFeeInfo.get("remark"));
        currentReturnPayFeeInfo.put("receivedAmount", currentReturnPayFeeInfo.get("received_amount"));
        currentReturnPayFeeInfo.put("createTime", currentReturnPayFeeInfo.get("create_time"));
        currentReturnPayFeeInfo.put("feeId", currentReturnPayFeeInfo.get("fee_id"));
        currentReturnPayFeeInfo.put("returnFeeId", currentReturnPayFeeInfo.get("return_fee_id"));
        currentReturnPayFeeInfo.put("operate", currentReturnPayFeeInfo.get("operate"));
        currentReturnPayFeeInfo.put("configId", currentReturnPayFeeInfo.get("config_id"));
        currentReturnPayFeeInfo.put("state", currentReturnPayFeeInfo.get("state"));
        currentReturnPayFeeInfo.put("communityId", currentReturnPayFeeInfo.get("community_id"));
        currentReturnPayFeeInfo.put("operate", StatusConstant.OPERATE_DEL);
        getReturnPayFeeServiceDaoImpl().saveBusinessReturnPayFeeInfo(currentReturnPayFeeInfo);
    }
}
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/DeleteReturnPayFeeInfoListener.java
New file
@@ -0,0 +1,180 @@
package com.java110.fee.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 删除退费表信息 侦听
 * <p>
 * 处理节点
 * 1、businessReturnPayFee:{} 退费表基本信息节点
 * 2、businessReturnPayFeeAttr:[{}] 退费表属性信息节点
 * 3、businessReturnPayFeePhoto:[{}] 退费表照片信息节点
 * 4、businessReturnPayFeeCerdentials:[{}] 退费表证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("deleteReturnPayFeeInfoListener")
@Transactional
public class DeleteReturnPayFeeInfoListener extends AbstractReturnPayFeeBusinessServiceDataFlowListener {
    private final static Logger logger = LoggerFactory.getLogger(DeleteReturnPayFeeInfoListener.class);
    @Autowired
    IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl;
    @Override
    public int getOrder() {
        return 3;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_RETURN_PAY_FEE;
    }
    /**
     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        //处理 businessReturnPayFee 节点
        if (data.containsKey("businessReturnPayFee")) {
            //处理 businessReturnPayFee 节点
            if (data.containsKey("businessReturnPayFee")) {
                Object _obj = data.get("businessReturnPayFee");
                JSONArray businessReturnPayFees = null;
                if (_obj instanceof JSONObject) {
                    businessReturnPayFees = new JSONArray();
                    businessReturnPayFees.add(_obj);
                } else {
                    businessReturnPayFees = (JSONArray) _obj;
                }
                //JSONObject businessReturnPayFee = data.getJSONObject("businessReturnPayFee");
                for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFees.size(); _returnPayFeeIndex++) {
                    JSONObject businessReturnPayFee = businessReturnPayFees.getJSONObject(_returnPayFeeIndex);
                    doBusinessReturnPayFee(business, businessReturnPayFee);
                    if (_obj instanceof JSONObject) {
                        dataFlowContext.addParamOut("returnFeeId", businessReturnPayFee.getString("returnFeeId"));
                    }
                }
            }
        }
    }
    /**
     * 删除 instance数据
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        //退费表信息
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_DEL);
        //退费表信息
        List<Map> businessReturnPayFeeInfos = returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo(info);
        if (businessReturnPayFeeInfos != null && businessReturnPayFeeInfos.size() > 0) {
            for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFeeInfos.size(); _returnPayFeeIndex++) {
                Map businessReturnPayFeeInfo = businessReturnPayFeeInfos.get(_returnPayFeeIndex);
                flushBusinessReturnPayFeeInfo(businessReturnPayFeeInfo, StatusConstant.STATUS_CD_INVALID);
                returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance(businessReturnPayFeeInfo);
                dataFlowContext.addParamOut("returnFeeId", businessReturnPayFeeInfo.get("return_fee_id"));
            }
        }
    }
    /**
     * 撤单
     * 从business表中查询到DEL的数据 将instance中的数据更新回来
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_INVALID);
        Map delInfo = new HashMap();
        delInfo.put("bId", business.getbId());
        delInfo.put("operate", StatusConstant.OPERATE_DEL);
        //退费表信息
        List<Map> returnPayFeeInfo = returnPayFeeServiceDaoImpl.getReturnPayFeeInfo(info);
        if (returnPayFeeInfo != null && returnPayFeeInfo.size() > 0) {
            //退费表信息
            List<Map> businessReturnPayFeeInfos = returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo(delInfo);
            //除非程序出错了,这里不会为空
            if (businessReturnPayFeeInfos == null || businessReturnPayFeeInfos.size() == 0) {
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(returnPayFee),程序内部异常,请检查! " + delInfo);
            }
            for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFeeInfos.size(); _returnPayFeeIndex++) {
                Map businessReturnPayFeeInfo = businessReturnPayFeeInfos.get(_returnPayFeeIndex);
                flushBusinessReturnPayFeeInfo(businessReturnPayFeeInfo, StatusConstant.STATUS_CD_VALID);
                returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance(businessReturnPayFeeInfo);
            }
        }
    }
    /**
     * 处理 businessReturnPayFee 节点
     *
     * @param business             总的数据节点
     * @param businessReturnPayFee 退费表节点
     */
    private void doBusinessReturnPayFee(Business business, JSONObject businessReturnPayFee) {
        Assert.jsonObjectHaveKey(businessReturnPayFee, "returnFeeId", "businessReturnPayFee 节点下没有包含 returnFeeId 节点");
        if (businessReturnPayFee.getString("returnFeeId").startsWith("-")) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "returnFeeId 错误,不能自动生成(必须已经存在的returnFeeId)" + businessReturnPayFee);
        }
        //自动插入DEL
        autoSaveDelBusinessReturnPayFee(business, businessReturnPayFee);
    }
    public IReturnPayFeeServiceDao getReturnPayFeeServiceDaoImpl() {
        return returnPayFeeServiceDaoImpl;
    }
    public void setReturnPayFeeServiceDaoImpl(IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl) {
        this.returnPayFeeServiceDaoImpl = returnPayFeeServiceDaoImpl;
    }
}
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/SaveReturnPayFeeInfoListener.java
New file
@@ -0,0 +1,183 @@
package com.java110.fee.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.Assert;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.Business;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 保存 退费表信息 侦听
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("saveReturnPayFeeInfoListener")
@Transactional
public class SaveReturnPayFeeInfoListener extends AbstractReturnPayFeeBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(SaveReturnPayFeeInfoListener.class);
    @Autowired
    private IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl;
    @Override
    public int getOrder() {
        return 0;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_RETURN_PAY_FEE;
    }
    /**
     * 保存退费表信息 business 表中
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        //处理 businessReturnPayFee 节点
        if (data.containsKey("businessReturnPayFee")) {
            Object bObj = data.get("businessReturnPayFee");
            JSONArray businessReturnPayFees = null;
            if (bObj instanceof JSONObject) {
                businessReturnPayFees = new JSONArray();
                businessReturnPayFees.add(bObj);
            } else {
                businessReturnPayFees = (JSONArray) bObj;
            }
            //JSONObject businessReturnPayFee = data.getJSONObject("businessReturnPayFee");
            for (int bReturnPayFeeIndex = 0; bReturnPayFeeIndex < businessReturnPayFees.size(); bReturnPayFeeIndex++) {
                JSONObject businessReturnPayFee = businessReturnPayFees.getJSONObject(bReturnPayFeeIndex);
                doBusinessReturnPayFee(business, businessReturnPayFee);
                if (bObj instanceof JSONObject) {
                    dataFlowContext.addParamOut("returnFeeId", businessReturnPayFee.getString("returnFeeId"));
                }
            }
        }
    }
    /**
     * business 数据转移到 instance
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_ADD);
        //退费表信息
        List<Map> businessReturnPayFeeInfo = returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo(info);
        if (businessReturnPayFeeInfo != null && businessReturnPayFeeInfo.size() > 0) {
            reFreshShareColumn(info, businessReturnPayFeeInfo.get(0));
            returnPayFeeServiceDaoImpl.saveReturnPayFeeInfoInstance(info);
            if (businessReturnPayFeeInfo.size() == 1) {
                dataFlowContext.addParamOut("returnFeeId", businessReturnPayFeeInfo.get(0).get("return_fee_id"));
            }
        }
    }
    /**
     * 刷 分片字段
     *
     * @param info         查询对象
     * @param businessInfo 小区ID
     */
    private void reFreshShareColumn(Map info, Map businessInfo) {
        if (info.containsKey("communityId")) {
            return;
        }
        if (!businessInfo.containsKey("community_id")) {
            return;
        }
        info.put("communityId", businessInfo.get("community_id"));
    }
    /**
     * 撤单
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        Map paramIn = new HashMap();
        paramIn.put("bId", bId);
        paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID);
        //退费表信息
        List<Map> returnPayFeeInfo = returnPayFeeServiceDaoImpl.getReturnPayFeeInfo(info);
        if (returnPayFeeInfo != null && returnPayFeeInfo.size() > 0) {
            reFreshShareColumn(paramIn, returnPayFeeInfo.get(0));
            returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance(paramIn);
        }
    }
    /**
     * 处理 businessReturnPayFee 节点
     *
     * @param business             总的数据节点
     * @param businessReturnPayFee 退费表节点
     */
    private void doBusinessReturnPayFee(Business business, JSONObject businessReturnPayFee) {
        Assert.jsonObjectHaveKey(businessReturnPayFee, "returnFeeId", "businessReturnPayFee 节点下没有包含 returnFeeId 节点");
        if (businessReturnPayFee.getString("returnFeeId").startsWith("-")) {
            //刷新缓存
            //flushReturnPayFeeId(business.getDatas());
            businessReturnPayFee.put("returnFeeId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_returnFeeId));
        }
        businessReturnPayFee.put("bId", business.getbId());
        businessReturnPayFee.put("operate", StatusConstant.OPERATE_ADD);
        //保存退费表信息
        businessReturnPayFee.put("cycles","-"+businessReturnPayFee.get("cycles"));
        businessReturnPayFee.put("receivableAmount","-"+businessReturnPayFee.get("receivableAmount"));
        businessReturnPayFee.put("receivedAmount","-"+businessReturnPayFee.get("receivedAmount"));
        businessReturnPayFee.put("state","1000");
        returnPayFeeServiceDaoImpl.saveBusinessReturnPayFeeInfo(businessReturnPayFee);
    }
    public IReturnPayFeeServiceDao getReturnPayFeeServiceDaoImpl() {
        return returnPayFeeServiceDaoImpl;
    }
    public void setReturnPayFeeServiceDaoImpl(IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl) {
        this.returnPayFeeServiceDaoImpl = returnPayFeeServiceDaoImpl;
    }
}
FeeService/src/main/java/com/java110/fee/listener/returnPayFee/UpdateReturnPayFeeInfoListener.java
New file
@@ -0,0 +1,187 @@
package com.java110.fee.listener.returnPayFee;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 修改退费表信息 侦听
 * <p>
 * 处理节点
 * 1、businessReturnPayFee:{} 退费表基本信息节点
 * 2、businessReturnPayFeeAttr:[{}] 退费表属性信息节点
 * 3、businessReturnPayFeePhoto:[{}] 退费表照片信息节点
 * 4、businessReturnPayFeeCerdentials:[{}] 退费表证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("updateReturnPayFeeInfoListener")
@Transactional
public class UpdateReturnPayFeeInfoListener extends AbstractReturnPayFeeBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(UpdateReturnPayFeeInfoListener.class);
    @Autowired
    private IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl;
    @Override
    public int getOrder() {
        return 2;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_RETURN_PAY_FEE;
    }
    /**
     * business过程
     *
     * @param dataFlowContext 上下文对象
     * @param business        业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        if (data.containsKey("businessReturnPayFee")) {
            Object _obj = data.get("businessReturnPayFee");
            JSONArray businessReturnPayFees = null;
            if (_obj instanceof JSONObject) {
                businessReturnPayFees = new JSONArray();
                businessReturnPayFees.add(_obj);
            } else {
                businessReturnPayFees = (JSONArray) _obj;
            }
            //JSONObject businessReturnPayFee = data.getJSONObject("businessReturnPayFee");
            for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFees.size(); _returnPayFeeIndex++) {
                JSONObject businessReturnPayFee = businessReturnPayFees.getJSONObject(_returnPayFeeIndex);
                doBusinessReturnPayFee(business, businessReturnPayFee);
                if (_obj instanceof JSONObject) {
                    dataFlowContext.addParamOut("returnFeeId", businessReturnPayFee.getString("returnFeeId"));
                }
            }
        }
    }
    /**
     * business to instance 过程
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_ADD);
        //退费表信息
        List<Map> businessReturnPayFeeInfos = returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo(info);
        if (businessReturnPayFeeInfos != null && businessReturnPayFeeInfos.size() > 0) {
            for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFeeInfos.size(); _returnPayFeeIndex++) {
                Map businessReturnPayFeeInfo = businessReturnPayFeeInfos.get(_returnPayFeeIndex);
                flushBusinessReturnPayFeeInfo(businessReturnPayFeeInfo, StatusConstant.STATUS_CD_VALID);
                returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance(businessReturnPayFeeInfo);
                if (businessReturnPayFeeInfo.size() == 1) {
                    dataFlowContext.addParamOut("returnFeeId", businessReturnPayFeeInfo.get("return_fee_id"));
                }
            }
        }
    }
    /**
     * 撤单
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        Map delInfo = new HashMap();
        delInfo.put("bId", business.getbId());
        delInfo.put("operate", StatusConstant.OPERATE_DEL);
        //退费表信息
        List<Map> returnPayFeeInfo = returnPayFeeServiceDaoImpl.getReturnPayFeeInfo(info);
        if (returnPayFeeInfo != null && returnPayFeeInfo.size() > 0) {
            //退费表信息
            List<Map> businessReturnPayFeeInfos = returnPayFeeServiceDaoImpl.getBusinessReturnPayFeeInfo(delInfo);
            //除非程序出错了,这里不会为空
            if (businessReturnPayFeeInfos == null || businessReturnPayFeeInfos.size() == 0) {
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(returnPayFee),程序内部异常,请检查! " + delInfo);
            }
            for (int _returnPayFeeIndex = 0; _returnPayFeeIndex < businessReturnPayFeeInfos.size(); _returnPayFeeIndex++) {
                Map businessReturnPayFeeInfo = businessReturnPayFeeInfos.get(_returnPayFeeIndex);
                flushBusinessReturnPayFeeInfo(businessReturnPayFeeInfo, StatusConstant.STATUS_CD_VALID);
                returnPayFeeServiceDaoImpl.updateReturnPayFeeInfoInstance(businessReturnPayFeeInfo);
            }
        }
    }
    /**
     * 处理 businessReturnPayFee 节点
     *
     * @param business             总的数据节点
     * @param businessReturnPayFee 退费表节点
     */
    private void doBusinessReturnPayFee(Business business, JSONObject businessReturnPayFee) {
        Assert.jsonObjectHaveKey(businessReturnPayFee, "returnFeeId", "businessReturnPayFee 节点下没有包含 returnFeeId 节点");
        if (businessReturnPayFee.getString("returnFeeId").startsWith("-")) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "returnFeeId 错误,不能自动生成(必须已经存在的returnFeeId)" + businessReturnPayFee);
        }
        //自动保存DEL
        autoSaveDelBusinessReturnPayFee(business, businessReturnPayFee);
        businessReturnPayFee.put("bId", business.getbId());
        businessReturnPayFee.put("operate", StatusConstant.OPERATE_ADD);
        //保存退费表信息
        returnPayFeeServiceDaoImpl.saveBusinessReturnPayFeeInfo(businessReturnPayFee);
    }
    public IReturnPayFeeServiceDao getReturnPayFeeServiceDaoImpl() {
        return returnPayFeeServiceDaoImpl;
    }
    public void setReturnPayFeeServiceDaoImpl(IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl) {
        this.returnPayFeeServiceDaoImpl = returnPayFeeServiceDaoImpl;
    }
}
FeeService/src/main/java/com/java110/fee/smo/impl/ReturnPayFeeInnerServiceSMOImpl.java
New file
@@ -0,0 +1,112 @@
package com.java110.fee.smo.impl;
import com.java110.dto.returnPayFee.ReturnPayFeeDto;
import com.java110.fee.dao.IReturnPayFeeServiceDao;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.smo.returnPayFee.IReturnPayFeeInnerServiceSMO;
import com.java110.core.smo.user.IUserInnerServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.user.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
 * @ClassName FloorInnerServiceSMOImpl
 * @Description 退费表内部服务实现类
 * @Author wuxw
 * @Date 2019/4/24 9:20
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@RestController
public class ReturnPayFeeInnerServiceSMOImpl extends BaseServiceSMO implements IReturnPayFeeInnerServiceSMO {
    @Autowired
    private IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public List<ReturnPayFeeDto> queryReturnPayFees(@RequestBody ReturnPayFeeDto returnPayFeeDto) {
        //校验是否传了 分页信息
        int page = returnPayFeeDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            returnPayFeeDto.setPage((page - 1) * returnPayFeeDto.getRow());
        }
        List<ReturnPayFeeDto> returnPayFees = BeanConvertUtil.covertBeanList(returnPayFeeServiceDaoImpl.getReturnPayFeeInfo(BeanConvertUtil.beanCovertMap(returnPayFeeDto)), ReturnPayFeeDto.class);
        if (returnPayFees == null || returnPayFees.size() == 0) {
            return returnPayFees;
        }
//        String[] userIds = getUserIds(returnPayFees);
//        //根据 userId 查询用户信息
//        List<UserDto> users = userInnerServiceSMOImpl.getUserInfo(userIds);
//
//        for (ReturnPayFeeDto returnPayFee : returnPayFees) {
//            refreshReturnPayFee(returnPayFee, users);
//        }
        return returnPayFees;
    }
//    /**
//     * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中
//     *
//     * @param returnPayFee 小区退费表信息
//     * @param users        用户列表
//     */
//    private void refreshReturnPayFee(ReturnPayFeeDto returnPayFee, List<UserDto> users) {
//        for (UserDto user : users) {
//            if (returnPayFee.getUserId().equals(user.getUserId())) {
//                BeanConvertUtil.covertBean(user, returnPayFee);
//            }
//        }
//    }
//
//    /**
//     * 获取批量userId
//     *
//     * @param returnPayFees 小区楼信息
//     * @return 批量userIds 信息
//     */
//    private String[] getUserIds(List<ReturnPayFeeDto> returnPayFees) {
//        List<String> userIds = new ArrayList<String>();
//        for (ReturnPayFeeDto returnPayFee : returnPayFees) {
//            userIds.add(returnPayFee.getUserId());
//        }
//
//        return userIds.toArray(new String[userIds.size()]);
//    }
    @Override
    public int queryReturnPayFeesCount(@RequestBody ReturnPayFeeDto returnPayFeeDto) {
        return returnPayFeeServiceDaoImpl.queryReturnPayFeesCount(BeanConvertUtil.beanCovertMap(returnPayFeeDto));
    }
    public IReturnPayFeeServiceDao getReturnPayFeeServiceDaoImpl() {
        return returnPayFeeServiceDaoImpl;
    }
    public void setReturnPayFeeServiceDaoImpl(IReturnPayFeeServiceDao returnPayFeeServiceDaoImpl) {
        this.returnPayFeeServiceDaoImpl = returnPayFeeServiceDaoImpl;
    }
    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
        return userInnerServiceSMOImpl;
    }
    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
    }
}
docs/document/services/returnPayFee/SaveReturnPayFeeInfo.md
New file
@@ -0,0 +1,140 @@
**1\. 保存退费表**
###### 接口功能
> API服务做保存退费表时调用该接口
###### URL
> [http://returnPayFee-service/returnPayFeeApi/service](http://returnPayFee-service/returnPayFeeApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessReturnPayFeeInfo|1|Object|-|小区成员|小区成员|
|businessReturnPayFeeInfo|reason|1|String|30|-|-|
|businessReturnPayFeeInfo|primeRate|1|String|30|-|-|
|businessReturnPayFeeInfo|feeTypeCd|1|String|30|-|-|
|businessReturnPayFeeInfo|payTime|1|String|30|-|-|
|businessReturnPayFeeInfo|detailId|1|String|30|-|-|
|businessReturnPayFeeInfo|receivableAmount|1|String|30|-|-|
|businessReturnPayFeeInfo|cycles|1|String|30|-|-|
|businessReturnPayFeeInfo|remark|1|String|30|-|-|
|businessReturnPayFeeInfo|receivedAmount|1|String|30|-|-|
|businessReturnPayFeeInfo|feeId|1|String|30|-|-|
|businessReturnPayFeeInfo|returnFeeId|1|String|30|-|-|
|businessReturnPayFeeInfo|configId|1|String|30|-|-|
|businessReturnPayFeeInfo|state|1|String|30|-|-|
|businessReturnPayFeeInfo|communityId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://returnPayFee-service/returnPayFeeApi/service](http://returnPayFee-service/returnPayFeeApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "621100030001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessReturnPayFeeInfo": {
                "reason":"填写具体值",
        "primeRate":"填写具体值",
        "feeTypeCd":"填写具体值",
        "payTime":"填写具体值",
        "detailId":"填写具体值",
        "receivableAmount":"填写具体值",
        "cycles":"填写具体值",
        "remark":"填写具体值",
        "receivedAmount":"填写具体值",
        "feeId":"填写具体值",
        "returnFeeId":"填写具体值",
        "configId":"填写具体值",
        "state":"填写具体值",
        "communityId":"填写具体值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
java110-bean/src/main/java/com/java110/dto/returnPayFee/ReturnPayFeeDto.java
New file
@@ -0,0 +1,185 @@
package com.java110.dto.returnPayFee;
import com.java110.dto.PageDto;
import java.io.Serializable;
import java.util.Date;
/**
 * @ClassName FloorDto
 * @Description 退费表数据层封装
 * @Author wuxw
 * @Date 2019/4/24 8:52
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
public class ReturnPayFeeDto extends PageDto implements Serializable {
    private String reason;
    private String primeRate;
    private String feeTypeCd;
    private String payTime;
    private String detailId;
    private String receivableAmount;
    private String cycles;
    private String remark;
    private String receivedAmount;
    private String feeId;
    private String returnFeeId;
    private String configId;
    private String state;
    private String communityId;
    private String createTime;
    private String statusCd = "0";
    private String feeTypeCdName;
    private String stateName;
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getPrimeRate() {
        return primeRate;
    }
    public void setPrimeRate(String primeRate) {
        this.primeRate = primeRate;
    }
    public String getFeeTypeCd() {
        return feeTypeCd;
    }
    public void setFeeTypeCd(String feeTypeCd) {
        this.feeTypeCd = feeTypeCd;
    }
    public String getPayTime() {
        return payTime;
    }
    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }
    public String getDetailId() {
        return detailId;
    }
    public void setDetailId(String detailId) {
        this.detailId = detailId;
    }
    public String getReceivableAmount() {
        return receivableAmount;
    }
    public void setReceivableAmount(String receivableAmount) {
        this.receivableAmount = receivableAmount;
    }
    public String getCycles() {
        return cycles;
    }
    public void setCycles(String cycles) {
        this.cycles = cycles;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getReceivedAmount() {
        return receivedAmount;
    }
    public void setReceivedAmount(String receivedAmount) {
        this.receivedAmount = receivedAmount;
    }
    public String getFeeId() {
        return feeId;
    }
    public void setFeeId(String feeId) {
        this.feeId = feeId;
    }
    public String getReturnFeeId() {
        return returnFeeId;
    }
    public void setReturnFeeId(String returnFeeId) {
        this.returnFeeId = returnFeeId;
    }
    public String getConfigId() {
        return configId;
    }
    public void setConfigId(String configId) {
        this.configId = configId;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getStatusCd() {
        return statusCd;
    }
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getFeeTypeCdName() {
        return feeTypeCdName;
    }
    public void setFeeTypeCdName(String feeTypeCdName) {
        this.feeTypeCdName = feeTypeCdName;
    }
    public String getStateName() {
        return stateName;
    }
    public void setStateName(String stateName) {
        this.stateName = stateName;
    }
}
java110-bean/src/main/java/com/java110/vo/api/returnPayFee/ApiReturnPayFeeDataVo.java
New file
@@ -0,0 +1,188 @@
package com.java110.vo.api.returnPayFee;
import java.io.Serializable;
import java.util.Date;
public class ApiReturnPayFeeDataVo implements Serializable {
    private String reason;
    private String primeRate;
    private String feeTypeCd;
    private String payTime;
    private String detailId;
    private String receivableAmount;
    private String cycles;
    private String remark;
    private String statusCd;
    private String receivedAmount;
    private String feeId;
    private String returnFeeId;
    private String operate;
    private String configId;
    private String state;
    private String bId;
    private String communityId;
    private String feeTypeCdName;
    private String stateName;
    private String createTime;
    public String getReason() {
        return reason;
    }
    public void setReason(String reason) {
        this.reason = reason;
    }
    public String getPrimeRate() {
        return primeRate;
    }
    public void setPrimeRate(String primeRate) {
        this.primeRate = primeRate;
    }
    public String getFeeTypeCd() {
        return feeTypeCd;
    }
    public void setFeeTypeCd(String feeTypeCd) {
        this.feeTypeCd = feeTypeCd;
    }
    public String getPayTime() {
        return payTime;
    }
    public void setPayTime(String payTime) {
        this.payTime = payTime;
    }
    public String getDetailId() {
        return detailId;
    }
    public void setDetailId(String detailId) {
        this.detailId = detailId;
    }
    public String getReceivableAmount() {
        return receivableAmount;
    }
    public void setReceivableAmount(String receivableAmount) {
        this.receivableAmount = receivableAmount;
    }
    public String getCycles() {
        return cycles;
    }
    public void setCycles(String cycles) {
        this.cycles = cycles;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getStatusCd() {
        return statusCd;
    }
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getReceivedAmount() {
        return receivedAmount;
    }
    public void setReceivedAmount(String receivedAmount) {
        this.receivedAmount = receivedAmount;
    }
    public String getFeeId() {
        return feeId;
    }
    public void setFeeId(String feeId) {
        this.feeId = feeId;
    }
    public String getReturnFeeId() {
        return returnFeeId;
    }
    public void setReturnFeeId(String returnFeeId) {
        this.returnFeeId = returnFeeId;
    }
    public String getOperate() {
        return operate;
    }
    public void setOperate(String operate) {
        this.operate = operate;
    }
    public String getConfigId() {
        return configId;
    }
    public void setConfigId(String configId) {
        this.configId = configId;
    }
    public String getState() {
        return state;
    }
    public void setState(String state) {
        this.state = state;
    }
    public String getBId() {
        return bId;
    }
    public void setBId(String bId) {
        this.bId = bId;
    }
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getFeeTypeCdName() {
        return feeTypeCdName;
    }
    public void setFeeTypeCdName(String feeTypeCdName) {
        this.feeTypeCdName = feeTypeCdName;
    }
    public String getStateName() {
        return stateName;
    }
    public void setStateName(String stateName) {
        this.stateName = stateName;
    }
    public String getCreateTime() {
        return createTime;
    }
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
java110-bean/src/main/java/com/java110/vo/api/returnPayFee/ApiReturnPayFeeVo.java
New file
@@ -0,0 +1,19 @@
package com.java110.vo.api.returnPayFee;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
public class ApiReturnPayFeeVo extends MorePageVo implements Serializable {
    List<ApiReturnPayFeeDataVo> returnPayFees;
    public List<ApiReturnPayFeeDataVo> getReturnPayFees() {
        return returnPayFees;
    }
    public void setReturnPayFees(List<ApiReturnPayFeeDataVo> returnPayFees) {
        this.returnPayFees = returnPayFees;
    }
}
java110-code-generator/src/main/resources/back/template_1.json
@@ -1,54 +1,56 @@
{
  "id": "ipStaffId",
  "name": "inspectionPlanStaff",
  "desc": "执行计划人",
  "id": "returnFeeId",
  "name": "returnPayFee",
  "desc": "退费表",
  "shareParam": "communityId",
  "shareColumn": "community_id",
  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_PLAN_STAFF",
  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_PLAN_STAFF",
  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_PLAN_STAFF",
  "newBusinessTypeCdValue": "520300030001",
  "updateBusinessTypeCdValue": "520300040001",
  "deleteBusinessTypeCdValue": "520300050001",
  "businessTableName": "business_inspection_plan_staff",
  "tableName": "inspection_plan_staff",
  "newBusinessTypeCd": "BUSINESS_TYPE_SAVE_RETURN_PAY_FEE",
  "updateBusinessTypeCd": "BUSINESS_TYPE_UPDATE_RETURN_PAY_FEE",
  "deleteBusinessTypeCd": "BUSINESS_TYPE_DELETE_RETURN_PAY_FEE",
  "newBusinessTypeCdValue": "621100030001",
  "updateBusinessTypeCdValue": "621100040001",
  "deleteBusinessTypeCdValue": "621100050001",
  "businessTableName": "business_return_pay_fee",
  "tableName": "return_pay_fee",
  "param": {
    "ipStaffId": "ip_staff_id",
    "returnFeeId": "return_fee_id",
    "bId": "bId",
    "inspectionPlanId": "inspection_plan_id",
    "configId": "config_id",
    "communityId": "community_id",
    "staffId": "staff_id",
    "staffName": "staff_name",
    "startTime": "start_time",
    "endTime": "end_time",
    "createTime": "create_time",
    "feeId": "fee_id",
    "feeTypeCd": "fee_type_cd",
    "detailId": "detail_id",
    "cycles": "cycles",
    "receivableAmount": "receivable_amount",
    "receivedAmount": "received_amount",
    "primeRate": "prime_rate",
    "remark": "remark",
    "state": "state",
    "statusCd": "status_cd",
    "operate": "operate"
    "payTime": "pay_time",
    "operate": "operate",
    "reason": "reason"
  },
  "required": [
    {
      "code": "staffId",
      "msg": "巡检执行人不能为空"
      "code": "configId",
      "msg": "费用项ID不能为空"
    },
    {
      "code": "staffName",
      "msg": "巡检执行人名称不能为空"
      "code": "feeId",
      "msg": "feeId不能为空"
    },
    {
      "code": "communityId",
      "msg": "小区不能为空"
    },
    {
      "code": "startTime",
      "msg": "开始时间不能为空"
      "code": "detailId",
      "msg": "缴费id不能为空"
    },
    {
      "code": "endTime",
      "msg": "结束时间不能为空"
    },
    {
      "code": "inspectionPlanId",
      "msg": "巡检计划不能为空"
      "code": "reason",
      "msg": "退费原因不能为空"
    }
  ]
}
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
@@ -125,6 +125,7 @@
    public static final String CODE_PREFIX_applyOrderId = "15";
    public static final String CODE_PREFIX_fastuserId = "68";
    public static final String CODE_PREFIX_junkRequirementId = "69";
    public static final String CODE_PREFIX_returnFeeId = "70";
java110-core/src/main/java/com/java110/core/smo/returnPayFee/IReturnPayFeeInnerServiceSMO.java
New file
@@ -0,0 +1,42 @@
package com.java110.core.smo.returnPayFee;
import com.java110.core.feign.FeignConfiguration;
import com.java110.dto.returnPayFee.ReturnPayFeeDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
/**
 * @ClassName IReturnPayFeeInnerServiceSMO
 * @Description 退费表接口类
 * @Author wuxw
 * @Date 2019/4/24 9:04
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
@RequestMapping("/returnPayFeeApi")
public interface IReturnPayFeeInnerServiceSMO {
    /**
     * <p>查询小区楼信息</p>
     *
     * @param returnPayFeeDto 数据对象分享
     * @return ReturnPayFeeDto 对象数据
     */
    @RequestMapping(value = "/queryReturnPayFees", method = RequestMethod.POST)
    List<ReturnPayFeeDto> queryReturnPayFees(@RequestBody ReturnPayFeeDto returnPayFeeDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param returnPayFeeDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryReturnPayFeesCount", method = RequestMethod.POST)
    int queryReturnPayFeesCount(@RequestBody ReturnPayFeeDto returnPayFeeDto);
}
java110-db/src/main/resources/mapper/fee/ReturnPayFeeServiceDaoImplMapper.xml
New file
@@ -0,0 +1,306 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="returnPayFeeServiceDaoImpl">
    <!-- 保存退费表信息 add by wuxw 2018-07-03 -->
    <insert id="saveBusinessReturnPayFeeInfo" parameterType="Map">
        insert into
            business_return_pay_fee(
                reason,prime_rate,fee_type_cd,
                pay_time,detail_id,receivable_amount,
                cycles,remark,received_amount,
                fee_id,return_fee_id,operate,
                config_id,state,b_id,community_id) values (
                #{reason},#{primeRate},#{feeTypeCd},#{payTime},#{detailId},#{receivableAmount},
                #{cycles},#{remark},#{receivedAmount},#{feeId},#{returnFeeId},#{operate},#{configId},
                #{state},#{bId},#{communityId})
       </insert>
    <!-- 查询退费表信息(Business) add by wuxw 2018-07-03 -->
    <select id="getBusinessReturnPayFeeInfo" parameterType="Map" resultType="Map">
        select
            t.reason,
            t.prime_rate,t.prime_rate primeRate,
            t.fee_type_cd,t.fee_type_cd feeTypeCd,
            t.pay_time,t.pay_time payTime,
            t.detail_id,t.detail_id detailId,
            t.receivable_amount,t.receivable_amount receivableAmount,
            t.cycles,
            t.remark,
            t.received_amount,t.received_amount receivedAmount,
            t.fee_id,t.fee_id feeId,
            t.return_fee_id,t.return_fee_id returnFeeId,
            t.operate,t.config_id,t.config_id configId,
            t.state,
            t.b_id,t.b_id bId,
            t.community_id,t.community_id communityId
        from business_return_pay_fee t
        where 1 =1
        <if test="reason !=null and reason != ''">
            and t.reason= #{reason}
        </if>
        <if test="primeRate !=null and primeRate != ''">
            and t.prime_rate= #{primeRate}
        </if>
        <if test="feeTypeCd !=null and feeTypeCd != ''">
            and t.fee_type_cd= #{feeTypeCd}
        </if>
        <if test="payTime !=null and payTime != ''">
            and t.pay_time= #{payTime}
        </if>
        <if test="detailId !=null and detailId != ''">
            and t.detail_id= #{detailId}
        </if>
        <if test="receivableAmount !=null and receivableAmount != ''">
            and t.receivable_amount= #{receivableAmount}
        </if>
        <if test="cycles !=null and cycles != ''">
            and t.cycles= #{cycles}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="receivedAmount !=null and receivedAmount != ''">
            and t.received_amount= #{receivedAmount}
        </if>
        <if test="feeId !=null and feeId != ''">
            and t.fee_id= #{feeId}
        </if>
        <if test="returnFeeId !=null and returnFeeId != ''">
            and t.return_fee_id= #{returnFeeId}
        </if>
        <if test="operate !=null and operate != ''">
            and t.operate= #{operate}
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
    <!-- 保存退费表信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveReturnPayFeeInfoInstance" parameterType="Map">
        insert into return_pay_fee(
            reason,prime_rate,fee_type_cd,pay_time,detail_id,receivable_amount,cycles,
        remark,status_cd,received_amount,fee_id,return_fee_id,config_id,state,b_id,community_id
        ) select t.reason,t.prime_rate,t.fee_type_cd,t.pay_time,t.detail_id,t.receivable_amount,t.cycles,t.remark,'0',
        t.received_amount,t.fee_id,t.return_fee_id,t.config_id,t.state,t.b_id,t.community_id
        from business_return_pay_fee t where 1=1
        <if test="reason !=null and reason != ''">
            and t.reason= #{reason}
        </if>
        <if test="primeRate !=null and primeRate != ''">
            and t.prime_rate= #{primeRate}
        </if>
        <if test="feeTypeCd !=null and feeTypeCd != ''">
            and t.fee_type_cd= #{feeTypeCd}
        </if>
        <if test="payTime !=null and payTime != ''">
            and t.pay_time= #{payTime}
        </if>
        <if test="detailId !=null and detailId != ''">
            and t.detail_id= #{detailId}
        </if>
        <if test="receivableAmount !=null and receivableAmount != ''">
            and t.receivable_amount= #{receivableAmount}
        </if>
        <if test="cycles !=null and cycles != ''">
            and t.cycles= #{cycles}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="receivedAmount !=null and receivedAmount != ''">
            and t.received_amount= #{receivedAmount}
        </if>
        <if test="feeId !=null and feeId != ''">
            and t.fee_id= #{feeId}
        </if>
        <if test="returnFeeId !=null and returnFeeId != ''">
            and t.return_fee_id= #{returnFeeId}
        </if>
        and t.operate= 'ADD'
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </insert>
    <!-- 查询退费表信息 add by wuxw 2018-07-03 -->
    <select id="getReturnPayFeeInfo" parameterType="Map" resultType="Map">
        select
        t.reason,
        t.prime_rate,t.prime_rate primeRate,
        t.fee_type_cd,t.fee_type_cd feeTypeCd,
        t.pay_time,t.pay_time payTime,
        t.detail_id,t.detail_id detailId,
        t.receivable_amount,t.receivable_amount receivableAmount,
        t.cycles,
        t.remark,
        t.status_cd,t.status_cd statusCd,
        t.received_amount,t.received_amount receivedAmount,
        t.fee_id,t.fee_id feeId,
        t.return_fee_id,t.return_fee_id returnFeeId,
        t.config_id,t.config_id configId,
        t.state,
        t.b_id,t.b_id bId,
        t.community_id,t.community_id communityId,
        t.create_time,t.create_time createTime,
        d.name feeTypeCdName,
        c.name stateName
        from return_pay_fee t
        inner join t_dict d on t.fee_type_cd = d.status_cd and d.table_name = 'pay_fee_config' and d.table_columns = 'fee_type_cd'
        inner join t_dict c on t.state = c.status_cd and c.table_name = 'return_pay_fee' and c.table_columns = 'state'
        where 1 =1
        <if test="reason !=null and reason != ''">
            and t.reason= #{reason}
        </if>
        <if test="primeRate !=null and primeRate != ''">
            and t.prime_rate= #{primeRate}
        </if>
        <if test="feeTypeCd !=null and feeTypeCd != ''">
            and t.fee_type_cd= #{feeTypeCd}
        </if>
        <if test="payTime !=null and payTime != ''">
            and t.pay_time= #{payTime}
        </if>
        <if test="detailId !=null and detailId != ''">
            and t.detail_id= #{detailId}
        </if>
        <if test="receivableAmount !=null and receivableAmount != ''">
            and t.receivable_amount= #{receivableAmount}
        </if>
        <if test="cycles !=null and cycles != ''">
            and t.cycles= #{cycles}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="receivedAmount !=null and receivedAmount != ''">
            and t.received_amount= #{receivedAmount}
        </if>
        <if test="feeId !=null and feeId != ''">
            and t.fee_id= #{feeId}
        </if>
        <if test="returnFeeId !=null and returnFeeId != ''">
            and t.return_fee_id= #{returnFeeId}
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <!-- 修改退费表信息 add by wuxw 2018-07-03 -->
    <update id="updateReturnPayFeeInfoInstance" parameterType="Map">
        update return_pay_fee t set t.status_cd = #{statusCd}
        <if test="state !=null and state != ''">
            , t.state= #{state}
        </if>
        where 1=1
        <if test="returnFeeId !=null and returnFeeId != ''">
            and t.return_fee_id= #{returnFeeId}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
    </update>
    <!-- 查询退费表数量 add by wuxw 2018-07-03 -->
    <select id="queryReturnPayFeesCount" parameterType="Map" resultType="Map">
        select count(1) count
        from return_pay_fee t
        where 1 =1
        <if test="reason !=null and reason != ''">
            and t.reason= #{reason}
        </if>
        <if test="primeRate !=null and primeRate != ''">
            and t.prime_rate= #{primeRate}
        </if>
        <if test="feeTypeCd !=null and feeTypeCd != ''">
            and t.fee_type_cd= #{feeTypeCd}
        </if>
        <if test="payTime !=null and payTime != ''">
            and t.pay_time= #{payTime}
        </if>
        <if test="detailId !=null and detailId != ''">
            and t.detail_id= #{detailId}
        </if>
        <if test="receivableAmount !=null and receivableAmount != ''">
            and t.receivable_amount= #{receivableAmount}
        </if>
        <if test="cycles !=null and cycles != ''">
            and t.cycles= #{cycles}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="receivedAmount !=null and receivedAmount != ''">
            and t.received_amount= #{receivedAmount}
        </if>
        <if test="feeId !=null and feeId != ''">
            and t.fee_id= #{feeId}
        </if>
        <if test="returnFeeId !=null and returnFeeId != ''">
            and t.return_fee_id= #{returnFeeId}
        </if>
        <if test="configId !=null and configId != ''">
            and t.config_id= #{configId}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
    </select>
</mapper>
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
@@ -454,6 +454,19 @@
     */
    public static final String BUSINESS_TYPE_DELETE_FEE_CONFIG = "620100050001";
    /**
     * 保存退费信息
     */
    public static final String BUSINESS_TYPE_SAVE_RETURN_PAY_FEE = "621100030001";
    /**
     * 修改退费信息
     */
    public static final String BUSINESS_TYPE_UPDATE_RETURN_PAY_FEE = "621100040001";
    /**
     * 删除退费信息
     */
    public static final String BUSINESS_TYPE_DELETE_RETURN_PAY_FEE = "621100050001";
    /**
     * 删除住户
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeReturnPayFeeConstant.java
New file
@@ -0,0 +1,31 @@
package com.java110.utils.constant;
/**
 * 退费表常量类
 * Created by wuxw on 2017/5/20.
 */
public class ServiceCodeReturnPayFeeConstant {
    /**
     * 添加 退费表
     */
    public static final String ADD_RETURNPAYFEE = "returnPayFee.saveReturnPayFee";
    /**
     * 修改 退费表
     */
    public static final String UPDATE_RETURNPAYFEE = "returnPayFee.updateReturnPayFee";
    /**
     * 删除 退费表
     */
    public static final String DELETE_RETURNPAYFEE = "returnPayFee.deleteReturnPayFee";
    /**
     * 查询 退费表
     */
    public static final String LIST_RETURNPAYFEES = "returnPayFee.listReturnPayFees";
}