提交代码

yy_dev
胡锐 2 years ago
parent 5f4f05cb6a
commit 8d156bc7bd
  1. 2
      bweb/src/main/java/com/bweb/controller/BsCompanyController.java
  2. 2
      bweb/src/main/java/com/bweb/controller/BsDeviceController.java
  3. 1
      bweb/src/main/java/com/bweb/controller/BsStoreDiscountActivityController.java
  4. 321
      bweb/src/main/java/com/bweb/controller/BsTradeTakeConfigController.java
  5. 6
      bweb/src/main/java/com/bweb/excel/listener/ImportDeviceListener.java
  6. 2
      bweb/src/main/resources/prod/application.yml
  7. 58
      cweb/src/main/java/com/cweb/notify/WeiXinController.java
  8. 2
      cweb/src/main/resources/prod/application.yml
  9. 3
      schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java
  10. 57
      service/src/main/java/com/hfkj/channel/weixin/WeiXinMerService.java
  11. 45
      service/src/main/java/com/hfkj/channel/weixin/utils/WxOrderConfig.java
  12. 24
      service/src/main/java/com/hfkj/dao/BsIndustryMapper.java
  13. 42
      service/src/main/java/com/hfkj/dao/BsIndustrySqlProvider.java
  14. 29
      service/src/main/java/com/hfkj/dao/BsMerPlatformNoMapper.java
  15. 28
      service/src/main/java/com/hfkj/dao/BsMerPlatformNoSqlProvider.java
  16. 30
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivityMapper.java
  17. 14
      service/src/main/java/com/hfkj/dao/BsStoreDiscountActivitySqlProvider.java
  18. 61
      service/src/main/java/com/hfkj/dao/BsTradeOrderMapper.java
  19. 14
      service/src/main/java/com/hfkj/dao/BsTradeOrderSqlProvider.java
  20. 190
      service/src/main/java/com/hfkj/dao/BsTradeTakeConfigMapper.java
  21. 7
      service/src/main/java/com/hfkj/dao/BsTradeTakeConfigMapperExt.java
  22. 542
      service/src/main/java/com/hfkj/dao/BsTradeTakeConfigSqlProvider.java
  23. 48
      service/src/main/java/com/hfkj/entity/BsIndustry.java
  24. 210
      service/src/main/java/com/hfkj/entity/BsIndustryExample.java
  25. 32
      service/src/main/java/com/hfkj/entity/BsMerPlatformNo.java
  26. 120
      service/src/main/java/com/hfkj/entity/BsMerPlatformNoExample.java
  27. 16
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivity.java
  28. 60
      service/src/main/java/com/hfkj/entity/BsStoreDiscountActivityExample.java
  29. 16
      service/src/main/java/com/hfkj/entity/BsTradeOrder.java
  30. 60
      service/src/main/java/com/hfkj/entity/BsTradeOrderExample.java
  31. 473
      service/src/main/java/com/hfkj/entity/BsTradeTakeConfig.java
  32. 1984
      service/src/main/java/com/hfkj/entity/BsTradeTakeConfigExample.java
  33. 10
      service/src/main/java/com/hfkj/service/BsMerPlatformNoService.java
  34. 36
      service/src/main/java/com/hfkj/service/BsTradeTakeConfigService.java
  35. 23
      service/src/main/java/com/hfkj/service/impl/BsMerPlatformNoServiceImpl.java
  36. 3
      service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java
  37. 339
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java
  38. 72
      service/src/main/java/com/hfkj/service/impl/BsTradeTakeConfigServiceImpl.java
  39. 2
      service/src/main/java/com/hfkj/service/impl/CommonServiceImpl.java
  40. 1
      service/src/main/java/com/hfkj/sysenum/MerAttachType.java
  41. 51
      service/src/main/java/com/hfkj/sysenum/ProfitSharingReceiverRoleEnum.java
  42. 2
      service/src/main/resources/prod/commonConfig.properties

@ -106,7 +106,7 @@ public class BsCompanyController {
user.setAvatar(company.getLogo());
user.setUserName(company.getName());
user.setLoginName(body.getString("loginName"));
user.setPassword(MD5Encoder.encode(body.getString("password").getBytes()));
user.setPassword(MD5Util.encode(body.getString("password").getBytes()));
user.setStatus(1);
user.setAdminFlag(1);
user.setCreateTime(new Date());

@ -125,7 +125,7 @@ public class BsDeviceController {
}
ImportDeviceListener importDeviceListener = new ImportDeviceListener();
importDeviceListener.initData(userModel, deviceService);
importDeviceListener.initData(userModel, body.getInteger("deviceType"), deviceService);
EasyExcel.read(fileUrl, ImportDeviceModel.class, importDeviceListener).sheet().doRead();
return ResponseMsgUtil.success(importDeviceListener.getErrorData());

@ -59,6 +59,7 @@ public class BsStoreDiscountActivityController {
|| StringUtils.isBlank(body.getName())
|| body.getDiscountType() == null
|| body.getDiscountPrice() == null
|| body.getFinalCostPrice() == null
|| body.getEndTime() == null
) {
log.error("BsStoreDiscountActivityController --> configActivity() error!", "参数错误");

@ -0,0 +1,321 @@
package com.bweb.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.weixin.utils.WxOrderConfig;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.model.UserInfoModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum;
import com.hfkj.sysenum.TradeOrderRefundStatusEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;
/**
* @className: BsTradeTakeConfigController
* @author: HuRui
* @date: 2023/2/27
**/
@Controller
@Api(value = "交易订单退款")
@RequestMapping(value = "/tradeTakeConfig")
public class BsTradeTakeConfigController {
private static Logger log = LoggerFactory.getLogger(BsTradeTakeConfigController.class);
@Resource
private BsCompanyService companyService;
@Resource
private BsTradeTakeConfigService tradeTakeConfigService;
@Resource
private BsAgentService agentService;
@Resource
private BsMerPlatformNoService merPlatformNoService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/editParentCompanyConfig",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑母公司抽成配置")
public ResponseData editParentCompanyConfig(@RequestBody JSONObject body) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel.getBsCompany() == null) {
log.error("configAccount error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (body == null
|| body.getLong("companyId") == null
|| body.getInteger("platformType") == null
|| StringUtils.isBlank(body.getString("receiverAccount"))
|| StringUtils.isBlank(body.getString("receiverName"))
|| body.getBigDecimal("receiverRatio") == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 公司
BsCompany company = companyService.getCompanyById(body.getLong("companyId"));
if (company == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知公司");
}
// 平台类型
PlatformTypeEnum platformType = PlatformTypeEnum.getDataByNumber(body.getInteger("platformType"));
if (platformType == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台");
}
// 接收方角色
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.role1;
// 查询配置
BsTradeTakeConfig tradeTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
company.getId(),
platformType,
receiverRoleEnum,
userInfoModel.getBsCompany().getId(),
null);
if (tradeTakeConfig == null) {
tradeTakeConfig = new BsTradeTakeConfig();
}
tradeTakeConfig.setCompanyId(company.getId());
tradeTakeConfig.setCompanyName(company.getName());
tradeTakeConfig.setPlatformType(platformType.getNumber());
tradeTakeConfig.setPlatformTypeName(platformType.getName());
tradeTakeConfig.setReceiverRole(receiverRoleEnum.getNumber());
tradeTakeConfig.setReceiverRoleName(receiverRoleEnum.getName());
tradeTakeConfig.setReceiverAccount(body.getString("receiverAccount"));
tradeTakeConfig.setReceiverName(body.getString("receiverName"));
tradeTakeConfig.setReceiverRatio(body.getBigDecimal("receiverRatio"));
tradeTakeConfig.setReceiverObjectId(userInfoModel.getBsCompany().getId());
tradeTakeConfig.setReceiverObjectName(userInfoModel.getBsCompany().getName());
tradeTakeConfig.setOpUserId(userInfoModel.getSecUser().getId());
tradeTakeConfig.setOpUserName(userInfoModel.getSecUser().getUserName());
tradeTakeConfigService.editData(tradeTakeConfig);
BsTradeTakeConfig finalTradeTakeConfig = tradeTakeConfig;
new Thread(() -> {
Map<String,Object> param = new HashMap<>();
param.put("platformType", PlatformTypeEnum.type4.getNumber());
List<BsMerPlatformNo> merPlatformNoList = merPlatformNoService.getMerPlatformNoList(param);
for (BsMerPlatformNo platformNo : merPlatformNoList) {
try {
TreeMap<String, String> response = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getReceiverName(), finalTradeTakeConfig.getReceiverAccount());
if(!"SUCCESS".equals(MapUtils.getString(response, "return_code")) || !"SUCCESS".equals(MapUtils.getString(response, "result_code"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(response,"err_code_des"));
}
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + e);
}
}
});
return ResponseMsgUtil.success("配置成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/editAgentConfig",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "编辑代理商抽成配置")
public ResponseData editAgentConfig(@RequestBody JSONObject body) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel.getBsCompany() == null) {
log.error("configAccount error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
if (body == null
|| body.getInteger("platformType") == null
|| StringUtils.isBlank(body.getString("receiverName"))
|| StringUtils.isBlank(body.getString("receiverAccount"))
|| body.getBigDecimal("receiverRatio") == null
|| StringUtils.isBlank(body.getString("subReceiverName"))
|| StringUtils.isBlank(body.getString("subReceiverAccount"))
|| body.getBigDecimal("subReceiverRatio") == null
|| body.getLong("subReceiverObjectId") == null
) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 平台类型
PlatformTypeEnum platformType = PlatformTypeEnum.getDataByNumber(body.getInteger("platformType"));
if (platformType == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台");
}
// 公司
BsCompany company = companyService.getCompanyById(userInfoModel.getBsCompany().getId());
if (company == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知公司");
}
// 代理商
BsAgent agent = agentService.getAgent(body.getLong("subReceiverObjectId"));
if (agent == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知代理商");
}
// 公司角色
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.role2;
// 代理商角色
ProfitSharingReceiverRoleEnum subReceiverRoleEnum = ProfitSharingReceiverRoleEnum.role3;
// 查询配置
BsTradeTakeConfig tradeTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
company.getId(),
platformType,
receiverRoleEnum,
company.getId(),
body.getLong("subReceiverObjectId"));
if (tradeTakeConfig == null) {
tradeTakeConfig = new BsTradeTakeConfig();
}
tradeTakeConfig.setCompanyId(company.getId());
tradeTakeConfig.setCompanyName(company.getName());
tradeTakeConfig.setPlatformType(platformType.getNumber());
tradeTakeConfig.setPlatformTypeName(platformType.getName());
tradeTakeConfig.setReceiverRole(receiverRoleEnum.getNumber());
tradeTakeConfig.setReceiverRoleName(receiverRoleEnum.getName());
tradeTakeConfig.setReceiverAccount(body.getString("receiverAccount"));
tradeTakeConfig.setReceiverName(body.getString("receiverName"));
tradeTakeConfig.setReceiverRatio(body.getBigDecimal("receiverRatio"));
tradeTakeConfig.setReceiverObjectId(company.getId());
tradeTakeConfig.setReceiverObjectName(company.getName());
tradeTakeConfig.setSubReceiverRole(subReceiverRoleEnum.getNumber());
tradeTakeConfig.setSubReceiverRoleName(subReceiverRoleEnum.getName());
tradeTakeConfig.setSubReceiverName(body.getString("subReceiverName"));
tradeTakeConfig.setSubReceiverAccount(body.getString("subReceiverAccount"));
tradeTakeConfig.setSubReceiverRatio(body.getBigDecimal("subReceiverRatio"));
tradeTakeConfig.setSubReceiverObjectId(agent.getId());
tradeTakeConfig.setSubReceiverObjectName(agent.getName());
tradeTakeConfig.setOpUserId(agent.getId());
tradeTakeConfig.setOpUserName(agent.getName());
tradeTakeConfigService.editData(tradeTakeConfig);
BsTradeTakeConfig finalTradeTakeConfig = tradeTakeConfig;
new Thread(() -> {
Map<String,Object> param = new HashMap<>();
param.put("companyId", finalTradeTakeConfig.getReceiverObjectId());
param.put("agentId", finalTradeTakeConfig.getSubReceiverObjectId());
param.put("platformType", PlatformTypeEnum.type4.getNumber());
List<BsMerPlatformNo> merPlatformNoList = merPlatformNoService.getMerPlatformNoList(param);
for (BsMerPlatformNo platformNo : merPlatformNoList) {
try {
TreeMap<String, String> response = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getReceiverName(), finalTradeTakeConfig.getReceiverAccount());
if(!"SUCCESS".equals(MapUtils.getString(response, "return_code")) || !"SUCCESS".equals(MapUtils.getString(response, "result_code"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "分公司与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(response,"err_code_des"));
}
TreeMap<String, String> subResponse = WxOrderConfig.profitsharingAddReceiver(platformNo.getPlatformNo(), finalTradeTakeConfig.getSubReceiverName(), finalTradeTakeConfig.getSubReceiverAccount());
if(!"SUCCESS".equals(MapUtils.getString(subResponse, "return_code")) || !"SUCCESS".equals(MapUtils.getString(subResponse, "result_code"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "代理商与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + MapUtils.getString(subResponse,"err_code_des"));
}
} catch (Exception e) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "与商户号:"+platformNo.getPlatformNo()+"创建分账关系失败!原因:" + e);
}
}
});
return ResponseMsgUtil.success("配置成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getTradeTakeConfig",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询交易配置")
public ResponseData getTradeTakeConfig(@RequestParam(value = "companyId", required = true) Long companyId,
@RequestParam(value = "platformType", required = true) Integer platformType,
@RequestParam(value = "profitSharingReceiverRole", required = true) Integer profitSharingReceiverRole,
@RequestParam(value = "receiverObjectId", required = false) Long receiverObjectId,
@RequestParam(value = "subReceiverObjectId", required = false) Long subReceiverObjectId) {
try {
// 平台类型
PlatformTypeEnum platform = PlatformTypeEnum.getDataByNumber(platformType);
if (platformType == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台");
}
ProfitSharingReceiverRoleEnum receiverRoleEnum = ProfitSharingReceiverRoleEnum.getDataByNumber(profitSharingReceiverRole);
if (receiverRoleEnum == null) {
log.error("getTradeTakeConfig error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
return ResponseMsgUtil.success(tradeTakeConfigService.getTradeTakeConfig(companyId, platform, receiverRoleEnum, receiverObjectId, subReceiverObjectId));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getAgentTradeTakeConfig",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查代理商交易配置")
public ResponseData getAgentTradeTakeConfig(@RequestParam(value = "platformType", required = true) Integer platformType,
@RequestParam(value = "agentId", required = true) Long agentId) {
try {
UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class);
if (userInfoModel.getBsCompany() == null) {
log.error("configAccount error!","权限不足");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, "");
}
// 代理商
BsAgent agent = agentService.getAgent(agentId);
if (agent == null) {
log.error("BsTradeTakeConfigController --> getAgentTradeTakeConfig() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 平台类型
PlatformTypeEnum platform = PlatformTypeEnum.getDataByNumber(platformType);
if (platformType == null) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的平台");
}
return ResponseMsgUtil.success(tradeTakeConfigService.getTradeTakeConfig(agent.getCompanyId(), platform, ProfitSharingReceiverRoleEnum.role2, null, agent.getId()));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -30,6 +30,8 @@ public class ImportDeviceListener extends AnalysisEventListener<ImportDeviceMode
private UserInfoModel userInfoModel;
Integer deviceType;
private BsDevice device;
/**
@ -53,6 +55,7 @@ public class ImportDeviceListener extends AnalysisEventListener<ImportDeviceMode
}
device = new BsDevice();
device.setDeviceType(deviceType);
device.setDeviceNo(deviceModel.getDeviceNo());
device.setDeviceIccid(deviceModel.getDeviceIccid());
device.setDeviceImsi(deviceModel.getDeviceImsi());
@ -83,8 +86,9 @@ public class ImportDeviceListener extends AnalysisEventListener<ImportDeviceMode
return errorData;
}
public void initData(UserInfoModel userInfoModel, BsDeviceService deviceService) {
public void initData(UserInfoModel userInfoModel, Integer deviceType,BsDeviceService deviceService) {
this.userInfoModel = userInfoModel;
this.deviceType = deviceType;
this.deviceService = deviceService;
this.allDeviceList = this.deviceService.getDeviceList(new HashMap<>());
}

@ -1,5 +1,5 @@
server:
port: 9502
port: 9602
servlet:
context-path: /brest

@ -117,6 +117,64 @@ public class WeiXinController {
}
}
@RequestMapping(value="/test",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "交易【主扫】通知")
public void test(@RequestBody String reqBody, HttpServletRequest request, HttpServletResponse response){
try {
log.info("微信支付 -> 异步通知:处理开始");
String resXml = "<xml> <return_code><![CDATA[SUCCESS]]></return_code>" +
" <return_msg><![CDATA[OK]]></return_msg> </xml> ";
String notifyXml = reqBody;
log.info("微信支付 -> 异步通知数据:", notifyXml);
SortedMap<String, String> map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8");
// 请求记录
BsTradeOrderMsg orderMsg = new BsTradeOrderMsg();
orderMsg.setOutTradeNo(map.get("out_trade_no"));
orderMsg.setType(TradeOrderMsgTypeEnum.type2.getNumber());
orderMsg.setResponseContent(notifyXml);
tradeOrderMsgService.editTradeOrderMsg(orderMsg);
if ("SUCCESS".equals(map.get("return_code")) && "SUCCESS".equals(map.get("result_code"))) {
// 查询订单
BsTradeOrder order = tradeOrderService.getOrderByOutTradeNo(map.get("out_trade_no"));
if (order != null && order.getStatus().equals(TradeOrderStatusEnum.status1.getNumber())) {
order.setPayMode(TradeOrderPayModeEnum.WECHAT.getCode());
order.setPlatformType(PlatformTypeEnum.type4.getNumber());
order.setPlatformMerNo(map.get("sub_mch_id"));
order.setPlatformTradeNo(map.get("transaction_id"));
order.setTradeActualAmount(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100")));
// order.setStatus(TradeOrderStatusEnum.status3.getNumber());
order.setPayTime(new Date());
tradeOrderService.editOrder(order);
// 创建分账
if (order.getProfitSharingStatus().equals(true)) {
tradeOrderProfitSharingService.createProfitSharing(order);
}
Map<String,Object> param = new HashMap<>();
param.put("storeId", order.getStoreId());
param.put("deviceType", DeviceTypeEnum.type1.getNumber());
param.put("status", DeviceStatusEnum.status1.getNumber());
List<BsDevice> deviceList = deviceService.getDeviceList(param);
for (BsDevice device : deviceList) {
soundService.sendPayMsg(device.getDeviceNo(), order.getTradeAmount());
}
}
}
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
out.write(resXml.getBytes());
out.flush();
out.close();
log.info("微信支付 -> 异步通知:处理完成");
} catch (Exception e) {
log.error("login error!",e);
}
}
public static void main(String[] args) {
String data = "<xml>\n" +
"<return_code><![CDATA[SUCCESS]]></return_code>\n" +

@ -1,5 +1,5 @@
server:
port: 9501
port: 9601
servlet:
context-path: /crest

@ -7,6 +7,7 @@ import com.hfkj.entity.BsTradeOrderProfitSharingReceiver;
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService;
import com.hfkj.service.BsTradeOrderProfitSharingService;
import com.hfkj.service.BsTradeOrderService;
import com.hfkj.service.BsTradeTakeConfigService;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.TradeOrderPayModeEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum;
@ -66,7 +67,7 @@ public class TradeOrderSchedule {
if (tradeOrderProfitSharing.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) {
// 微信分账
TreeMap<String, String> refundModel = WxOrderConfig.createProfitsharing(
TreeMap<String, String> refundModel = WxOrderConfig.profitsharingCreate(
tradeOrderProfitSharing.getPlatformAppid(),
tradeOrderProfitSharing.getPlatformMerNo(),
tradeOrderProfitSharing.getPlatformTradeNo(),

@ -54,6 +54,9 @@ public class WeiXinMerService {
@Resource
private BsStoreContractRecordService storeContractRecordService;
@Resource
private BsIndustryService industryService;
private List<BsMerAttach> merAttachList;
private List<BsStoreAttach> storeAttachList;
@ -85,12 +88,12 @@ public class WeiXinMerService {
// 营业执照
JSONObject businessLicenseInfo = new JSONObject();
businessLicenseInfo.put("license_copy", getMerAttach(MerAttachType.type1).get(0).getFileUrl());
businessLicenseInfo.put("license_copy", getMerAttach(MerAttachType.type1,true).get(0).getFileUrl());
businessLicenseInfo.put("license_number", basisModel.getBlisNo());
businessLicenseInfo.put("merchant_name", basisModel.getBlisName());
businessLicenseInfo.put("legal_person", basisModel.getLarName());
businessLicenseInfo.put("license_address", basisModel.getBlisRegAddress());
businessLicenseInfo.put("period_begin", basisModel.getBlisPeriodStart().replace(".", "-"));
businessLicenseInfo.put("period_begin", basisModel.getBlisPeriodStart().replace("年", "-").replace("月", "-").replace("日", ""));
if (basisModel.getBlisPeriodType().equals(2)) {
businessLicenseInfo.put("period_end", "长期");
} else {
@ -109,8 +112,8 @@ public class WeiXinMerService {
// 当证件持有人类型为经营者/法人且证件类型为“身份证”时填写。
JSONObject idCardInfo = new JSONObject();
idCardInfo.put("id_card_copy", getMerAttach(MerAttachType.type2).get(0).getFileUrl());
idCardInfo.put("id_card_national", getMerAttach(MerAttachType.type3).get(0).getFileUrl());
idCardInfo.put("id_card_copy", getMerAttach(MerAttachType.type2,true).get(0).getFileUrl());
idCardInfo.put("id_card_national", getMerAttach(MerAttachType.type3,true).get(0).getFileUrl());
idCardInfo.put("id_card_name", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarName()));
idCardInfo.put("id_card_number", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarIdCard()));
idCardInfo.put("id_card_address", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarIdCardAddress()));
@ -128,8 +131,8 @@ public class WeiXinMerService {
JSONArray uboInfoList = new JSONArray();
JSONObject uboInfo = new JSONObject();
uboInfo.put("ubo_id_doc_type", "IDENTIFICATION_TYPE_IDCARD");
uboInfo.put("ubo_id_doc_copy", getMerAttach(MerAttachType.type2).get(0).getFileUrl());
uboInfo.put("ubo_id_doc_copy_back", getMerAttach(MerAttachType.type3).get(0).getFileUrl());
uboInfo.put("ubo_id_doc_copy", getMerAttach(MerAttachType.type2,true).get(0).getFileUrl());
uboInfo.put("ubo_id_doc_copy_back", getMerAttach(MerAttachType.type3,true).get(0).getFileUrl());
uboInfo.put("ubo_id_doc_name", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarName()));
uboInfo.put("ubo_id_doc_number", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarIdCard()));
uboInfo.put("ubo_id_doc_address", HttpClientBuilder.rsaEncryptOAEP(basisModel.getLarIdCardAddress()));
@ -162,14 +165,14 @@ public class WeiXinMerService {
bizStoreInfo.put("biz_address_code", basisModel.getStoreModel().getStoreRegion().getAreaCode().toString());
bizStoreInfo.put("biz_store_address", basisModel.getStoreModel().getStoreRegion().getAddress());
List<String> storeEntrancePicList = new ArrayList<>();
List<BsMerAttach> storeEntrancePic = getMerAttach(MerAttachType.type4);
List<BsMerAttach> storeEntrancePic = getMerAttach(MerAttachType.type4,true);
for (BsMerAttach attach : storeEntrancePic) {
storeEntrancePicList.add(attach.getFileUrl());
}
bizStoreInfo.put("store_entrance_pic", storeEntrancePicList);
List<String> indoorPicList = new ArrayList<>();
List<BsMerAttach> indoorPic = getMerAttach(MerAttachType.type4);
List<BsMerAttach> indoorPic = getMerAttach(MerAttachType.type4,true);
for (BsMerAttach attach : indoorPic) {
indoorPicList.add(attach.getFileUrl());
}
@ -180,8 +183,22 @@ public class WeiXinMerService {
// 结算规则
JSONObject settlementInfo = new JSONObject();
settlementInfo.put("settlement_id", basisModel.getMerType().equals(MerTypeEnum.status1.getNumber())?"719":"716");
settlementInfo.put("qualification_type", basisModel.getMerIndustry().getParentName());
BsIndustry industry = industryService.getDetailById(basisModel.getMerIndustry().getChildId());
if (industry == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的行业");
}
String settlementId = null;
if (basisModel.getMerType().equals(MerTypeEnum.status1.getNumber())) {
settlementId = industry.getWechatSelfEmployedCode();
} else if (basisModel.getMerType().equals(MerTypeEnum.status2.getNumber())) {
settlementId = industry.getWechatCompanyCode();
}
if (settlementId == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "行业选择不正确");
}
settlementInfo.put("settlement_id", settlementId);
settlementInfo.put("qualification_type", industry.getWechatName());
body.put("settlement_info", settlementInfo);
// 结算银行账户
@ -193,10 +210,23 @@ public class WeiXinMerService {
bankAccountInfo.put("account_name",HttpClientBuilder.rsaEncryptOAEP(basisModel.getRegName()));
}
bankAccountInfo.put("account_bank", basisModel.getMerSettleAcct().getBankName());
bankAccountInfo.put("bank_address_code", basisModel.getMerSettleAcct().getOpenningBankCityCode());
bankAccountInfo.put("bank_address_code", basisModel.getMerSettleAcct().getOpenningBankCityCode().toString());
bankAccountInfo.put("account_number", HttpClientBuilder.rsaEncryptOAEP(basisModel.getMerSettleAcct().getBankCardNo()));
body.put("bank_account_info", bankAccountInfo);
// 补充材料
JSONObject additionInfo = new JSONObject();
List<String> additionPicsList = new ArrayList<>();
List<BsMerAttach> merAdditionPicsList = getMerAttach(MerAttachType.type6, false);
if (merAdditionPicsList != null) {
for (BsMerAttach merAttach : merAdditionPicsList) {
additionPicsList.add(merAttach.getFileUrl());
}
additionInfo.put("business_addition_pics", additionPicsList);
body.put("addition_info", additionInfo);
}
HttpClientBuilder httpClientBuilder = new HttpClientBuilder();
JSONObject applymentObject = JSONObject.parseObject(httpClientBuilder.applyment(body));
if (StringUtils.isNotBlank(applymentObject.getString("code"))) {
@ -375,16 +405,17 @@ public class WeiXinMerService {
/**
* 获取商户附件
* @param attachType
* @param check 检查是否上传true抛出异常 false: 不检查
* @return
*/
private List<BsMerAttach> getMerAttach(MerAttachType attachType) {
private List<BsMerAttach> getMerAttach(MerAttachType attachType, Boolean check) {
if (merAttachList == null || merAttachList.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未上传相关图片");
}
List<BsMerAttach> collect = merAttachList.stream()
.filter(o -> o.getType().equals(attachType.getNumber()))
.collect(Collectors.toList());
if (collect.size() == 0) {
if (check == true && collect.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未上传" + attachType.getName() + "图片");
}
return collect;

@ -93,11 +93,11 @@ public class WxOrderConfig {
* @param transactionId 第三方交易订单号
* @param outOrderNo 交易订单号
*/
public static TreeMap<String,String> createProfitsharing(String appId,
String subMchId,
String transactionId,
String outOrderNo,
List<Map<String,Object>> receiversList) {
public static TreeMap<String,String> profitsharingCreate(String appId,
String subMchId,
String transactionId,
String outOrderNo,
List<Map<String,Object>> receiversList) {
try {
Map<String,String> param = new LinkedHashMap<>();
param.put("appid", appId);
@ -124,6 +124,39 @@ public class WxOrderConfig {
return XmlUtil.parseXmlToTreeMap(resultXmL, "utf-8");
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
}
return null;
}
/**
* 微信添加分账接收方
* @param receiversName 接收方商户全称
* @param receiversAccount 接收方商户
*/
public static TreeMap<String,String> profitsharingAddReceiver(String subMchId,String receiversName,String receiversAccount) {
try {
Map<String,String> param = new LinkedHashMap<>();
param.put("mch_id", "1289663601");
param.put("sub_mch_id" , subMchId);
param.put("appid", "wx637bd6f7314daa46");
param.put("nonce_str" , WxUtils.makeNonStr());
Map<String,Object> receivers = new LinkedHashMap<>();
receivers.put("type", "MERCHANT_ID");
receivers.put("account", receiversAccount);
receivers.put("name", receiversName);
receivers.put("relation_type", "SERVICE_PROVIDER");
param.put("receiver" , JSONObject.toJSONString(receivers));
String signStr = WxUtils.generateSignature(param, "Skufk5oi85wDFGl888i6wsRSTkdd5df5" , WXPayConstants.SignType.HMACSHA256);
param.put("sign" , signStr);
// 请求分账返回的结果
String resultXmL = wechatRequest("https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver", param.get("mch_id"), WxUtils.mapToXml(param));
return XmlUtil.parseXmlToTreeMap(resultXmL, "utf-8");
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
}
@ -137,7 +170,7 @@ public class WxOrderConfig {
* @param transactionId 第三方交易订单号
* @param outOrderNo 交易订单号
*//*
public static TreeMap<String,String> returnProfitsharing(String subMchId,
public static TreeMap<String,String> profitsharingReturn(String subMchId,
String profitsharingOrderNo,
String return_mchid,
String amount,

@ -40,11 +40,15 @@ public interface BsIndustryMapper extends BsIndustryMapperExt {
@Insert({
"insert into bs_industry (parent_id, `name`, ",
"`status`, create_time, ",
"ext_1, ext_2, ext_3)",
"wechat_company_code, wechat_self_employed_code, ",
"wechat_name, `status`, ",
"create_time, ext_1, ",
"ext_2, ext_3)",
"values (#{parentId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{wechatCompanyCode,jdbcType=VARCHAR}, #{wechatSelfEmployedCode,jdbcType=VARCHAR}, ",
"#{wechatName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsIndustry record);
@ -58,6 +62,9 @@ public interface BsIndustryMapper extends BsIndustryMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_company_code", property="wechatCompanyCode", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_self_employed_code", property="wechatSelfEmployedCode", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_name", property="wechatName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -68,7 +75,8 @@ public interface BsIndustryMapper extends BsIndustryMapperExt {
@Select({
"select",
"id, parent_id, `name`, `status`, create_time, ext_1, ext_2, ext_3",
"id, parent_id, `name`, wechat_company_code, wechat_self_employed_code, wechat_name, ",
"`status`, create_time, ext_1, ext_2, ext_3",
"from bs_industry",
"where id = #{id,jdbcType=BIGINT}"
})
@ -76,6 +84,9 @@ public interface BsIndustryMapper extends BsIndustryMapperExt {
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_company_code", property="wechatCompanyCode", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_self_employed_code", property="wechatSelfEmployedCode", jdbcType=JdbcType.VARCHAR),
@Result(column="wechat_name", property="wechatName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@ -97,6 +108,9 @@ public interface BsIndustryMapper extends BsIndustryMapperExt {
"update bs_industry",
"set parent_id = #{parentId,jdbcType=BIGINT},",
"`name` = #{name,jdbcType=VARCHAR},",
"wechat_company_code = #{wechatCompanyCode,jdbcType=VARCHAR},",
"wechat_self_employed_code = #{wechatSelfEmployedCode,jdbcType=VARCHAR},",
"wechat_name = #{wechatName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",

@ -36,6 +36,18 @@ public class BsIndustrySqlProvider {
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}");
}
if (record.getWechatCompanyCode() != null) {
sql.VALUES("wechat_company_code", "#{wechatCompanyCode,jdbcType=VARCHAR}");
}
if (record.getWechatSelfEmployedCode() != null) {
sql.VALUES("wechat_self_employed_code", "#{wechatSelfEmployedCode,jdbcType=VARCHAR}");
}
if (record.getWechatName() != null) {
sql.VALUES("wechat_name", "#{wechatName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
@ -68,6 +80,9 @@ public class BsIndustrySqlProvider {
}
sql.SELECT("parent_id");
sql.SELECT("`name`");
sql.SELECT("wechat_company_code");
sql.SELECT("wechat_self_employed_code");
sql.SELECT("wechat_name");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("ext_1");
@ -102,6 +117,18 @@ public class BsIndustrySqlProvider {
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
}
if (record.getWechatCompanyCode() != null) {
sql.SET("wechat_company_code = #{record.wechatCompanyCode,jdbcType=VARCHAR}");
}
if (record.getWechatSelfEmployedCode() != null) {
sql.SET("wechat_self_employed_code = #{record.wechatSelfEmployedCode,jdbcType=VARCHAR}");
}
if (record.getWechatName() != null) {
sql.SET("wechat_name = #{record.wechatName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
@ -133,6 +160,9 @@ public class BsIndustrySqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}");
sql.SET("wechat_company_code = #{record.wechatCompanyCode,jdbcType=VARCHAR}");
sql.SET("wechat_self_employed_code = #{record.wechatSelfEmployedCode,jdbcType=VARCHAR}");
sql.SET("wechat_name = #{record.wechatName,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
@ -156,6 +186,18 @@ public class BsIndustrySqlProvider {
sql.SET("`name` = #{name,jdbcType=VARCHAR}");
}
if (record.getWechatCompanyCode() != null) {
sql.SET("wechat_company_code = #{wechatCompanyCode,jdbcType=VARCHAR}");
}
if (record.getWechatSelfEmployedCode() != null) {
sql.SET("wechat_self_employed_code = #{wechatSelfEmployedCode,jdbcType=VARCHAR}");
}
if (record.getWechatName() != null) {
sql.SET("wechat_name = #{wechatName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}

@ -39,17 +39,19 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_platform_no (mer_id, mer_no, ",
"platform_type, platform_no, ",
"cup_no, pos_id, branch_id, ",
"insert into bs_mer_platform_no (company_id, agent_id, ",
"mer_id, mer_no, platform_type, ",
"platform_no, cup_no, ",
"pos_id, branch_id, ",
"mer_public_key, platform_operator_id, ",
"platform_operator_pwd, refund_cert_url, ",
"refund_cert_pwd, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{platformType,jdbcType=INTEGER}, #{platformNo,jdbcType=VARCHAR}, ",
"#{cupNo,jdbcType=VARCHAR}, #{posId,jdbcType=VARCHAR}, #{branchId,jdbcType=VARCHAR}, ",
"values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ",
"#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ",
"#{posId,jdbcType=VARCHAR}, #{branchId,jdbcType=VARCHAR}, ",
"#{merPublicKey,jdbcType=VARCHAR}, #{platformOperatorId,jdbcType=VARCHAR}, ",
"#{platformOperatorPwd,jdbcType=VARCHAR}, #{refundCertUrl,jdbcType=VARCHAR}, ",
"#{refundCertPwd,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
@ -66,6 +68,8 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
@SelectProvider(type=BsMerPlatformNoSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@ -89,14 +93,17 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
@Select({
"select",
"id, mer_id, mer_no, platform_type, platform_no, cup_no, pos_id, branch_id, mer_public_key, ",
"platform_operator_id, platform_operator_pwd, refund_cert_url, refund_cert_pwd, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"id, company_id, agent_id, mer_id, mer_no, platform_type, platform_no, cup_no, ",
"pos_id, branch_id, mer_public_key, platform_operator_id, platform_operator_pwd, ",
"refund_cert_url, refund_cert_pwd, `status`, create_time, update_time, ext_1, ",
"ext_2, ext_3",
"from bs_mer_platform_no",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@ -129,7 +136,9 @@ public interface BsMerPlatformNoMapper extends BsMerPlatformNoMapperExt {
@Update({
"update bs_mer_platform_no",
"set mer_id = #{merId,jdbcType=BIGINT},",
"set company_id = #{companyId,jdbcType=BIGINT},",
"agent_id = #{agentId,jdbcType=BIGINT},",
"mer_id = #{merId,jdbcType=BIGINT},",
"mer_no = #{merNo,jdbcType=VARCHAR},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_no = #{platformNo,jdbcType=VARCHAR},",

@ -28,6 +28,14 @@ public class BsMerPlatformNoSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("bs_mer_platform_no");
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
@ -110,6 +118,8 @@ public class BsMerPlatformNoSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("company_id");
sql.SELECT("agent_id");
sql.SELECT("mer_id");
sql.SELECT("mer_no");
sql.SELECT("platform_type");
@ -149,6 +159,14 @@ public class BsMerPlatformNoSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
@ -230,6 +248,8 @@ public class BsMerPlatformNoSqlProvider {
sql.UPDATE("bs_mer_platform_no");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
@ -258,6 +278,14 @@ public class BsMerPlatformNoSqlProvider {
SQL sql = new SQL();
sql.UPDATE("bs_mer_platform_no");
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
if (record.getAgentId() != null) {
sql.SET("agent_id = #{agentId,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}

@ -46,11 +46,12 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
"store_no, store_name, ",
"store_tel, `name`, ",
"discount_type, discount_condition, ",
"discount_price, start_time, ",
"end_time, `status`, ",
"operator_id, operator_name, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"discount_price, final_cost_price, ",
"start_time, end_time, ",
"`status`, operator_id, ",
"operator_name, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
"#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
@ -58,11 +59,12 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
"#{storeNo,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
"#{storeTel,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ",
"#{discountType,jdbcType=INTEGER}, #{discountCondition,jdbcType=DECIMAL}, ",
"#{discountPrice,jdbcType=DECIMAL}, #{startTime,jdbcType=TIMESTAMP}, ",
"#{endTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ",
"#{operatorId,jdbcType=BIGINT}, #{operatorName,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{discountPrice,jdbcType=DECIMAL}, #{finalCostPrice,jdbcType=DECIMAL}, ",
"#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, ",
"#{status,jdbcType=INTEGER}, #{operatorId,jdbcType=BIGINT}, ",
"#{operatorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsStoreDiscountActivity record);
@ -90,6 +92,7 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="final_cost_price", property="finalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -107,8 +110,9 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
"select",
"id, company_id, company_name, agent_id, agent_name, salesman_id, salesman_name, ",
"mer_id, mer_name, store_id, store_no, store_name, store_tel, `name`, discount_type, ",
"discount_condition, discount_price, start_time, end_time, `status`, operator_id, ",
"operator_name, create_time, update_time, ext_1, ext_2, ext_3",
"discount_condition, discount_price, final_cost_price, start_time, end_time, ",
"`status`, operator_id, operator_name, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from bs_store_discount_activity",
"where id = #{id,jdbcType=BIGINT}"
})
@ -130,6 +134,7 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
@Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER),
@Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="final_cost_price", property="finalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -170,6 +175,7 @@ public interface BsStoreDiscountActivityMapper extends BsStoreDiscountActivityMa
"discount_type = #{discountType,jdbcType=INTEGER},",
"discount_condition = #{discountCondition,jdbcType=DECIMAL},",
"discount_price = #{discountPrice,jdbcType=DECIMAL},",
"final_cost_price = #{finalCostPrice,jdbcType=DECIMAL},",
"start_time = #{startTime,jdbcType=TIMESTAMP},",
"end_time = #{endTime,jdbcType=TIMESTAMP},",
"`status` = #{status,jdbcType=INTEGER},",

@ -92,6 +92,10 @@ public class BsStoreDiscountActivitySqlProvider {
sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}");
}
if (record.getFinalCostPrice() != null) {
sql.VALUES("final_cost_price", "#{finalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}");
}
@ -158,6 +162,7 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SELECT("discount_type");
sql.SELECT("discount_condition");
sql.SELECT("discount_price");
sql.SELECT("final_cost_price");
sql.SELECT("start_time");
sql.SELECT("end_time");
sql.SELECT("`status`");
@ -253,6 +258,10 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
}
if (record.getFinalCostPrice() != null) {
sql.SET("final_cost_price = #{record.finalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
}
@ -318,6 +327,7 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}");
sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}");
sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}");
sql.SET("final_cost_price = #{record.finalCostPrice,jdbcType=DECIMAL}");
sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}");
sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -402,6 +412,10 @@ public class BsStoreDiscountActivitySqlProvider {
sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}");
}
if (record.getFinalCostPrice() != null) {
sql.SET("final_cost_price = #{finalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStartTime() != null) {
sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}");
}

@ -52,18 +52,18 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"trade_amount, store_discount_satisfy, ",
"store_discount_id, store_discount_name, ",
"store_discount_type, store_discount_condition, ",
"store_discount_price, store_discount_actual_price, ",
"user_id, user_phone, ",
"user_discount_id, user_discount_name, ",
"user_discount_type, user_discount_price, ",
"user_discount_actual_price, trade_actual_amount, ",
"acc_trade_no, acc_mdiscount_amount, ",
"acc_discount_amount, acc_payment_code, ",
"card_type, `status`, ",
"profit_sharing_status, pay_time, ",
"create_time, cancel_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"store_discount_price, store_discount_final_cost_price, ",
"store_discount_actual_price, user_id, ",
"user_phone, user_discount_id, ",
"user_discount_name, user_discount_type, ",
"user_discount_price, user_discount_actual_price, ",
"trade_actual_amount, acc_trade_no, ",
"acc_mdiscount_amount, acc_discount_amount, ",
"acc_payment_code, card_type, ",
"`status`, profit_sharing_status, ",
"pay_time, create_time, ",
"cancel_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
"#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
"#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merNo,jdbcType=VARCHAR}, ",
@ -77,18 +77,18 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"#{tradeAmount,jdbcType=DECIMAL}, #{storeDiscountSatisfy,jdbcType=BIT}, ",
"#{storeDiscountId,jdbcType=BIGINT}, #{storeDiscountName,jdbcType=VARCHAR}, ",
"#{storeDiscountType,jdbcType=INTEGER}, #{storeDiscountCondition,jdbcType=DECIMAL}, ",
"#{storeDiscountPrice,jdbcType=DECIMAL}, #{storeDiscountActualPrice,jdbcType=DECIMAL}, ",
"#{userId,jdbcType=INTEGER}, #{userPhone,jdbcType=VARCHAR}, ",
"#{userDiscountId,jdbcType=BIGINT}, #{userDiscountName,jdbcType=VARCHAR}, ",
"#{userDiscountType,jdbcType=INTEGER}, #{userDiscountPrice,jdbcType=DECIMAL}, ",
"#{userDiscountActualPrice,jdbcType=DECIMAL}, #{tradeActualAmount,jdbcType=DECIMAL}, ",
"#{accTradeNo,jdbcType=VARCHAR}, #{accMdiscountAmount,jdbcType=DECIMAL}, ",
"#{accDiscountAmount,jdbcType=DECIMAL}, #{accPaymentCode,jdbcType=VARCHAR}, ",
"#{cardType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{profitSharingStatus,jdbcType=BIT}, #{payTime,jdbcType=TIMESTAMP}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{storeDiscountPrice,jdbcType=DECIMAL}, #{storeDiscountFinalCostPrice,jdbcType=DECIMAL}, ",
"#{storeDiscountActualPrice,jdbcType=DECIMAL}, #{userId,jdbcType=INTEGER}, ",
"#{userPhone,jdbcType=VARCHAR}, #{userDiscountId,jdbcType=BIGINT}, ",
"#{userDiscountName,jdbcType=VARCHAR}, #{userDiscountType,jdbcType=INTEGER}, ",
"#{userDiscountPrice,jdbcType=DECIMAL}, #{userDiscountActualPrice,jdbcType=DECIMAL}, ",
"#{tradeActualAmount,jdbcType=DECIMAL}, #{accTradeNo,jdbcType=VARCHAR}, ",
"#{accMdiscountAmount,jdbcType=DECIMAL}, #{accDiscountAmount,jdbcType=DECIMAL}, ",
"#{accPaymentCode,jdbcType=VARCHAR}, #{cardType,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{profitSharingStatus,jdbcType=BIT}, ",
"#{payTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{cancelTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsTradeOrder record);
@ -128,6 +128,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
@Result(column="store_discount_type", property="storeDiscountType", jdbcType=JdbcType.INTEGER),
@Result(column="store_discount_condition", property="storeDiscountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_price", property="storeDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_final_cost_price", property="storeDiscountFinalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_actual_price", property="storeDiscountActualPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@ -161,11 +162,11 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"platform_mer_no, platform_trade_no, platform_log_no, platform_appid, pay_user_id, ",
"pay_mode, out_trade_no, trade_amount, store_discount_satisfy, store_discount_id, ",
"store_discount_name, store_discount_type, store_discount_condition, store_discount_price, ",
"store_discount_actual_price, user_id, user_phone, user_discount_id, user_discount_name, ",
"user_discount_type, user_discount_price, user_discount_actual_price, trade_actual_amount, ",
"acc_trade_no, acc_mdiscount_amount, acc_discount_amount, acc_payment_code, card_type, ",
"`status`, profit_sharing_status, pay_time, create_time, cancel_time, update_time, ",
"ext_1, ext_2, ext_3",
"store_discount_final_cost_price, store_discount_actual_price, user_id, user_phone, ",
"user_discount_id, user_discount_name, user_discount_type, user_discount_price, ",
"user_discount_actual_price, trade_actual_amount, acc_trade_no, acc_mdiscount_amount, ",
"acc_discount_amount, acc_payment_code, card_type, `status`, profit_sharing_status, ",
"pay_time, create_time, cancel_time, update_time, ext_1, ext_2, ext_3",
"from bs_trade_order",
"where id = #{id,jdbcType=BIGINT}"
})
@ -199,6 +200,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
@Result(column="store_discount_type", property="storeDiscountType", jdbcType=JdbcType.INTEGER),
@Result(column="store_discount_condition", property="storeDiscountCondition", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_price", property="storeDiscountPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_final_cost_price", property="storeDiscountFinalCostPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="store_discount_actual_price", property="storeDiscountActualPrice", jdbcType=JdbcType.DECIMAL),
@Result(column="user_id", property="userId", jdbcType=JdbcType.INTEGER),
@Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
@ -264,6 +266,7 @@ public interface BsTradeOrderMapper extends BsTradeOrderMapperExt {
"store_discount_type = #{storeDiscountType,jdbcType=INTEGER},",
"store_discount_condition = #{storeDiscountCondition,jdbcType=DECIMAL},",
"store_discount_price = #{storeDiscountPrice,jdbcType=DECIMAL},",
"store_discount_final_cost_price = #{storeDiscountFinalCostPrice,jdbcType=DECIMAL},",
"store_discount_actual_price = #{storeDiscountActualPrice,jdbcType=DECIMAL},",
"user_id = #{userId,jdbcType=INTEGER},",
"user_phone = #{userPhone,jdbcType=VARCHAR},",

@ -140,6 +140,10 @@ public class BsTradeOrderSqlProvider {
sql.VALUES("store_discount_price", "#{storeDiscountPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountFinalCostPrice() != null) {
sql.VALUES("store_discount_final_cost_price", "#{storeDiscountFinalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountActualPrice() != null) {
sql.VALUES("store_discount_actual_price", "#{storeDiscountActualPrice,jdbcType=DECIMAL}");
}
@ -270,6 +274,7 @@ public class BsTradeOrderSqlProvider {
sql.SELECT("store_discount_type");
sql.SELECT("store_discount_condition");
sql.SELECT("store_discount_price");
sql.SELECT("store_discount_final_cost_price");
sql.SELECT("store_discount_actual_price");
sql.SELECT("user_id");
sql.SELECT("user_phone");
@ -426,6 +431,10 @@ public class BsTradeOrderSqlProvider {
sql.SET("store_discount_price = #{record.storeDiscountPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountFinalCostPrice() != null) {
sql.SET("store_discount_final_cost_price = #{record.storeDiscountFinalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountActualPrice() != null) {
sql.SET("store_discount_actual_price = #{record.storeDiscountActualPrice,jdbcType=DECIMAL}");
}
@ -555,6 +564,7 @@ public class BsTradeOrderSqlProvider {
sql.SET("store_discount_type = #{record.storeDiscountType,jdbcType=INTEGER}");
sql.SET("store_discount_condition = #{record.storeDiscountCondition,jdbcType=DECIMAL}");
sql.SET("store_discount_price = #{record.storeDiscountPrice,jdbcType=DECIMAL}");
sql.SET("store_discount_final_cost_price = #{record.storeDiscountFinalCostPrice,jdbcType=DECIMAL}");
sql.SET("store_discount_actual_price = #{record.storeDiscountActualPrice,jdbcType=DECIMAL}");
sql.SET("user_id = #{record.userId,jdbcType=INTEGER}");
sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}");
@ -700,6 +710,10 @@ public class BsTradeOrderSqlProvider {
sql.SET("store_discount_price = #{storeDiscountPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountFinalCostPrice() != null) {
sql.SET("store_discount_final_cost_price = #{storeDiscountFinalCostPrice,jdbcType=DECIMAL}");
}
if (record.getStoreDiscountActualPrice() != null) {
sql.SET("store_discount_actual_price = #{storeDiscountActualPrice,jdbcType=DECIMAL}");
}

@ -0,0 +1,190 @@
package com.hfkj.dao;
import com.hfkj.entity.BsTradeTakeConfig;
import com.hfkj.entity.BsTradeTakeConfigExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;
/**
*
* 代码由工具生成,请勿修改!!!
* 如果需要扩展请在其父类进行扩展
*
**/
@Repository
public interface BsTradeTakeConfigMapper extends BsTradeTakeConfigMapperExt {
@SelectProvider(type=BsTradeTakeConfigSqlProvider.class, method="countByExample")
long countByExample(BsTradeTakeConfigExample example);
@DeleteProvider(type=BsTradeTakeConfigSqlProvider.class, method="deleteByExample")
int deleteByExample(BsTradeTakeConfigExample example);
@Delete({
"delete from bs_trade_take_config",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_trade_take_config (company_id, company_name, ",
"platform_type, platform_type_name, ",
"receiver_role, receiver_role_name, ",
"receiver_account, receiver_name, ",
"receiver_ratio, receiver_object_id, ",
"receiver_object_name, sub_receiver_role, ",
"sub_receiver_role_name, sub_receiver_account, ",
"sub_receiver_name, sub_receiver_ratio, ",
"sub_receiver_object_id, sub_receiver_object_name, ",
"`status`, op_user_id, ",
"op_user_name, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{platformType,jdbcType=INTEGER}, #{platformTypeName,jdbcType=VARCHAR}, ",
"#{receiverRole,jdbcType=INTEGER}, #{receiverRoleName,jdbcType=VARCHAR}, ",
"#{receiverAccount,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, ",
"#{receiverRatio,jdbcType=DECIMAL}, #{receiverObjectId,jdbcType=BIGINT}, ",
"#{receiverObjectName,jdbcType=VARCHAR}, #{subReceiverRole,jdbcType=INTEGER}, ",
"#{subReceiverRoleName,jdbcType=VARCHAR}, #{subReceiverAccount,jdbcType=VARCHAR}, ",
"#{subReceiverName,jdbcType=VARCHAR}, #{subReceiverRatio,jdbcType=DECIMAL}, ",
"#{subReceiverObjectId,jdbcType=BIGINT}, #{subReceiverObjectName,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ",
"#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsTradeTakeConfig record);
@InsertProvider(type=BsTradeTakeConfigSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsTradeTakeConfig record);
@SelectProvider(type=BsTradeTakeConfigSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER),
@Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER),
@Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
List<BsTradeTakeConfig> selectByExample(BsTradeTakeConfigExample example);
@Select({
"select",
"id, company_id, company_name, platform_type, platform_type_name, receiver_role, ",
"receiver_role_name, receiver_account, receiver_name, receiver_ratio, receiver_object_id, ",
"receiver_object_name, sub_receiver_role, sub_receiver_role_name, sub_receiver_account, ",
"sub_receiver_name, sub_receiver_ratio, sub_receiver_object_id, sub_receiver_object_name, ",
"`status`, op_user_id, op_user_name, create_time, update_time, ext_1, ext_2, ",
"ext_3",
"from bs_trade_take_config",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
@Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER),
@Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER),
@Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT),
@Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
@Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
})
BsTradeTakeConfig selectByPrimaryKey(Long id);
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example);
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example);
@UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsTradeTakeConfig record);
@Update({
"update bs_trade_take_config",
"set company_id = #{companyId,jdbcType=BIGINT},",
"company_name = #{companyName,jdbcType=VARCHAR},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_type_name = #{platformTypeName,jdbcType=VARCHAR},",
"receiver_role = #{receiverRole,jdbcType=INTEGER},",
"receiver_role_name = #{receiverRoleName,jdbcType=VARCHAR},",
"receiver_account = #{receiverAccount,jdbcType=VARCHAR},",
"receiver_name = #{receiverName,jdbcType=VARCHAR},",
"receiver_ratio = #{receiverRatio,jdbcType=DECIMAL},",
"receiver_object_id = #{receiverObjectId,jdbcType=BIGINT},",
"receiver_object_name = #{receiverObjectName,jdbcType=VARCHAR},",
"sub_receiver_role = #{subReceiverRole,jdbcType=INTEGER},",
"sub_receiver_role_name = #{subReceiverRoleName,jdbcType=VARCHAR},",
"sub_receiver_account = #{subReceiverAccount,jdbcType=VARCHAR},",
"sub_receiver_name = #{subReceiverName,jdbcType=VARCHAR},",
"sub_receiver_ratio = #{subReceiverRatio,jdbcType=DECIMAL},",
"sub_receiver_object_id = #{subReceiverObjectId,jdbcType=BIGINT},",
"sub_receiver_object_name = #{subReceiverObjectName,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"op_user_id = #{opUserId,jdbcType=BIGINT},",
"op_user_name = #{opUserName,jdbcType=VARCHAR},",
"create_time = #{createTime,jdbcType=TIMESTAMP},",
"update_time = #{updateTime,jdbcType=TIMESTAMP},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",
"where id = #{id,jdbcType=BIGINT}"
})
int updateByPrimaryKey(BsTradeTakeConfig record);
}

@ -0,0 +1,7 @@
package com.hfkj.dao;
/**
* mapper扩展类
*/
public interface BsTradeTakeConfigMapperExt {
}

@ -0,0 +1,542 @@
package com.hfkj.dao;
import com.hfkj.entity.BsTradeTakeConfig;
import com.hfkj.entity.BsTradeTakeConfigExample.Criteria;
import com.hfkj.entity.BsTradeTakeConfigExample.Criterion;
import com.hfkj.entity.BsTradeTakeConfigExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsTradeTakeConfigSqlProvider {
public String countByExample(BsTradeTakeConfigExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_trade_take_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsTradeTakeConfigExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_trade_take_config");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsTradeTakeConfig record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_trade_take_config");
if (record.getCompanyId() != null) {
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
}
if (record.getPlatformType() != null) {
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformTypeName() != null) {
sql.VALUES("platform_type_name", "#{platformTypeName,jdbcType=VARCHAR}");
}
if (record.getReceiverRole() != null) {
sql.VALUES("receiver_role", "#{receiverRole,jdbcType=INTEGER}");
}
if (record.getReceiverRoleName() != null) {
sql.VALUES("receiver_role_name", "#{receiverRoleName,jdbcType=VARCHAR}");
}
if (record.getReceiverAccount() != null) {
sql.VALUES("receiver_account", "#{receiverAccount,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.VALUES("receiver_name", "#{receiverName,jdbcType=VARCHAR}");
}
if (record.getReceiverRatio() != null) {
sql.VALUES("receiver_ratio", "#{receiverRatio,jdbcType=DECIMAL}");
}
if (record.getReceiverObjectId() != null) {
sql.VALUES("receiver_object_id", "#{receiverObjectId,jdbcType=BIGINT}");
}
if (record.getReceiverObjectName() != null) {
sql.VALUES("receiver_object_name", "#{receiverObjectName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRole() != null) {
sql.VALUES("sub_receiver_role", "#{subReceiverRole,jdbcType=INTEGER}");
}
if (record.getSubReceiverRoleName() != null) {
sql.VALUES("sub_receiver_role_name", "#{subReceiverRoleName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverAccount() != null) {
sql.VALUES("sub_receiver_account", "#{subReceiverAccount,jdbcType=VARCHAR}");
}
if (record.getSubReceiverName() != null) {
sql.VALUES("sub_receiver_name", "#{subReceiverName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRatio() != null) {
sql.VALUES("sub_receiver_ratio", "#{subReceiverRatio,jdbcType=DECIMAL}");
}
if (record.getSubReceiverObjectId() != null) {
sql.VALUES("sub_receiver_object_id", "#{subReceiverObjectId,jdbcType=BIGINT}");
}
if (record.getSubReceiverObjectName() != null) {
sql.VALUES("sub_receiver_object_name", "#{subReceiverObjectName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getOpUserId() != null) {
sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.VALUES("op_user_name", "#{opUserName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}");
}
return sql.toString();
}
public String selectByExample(BsTradeTakeConfigExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("company_id");
sql.SELECT("company_name");
sql.SELECT("platform_type");
sql.SELECT("platform_type_name");
sql.SELECT("receiver_role");
sql.SELECT("receiver_role_name");
sql.SELECT("receiver_account");
sql.SELECT("receiver_name");
sql.SELECT("receiver_ratio");
sql.SELECT("receiver_object_id");
sql.SELECT("receiver_object_name");
sql.SELECT("sub_receiver_role");
sql.SELECT("sub_receiver_role_name");
sql.SELECT("sub_receiver_account");
sql.SELECT("sub_receiver_name");
sql.SELECT("sub_receiver_ratio");
sql.SELECT("sub_receiver_object_id");
sql.SELECT("sub_receiver_object_name");
sql.SELECT("`status`");
sql.SELECT("op_user_id");
sql.SELECT("op_user_name");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_trade_take_config");
applyWhere(sql, example, false);
if (example != null && example.getOrderByClause() != null) {
sql.ORDER_BY(example.getOrderByClause());
}
return sql.toString();
}
public String updateByExampleSelective(Map<String, Object> parameter) {
BsTradeTakeConfig record = (BsTradeTakeConfig) parameter.get("record");
BsTradeTakeConfigExample example = (BsTradeTakeConfigExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_trade_take_config");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getCompanyId() != null) {
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
}
if (record.getPlatformTypeName() != null) {
sql.SET("platform_type_name = #{record.platformTypeName,jdbcType=VARCHAR}");
}
if (record.getReceiverRole() != null) {
sql.SET("receiver_role = #{record.receiverRole,jdbcType=INTEGER}");
}
if (record.getReceiverRoleName() != null) {
sql.SET("receiver_role_name = #{record.receiverRoleName,jdbcType=VARCHAR}");
}
if (record.getReceiverAccount() != null) {
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}");
}
if (record.getReceiverRatio() != null) {
sql.SET("receiver_ratio = #{record.receiverRatio,jdbcType=DECIMAL}");
}
if (record.getReceiverObjectId() != null) {
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=BIGINT}");
}
if (record.getReceiverObjectName() != null) {
sql.SET("receiver_object_name = #{record.receiverObjectName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRole() != null) {
sql.SET("sub_receiver_role = #{record.subReceiverRole,jdbcType=INTEGER}");
}
if (record.getSubReceiverRoleName() != null) {
sql.SET("sub_receiver_role_name = #{record.subReceiverRoleName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverAccount() != null) {
sql.SET("sub_receiver_account = #{record.subReceiverAccount,jdbcType=VARCHAR}");
}
if (record.getSubReceiverName() != null) {
sql.SET("sub_receiver_name = #{record.subReceiverName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRatio() != null) {
sql.SET("sub_receiver_ratio = #{record.subReceiverRatio,jdbcType=DECIMAL}");
}
if (record.getSubReceiverObjectId() != null) {
sql.SET("sub_receiver_object_id = #{record.subReceiverObjectId,jdbcType=BIGINT}");
}
if (record.getSubReceiverObjectName() != null) {
sql.SET("sub_receiver_object_name = #{record.subReceiverObjectName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getOpUserId() != null) {
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
}
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByExample(Map<String, Object> parameter) {
SQL sql = new SQL();
sql.UPDATE("bs_trade_take_config");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_type_name = #{record.platformTypeName,jdbcType=VARCHAR}");
sql.SET("receiver_role = #{record.receiverRole,jdbcType=INTEGER}");
sql.SET("receiver_role_name = #{record.receiverRoleName,jdbcType=VARCHAR}");
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}");
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}");
sql.SET("receiver_ratio = #{record.receiverRatio,jdbcType=DECIMAL}");
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=BIGINT}");
sql.SET("receiver_object_name = #{record.receiverObjectName,jdbcType=VARCHAR}");
sql.SET("sub_receiver_role = #{record.subReceiverRole,jdbcType=INTEGER}");
sql.SET("sub_receiver_role_name = #{record.subReceiverRoleName,jdbcType=VARCHAR}");
sql.SET("sub_receiver_account = #{record.subReceiverAccount,jdbcType=VARCHAR}");
sql.SET("sub_receiver_name = #{record.subReceiverName,jdbcType=VARCHAR}");
sql.SET("sub_receiver_ratio = #{record.subReceiverRatio,jdbcType=DECIMAL}");
sql.SET("sub_receiver_object_id = #{record.subReceiverObjectId,jdbcType=BIGINT}");
sql.SET("sub_receiver_object_name = #{record.subReceiverObjectName,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}");
sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}");
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
BsTradeTakeConfigExample example = (BsTradeTakeConfigExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsTradeTakeConfig record) {
SQL sql = new SQL();
sql.UPDATE("bs_trade_take_config");
if (record.getCompanyId() != null) {
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
}
if (record.getCompanyName() != null) {
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformTypeName() != null) {
sql.SET("platform_type_name = #{platformTypeName,jdbcType=VARCHAR}");
}
if (record.getReceiverRole() != null) {
sql.SET("receiver_role = #{receiverRole,jdbcType=INTEGER}");
}
if (record.getReceiverRoleName() != null) {
sql.SET("receiver_role_name = #{receiverRoleName,jdbcType=VARCHAR}");
}
if (record.getReceiverAccount() != null) {
sql.SET("receiver_account = #{receiverAccount,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.SET("receiver_name = #{receiverName,jdbcType=VARCHAR}");
}
if (record.getReceiverRatio() != null) {
sql.SET("receiver_ratio = #{receiverRatio,jdbcType=DECIMAL}");
}
if (record.getReceiverObjectId() != null) {
sql.SET("receiver_object_id = #{receiverObjectId,jdbcType=BIGINT}");
}
if (record.getReceiverObjectName() != null) {
sql.SET("receiver_object_name = #{receiverObjectName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRole() != null) {
sql.SET("sub_receiver_role = #{subReceiverRole,jdbcType=INTEGER}");
}
if (record.getSubReceiverRoleName() != null) {
sql.SET("sub_receiver_role_name = #{subReceiverRoleName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverAccount() != null) {
sql.SET("sub_receiver_account = #{subReceiverAccount,jdbcType=VARCHAR}");
}
if (record.getSubReceiverName() != null) {
sql.SET("sub_receiver_name = #{subReceiverName,jdbcType=VARCHAR}");
}
if (record.getSubReceiverRatio() != null) {
sql.SET("sub_receiver_ratio = #{subReceiverRatio,jdbcType=DECIMAL}");
}
if (record.getSubReceiverObjectId() != null) {
sql.SET("sub_receiver_object_id = #{subReceiverObjectId,jdbcType=BIGINT}");
}
if (record.getSubReceiverObjectName() != null) {
sql.SET("sub_receiver_object_name = #{subReceiverObjectName,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getOpUserId() != null) {
sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}");
}
if (record.getOpUserName() != null) {
sql.SET("op_user_name = #{opUserName,jdbcType=VARCHAR}");
}
if (record.getCreateTime() != null) {
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
}
if (record.getUpdateTime() != null) {
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}
if (record.getExt2() != null) {
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}");
}
if (record.getExt3() != null) {
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}");
}
sql.WHERE("id = #{id,jdbcType=BIGINT}");
return sql.toString();
}
protected void applyWhere(SQL sql, BsTradeTakeConfigExample example, boolean includeExamplePhrase) {
if (example == null) {
return;
}
String parmPhrase1;
String parmPhrase1_th;
String parmPhrase2;
String parmPhrase2_th;
String parmPhrase3;
String parmPhrase3_th;
if (includeExamplePhrase) {
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
} else {
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
}
StringBuilder sb = new StringBuilder();
List<Criteria> oredCriteria = example.getOredCriteria();
boolean firstCriteria = true;
for (int i = 0; i < oredCriteria.size(); i++) {
Criteria criteria = oredCriteria.get(i);
if (criteria.isValid()) {
if (firstCriteria) {
firstCriteria = false;
} else {
sb.append(" or ");
}
sb.append('(');
List<Criterion> criterions = criteria.getAllCriteria();
boolean firstCriterion = true;
for (int j = 0; j < criterions.size(); j++) {
Criterion criterion = criterions.get(j);
if (firstCriterion) {
firstCriterion = false;
} else {
sb.append(" and ");
}
if (criterion.isNoValue()) {
sb.append(criterion.getCondition());
} else if (criterion.isSingleValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
} else {
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
}
} else if (criterion.isBetweenValue()) {
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
} else {
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
}
} else if (criterion.isListValue()) {
sb.append(criterion.getCondition());
sb.append(" (");
List<?> listItems = (List<?>) criterion.getValue();
boolean comma = false;
for (int k = 0; k < listItems.size(); k++) {
if (comma) {
sb.append(", ");
} else {
comma = true;
}
if (criterion.getTypeHandler() == null) {
sb.append(String.format(parmPhrase3, i, j, k));
} else {
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
}
}
sb.append(')');
}
}
sb.append(')');
}
}
if (sb.length() > 0) {
sql.WHERE(sb.toString());
}
}
}

@ -29,6 +29,21 @@ public class BsIndustry implements Serializable {
*/
private String name;
/**
* 微信公司行业代码
*/
private String wechatCompanyCode;
/**
* 微信个体户代码
*/
private String wechatSelfEmployedCode;
/**
* 微信行业名称
*/
private String wechatName;
/**
* 状态 0删除 1正常
*/
@ -81,6 +96,30 @@ public class BsIndustry implements Serializable {
this.name = name;
}
public String getWechatCompanyCode() {
return wechatCompanyCode;
}
public void setWechatCompanyCode(String wechatCompanyCode) {
this.wechatCompanyCode = wechatCompanyCode;
}
public String getWechatSelfEmployedCode() {
return wechatSelfEmployedCode;
}
public void setWechatSelfEmployedCode(String wechatSelfEmployedCode) {
this.wechatSelfEmployedCode = wechatSelfEmployedCode;
}
public String getWechatName() {
return wechatName;
}
public void setWechatName(String wechatName) {
this.wechatName = wechatName;
}
public Integer getStatus() {
return status;
}
@ -136,6 +175,9 @@ public class BsIndustry implements Serializable {
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getWechatCompanyCode() == null ? other.getWechatCompanyCode() == null : this.getWechatCompanyCode().equals(other.getWechatCompanyCode()))
&& (this.getWechatSelfEmployedCode() == null ? other.getWechatSelfEmployedCode() == null : this.getWechatSelfEmployedCode().equals(other.getWechatSelfEmployedCode()))
&& (this.getWechatName() == null ? other.getWechatName() == null : this.getWechatName().equals(other.getWechatName()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
@ -150,6 +192,9 @@ public class BsIndustry implements Serializable {
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getWechatCompanyCode() == null) ? 0 : getWechatCompanyCode().hashCode());
result = prime * result + ((getWechatSelfEmployedCode() == null) ? 0 : getWechatSelfEmployedCode().hashCode());
result = prime * result + ((getWechatName() == null) ? 0 : getWechatName().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
@ -167,6 +212,9 @@ public class BsIndustry implements Serializable {
sb.append(", id=").append(id);
sb.append(", parentId=").append(parentId);
sb.append(", name=").append(name);
sb.append(", wechatCompanyCode=").append(wechatCompanyCode);
sb.append(", wechatSelfEmployedCode=").append(wechatSelfEmployedCode);
sb.append(", wechatName=").append(wechatName);
sb.append(", status=").append(status);
sb.append(", createTime=").append(createTime);
sb.append(", ext1=").append(ext1);

@ -315,6 +315,216 @@ public class BsIndustryExample {
return (Criteria) this;
}
public Criteria andWechatCompanyCodeIsNull() {
addCriterion("wechat_company_code is null");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeIsNotNull() {
addCriterion("wechat_company_code is not null");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeEqualTo(String value) {
addCriterion("wechat_company_code =", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeNotEqualTo(String value) {
addCriterion("wechat_company_code <>", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeGreaterThan(String value) {
addCriterion("wechat_company_code >", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeGreaterThanOrEqualTo(String value) {
addCriterion("wechat_company_code >=", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeLessThan(String value) {
addCriterion("wechat_company_code <", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeLessThanOrEqualTo(String value) {
addCriterion("wechat_company_code <=", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeLike(String value) {
addCriterion("wechat_company_code like", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeNotLike(String value) {
addCriterion("wechat_company_code not like", value, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeIn(List<String> values) {
addCriterion("wechat_company_code in", values, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeNotIn(List<String> values) {
addCriterion("wechat_company_code not in", values, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeBetween(String value1, String value2) {
addCriterion("wechat_company_code between", value1, value2, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatCompanyCodeNotBetween(String value1, String value2) {
addCriterion("wechat_company_code not between", value1, value2, "wechatCompanyCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeIsNull() {
addCriterion("wechat_self_employed_code is null");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeIsNotNull() {
addCriterion("wechat_self_employed_code is not null");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeEqualTo(String value) {
addCriterion("wechat_self_employed_code =", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeNotEqualTo(String value) {
addCriterion("wechat_self_employed_code <>", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeGreaterThan(String value) {
addCriterion("wechat_self_employed_code >", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeGreaterThanOrEqualTo(String value) {
addCriterion("wechat_self_employed_code >=", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeLessThan(String value) {
addCriterion("wechat_self_employed_code <", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeLessThanOrEqualTo(String value) {
addCriterion("wechat_self_employed_code <=", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeLike(String value) {
addCriterion("wechat_self_employed_code like", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeNotLike(String value) {
addCriterion("wechat_self_employed_code not like", value, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeIn(List<String> values) {
addCriterion("wechat_self_employed_code in", values, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeNotIn(List<String> values) {
addCriterion("wechat_self_employed_code not in", values, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeBetween(String value1, String value2) {
addCriterion("wechat_self_employed_code between", value1, value2, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatSelfEmployedCodeNotBetween(String value1, String value2) {
addCriterion("wechat_self_employed_code not between", value1, value2, "wechatSelfEmployedCode");
return (Criteria) this;
}
public Criteria andWechatNameIsNull() {
addCriterion("wechat_name is null");
return (Criteria) this;
}
public Criteria andWechatNameIsNotNull() {
addCriterion("wechat_name is not null");
return (Criteria) this;
}
public Criteria andWechatNameEqualTo(String value) {
addCriterion("wechat_name =", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameNotEqualTo(String value) {
addCriterion("wechat_name <>", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameGreaterThan(String value) {
addCriterion("wechat_name >", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameGreaterThanOrEqualTo(String value) {
addCriterion("wechat_name >=", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameLessThan(String value) {
addCriterion("wechat_name <", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameLessThanOrEqualTo(String value) {
addCriterion("wechat_name <=", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameLike(String value) {
addCriterion("wechat_name like", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameNotLike(String value) {
addCriterion("wechat_name not like", value, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameIn(List<String> values) {
addCriterion("wechat_name in", values, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameNotIn(List<String> values) {
addCriterion("wechat_name not in", values, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameBetween(String value1, String value2) {
addCriterion("wechat_name between", value1, value2, "wechatName");
return (Criteria) this;
}
public Criteria andWechatNameNotBetween(String value1, String value2) {
addCriterion("wechat_name not between", value1, value2, "wechatName");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("`status` is null");
return (Criteria) this;

@ -18,6 +18,16 @@ public class BsMerPlatformNo implements Serializable {
*/
private Long id;
/**
* 公司id
*/
private Long companyId;
/**
* 代理商id
*/
private Long agentId;
/**
* 商户id
*/
@ -109,6 +119,22 @@ public class BsMerPlatformNo implements Serializable {
this.id = id;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public Long getAgentId() {
return agentId;
}
public void setAgentId(Long agentId) {
this.agentId = agentId;
}
public Long getMerId() {
return merId;
}
@ -266,6 +292,8 @@ public class BsMerPlatformNo implements Serializable {
}
BsMerPlatformNo other = (BsMerPlatformNo) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
@ -291,6 +319,8 @@ public class BsMerPlatformNo implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode());
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
@ -319,6 +349,8 @@ public class BsMerPlatformNo implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", agentId=").append(agentId);
sb.append(", merId=").append(merId);
sb.append(", merNo=").append(merNo);
sb.append(", platformType=").append(platformType);

@ -185,6 +185,126 @@ public class BsMerPlatformNoExample {
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andAgentIdIsNull() {
addCriterion("agent_id is null");
return (Criteria) this;
}
public Criteria andAgentIdIsNotNull() {
addCriterion("agent_id is not null");
return (Criteria) this;
}
public Criteria andAgentIdEqualTo(Long value) {
addCriterion("agent_id =", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotEqualTo(Long value) {
addCriterion("agent_id <>", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThan(Long value) {
addCriterion("agent_id >", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdGreaterThanOrEqualTo(Long value) {
addCriterion("agent_id >=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThan(Long value) {
addCriterion("agent_id <", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdLessThanOrEqualTo(Long value) {
addCriterion("agent_id <=", value, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdIn(List<Long> values) {
addCriterion("agent_id in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotIn(List<Long> values) {
addCriterion("agent_id not in", values, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdBetween(Long value1, Long value2) {
addCriterion("agent_id between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andAgentIdNotBetween(Long value1, Long value2) {
addCriterion("agent_id not between", value1, value2, "agentId");
return (Criteria) this;
}
public Criteria andMerIdIsNull() {
addCriterion("mer_id is null");
return (Criteria) this;

@ -99,6 +99,11 @@ public class BsStoreDiscountActivity implements Serializable {
*/
private BigDecimal discountPrice;
/**
* 优惠的成本金额与商家洽淡的金额
*/
private BigDecimal finalCostPrice;
/**
* 优惠活动开始时间
*/
@ -278,6 +283,14 @@ public class BsStoreDiscountActivity implements Serializable {
this.discountPrice = discountPrice;
}
public BigDecimal getFinalCostPrice() {
return finalCostPrice;
}
public void setFinalCostPrice(BigDecimal finalCostPrice) {
this.finalCostPrice = finalCostPrice;
}
public Date getStartTime() {
return startTime;
}
@ -387,6 +400,7 @@ public class BsStoreDiscountActivity implements Serializable {
&& (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType()))
&& (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition()))
&& (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice()))
&& (this.getFinalCostPrice() == null ? other.getFinalCostPrice() == null : this.getFinalCostPrice().equals(other.getFinalCostPrice()))
&& (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
&& (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -420,6 +434,7 @@ public class BsStoreDiscountActivity implements Serializable {
result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode());
result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode());
result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode());
result = prime * result + ((getFinalCostPrice() == null) ? 0 : getFinalCostPrice().hashCode());
result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -456,6 +471,7 @@ public class BsStoreDiscountActivity implements Serializable {
sb.append(", discountType=").append(discountType);
sb.append(", discountCondition=").append(discountCondition);
sb.append(", discountPrice=").append(discountPrice);
sb.append(", finalCostPrice=").append(finalCostPrice);
sb.append(", startTime=").append(startTime);
sb.append(", endTime=").append(endTime);
sb.append(", status=").append(status);

@ -1216,6 +1216,66 @@ public class BsStoreDiscountActivityExample {
return (Criteria) this;
}
public Criteria andFinalCostPriceIsNull() {
addCriterion("final_cost_price is null");
return (Criteria) this;
}
public Criteria andFinalCostPriceIsNotNull() {
addCriterion("final_cost_price is not null");
return (Criteria) this;
}
public Criteria andFinalCostPriceEqualTo(BigDecimal value) {
addCriterion("final_cost_price =", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceNotEqualTo(BigDecimal value) {
addCriterion("final_cost_price <>", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceGreaterThan(BigDecimal value) {
addCriterion("final_cost_price >", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("final_cost_price >=", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceLessThan(BigDecimal value) {
addCriterion("final_cost_price <", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("final_cost_price <=", value, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceIn(List<BigDecimal> values) {
addCriterion("final_cost_price in", values, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceNotIn(List<BigDecimal> values) {
addCriterion("final_cost_price not in", values, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("final_cost_price between", value1, value2, "finalCostPrice");
return (Criteria) this;
}
public Criteria andFinalCostPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("final_cost_price not between", value1, value2, "finalCostPrice");
return (Criteria) this;
}
public Criteria andStartTimeIsNull() {
addCriterion("start_time is null");
return (Criteria) this;

@ -163,6 +163,11 @@ public class BsTradeOrder implements Serializable {
*/
private BigDecimal storeDiscountPrice;
/**
* 门店优惠成本金额
*/
private BigDecimal storeDiscountFinalCostPrice;
/**
* 门店实际优惠金额
*/
@ -503,6 +508,14 @@ public class BsTradeOrder implements Serializable {
this.storeDiscountPrice = storeDiscountPrice;
}
public BigDecimal getStoreDiscountFinalCostPrice() {
return storeDiscountFinalCostPrice;
}
public void setStoreDiscountFinalCostPrice(BigDecimal storeDiscountFinalCostPrice) {
this.storeDiscountFinalCostPrice = storeDiscountFinalCostPrice;
}
public BigDecimal getStoreDiscountActualPrice() {
return storeDiscountActualPrice;
}
@ -728,6 +741,7 @@ public class BsTradeOrder implements Serializable {
&& (this.getStoreDiscountType() == null ? other.getStoreDiscountType() == null : this.getStoreDiscountType().equals(other.getStoreDiscountType()))
&& (this.getStoreDiscountCondition() == null ? other.getStoreDiscountCondition() == null : this.getStoreDiscountCondition().equals(other.getStoreDiscountCondition()))
&& (this.getStoreDiscountPrice() == null ? other.getStoreDiscountPrice() == null : this.getStoreDiscountPrice().equals(other.getStoreDiscountPrice()))
&& (this.getStoreDiscountFinalCostPrice() == null ? other.getStoreDiscountFinalCostPrice() == null : this.getStoreDiscountFinalCostPrice().equals(other.getStoreDiscountFinalCostPrice()))
&& (this.getStoreDiscountActualPrice() == null ? other.getStoreDiscountActualPrice() == null : this.getStoreDiscountActualPrice().equals(other.getStoreDiscountActualPrice()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone()))
@ -786,6 +800,7 @@ public class BsTradeOrder implements Serializable {
result = prime * result + ((getStoreDiscountType() == null) ? 0 : getStoreDiscountType().hashCode());
result = prime * result + ((getStoreDiscountCondition() == null) ? 0 : getStoreDiscountCondition().hashCode());
result = prime * result + ((getStoreDiscountPrice() == null) ? 0 : getStoreDiscountPrice().hashCode());
result = prime * result + ((getStoreDiscountFinalCostPrice() == null) ? 0 : getStoreDiscountFinalCostPrice().hashCode());
result = prime * result + ((getStoreDiscountActualPrice() == null) ? 0 : getStoreDiscountActualPrice().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode());
@ -847,6 +862,7 @@ public class BsTradeOrder implements Serializable {
sb.append(", storeDiscountType=").append(storeDiscountType);
sb.append(", storeDiscountCondition=").append(storeDiscountCondition);
sb.append(", storeDiscountPrice=").append(storeDiscountPrice);
sb.append(", storeDiscountFinalCostPrice=").append(storeDiscountFinalCostPrice);
sb.append(", storeDiscountActualPrice=").append(storeDiscountActualPrice);
sb.append(", userId=").append(userId);
sb.append(", userPhone=").append(userPhone);

@ -2006,6 +2006,66 @@ public class BsTradeOrderExample {
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceIsNull() {
addCriterion("store_discount_final_cost_price is null");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceIsNotNull() {
addCriterion("store_discount_final_cost_price is not null");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceEqualTo(BigDecimal value) {
addCriterion("store_discount_final_cost_price =", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceNotEqualTo(BigDecimal value) {
addCriterion("store_discount_final_cost_price <>", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceGreaterThan(BigDecimal value) {
addCriterion("store_discount_final_cost_price >", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("store_discount_final_cost_price >=", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceLessThan(BigDecimal value) {
addCriterion("store_discount_final_cost_price <", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceLessThanOrEqualTo(BigDecimal value) {
addCriterion("store_discount_final_cost_price <=", value, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceIn(List<BigDecimal> values) {
addCriterion("store_discount_final_cost_price in", values, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceNotIn(List<BigDecimal> values) {
addCriterion("store_discount_final_cost_price not in", values, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("store_discount_final_cost_price between", value1, value2, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountFinalCostPriceNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("store_discount_final_cost_price not between", value1, value2, "storeDiscountFinalCostPrice");
return (Criteria) this;
}
public Criteria andStoreDiscountActualPriceIsNull() {
addCriterion("store_discount_actual_price is null");
return (Criteria) this;

@ -0,0 +1,473 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_trade_take_config
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsTradeTakeConfig implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 公司id
*/
private Long companyId;
/**
* 公司名称
*/
private String companyName;
/**
* 平台类型
*/
private Integer platformType;
/**
* 平台类型名称
*/
private String platformTypeName;
/**
* 接收方角色
*/
private Integer receiverRole;
/**
* 接收方角色名称
*/
private String receiverRoleName;
/**
* 分账接收方账户
*/
private String receiverAccount;
/**
* 分账接收方姓名
*/
private String receiverName;
/**
* 抽成比例 单位%
*/
private BigDecimal receiverRatio;
/**
* 接收方角色id
*/
private Long receiverObjectId;
/**
* 接收方角色名称
*/
private String receiverObjectName;
/**
* 接收方角色
*/
private Integer subReceiverRole;
/**
* 子接收方角色名称
*/
private String subReceiverRoleName;
/**
* 子分账接收方账户
*/
private String subReceiverAccount;
/**
* 分账接收方姓名
*/
private String subReceiverName;
/**
* 抽成比例 单位%
*/
private BigDecimal subReceiverRatio;
/**
* 接收方角色id
*/
private Long subReceiverObjectId;
/**
* 接收方角色名称
*/
private String subReceiverObjectName;
/**
* 状态 0不可用 1可用
*/
private Integer status;
/**
* 操作人
*/
private Long opUserId;
/**
* 操作名称
*/
private String opUserName;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
private String ext1;
private String ext2;
private String ext3;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformTypeName() {
return platformTypeName;
}
public void setPlatformTypeName(String platformTypeName) {
this.platformTypeName = platformTypeName;
}
public Integer getReceiverRole() {
return receiverRole;
}
public void setReceiverRole(Integer receiverRole) {
this.receiverRole = receiverRole;
}
public String getReceiverRoleName() {
return receiverRoleName;
}
public void setReceiverRoleName(String receiverRoleName) {
this.receiverRoleName = receiverRoleName;
}
public String getReceiverAccount() {
return receiverAccount;
}
public void setReceiverAccount(String receiverAccount) {
this.receiverAccount = receiverAccount;
}
public String getReceiverName() {
return receiverName;
}
public void setReceiverName(String receiverName) {
this.receiverName = receiverName;
}
public BigDecimal getReceiverRatio() {
return receiverRatio;
}
public void setReceiverRatio(BigDecimal receiverRatio) {
this.receiverRatio = receiverRatio;
}
public Long getReceiverObjectId() {
return receiverObjectId;
}
public void setReceiverObjectId(Long receiverObjectId) {
this.receiverObjectId = receiverObjectId;
}
public String getReceiverObjectName() {
return receiverObjectName;
}
public void setReceiverObjectName(String receiverObjectName) {
this.receiverObjectName = receiverObjectName;
}
public Integer getSubReceiverRole() {
return subReceiverRole;
}
public void setSubReceiverRole(Integer subReceiverRole) {
this.subReceiverRole = subReceiverRole;
}
public String getSubReceiverRoleName() {
return subReceiverRoleName;
}
public void setSubReceiverRoleName(String subReceiverRoleName) {
this.subReceiverRoleName = subReceiverRoleName;
}
public String getSubReceiverAccount() {
return subReceiverAccount;
}
public void setSubReceiverAccount(String subReceiverAccount) {
this.subReceiverAccount = subReceiverAccount;
}
public String getSubReceiverName() {
return subReceiverName;
}
public void setSubReceiverName(String subReceiverName) {
this.subReceiverName = subReceiverName;
}
public BigDecimal getSubReceiverRatio() {
return subReceiverRatio;
}
public void setSubReceiverRatio(BigDecimal subReceiverRatio) {
this.subReceiverRatio = subReceiverRatio;
}
public Long getSubReceiverObjectId() {
return subReceiverObjectId;
}
public void setSubReceiverObjectId(Long subReceiverObjectId) {
this.subReceiverObjectId = subReceiverObjectId;
}
public String getSubReceiverObjectName() {
return subReceiverObjectName;
}
public void setSubReceiverObjectName(String subReceiverObjectName) {
this.subReceiverObjectName = subReceiverObjectName;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Long getOpUserId() {
return opUserId;
}
public void setOpUserId(Long opUserId) {
this.opUserId = opUserId;
}
public String getOpUserName() {
return opUserName;
}
public void setOpUserName(String opUserName) {
this.opUserName = opUserName;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getExt1() {
return ext1;
}
public void setExt1(String ext1) {
this.ext1 = ext1;
}
public String getExt2() {
return ext2;
}
public void setExt2(String ext2) {
this.ext2 = ext2;
}
public String getExt3() {
return ext3;
}
public void setExt3(String ext3) {
this.ext3 = ext3;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsTradeTakeConfig other = (BsTradeTakeConfig) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId()))
&& (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformTypeName() == null ? other.getPlatformTypeName() == null : this.getPlatformTypeName().equals(other.getPlatformTypeName()))
&& (this.getReceiverRole() == null ? other.getReceiverRole() == null : this.getReceiverRole().equals(other.getReceiverRole()))
&& (this.getReceiverRoleName() == null ? other.getReceiverRoleName() == null : this.getReceiverRoleName().equals(other.getReceiverRoleName()))
&& (this.getReceiverAccount() == null ? other.getReceiverAccount() == null : this.getReceiverAccount().equals(other.getReceiverAccount()))
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName()))
&& (this.getReceiverRatio() == null ? other.getReceiverRatio() == null : this.getReceiverRatio().equals(other.getReceiverRatio()))
&& (this.getReceiverObjectId() == null ? other.getReceiverObjectId() == null : this.getReceiverObjectId().equals(other.getReceiverObjectId()))
&& (this.getReceiverObjectName() == null ? other.getReceiverObjectName() == null : this.getReceiverObjectName().equals(other.getReceiverObjectName()))
&& (this.getSubReceiverRole() == null ? other.getSubReceiverRole() == null : this.getSubReceiverRole().equals(other.getSubReceiverRole()))
&& (this.getSubReceiverRoleName() == null ? other.getSubReceiverRoleName() == null : this.getSubReceiverRoleName().equals(other.getSubReceiverRoleName()))
&& (this.getSubReceiverAccount() == null ? other.getSubReceiverAccount() == null : this.getSubReceiverAccount().equals(other.getSubReceiverAccount()))
&& (this.getSubReceiverName() == null ? other.getSubReceiverName() == null : this.getSubReceiverName().equals(other.getSubReceiverName()))
&& (this.getSubReceiverRatio() == null ? other.getSubReceiverRatio() == null : this.getSubReceiverRatio().equals(other.getSubReceiverRatio()))
&& (this.getSubReceiverObjectId() == null ? other.getSubReceiverObjectId() == null : this.getSubReceiverObjectId().equals(other.getSubReceiverObjectId()))
&& (this.getSubReceiverObjectName() == null ? other.getSubReceiverObjectName() == null : this.getSubReceiverObjectName().equals(other.getSubReceiverObjectName()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId()))
&& (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1()))
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2()))
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode());
result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformTypeName() == null) ? 0 : getPlatformTypeName().hashCode());
result = prime * result + ((getReceiverRole() == null) ? 0 : getReceiverRole().hashCode());
result = prime * result + ((getReceiverRoleName() == null) ? 0 : getReceiverRoleName().hashCode());
result = prime * result + ((getReceiverAccount() == null) ? 0 : getReceiverAccount().hashCode());
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode());
result = prime * result + ((getReceiverRatio() == null) ? 0 : getReceiverRatio().hashCode());
result = prime * result + ((getReceiverObjectId() == null) ? 0 : getReceiverObjectId().hashCode());
result = prime * result + ((getReceiverObjectName() == null) ? 0 : getReceiverObjectName().hashCode());
result = prime * result + ((getSubReceiverRole() == null) ? 0 : getSubReceiverRole().hashCode());
result = prime * result + ((getSubReceiverRoleName() == null) ? 0 : getSubReceiverRoleName().hashCode());
result = prime * result + ((getSubReceiverAccount() == null) ? 0 : getSubReceiverAccount().hashCode());
result = prime * result + ((getSubReceiverName() == null) ? 0 : getSubReceiverName().hashCode());
result = prime * result + ((getSubReceiverRatio() == null) ? 0 : getSubReceiverRatio().hashCode());
result = prime * result + ((getSubReceiverObjectId() == null) ? 0 : getSubReceiverObjectId().hashCode());
result = prime * result + ((getSubReceiverObjectName() == null) ? 0 : getSubReceiverObjectName().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode());
result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode());
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode());
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", companyName=").append(companyName);
sb.append(", platformType=").append(platformType);
sb.append(", platformTypeName=").append(platformTypeName);
sb.append(", receiverRole=").append(receiverRole);
sb.append(", receiverRoleName=").append(receiverRoleName);
sb.append(", receiverAccount=").append(receiverAccount);
sb.append(", receiverName=").append(receiverName);
sb.append(", receiverRatio=").append(receiverRatio);
sb.append(", receiverObjectId=").append(receiverObjectId);
sb.append(", receiverObjectName=").append(receiverObjectName);
sb.append(", subReceiverRole=").append(subReceiverRole);
sb.append(", subReceiverRoleName=").append(subReceiverRoleName);
sb.append(", subReceiverAccount=").append(subReceiverAccount);
sb.append(", subReceiverName=").append(subReceiverName);
sb.append(", subReceiverRatio=").append(subReceiverRatio);
sb.append(", subReceiverObjectId=").append(subReceiverObjectId);
sb.append(", subReceiverObjectName=").append(subReceiverObjectName);
sb.append(", status=").append(status);
sb.append(", opUserId=").append(opUserId);
sb.append(", opUserName=").append(opUserName);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

@ -3,6 +3,9 @@ package com.hfkj.service;
import com.hfkj.entity.BsMerPlatformNo;
import com.hfkj.sysenum.PlatformTypeEnum;
import java.util.List;
import java.util.Map;
/**
* 商户平台商户
* @author hurui
@ -22,4 +25,11 @@ public interface BsMerPlatformNoService {
* @return
*/
BsMerPlatformNo getPlatformNo(Long merId, PlatformTypeEnum type);
/**
* 查询商户号
* @param param
* @return
*/
List<BsMerPlatformNo> getMerPlatformNoList(Map<String, Object> param);
}

@ -0,0 +1,36 @@
package com.hfkj.service;
import com.hfkj.entity.BsTradeTakeConfig;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum;
import java.util.List;
/**
* @className: BsTradeTakeConfigService
* @author: HuRui
* @date: 2023/2/27
**/
public interface BsTradeTakeConfigService {
/**
* 编辑数据
* @param tradeTakeConfig
*/
void editData(BsTradeTakeConfig tradeTakeConfig);
/**
* 批量编辑数据
* @param tradeTakeConfigList
*/
void editBatchData(List<BsTradeTakeConfig> tradeTakeConfigList);
/**
* 查询配置
* @param companyId 公司id
* @param profitSharingReceiverRoleEnum 角色
* @return
*/
BsTradeTakeConfig getTradeTakeConfig(Long companyId, PlatformTypeEnum platformType, ProfitSharingReceiverRoleEnum profitSharingReceiverRoleEnum, Long receiverObjectId , Long subReceiverObjectId);
}

@ -5,11 +5,13 @@ import com.hfkj.entity.BsMerPlatformNo;
import com.hfkj.entity.BsMerPlatformNoExample;
import com.hfkj.service.BsMerPlatformNoService;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("merPlatformNoService")
public class BsMerPlatformNoServiceImpl implements BsMerPlatformNoService {
@ -40,4 +42,25 @@ public class BsMerPlatformNoServiceImpl implements BsMerPlatformNoService {
}
return null;
}
@Override
public List<BsMerPlatformNo> getMerPlatformNoList(Map<String, Object> param) {
BsMerPlatformNoExample example = new BsMerPlatformNoExample();
BsMerPlatformNoExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0);
if (MapUtils.getLong(param, "companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId"));
}
if (MapUtils.getLong(param, "agentId") != null) {
criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId"));
}
if (MapUtils.getInteger(param, "platformType") != null) {
criteria.andPlatformTypeEqualTo(MapUtils.getInteger(param, "platformType"));
}
return merPlatformNoMapper.selectByExample(example);
}
}

@ -221,7 +221,7 @@ public class BsMerServiceImpl implements BsMerService {
}
mer.setCompleteStatus(MerCompleteStatusEnum.status4.getNumber());
editMer(mer);
/*
for (BsMerRate merRate : merSettleAcct.getMerRateList()) {
if (merRate.getRateTypeCode() == null || merRate.getRatePct() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
@ -238,7 +238,6 @@ public class BsMerServiceImpl implements BsMerService {
merRateService.editMerRate(merRate);
}
}
*/
// 查询商户结算信息
BsMerSettleAcct settle = merSettleAcctService.getMerSettleByMerId(merSettleAcct.getMerId());

@ -6,16 +6,12 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.IDGenerator;
import com.hfkj.dao.BsTradeOrderProfitSharingMapper;
import com.hfkj.entity.BsMerPlatformNoRate;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderProfitSharing;
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver;
import com.hfkj.service.BsMerPlatformNoRateService;
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService;
import com.hfkj.service.BsTradeOrderProfitSharingService;
import com.hfkj.service.BsTradeOrderService;
import com.hfkj.entity.*;
import com.hfkj.service.*;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.ProfitSharingReceiverObjectType;
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum;
import com.hfkj.sysenum.StoreDiscountActivityTypeEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -45,6 +41,9 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
@Resource
private BsMerPlatformNoRateService merPlatformNoRateService;
@Resource
private BsTradeTakeConfigService tradeTakeConfigService;
@Override
public void editData(BsTradeOrderProfitSharing profitSharing) {
if (profitSharing.getId() == null) {
@ -76,41 +75,315 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
tradeOrderProfitSharing.setPlatformAppid(tradeOrder.getPlatformAppid());
editData(tradeOrderProfitSharing);
// 平台手续费
// 渠道平台手续费
BigDecimal platformServiceCharge = null;
if (tradeOrder.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) {
platformServiceCharge = new BigDecimal("0.002");
}
// 平台手续费 (四舍五入向上取取整)
// 交易金额 * 渠道平台收取手续费率 = 渠道平台手续费 (四舍五入向上取取整)
BigDecimal platformServiceChargeAmount = tradeOrder.getTradeActualAmount().multiply(platformServiceCharge).setScale(2, BigDecimal.ROUND_HALF_DOWN);
// 实际到账金额 = 交易金额 - 平台手续费
BigDecimal amount = tradeOrder.getTradeActualAmount().subtract(platformServiceChargeAmount);
for (ProfitSharingReceiverObjectType receiverObjectType : ProfitSharingReceiverObjectType.getDataList()) {
if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.operating.getType())) {
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.company.getType())) {
// 公司抽成
BigDecimal companyAmount = amount.multiply(rate.getRatePct()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(amount);
profitSharingReceiver.setRatio(rate.getRatePct());
profitSharingReceiver.setReceiverObjectType(2);
profitSharingReceiver.setReceiverObjectId(tradeOrder.getCompanyId()!=null?tradeOrder.getCompanyId().toString():null);
profitSharingReceiver.setReceiverAccount("1603942866");
profitSharingReceiver.setReceiverName("惠昕石化");
profitSharingReceiver.setReceiverAmount(companyAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.agent.getType())) {
// 自建平台手续费
BigDecimal platformServiceAmount = tradeOrder.getTradeAmount().multiply(rate.getRatePct()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
// 无任何优惠
if (tradeOrder.getStoreDiscountSatisfy().equals(false) && tradeOrder.getUserDiscountId() == null) {
// 自建平台手续费 - 渠道平台手续费 = 利润
BigDecimal totalProfit = platformServiceAmount.subtract(platformServiceChargeAmount);
tradeOrderProfitSharing.setProfitSharingAmoun(totalProfit);
// 剩余利润
BigDecimal surplusProfit = totalProfit;
// 运营商配置
BsTradeTakeConfig operatingTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role1,
2L,
null);
// 代理商配置
BsTradeTakeConfig agentTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role2,
null,
tradeOrder.getAgentId());
for (ProfitSharingReceiverObjectType receiverObjectType : ProfitSharingReceiverObjectType.getDataList()) {
if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.operating.getType())) {
// 运营商抽成
BigDecimal operatingAmount;
if (agentTakeConfig != null) {
operatingAmount = surplusProfit.multiply(operatingTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
operatingAmount = surplusProfit;
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(operatingTakeConfig.getReceiverRatio());
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.operating.getType());
profitSharingReceiver.setReceiverObjectId(operatingTakeConfig.getReceiverObjectId().toString());
profitSharingReceiver.setReceiverAccount(operatingTakeConfig.getReceiverAccount());
profitSharingReceiver.setReceiverName(operatingTakeConfig.getReceiverName());
profitSharingReceiver.setReceiverAmount(operatingAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(operatingAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.company.getType())) {
// 公司抽成
BigDecimal companyAmount;
if (agentTakeConfig != null) {
companyAmount = surplusProfit.multiply(agentTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
companyAmount = new BigDecimal("0");
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getReceiverRatio():new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.company.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getCompanyId()!=null?tradeOrder.getCompanyId().toString():null);
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getReceiverName():null);
profitSharingReceiver.setReceiverAmount(companyAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(companyAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.agent.getType())) {
// 代理商抽成
BigDecimal agentAmount = surplusProfit;
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getSubReceiverRatio(): new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.agent.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getAgentId().toString());
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getSubReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getSubReceiverName():null);
profitSharingReceiver.setReceiverAmount(agentAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
}
}
}
// 门店优惠
if (tradeOrder.getStoreDiscountSatisfy().equals(true)) {
// 运营商配置
BsTradeTakeConfig operatingTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role1,
2L,
null);
// 代理商配置
BsTradeTakeConfig agentTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role2,
null,
tradeOrder.getAgentId());
BigDecimal totalProfit = new BigDecimal("0");
BigDecimal surplusProfit = new BigDecimal("0");
if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type1.getNumber())
|| tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type2.getNumber())) {
// 优惠成本价 - 优惠金额 = 利润
totalProfit = tradeOrder.getStoreDiscountFinalCostPrice().subtract(tradeOrder.getStoreDiscountActualPrice());
// 剩余利润
surplusProfit = totalProfit;
} else if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type3.getNumber())) {
// 平台交易成本价
BigDecimal finalCostPrice = tradeOrder.getTradeActualAmount().multiply(tradeOrder.getStoreDiscountFinalCostPrice()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
// 实际交易金额 - 平台交易成本价 = 利润
totalProfit = tradeOrder.getTradeActualAmount().subtract(finalCostPrice);
// 剩余利润
surplusProfit = totalProfit;
}
tradeOrderProfitSharing.setProfitSharingAmoun(totalProfit);
for (ProfitSharingReceiverObjectType receiverObjectType : ProfitSharingReceiverObjectType.getDataList()) {
if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.operating.getType())) {
// 运营商抽成
BigDecimal operatingAmount;
if (agentTakeConfig != null) {
operatingAmount = surplusProfit.multiply(operatingTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
operatingAmount = surplusProfit;
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(operatingTakeConfig.getReceiverRatio());
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.operating.getType());
profitSharingReceiver.setReceiverObjectId(operatingTakeConfig.getReceiverObjectId().toString());
profitSharingReceiver.setReceiverAccount(operatingTakeConfig.getReceiverAccount());
profitSharingReceiver.setReceiverName(operatingTakeConfig.getReceiverName());
profitSharingReceiver.setReceiverAmount(operatingAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(operatingAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.company.getType())) {
// 公司抽成
BigDecimal companyAmount;
if (agentTakeConfig != null) {
companyAmount = surplusProfit.multiply(agentTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
companyAmount = new BigDecimal("0");
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getReceiverRatio():new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.company.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getCompanyId()!=null?tradeOrder.getCompanyId().toString():null);
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getReceiverName():null);
profitSharingReceiver.setReceiverAmount(companyAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(companyAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.agent.getType())) {
// 代理商抽成
BigDecimal agentAmount = surplusProfit;
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getSubReceiverRatio(): new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.agent.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getAgentId().toString());
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getSubReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getSubReceiverName():null);
profitSharingReceiver.setReceiverAmount(agentAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
}
}
}
// 用户优惠券优惠
if (tradeOrder.getUserDiscountId() != null) {
// 运营商配置
BsTradeTakeConfig operatingTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role1,
2L,
null);
// 代理商配置
BsTradeTakeConfig agentTakeConfig = tradeTakeConfigService.getTradeTakeConfig(
tradeOrder.getCompanyId(),
PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()),
ProfitSharingReceiverRoleEnum.role2,
null,
tradeOrder.getAgentId());
BigDecimal totalProfit = new BigDecimal("0");
BigDecimal surplusProfit = new BigDecimal("0");
if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type1.getNumber())
|| tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type2.getNumber())) {
// 优惠成本价 - 优惠金额 = 利润
totalProfit = tradeOrder.getStoreDiscountActualPrice().subtract(tradeOrder.getStoreDiscountActualPrice());
// 剩余利润
surplusProfit = totalProfit;
} else if (tradeOrder.getStoreDiscountType().equals(StoreDiscountActivityTypeEnum.type3.getNumber())) {
// 平台交易成本价
BigDecimal finalCostPrice = tradeOrder.getTradeAmount().multiply(tradeOrder.getStoreDiscountFinalCostPrice()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
// 实际交易金额 - 平台交易成本价 = 利润
totalProfit = tradeOrder.getTradeActualAmount().subtract(finalCostPrice);
// 剩余利润
surplusProfit = totalProfit;
}
tradeOrderProfitSharing.setProfitSharingAmoun(totalProfit);
for (ProfitSharingReceiverObjectType receiverObjectType : ProfitSharingReceiverObjectType.getDataList()) {
if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.operating.getType())) {
// 运营商抽成
BigDecimal operatingAmount;
if (agentTakeConfig != null) {
operatingAmount = surplusProfit.multiply(operatingTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
operatingAmount = surplusProfit;
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(operatingTakeConfig.getReceiverRatio());
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.operating.getType());
profitSharingReceiver.setReceiverObjectId(operatingTakeConfig.getReceiverObjectId().toString());
profitSharingReceiver.setReceiverAccount(operatingTakeConfig.getReceiverAccount());
profitSharingReceiver.setReceiverName(operatingTakeConfig.getReceiverName());
profitSharingReceiver.setReceiverAmount(operatingAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(operatingAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.company.getType())) {
// 公司抽成
BigDecimal companyAmount;
if (agentTakeConfig != null) {
companyAmount = surplusProfit.multiply(agentTakeConfig.getReceiverRatio()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
} else {
companyAmount = new BigDecimal("0");
}
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getReceiverRatio():new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.company.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getCompanyId()!=null?tradeOrder.getCompanyId().toString():null);
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getReceiverName():null);
profitSharingReceiver.setReceiverAmount(companyAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
surplusProfit = surplusProfit.subtract(companyAmount);
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.agent.getType())) {
// 代理商抽成
BigDecimal agentAmount = surplusProfit;
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver();
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId());
profitSharingReceiver.setTradeOrderId(tradeOrder.getId());
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo());
profitSharingReceiver.setProfitSharingAmount(surplusProfit);
profitSharingReceiver.setRatio(agentTakeConfig!=null?agentTakeConfig.getSubReceiverRatio(): new BigDecimal("0"));
profitSharingReceiver.setReceiverObjectType(ProfitSharingReceiverObjectType.agent.getType());
profitSharingReceiver.setReceiverObjectId(tradeOrder.getAgentId().toString());
profitSharingReceiver.setReceiverAccount(agentTakeConfig!=null?agentTakeConfig.getSubReceiverAccount():null);
profitSharingReceiver.setReceiverName(agentTakeConfig!=null?agentTakeConfig.getSubReceiverName():null);
profitSharingReceiver.setReceiverAmount(agentAmount);
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver);
}
}
}
editData(tradeOrderProfitSharing);
}
}

@ -0,0 +1,72 @@
package com.hfkj.service.impl;
import com.hfkj.dao.BsTradeTakeConfigMapper;
import com.hfkj.entity.BsTradeTakeConfig;
import com.hfkj.entity.BsTradeTakeConfigExample;
import com.hfkj.service.BsTradeTakeConfigService;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.ProfitSharingReceiverRoleEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsTradeTakeConfigServiceImpl
* @author: HuRui
* @date: 2023/2/27
**/
@Service("tradeTakeConfigService")
public class BsTradeTakeConfigServiceImpl implements BsTradeTakeConfigService {
@Resource
private BsTradeTakeConfigMapper tradeTakeConfigMapper;
@Override
public void editData(BsTradeTakeConfig tradeTakeConfig) {
if (tradeTakeConfig.getId() == null) {
tradeTakeConfig.setStatus(1);
tradeTakeConfig.setCreateTime(new Date());
tradeTakeConfig.setUpdateTime(new Date());
tradeTakeConfigMapper.insert(tradeTakeConfig);
} else {
tradeTakeConfig.setUpdateTime(new Date());
tradeTakeConfigMapper.updateByPrimaryKey(tradeTakeConfig);
}
}
@Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void editBatchData(List<BsTradeTakeConfig> tradeTakeConfigList) {
for (BsTradeTakeConfig tradeTakeConfig : tradeTakeConfigList) {
editData(tradeTakeConfig);
}
}
@Override
public BsTradeTakeConfig getTradeTakeConfig(Long companyId, PlatformTypeEnum platformType, ProfitSharingReceiverRoleEnum profitSharingReceiverRoleEnum, Long receiverObjectId, Long subReceiverObjectId) {
BsTradeTakeConfigExample example = new BsTradeTakeConfigExample();
BsTradeTakeConfigExample.Criteria criteria = example.createCriteria()
.andCompanyIdEqualTo(companyId)
.andPlatformTypeEqualTo(platformType.getNumber())
.andReceiverRoleEqualTo(profitSharingReceiverRoleEnum.getNumber())
.andStatusEqualTo(1);
if (receiverObjectId != null) {
criteria.andReceiverObjectIdEqualTo(receiverObjectId);
}
if (subReceiverObjectId != null) {
criteria.andSubReceiverObjectIdEqualTo(subReceiverObjectId);
}
List<BsTradeTakeConfig> list = tradeTakeConfigMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -384,7 +384,7 @@ public class CommonServiceImpl implements CommonService {
@Override
public List<SecRegion> getProvinceList(Map<String, Object> param) {
SecRegionExample example = new SecRegionExample();
example.createCriteria().andStatusEqualTo(1);
example.createCriteria().andStatusEqualTo(1).andParentIdIsNull();
return regionMapper.selectByExample(example);
}

@ -11,6 +11,7 @@ public enum MerAttachType {
type3(3, "法人身份证反面"),
type4(4, "场所门头照片"),
type5(5, "场所内部照片"),
type6(6, "补充资料"),
;
private Integer number;

@ -0,0 +1,51 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: ProfitSharingReceiverRole
* @author: HuRui
* @date: 2023/2/27
**/
public enum ProfitSharingReceiverRoleEnum {
role1(1, "运营中心"),
role2(2, "分公司"),
role3(3, "代理商"),
;
private Integer number;
private String name;
ProfitSharingReceiverRoleEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static ProfitSharingReceiverRoleEnum getDataByNumber(Integer number) {
for (ProfitSharingReceiverRoleEnum ele : values()) {
if (Objects.equals(number,ele.getNumber())) {
return ele;
}
}
return null;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -1,6 +1,6 @@
obs_bucket_name=xuan-pay-private
obs_end_point=https://obs.cn-east-3.myhuaweicloud.com
obs_url=https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com
obs_url=https://gratia-pay.obs.cn-southwest-2.myhuaweicloud.com
qr_code_data_url=https://pay.dctpay.com/scanPay
qr_code_url=https://pay.dctpay.com/filesystem/payQrCode/

Loading…
Cancel
Save