提交代码

yy_dev
胡锐 2 years ago
parent 1404a31e3b
commit 47b8987997
  1. 2
      cweb/src/main/java/com/cweb/config/SysConfig.java
  2. 8
      cweb/src/main/java/com/cweb/controller/BsDeviceOrderPayController.java
  3. 264
      cweb/src/main/java/com/cweb/controller/BsMerLedgerController.java
  4. 2
      cweb/src/main/java/com/cweb/controller/BsStoreDiscountActivityPartakeUserController.java
  5. 13
      cweb/src/main/java/com/cweb/controller/TestController.java
  6. 92
      cweb/src/main/java/com/cweb/notify/LaKaLaController.java
  7. 2
      cweb/src/main/resources/dev/config.properties
  8. 2
      cweb/src/main/resources/prod/config.properties
  9. 113
      schedule/src/main/java/com/hfkj/schedule/TradeOrderSchedule.java
  10. 382
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaLedgerService.java
  11. 6
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaMerService.java
  12. 243
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeSeparateService.java
  13. 2
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
  14. 6
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  15. 2
      service/src/main/java/com/hfkj/common/utils/DateUtil.java
  16. 4
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  17. 133
      service/src/main/java/com/hfkj/dao/BsMerLedgerApplyMapper.java
  18. 7
      service/src/main/java/com/hfkj/dao/BsMerLedgerApplyMapperExt.java
  19. 360
      service/src/main/java/com/hfkj/dao/BsMerLedgerApplySqlProvider.java
  20. 142
      service/src/main/java/com/hfkj/dao/BsMerLedgerMapper.java
  21. 7
      service/src/main/java/com/hfkj/dao/BsMerLedgerMapperExt.java
  22. 147
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverApplyMapper.java
  23. 7
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverApplyMapperExt.java
  24. 402
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverApplySqlProvider.java
  25. 147
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverMapper.java
  26. 7
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverMapperExt.java
  27. 402
      service/src/main/java/com/hfkj/dao/BsMerLedgerReceiverSqlProvider.java
  28. 388
      service/src/main/java/com/hfkj/dao/BsMerLedgerSqlProvider.java
  29. 22
      service/src/main/java/com/hfkj/dao/BsTradeOrderProfitSharingMapper.java
  30. 28
      service/src/main/java/com/hfkj/dao/BsTradeOrderProfitSharingSqlProvider.java
  31. 3
      service/src/main/java/com/hfkj/dao/SecMenuMapperExt.java
  32. 297
      service/src/main/java/com/hfkj/entity/BsMerLedger.java
  33. 264
      service/src/main/java/com/hfkj/entity/BsMerLedgerApply.java
  34. 1143
      service/src/main/java/com/hfkj/entity/BsMerLedgerApplyExample.java
  35. 1274
      service/src/main/java/com/hfkj/entity/BsMerLedgerExample.java
  36. 312
      service/src/main/java/com/hfkj/entity/BsMerLedgerReceiver.java
  37. 312
      service/src/main/java/com/hfkj/entity/BsMerLedgerReceiverApply.java
  38. 1343
      service/src/main/java/com/hfkj/entity/BsMerLedgerReceiverApplyExample.java
  39. 1343
      service/src/main/java/com/hfkj/entity/BsMerLedgerReceiverExample.java
  40. 35
      service/src/main/java/com/hfkj/entity/BsTradeOrderProfitSharing.java
  41. 130
      service/src/main/java/com/hfkj/entity/BsTradeOrderProfitSharingExample.java
  42. 31
      service/src/main/java/com/hfkj/service/BsMerLedgerApplyService.java
  43. 24
      service/src/main/java/com/hfkj/service/BsMerLedgerReceiverApplyService.java
  44. 55
      service/src/main/java/com/hfkj/service/BsMerLedgerReceiverService.java
  45. 41
      service/src/main/java/com/hfkj/service/BsMerLedgerService.java
  46. 7
      service/src/main/java/com/hfkj/service/BsTradeOrderProfitSharingReceiverService.java
  47. 7
      service/src/main/java/com/hfkj/service/BsTradeOrderProfitSharingService.java
  48. 53
      service/src/main/java/com/hfkj/service/impl/BsMerLedgerApplyServiceImpl.java
  49. 46
      service/src/main/java/com/hfkj/service/impl/BsMerLedgerReceiverApplyServiceImpl.java
  50. 104
      service/src/main/java/com/hfkj/service/impl/BsMerLedgerReceiverServiceImpl.java
  51. 68
      service/src/main/java/com/hfkj/service/impl/BsMerLedgerServiceImpl.java
  52. 7
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingReceiverServiceImpl.java
  53. 36
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderProfitSharingServiceImpl.java
  54. 2
      service/src/main/java/com/hfkj/sysenum/DeviceOrderTypeEnum.java
  55. 50
      service/src/main/java/com/hfkj/sysenum/MerAttachType.java
  56. 52
      service/src/main/java/com/hfkj/sysenum/MerLedgerReceiverApplyStatusEnum.java
  57. 52
      service/src/main/java/com/hfkj/sysenum/MerLedgerReceiverStatusEnum.java
  58. 52
      service/src/main/java/com/hfkj/sysenum/MerLedgerStatusEnum.java
  59. 52
      service/src/main/java/com/hfkj/sysenum/ProfitSharingCmdTypeEnum.java
  60. 50
      service/src/main/java/com/hfkj/sysenum/ProfitSharingReceiverStatusEnum.java
  61. 53
      service/src/main/java/com/hfkj/sysenum/ProfitSharingStatusEnum.java
  62. 3
      service/src/main/resources/dev/commonConfig.properties
  63. 2
      service/src/main/resources/prod/commonConfig.properties

@ -15,8 +15,6 @@ public class SysConfig {
private String cmsPath;
private String domainName;
private String wxAppId;
private String wxAppSecret;

@ -14,6 +14,8 @@ import com.hfkj.common.exception.SysCode;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.MathUtils;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConfig;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.BsDeviceOrder;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderMsg;
@ -87,8 +89,8 @@ public class BsDeviceOrderPayController {
Map<String,Object> map = new HashMap<>();
map.put("orderNo", order.getOrderNo());
map.put("payPrice", order.getPayPrice());
map.put("body", DeviceTypeEnum.getDataByNumber(order.getOrderType()).getName());
map.put("subject", DeviceTypeEnum.getDataByNumber(order.getOrderType()).getName());
map.put("body", DeviceTypeEnum.getDataByNumber(order.getDeviceType()).getName());
map.put("subject", DeviceTypeEnum.getDataByNumber(order.getDeviceType()).getName());
// 微信支付
String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8");
@ -110,7 +112,7 @@ public class BsDeviceOrderPayController {
weChatPayReqInfo.setOut_trade_no(map.get("orderNo").toString()); // 商户订单号
weChatPayReqInfo.setTotal_fee(total_fee); // 总金额
weChatPayReqInfo.setSpbill_create_ip("122.9.135.148"); // 终端ip
weChatPayReqInfo.setNotify_url(SysConst.getSysConfig().getDomainName()+"/crest/deviceOrderPay/orderNotify"); // 通知url
weChatPayReqInfo.setNotify_url(CommonSysConst.getSysConfig().getDomainName()+"/crest/deviceOrderPay/orderNotify"); // 通知url
weChatPayReqInfo.setTrade_type("JSAPI"); // 交易类型
weChatPayReqInfo.setProfit_sharing("N");

@ -0,0 +1,264 @@
package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsMerLedgerReceiverService;
import com.hfkj.service.BsMerLedgerService;
import com.hfkj.service.BsMerPlatformNoService;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.HashMap;
import java.util.Map;
/**
* @className: BsMerLedgerController
* @author: HuRui
* @date: 2023/4/21
**/
@Controller
@Api(value = "设备管理")
@RequestMapping(value = "/merLedger")
public class BsMerLedgerController {
private static Logger log = LoggerFactory.getLogger(BsMerLedgerController.class);
@Resource
private BsMerPlatformNoService merPlatformNoService;
@Resource
private BsMerLedgerService merLedgerService;
@Resource
private BsMerLedgerReceiverService merLedgerReceiverService;
@RequestMapping(value="/merLedgerApply",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "商户分账功能申请")
public ResponseData merLedgerApply(@RequestBody BsMerLedger body) {
try {
if (body.getMerId() == null || body.getPlatformType() == null) {
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
if (body.getSplitLowestRatio() == null || StringUtils.isBlank(body.getSplitEntrustFilePath())) {
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
}
// 商户平台
BsMerPlatformNo merPlatform = merPlatformNoService.getPlatformNo(body.getMerId(), PlatformTypeEnum.getDataByNumber(body.getPlatformType()));
if (merPlatform == null) {
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前平台未进件");
}
// 设备订单
BsMerLedger merLedger = merLedgerService.getMerLedger(body.getMerId(), PlatformTypeEnum.getDataByNumber(body.getPlatformType()));
if (merLedger == null) {
merLedger = new BsMerLedger();
merLedger.setMerId(merPlatform.getMerId());
merLedger.setPlatformType(merPlatform.getPlatformType());
merLedger.setPlatformNo(merPlatform.getPlatformNo());
merLedger.setCupNo(merPlatform.getCupNo());
merLedger.setSplitLowestRatio(body.getSplitLowestRatio());
merLedger.setSplitEntrustFileName(body.getSplitEntrustFilePath().substring(body.getSplitEntrustFilePath().lastIndexOf("/")+1));
merLedger.setSplitEntrustFilePath(body.getSplitEntrustFilePath());
if (PlatformTypeEnum.type1.getNumber().equals(merPlatform.getPlatformType())) {
merLedger.setStatus(MerLedgerStatusEnum.status2.getNumber());
} else {
merLedger.setStatus(MerLedgerStatusEnum.status1.getNumber());
}
} else {
if (merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())
|| merLedger.getStatus().equals(MerLedgerStatusEnum.status2.getNumber()) ) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "暂时无法修改");
}
merLedger = new BsMerLedger();
merLedger.setMerId(merPlatform.getMerId());
merLedger.setPlatformType(merPlatform.getPlatformType());
merLedger.setPlatformNo(merPlatform.getPlatformNo());
merLedger.setCupNo(merPlatform.getCupNo());
merLedger.setSplitLowestRatio(body.getSplitLowestRatio());
merLedger.setSplitEntrustFileName(body.getSplitEntrustFilePath().substring(body.getSplitEntrustFilePath().lastIndexOf("/")+1));
merLedger.setSplitEntrustFilePath(body.getSplitEntrustFilePath());
}
merLedgerService.merLedgerApply(merLedger);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getMerLedgerApply",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询商户分账功能")
public ResponseData getMerLedgerApply(@RequestParam(name = "merId", required = true) Long merId,
@RequestParam(name = "platformType", required = true) Integer platformType) {
try {
return ResponseMsgUtil.success(merLedgerService.getMerLedger(merId, PlatformTypeEnum.getDataByNumber(platformType)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/merLedgerReceiverApply",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "商户分账绑定接受方申请")
public ResponseData merLedgerReceiverApply(@RequestBody BsMerLedgerReceiver body) {
try {
if (body == null
|| body.getMerLedgerId() == null
|| StringUtils.isBlank(body.getReceiverNo())
|| StringUtils.isBlank(body.getReceiverName())
|| StringUtils.isBlank(body.getEntrustFilePath())
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型");
}
// 查询分账开通信息
BsMerLedger merLedger = merLedgerService.getMerLedgerById(body.getMerLedgerId());
if (merLedger == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能未开通");
}
if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能状态无法申请");
}
// 查询接收方数据
BsMerLedgerReceiver receiver = merLedgerReceiverService.getMerLedgerReceiver(merLedger.getMerId(), body.getReceiverNo());
if (receiver == null) {
receiver = new BsMerLedgerReceiver();
receiver.setMerId(merLedger.getMerId());
receiver.setMerLedgerId(merLedger.getId());
receiver.setPlatformType(merLedger.getPlatformType());
receiver.setPlatformNo(merLedger.getPlatformNo());
receiver.setCupNo(merLedger.getCupNo());
receiver.setReceiverNo(body.getReceiverNo());
receiver.setReceiverName(body.getReceiverName());
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1));
receiver.setEntrustFilePath(body.getEntrustFilePath());
} else {
receiver.setReceiverNo(body.getReceiverNo());
receiver.setReceiverName(body.getReceiverName());
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1));
receiver.setEntrustFilePath(body.getEntrustFilePath());
}
merLedgerReceiverService.merLedgerReceiverApply(receiver);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/merLedgerReceiverSecure",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "商户分账绑定接受方申请")
public ResponseData merLedgerReceiverSecure(@RequestBody BsMerLedgerReceiver body) {
try {
if (body == null
|| body.getMerLedgerId() == null
|| StringUtils.isBlank(body.getReceiverNo())
|| StringUtils.isBlank(body.getReceiverName())
|| StringUtils.isBlank(body.getEntrustFilePath())
) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型");
}
// 查询分账开通信息
BsMerLedger merLedger = merLedgerService.getMerLedgerById(body.getMerLedgerId());
if (merLedger == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能未开通");
}
if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能状态无法申请");
}
// 查询接收方数据
BsMerLedgerReceiver receiver = merLedgerReceiverService.getMerLedgerReceiver(merLedger.getMerId(), body.getReceiverNo());
if (receiver == null) {
receiver = new BsMerLedgerReceiver();
receiver.setMerId(merLedger.getMerId());
receiver.setMerLedgerId(merLedger.getId());
receiver.setPlatformType(merLedger.getPlatformType());
receiver.setPlatformNo(merLedger.getPlatformNo());
receiver.setCupNo(merLedger.getCupNo());
receiver.setReceiverNo(body.getReceiverNo());
receiver.setReceiverName(body.getReceiverName());
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1));
receiver.setEntrustFilePath(body.getEntrustFilePath());
} else {
receiver.setReceiverNo(body.getReceiverNo());
receiver.setReceiverName(body.getReceiverName());
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1));
receiver.setEntrustFilePath(body.getEntrustFilePath());
}
merLedgerReceiverService.merLedgerReceiverApply(receiver);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getLedgerReceiverListByMer",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询接收方列表")
public ResponseData getLedgerReceiverListByMer(@RequestParam(name = "merId", required = true) Long merId,
@RequestParam(name = "platformType", required = true) Integer platformType) {
try {
return ResponseMsgUtil.success(merLedgerReceiverService.getMerLedgerReceiverByMer(merId, PlatformTypeEnum.getDataByNumber(platformType)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getLedgerReceiverList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询接收方列表")
public ResponseData getLedgerReceiverList(@RequestParam(name = "platformType", required = true) Integer platformType,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
try {
Map<String, Object> param = new HashMap<>();
param.put("platformType", platformType);
param.put("status", MerLedgerReceiverStatusEnum.status1.getNumber());
param.put("receiverNoNotNull", "true");
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(merLedgerReceiverService.getMerLedgerReceiverList(param)));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -125,7 +125,7 @@ public class BsStoreDiscountActivityPartakeUserController {
QRCodeGenerator.overlapImage(fileUrl, "/template/qrCodeBackdrop2_2.png",250,650);
}
}
return ResponseMsgUtil.success(SysConst.getSysConfig().getDomainName() + "/filesystem" + fileUrl);
return ResponseMsgUtil.success(CommonSysConst.getSysConfig().getDomainName() + "/filesystem" + fileUrl);
} catch (Exception e) {
log.error("BsStoreDiscountActivityPartakeUserController --> generateWeChatMpQrCode() error!", e);

@ -8,6 +8,7 @@ import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.hfkj.channel.alipay.utils.AlipayRequest;
import com.hfkj.channel.alipay.utils.AlipayUtils;
import com.hfkj.channel.lakala.LaKaLaLedgerService;
import com.hfkj.channel.lakala.LaKaLaTradeService;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.SaasMerService;
@ -72,6 +73,9 @@ public class TestController {
@Resource
private BsLklMccService lklMccService;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
@RequestMapping(value="/rotationQueryTrade",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "交易【被扫】")
@ -110,9 +114,10 @@ public class TestController {
// return ResponseMsgUtil.success(saasCommon.fileUpload(new File("D:/home/project/gratia-pay/filesystem/share/1680164428924.png"), "OTHERS", "0"));
// 996900 6900 6905
// return ResponseMsgUtil.success(saasCommon.getArea("1"));
// return ResponseMsgUtil.success(saasCommon.getBank("1240", "工商银行"));
// return ResponseMsgUtil.success(saasCommon.getBank("6530", "大坪支行"));
return ResponseMsgUtil.success(saasMerService.merchantInfo(code));
return ResponseMsgUtil.success(laKaLaLedgerService);
// return ResponseMsgUtil.success("");
// 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));
/* AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
@ -132,10 +137,6 @@ public class TestController {
}
}
public static void main(String[] args) {
System.out.println(test("邯郸市", 1));
}
public static String test(String str, Integer type) {
char[] chars = str.toCharArray();
// oP: '省' 的偏移, oC: '市' 的偏移, oR: "自治区" 的偏移

@ -1,12 +1,12 @@
package com.cweb.notify;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderMsg;
import com.hfkj.entity.*;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
@ -37,11 +37,19 @@ public class LaKaLaController {
@Resource
private BsTradeOrderMsgService tradeOrderMsgService;
@Resource
private BsMerLedgerService merLedgerService;
@Resource
private BsMerLedgerApplyService merLedgerApplyService;
@Resource
private BsMerLedgerReceiverService merLedgerReceiverService;
@Resource
private BsMerLedgerReceiverApplyService merLedgerReceiverApplyService;
@RequestMapping(value="/microPay",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "交易【被扫】通知")
public void microPay(@RequestBody String reqBody, HttpServletResponse response){
public void microPay(@RequestBody String reqBody, HttpServletResponse response) {
try {
log.info("交易【被扫】通知", reqBody);
System.out.println(reqBody);
@ -56,7 +64,7 @@ public class LaKaLaController {
// 查询订单
BsTradeOrder order = tradeOrderService.getOrderByOutTradeNo(body.getString("out_trade_no"));
if (order != null){
if (order != null) {
tradeOrderService.paySuccess(
body.getString("out_trade_no"),
body.getString("trade_no"),
@ -96,4 +104,80 @@ public class LaKaLaController {
}
}
@RequestMapping(value="/applyLedgerMer",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "开通分账业务通知")
public void applyLedgerMer(@RequestBody String reqBody) {
try {
log.info("开通分账业务通知", reqBody);
System.out.println(reqBody);
JSONObject body = JSONObject.parseObject(reqBody);
JSONObject respData = body.getJSONObject("respData");
BsMerLedgerApply ledgerApply = merLedgerApplyService.getApplyByOrderNo(respData.getString("orderNo"));
if (ledgerApply != null) {
ledgerApply.setNotifyBody(reqBody);
merLedgerApplyService.editMerLedgerApply(ledgerApply);
// 查询商户分账信息
BsMerLedger merLedger = merLedgerService.getMerLedger(ledgerApply.getMerId(), PlatformTypeEnum.type1);
if (merLedger != null) {
// 审核状态 1:通过,2拒绝
if (respData.getString("auditStatus").equals("1")) {
merLedger.setStatus(MerLedgerStatusEnum.status1.getNumber());
} else {
merLedger.setStatus(MerLedgerStatusEnum.status3.getNumber());
merLedger.setRejectReason(respData.getString("auditStatusText"));
}
merLedgerService.editMerLedger(merLedger);
}
}
} catch (Exception e) {
log.error("login error!",e);
}
}
@RequestMapping(value="/applyBindReceiver",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "分账关系绑定申请")
public void applyBindReceiver(@RequestBody String reqBody) {
try {
log.info("分账关系绑定申请通知", reqBody);
System.out.println(reqBody);
JSONObject body = JSONObject.parseObject(reqBody);
JSONObject respData = body.getJSONObject("respData");
// 分手接收方申请记录
BsMerLedgerReceiverApply receiverApply = merLedgerReceiverApplyService.getReceiverApplyByApplyId(respData.getString("applyId"));
if (receiverApply != null) {
receiverApply.setNotifyBody(reqBody);
// 1:通过,2拒绝
receiverApply.setStatus(respData.getString("auditStatus").equals("1")
?MerLedgerReceiverApplyStatusEnum.status2.getNumber()
:MerLedgerReceiverApplyStatusEnum.status3.getNumber());
receiverApply.setRejectReason(respData.getString("auditStatusText"));
merLedgerReceiverApplyService.editReceiverApply(receiverApply);
// 分账接收方
BsMerLedgerReceiver ledgerReceiver = merLedgerReceiverService.getMerLedgerReceiver(receiverApply.getMerId(), receiverApply.getReceiverNo());
if (ledgerReceiver != null) {
ledgerReceiver.setStatus(receiverApply.getStatus().equals(MerLedgerReceiverApplyStatusEnum.status2.getNumber())
?MerLedgerReceiverStatusEnum.status1.getNumber():MerLedgerReceiverStatusEnum.status3.getNumber());
ledgerReceiver.setRejectReason(receiverApply.getRejectReason());
merLedgerReceiverService.editMerLedgerReceiver(ledgerReceiver);
}
}
} catch (Exception e) {
log.error("login error!",e);
}
}
}

@ -1,8 +1,6 @@
fileUrl=/home/project/gratia-pay/filesystem
cmsPath=/home/project/gratia-pay/filesystem/cmsPath
domainName=https://gratia-pay.dctpay.com
wxAppId=wxa075e8509802f826
wxAppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -1,8 +1,6 @@
fileUrl=/home/project/gratia-pay/filesystem
cmsPath=/home/project/gratia-pay/filesystem/cmsPath
domainName=https://pay.dctpay.com
wxAppId=wxa075e8509802f826
wxAppSecret=0e606fc1378d35e359fcf3f15570b2c5

@ -1,5 +1,7 @@
package com.hfkj.schedule;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.LaKaLaTradeSeparateService;
import com.hfkj.channel.weixin.utils.WxOrderConfig;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderProfitSharing;
@ -8,9 +10,7 @@ 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;
import com.hfkj.sysenum.*;
import org.apache.commons.collections4.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -30,15 +30,15 @@ public class TradeOrderSchedule {
private static final Logger log = LoggerFactory.getLogger(TradeOrderSchedule.class);
@Resource
private BsTradeOrderService tradeOrderService;
@Resource
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService;
@Resource
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService;
@Resource
private LaKaLaTradeSeparateService laKaLaTradeSeparateService;
/**
* 订单发起分账
* 5分钟扫描一次需要分账的订单
@ -48,7 +48,107 @@ public class TradeOrderSchedule {
List<BsTradeOrderProfitSharing> tradeOrderProfitSharingList = tradeOrderProfitSharingService.getNeedProfitSharingOrder();
for (BsTradeOrderProfitSharing tradeOrderProfitSharing : tradeOrderProfitSharingList) {
try {
if (tradeOrderProfitSharing.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
// 拉卡拉分账
if (tradeOrderProfitSharing.getCmdType().equals(ProfitSharingCmdTypeEnum.CMD_TYPE_1.getNumber())) {
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
laKaLaTradeSeparateService.separate(tradeOrderProfitSharing.getProfitSharingOrderNo());
} else if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status2.getNumber())
|| tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status3.getNumber())) {
// 查询拉卡拉分账记录
JSONObject queryProfitSharing = laKaLaTradeSeparateService.query(tradeOrderProfitSharing.getProfitSharingOrderNo());
if (queryProfitSharing != null) {
// ACCEPTED:已受理,PROCESSING:处理中,FAIL:失败,SUCCESS:成功,
//(如果分账指令后有反向操作指令,则原分账指令会变更成以下的状态之一:)
//CANCELING:撤销中,CANCELED:撤销成功,CANCEL_FAIL:撤销失败,FALLBACKING:回退中,FALLBACK_END:回退结束
String status = queryProfitSharing.getString("status");
if (status.equals("PROCESSING")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status3.getNumber());
} else if (status.equals("ACCEPTED")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
} else if (status.equals("SUCCESS")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status1.getNumber());
tradeOrderProfitSharing.setFinishTime(new Date());
// 修改接收方状态
List<BsTradeOrderProfitSharingReceiver> receiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId());
for (BsTradeOrderProfitSharingReceiver receiver : receiverList) {
receiver.setStatus(ProfitSharingReceiverStatusEnum.status1.getNumber());
tradeOrderProfitSharingReceiverService.editData(receiver);
}
} else if (status.equals("FAIL")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status4.getNumber());
}
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
}
}
} else if (tradeOrderProfitSharing.getCmdType().equals(ProfitSharingCmdTypeEnum.CMD_TYPE_2.getNumber())) {
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
laKaLaTradeSeparateService.cancel(tradeOrderProfitSharing.getProfitSharingOrderNo());
} else if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status2.getNumber())
|| tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status3.getNumber())) {
// 查询拉卡拉分账记录
JSONObject queryProfitSharing = laKaLaTradeSeparateService.query(tradeOrderProfitSharing.getProfitSharingOrderNo());
if (queryProfitSharing != null) {
// ACCEPTED:已受理,PROCESSING:处理中,FAIL:失败,SUCCESS:成功,
//(如果分账指令后有反向操作指令,则原分账指令会变更成以下的状态之一:)
//CANCELING:撤销中,CANCELED:撤销成功,CANCEL_FAIL:撤销失败,FALLBACKING:回退中,FALLBACK_END:回退结束
String status = queryProfitSharing.getString("status");
if (status.equals("PROCESSING")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status3.getNumber());
} else if (status.equals("ACCEPTED")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
} else if (status.equals("SUCCESS")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status1.getNumber());
tradeOrderProfitSharing.setFinishTime(new Date());
// 修改接收方状态
List<BsTradeOrderProfitSharingReceiver> receiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId());
for (BsTradeOrderProfitSharingReceiver receiver : receiverList) {
receiver.setStatus(ProfitSharingReceiverStatusEnum.status1.getNumber());
tradeOrderProfitSharingReceiverService.editData(receiver);
}
} else if (status.equals("FAIL")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status4.getNumber());
}
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
}
}
} else if (tradeOrderProfitSharing.getCmdType().equals(ProfitSharingCmdTypeEnum.CMD_TYPE_3.getNumber())) {
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
laKaLaTradeSeparateService.fallback(tradeOrderProfitSharing.getProfitSharingOrderNo());
} else if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status2.getNumber())
|| tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status3.getNumber())) {
// 查询拉卡拉分账记录
JSONObject queryProfitSharing = laKaLaTradeSeparateService.query(tradeOrderProfitSharing.getProfitSharingOrderNo());
if (queryProfitSharing != null) {
// ACCEPTED:已受理,PROCESSING:处理中,FAIL:失败,SUCCESS:成功,
//(如果分账指令后有反向操作指令,则原分账指令会变更成以下的状态之一:)
//CANCELING:撤销中,CANCELED:撤销成功,CANCEL_FAIL:撤销失败,FALLBACKING:回退中,FALLBACK_END:回退结束
String status = queryProfitSharing.getString("status");
if (status.equals("PROCESSING")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status3.getNumber());
} else if (status.equals("ACCEPTED")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
} else if (status.equals("SUCCESS")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status1.getNumber());
tradeOrderProfitSharing.setFinishTime(new Date());
// 修改接收方状态
List<BsTradeOrderProfitSharingReceiver> receiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId());
for (BsTradeOrderProfitSharingReceiver receiver : receiverList) {
receiver.setStatus(ProfitSharingReceiverStatusEnum.status1.getNumber());
tradeOrderProfitSharingReceiverService.editData(receiver);
}
} else if (status.equals("FAIL")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status4.getNumber());
}
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
}
}
}
} else if (tradeOrderProfitSharing.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) {
List<Map<String,Object>> receiversList = new ArrayList<>();
Map<String,Object> receiversMap;
@ -93,6 +193,7 @@ public class TradeOrderSchedule {
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
}
}
}
} catch (Exception e) {
tradeOrderProfitSharing.setExt1("分账失败");

@ -0,0 +1,382 @@
package com.hfkj.channel.lakala;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ImageUtils;
import com.hfkj.common.utils.UnionUtils;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.model.MerBasisModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import com.hfkj.sysenum.lakala.UploadFileTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.util.*;
/**
* 拉卡拉分账
* @author hurui
*/
@Service
public class LaKaLaLedgerService {
@Resource
private BsMerLedgerService merLedgerService;
@Resource
private BsMerLedgerApplyService merLedgerApplyService;
@Resource
private BsMerLedgerReceiverService merLedgerReceiverService;
@Resource
private BsMerService merService;
@Resource
private BsMerAttachService merAttachService;
/**
* 商户分账业务开通申请
* @param merLedgerId
* @return
*/
public JSONObject applyLedger(Long merLedgerId) {
//
BsMerLedger merLedger = merLedgerService.getMerLedgerById(merLedgerId);
if (merLedger == null || merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 商户
MerBasisModel merDetail = merService.getMerDetail(merLedger.getId());
if (merDetail == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
String orderNo = System.currentTimeMillis()+"";
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("merCupNo", merLedger.getCupNo());
map.put("contactMobile", merDetail.getRegPhone());
map.put("splitLowestRatio", merLedger.getSplitLowestRatio());
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName());
// 转换成bas64
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedger.getSplitEntrustFilePath());
String fileType = merLedger.getSplitEntrustFilePath().substring(merLedger.getSplitEntrustFilePath().lastIndexOf(".") + 1);
map.put("splitEntrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId"));
map.put("splitRange", "MARK");
map.put("retUrl", CommonSysConst.getSysConfig() + "/crest/laKaLaNotify/applyLedgerMer");
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
// 请求记录
Map<String, Object> requestMap = new HashMap<>();
requestMap.put("Authorization", reqParam.get("Authorization"));
requestMap.put("req_data", JSONObject.toJSONString(commonParam));
BsMerLedgerApply merLedgerApply = new BsMerLedgerApply();
merLedgerApply.setMerLedgerId(merLedger.getId());
merLedgerApply.setMerId(merLedger.getId());
merLedgerApply.setOrderNo(orderNo);
merLedgerApply.setRequestBody(JSONObject.toJSONString(requestMap));
merLedgerApplyService.editMerLedgerApply(merLedgerApply);
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerMer", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
merLedgerApply.setApplyId(responseBody.getJSONObject("respData").getString("applyId"));
merLedgerApply.setResponseBody(responseBody.toJSONString());
merLedgerApplyService.editMerLedgerApply(merLedgerApply);
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody;
}
/**
* 商户分账信息变更申请
* @param merLedgerId
* @return
*/
public JSONObject applyLedgerModify(Long merLedgerId) {
//
BsMerLedger merLedger = merLedgerService.getMerLedgerById(merLedgerId);
if (merLedger == null || merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 商户
MerBasisModel merDetail = merService.getMerDetail(merLedger.getId());
if (merDetail == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
String orderNo = System.currentTimeMillis()+"";
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("merCupNo", merLedger.getCupNo());
map.put("contactMobile", merDetail.getRegPhone());
map.put("splitLowestRatio", merLedger.getSplitLowestRatio());
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName());
// map.put("splitEntrustFilePath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merLedger.getSplitEntrustFilePath()), "SPLIT_ENTRUST_FILE", "0").getString("url"));
map.put("splitRange", "MARK");
map.put("retUrl", CommonSysConst.getSysConfig() + "/crest/laKaLaNotify/applyLedgerMer");
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
// 请求记录
Map<String, Object> requestMap = new HashMap<>();
requestMap.put("Authorization", reqParam.get("Authorization"));
requestMap.put("req_data", JSONObject.toJSONString(commonParam));
BsMerLedgerApply merLedgerApply = new BsMerLedgerApply();
merLedgerApply.setMerLedgerId(merLedger.getId());
merLedgerApply.setMerId(merLedger.getId());
merLedgerApply.setOrderNo(orderNo);
merLedgerApply.setRequestBody(JSONObject.toJSONString(requestMap));
merLedgerApplyService.editMerLedgerApply(merLedgerApply);
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerMer", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
merLedgerApply.setApplyId(responseBody.getJSONObject("respData").getString("applyId"));
merLedgerApply.setResponseBody(responseBody.toJSONString());
merLedgerApplyService.editMerLedgerApply(merLedgerApply);
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody;
}
/**
* 分账商户信息查询
* @param merCupNo 银联商户号
* @return
*/
public JSONObject queryLedgerMer(String merCupNo) {
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
String orderNo = System.currentTimeMillis()+"";
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", orderNo);
map.put("orgCode", "1");
map.put("merCupNo", merCupNo);
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/queryLedgerMer", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody;
}
/**
* 创建分账接收方
*/
public void applyLedgerReceiver(Long merId) {
// 商户
MerBasisModel merDetail = merService.getMerDetail(merId);
if (merDetail == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("receiverName", merDetail.getMerName());
map.put("contactMobile", merDetail.getRegPhone());
map.put("acctTypeCode", merDetail.getMerType().equals(MerSettleType.status1.getNumber())?57:58);// 57:对公 58:对私
map.put("acctNo", merDetail.getMerSettleAcct().getBankCardNo());
map.put("acctName", merDetail.getMerSettleAcct().getBankCardHolder());
map.put("acctCertificateType", "17");
map.put("acctCertificateNo", merDetail.getMerSettleAcct().getSettleIdCardNo());
map.put("acctOpenBankCode", merDetail.getMerSettleAcct().getOpenningBankCode());
map.put("acctOpenBankName", merDetail.getMerSettleAcct().getOpenningBankName());
map.put("acctClearBankCode", merDetail.getMerSettleAcct().getClearingBankCode());
if (merDetail.getMerType().equals(MerSettleType.status1.getNumber()) == true) {
map.put("licenseNo", merDetail.getBlisNo());
map.put("licenseName", merDetail.getBlisName());
map.put("legalPersonName", merDetail.getLarName());
map.put("legalPersonCertificateType", "17");
map.put("legalPersonCertificateNo", merDetail.getLarIdCard());
}
List<Map<String, Object>> attachMapList = new ArrayList<>();
Map<String, Object> attachMap;
List<BsMerAttach> attachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null);
for (BsMerAttach attach : attachList) {
if (StringUtils.isNotBlank(attach.getFileUrl())) {
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType());
if (attachType != null && StringUtils.isNotBlank(attachType.getLklCode())) {
attachMap = new HashMap<>();
// 转换成bas64
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ attach.getFileUrl());
String fileType = attach.getFileUrl().substring(attach.getFileUrl().lastIndexOf(".") + 1);
attachMap.put("attachType", attachType.getLklCode());
attachMap.put("attachName", attachType.getName());
attachMap.put("attachStorePath", LaKaLaConfig.uploadFile(attachType.getLklSaasCode(), fileType, base64ImgUrl).getString("attFileId"));
attachMapList.add(attachMap);
}
}
}
map.put("attachList", attachMapList);
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerReceiver", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
// 查询分账信息
BsMerLedger merLedger = merLedgerService.getMerLedger(merId, PlatformTypeEnum.type1);
if (merLedger != null) {
merLedger.setReceiverNo(responseBody.getJSONObject("respData").getString("receiverNo"));
merLedgerService.editMerLedger(merLedger);
}
}
/**
* 绑定分账关系
*/
public void applyBind(Long merId,String receiverNo) {
// 查询
BsMerLedgerReceiver merLedgerReceiver = merLedgerReceiverService.getMerLedgerReceiver(merId, receiverNo);
if (merLedgerReceiver == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("merCupNo", merLedgerReceiver.getCupNo());
map.put("receiverNo", merLedgerReceiver.getReceiverNo());
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedgerReceiver.getEntrustFilePath());
String fileType = merLedgerReceiver.getEntrustFilePath().substring(merLedgerReceiver.getEntrustFilePath().lastIndexOf(".") + 1);
map.put("entrustFileName", merLedgerReceiver.getEntrustFileName());
map.put("entrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId"));
map.put("retUrl", CommonSysConst.getSysConfig().getDomainName()+"/crest/laKaLaNotify/applyLedgerMer");
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyBind", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
merLedgerReceiver.setStatus(MerLedgerStatusEnum.status1.getNumber());
}
/**
* 分账关系解绑申请
*/
public void applyUnBind(Long merId,String receiverNo) {
// 查询
BsMerLedgerReceiver merLedgerReceiver = merLedgerReceiverService.getMerLedgerReceiver(merId, receiverNo);
if (merLedgerReceiver == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "1.0.0");
commonParam.put("reqId", UnionUtils.createNonceStr());
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", System.currentTimeMillis()+"");
map.put("orgCode", "1");
map.put("merCupNo", "8226900581208NT");
map.put("receiverNo", "");
map.put("entrustFileName", "123");
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedgerReceiver.getEntrustFilePath());
String fileType = merLedgerReceiver.getEntrustFilePath().substring(merLedgerReceiver.getEntrustFilePath().lastIndexOf(".") + 1);
map.put("entrustFileName", merLedgerReceiver.getEntrustFileName());
map.put("entrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId"));
map.put("retUrl", "123");
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyUnBind", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
}
}

@ -166,11 +166,11 @@ public class LaKaLaMerService {
for (BsMerAttach attach : attachList) {
attachMap = new HashMap<>();
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType());
if (attachType == null || StringUtils.isBlank(attachType.getLakalaCode())) {
if (attachType == null || StringUtils.isBlank(attachType.getLklCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的附件类型");
}
attachMap.put("attType", attachType.getLakalaCode());
attachMap.put("attFileId", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLakalaCode(), "0").getString("url"));
attachMap.put("attType", attachType.getLklCode());
attachMap.put("attFileId", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLklCode(), "0").getString("url"));
attachListMap.add(attachMap);
}
map.put("fileData", attachListMap);

@ -0,0 +1,243 @@
package com.hfkj.channel.lakala;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.ImageUtils;
import com.hfkj.common.utils.UnionUtils;
import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.model.MerBasisModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
/**
* 拉卡拉分账
* @author hurui
*/
@Service
public class LaKaLaTradeSeparateService {
@Resource
private BsTradeOrderService tradeOrderService;
@Resource
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService;
@Resource
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService;
/**
* 创建分账
* @param profitSharingOrderNo
* @return
*/
public JSONObject separate(String profitSharingOrderNo) {
// 交易分账
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo);
if (null == tradeOrderProfitSharing) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录");
}
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态");
}
// 查询交易详情
BsTradeOrder tradeOrder = tradeOrderService.getOrderByTradeNoId(tradeOrderProfitSharing.getTradeOrderId());
// 分账接收方
List<BsTradeOrderProfitSharingReceiver> profitSharingReceiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId());
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> map = new HashMap<>();
map.put("merchant_no", tradeOrder.getPlatformMerNo());
map.put("log_no", tradeOrder.getPlatformLogNo());
map.put("log_date", DateUtil.date2String(tradeOrder.getPayTime(), "yyyy-MM-dd"));
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo());
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun());
map.put("lkl_org_no", "1");
map.put("cal_type", "0");
List<Map<String,Object>> recvDatasMapList = new ArrayList<>();
Map<String,Object> recvDatasMap;
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceiverList) {
recvDatasMap = new HashMap<>();
recvDatasMap.put("recv_merchant_no", receiver.getReceiverAccount());
recvDatasMap.put("separate_value", receiver.getProfitSharingAmount());
recvDatasMapList.add(recvDatasMap);
}
commonParam.put("recv_datas", recvDatasMapList);
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/separate", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
JSONObject respData = responseBody.getJSONObject("resp_data");
// 分账状态 处理中:PROCESSING, 已受理:ACCEPTED, 成功:SUCCESS, 失败:FAIL
String statusCode = respData.getString("status");
if (statusCode.equals("PROCESSING")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
} else if (statusCode.equals("ACCEPTED")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status3.getNumber());
} else if (statusCode.equals("SUCCESS")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status1.getNumber());
tradeOrderProfitSharing.setProfitSharingTime(new Date());
tradeOrderProfitSharing.setFinishTime(new Date());
} else if (statusCode.equals("FAIL")) {
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status4.getNumber());
}
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
// 处理接收方数据
if (tradeOrderProfitSharing.equals(ProfitSharingStatusEnum.status1.getName())) {
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceiverList) {
receiver.setStatus(ProfitSharingReceiverStatusEnum.status1.getNumber());
receiver.setProfitSharingTime(new Date());
receiver.setFinishTime(new Date());
tradeOrderProfitSharingReceiverService.editData(receiver);
}
}
return responseBody;
}
/**
* 分账撤销
* @param profitSharingOrderNo
* @return
*/
public JSONObject cancel(String profitSharingOrderNo) {
// 交易订单分账
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo);
if (null == tradeOrderProfitSharing) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录");
}
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> map = new HashMap<>();
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo());
map.put("origin_separate_no", tradeOrderProfitSharing.getOriginProfitSharingOrderNo());
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo());
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun());
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/cancel", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
return responseBody;
}
/**
* 分账回退
* @param profitSharingOrderNo 交易订单号
* @return
*/
public JSONObject fallback(String profitSharingOrderNo) {
// 交易订单分账
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo);
if (null == tradeOrderProfitSharing) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录");
}
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> map = new HashMap<>();
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo());
map.put("origin_separate_no", tradeOrderProfitSharing.getOriginProfitSharingOrderNo());
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo());
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun());
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/fallback", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber());
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing);
return responseBody;
}
/**
* 分账结果查询
* @param profitSharingOrderNo 交易订单号
* @return
*/
public JSONObject query(String profitSharingOrderNo) {
// 交易订单分账
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo);
if (null == tradeOrderProfitSharing) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录");
}
Map<String, Object> commonParam = new HashMap<>();
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss"));
commonParam.put("version", "3.0");
Map<String, Object> map = new HashMap<>();
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo());
map.put("separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo());
commonParam.put("reqData", map);
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/query", commonParam, heard);
System.out.println("body:" + JSONObject.toJSONString(commonParam));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody.getJSONObject("resp_data");
}
}

@ -194,7 +194,7 @@ public class LaKaLaTradeService {
map.put("notify_url", CommonSysConst.getSysConfig().getLkl_micro_pay_ret_url());
Map<String, Object> locationInfo = new HashMap<>();
locationInfo.put("request_ip", "10.176.1.192");
locationInfo.put("request_ip", "0.0.0.0");
map.put("location_info", locationInfo);
Map<String, Object> accBusiFieldsMap = new HashMap<>();

@ -198,11 +198,11 @@ public class SaasMerService {
for (BsMerAttach attach : attachList) {
attchMap = new HashMap<>();
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType());
if (attachType == null || StringUtils.isBlank(attachType.getLakalaCode())) {
if (attachType == null || StringUtils.isBlank(attachType.getLklSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的附件类型");
}
attchMap.put("type", attachType.getLakalaCode());
attchMap.put("id", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLakalaCode(), "0").getString("url"));
attchMap.put("type", attachType.getLklSaasCode());
attchMap.put("id", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLklSaasCode(), "0").getString("url"));
attchMapList.add(attchMap);
}

@ -39,7 +39,7 @@ public class DateUtil {
Calendar calendar = Calendar.getInstance();
return calendar.get(Calendar.YEAR);
}
public static String date2String(Date date,String format) throws Exception{
public static String date2String(Date date,String format) {
String str = null;
SimpleDateFormat sdf = new SimpleDateFormat(format);
if(date != null){

@ -100,6 +100,10 @@ public class CommonSysConfig {
private String lkl_saas_public_key;
private String lkl_saas_private_key;
/**
* 域名
*/
private String domainName;
/**
* 微信支付回调
*/

@ -0,0 +1,133 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerApply;
import com.hfkj.entity.BsMerLedgerApplyExample;
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 BsMerLedgerApplyMapper extends BsMerLedgerApplyMapperExt {
@SelectProvider(type=BsMerLedgerApplySqlProvider.class, method="countByExample")
long countByExample(BsMerLedgerApplyExample example);
@DeleteProvider(type=BsMerLedgerApplySqlProvider.class, method="deleteByExample")
int deleteByExample(BsMerLedgerApplyExample example);
@Delete({
"delete from bs_mer_ledger_apply",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_ledger_apply (mer_id, mer_ledger_id, ",
"order_no, apply_id, ",
"request_body, response_body, ",
"notify_body, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ",
"#{orderNo,jdbcType=VARCHAR}, #{applyId,jdbcType=VARCHAR}, ",
"#{requestBody,jdbcType=VARCHAR}, #{responseBody,jdbcType=VARCHAR}, ",
"#{notifyBody,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMerLedgerApply record);
@InsertProvider(type=BsMerLedgerApplySqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMerLedgerApply record);
@SelectProvider(type=BsMerLedgerApplySqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@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<BsMerLedgerApply> selectByExample(BsMerLedgerApplyExample example);
@Select({
"select",
"id, mer_id, mer_ledger_id, order_no, apply_id, request_body, response_body, ",
"notify_body, `status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_mer_ledger_apply",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@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)
})
BsMerLedgerApply selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMerLedgerApply record, @Param("example") BsMerLedgerApplyExample example);
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMerLedgerApply record, @Param("example") BsMerLedgerApplyExample example);
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMerLedgerApply record);
@Update({
"update bs_mer_ledger_apply",
"set mer_id = #{merId,jdbcType=BIGINT},",
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"apply_id = #{applyId,jdbcType=VARCHAR},",
"request_body = #{requestBody,jdbcType=VARCHAR},",
"response_body = #{responseBody,jdbcType=VARCHAR},",
"notify_body = #{notifyBody,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"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(BsMerLedgerApply record);
}

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

@ -0,0 +1,360 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerApply;
import com.hfkj.entity.BsMerLedgerApplyExample.Criteria;
import com.hfkj.entity.BsMerLedgerApplyExample.Criterion;
import com.hfkj.entity.BsMerLedgerApplyExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMerLedgerApplySqlProvider {
public String countByExample(BsMerLedgerApplyExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_mer_ledger_apply");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMerLedgerApplyExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_mer_ledger_apply");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMerLedgerApply record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_mer_ledger_apply");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.VALUES("apply_id", "#{applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.VALUES("request_body", "#{requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.VALUES("response_body", "#{responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.VALUES("notify_body", "#{notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
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(BsMerLedgerApplyExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("mer_ledger_id");
sql.SELECT("order_no");
sql.SELECT("apply_id");
sql.SELECT("request_body");
sql.SELECT("response_body");
sql.SELECT("notify_body");
sql.SELECT("`status`");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_mer_ledger_apply");
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) {
BsMerLedgerApply record = (BsMerLedgerApply) parameter.get("record");
BsMerLedgerApplyExample example = (BsMerLedgerApplyExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_apply");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
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_mer_ledger_apply");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}");
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}");
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}");
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
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}");
BsMerLedgerApplyExample example = (BsMerLedgerApplyExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMerLedgerApply record) {
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_apply");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.SET("apply_id = #{applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.SET("request_body = #{requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.SET("response_body = #{responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.SET("notify_body = #{notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
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, BsMerLedgerApplyExample 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());
}
}
}

@ -0,0 +1,142 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedger;
import com.hfkj.entity.BsMerLedgerExample;
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 BsMerLedgerMapper extends BsMerLedgerMapperExt {
@SelectProvider(type=BsMerLedgerSqlProvider.class, method="countByExample")
long countByExample(BsMerLedgerExample example);
@DeleteProvider(type=BsMerLedgerSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMerLedgerExample example);
@Delete({
"delete from bs_mer_ledger",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_ledger (mer_id, platform_type, ",
"platform_no, cup_no, ",
"receiver_no, split_lowest_ratio, ",
"split_entrust_file_name, split_entrust_file_path, ",
"`status`, reject_reason, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ",
"#{receiverNo,jdbcType=VARCHAR}, #{splitLowestRatio,jdbcType=DECIMAL}, ",
"#{splitEntrustFileName,jdbcType=VARCHAR}, #{splitEntrustFilePath,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMerLedger record);
@InsertProvider(type=BsMerLedgerSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMerLedger record);
@SelectProvider(type=BsMerLedgerSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="split_lowest_ratio", property="splitLowestRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="split_entrust_file_name", property="splitEntrustFileName", jdbcType=JdbcType.VARCHAR),
@Result(column="split_entrust_file_path", property="splitEntrustFilePath", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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<BsMerLedger> selectByExample(BsMerLedgerExample example);
@Select({
"select",
"id, mer_id, platform_type, platform_no, cup_no, receiver_no, split_lowest_ratio, ",
"split_entrust_file_name, split_entrust_file_path, `status`, reject_reason, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_mer_ledger",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="split_lowest_ratio", property="splitLowestRatio", jdbcType=JdbcType.DECIMAL),
@Result(column="split_entrust_file_name", property="splitEntrustFileName", jdbcType=JdbcType.VARCHAR),
@Result(column="split_entrust_file_path", property="splitEntrustFilePath", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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)
})
BsMerLedger selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMerLedger record, @Param("example") BsMerLedgerExample example);
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMerLedger record, @Param("example") BsMerLedgerExample example);
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMerLedger record);
@Update({
"update bs_mer_ledger",
"set mer_id = #{merId,jdbcType=BIGINT},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_no = #{platformNo,jdbcType=VARCHAR},",
"cup_no = #{cupNo,jdbcType=VARCHAR},",
"receiver_no = #{receiverNo,jdbcType=VARCHAR},",
"split_lowest_ratio = #{splitLowestRatio,jdbcType=DECIMAL},",
"split_entrust_file_name = #{splitEntrustFileName,jdbcType=VARCHAR},",
"split_entrust_file_path = #{splitEntrustFilePath,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"reject_reason = #{rejectReason,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(BsMerLedger record);
}

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

@ -0,0 +1,147 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerReceiverApply;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample;
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 BsMerLedgerReceiverApplyMapper extends BsMerLedgerReceiverApplyMapperExt {
@SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="countByExample")
long countByExample(BsMerLedgerReceiverApplyExample example);
@DeleteProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="deleteByExample")
int deleteByExample(BsMerLedgerReceiverApplyExample example);
@Delete({
"delete from bs_mer_ledger_receiver_apply",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_ledger_receiver_apply (mer_id, mer_ledger_id, ",
"mer_ledger_receiver_id, receiver_no, ",
"order_no, apply_id, ",
"request_body, response_body, ",
"notify_body, `status`, ",
"reject_reason, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ",
"#{merLedgerReceiverId,jdbcType=BIGINT}, #{receiverNo,jdbcType=VARCHAR}, ",
"#{orderNo,jdbcType=VARCHAR}, #{applyId,jdbcType=VARCHAR}, ",
"#{requestBody,jdbcType=VARCHAR}, #{responseBody,jdbcType=VARCHAR}, ",
"#{notifyBody,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMerLedgerReceiverApply record);
@InsertProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMerLedgerReceiverApply record);
@SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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<BsMerLedgerReceiverApply> selectByExample(BsMerLedgerReceiverApplyExample example);
@Select({
"select",
"id, mer_id, mer_ledger_id, mer_ledger_receiver_id, receiver_no, order_no, apply_id, ",
"request_body, response_body, notify_body, `status`, reject_reason, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_mer_ledger_receiver_apply",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR),
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR),
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR),
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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)
})
BsMerLedgerReceiverApply selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example);
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example);
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMerLedgerReceiverApply record);
@Update({
"update bs_mer_ledger_receiver_apply",
"set mer_id = #{merId,jdbcType=BIGINT},",
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},",
"mer_ledger_receiver_id = #{merLedgerReceiverId,jdbcType=BIGINT},",
"receiver_no = #{receiverNo,jdbcType=VARCHAR},",
"order_no = #{orderNo,jdbcType=VARCHAR},",
"apply_id = #{applyId,jdbcType=VARCHAR},",
"request_body = #{requestBody,jdbcType=VARCHAR},",
"response_body = #{responseBody,jdbcType=VARCHAR},",
"notify_body = #{notifyBody,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"reject_reason = #{rejectReason,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(BsMerLedgerReceiverApply record);
}

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

@ -0,0 +1,402 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerReceiverApply;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample.Criteria;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample.Criterion;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMerLedgerReceiverApplySqlProvider {
public String countByExample(BsMerLedgerReceiverApplyExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_mer_ledger_receiver_apply");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMerLedgerReceiverApplyExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_mer_ledger_receiver_apply");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMerLedgerReceiverApply record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_mer_ledger_receiver_apply");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}");
}
if (record.getMerLedgerReceiverId() != null) {
sql.VALUES("mer_ledger_receiver_id", "#{merLedgerReceiverId,jdbcType=BIGINT}");
}
if (record.getReceiverNo() != null) {
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.VALUES("apply_id", "#{applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.VALUES("request_body", "#{requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.VALUES("response_body", "#{responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.VALUES("notify_body", "#{notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.VALUES("reject_reason", "#{rejectReason,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(BsMerLedgerReceiverApplyExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("mer_ledger_id");
sql.SELECT("mer_ledger_receiver_id");
sql.SELECT("receiver_no");
sql.SELECT("order_no");
sql.SELECT("apply_id");
sql.SELECT("request_body");
sql.SELECT("response_body");
sql.SELECT("notify_body");
sql.SELECT("`status`");
sql.SELECT("reject_reason");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_mer_ledger_receiver_apply");
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) {
BsMerLedgerReceiverApply record = (BsMerLedgerReceiverApply) parameter.get("record");
BsMerLedgerReceiverApplyExample example = (BsMerLedgerReceiverApplyExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_receiver_apply");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
}
if (record.getMerLedgerReceiverId() != null) {
sql.SET("mer_ledger_receiver_id = #{record.merLedgerReceiverId,jdbcType=BIGINT}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{record.rejectReason,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_mer_ledger_receiver_apply");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
sql.SET("mer_ledger_receiver_id = #{record.merLedgerReceiverId,jdbcType=BIGINT}");
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}");
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}");
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}");
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("reject_reason = #{record.rejectReason,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}");
BsMerLedgerReceiverApplyExample example = (BsMerLedgerReceiverApplyExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMerLedgerReceiverApply record) {
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_receiver_apply");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}");
}
if (record.getMerLedgerReceiverId() != null) {
sql.SET("mer_ledger_receiver_id = #{merLedgerReceiverId,jdbcType=BIGINT}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}");
}
if (record.getOrderNo() != null) {
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
}
if (record.getApplyId() != null) {
sql.SET("apply_id = #{applyId,jdbcType=VARCHAR}");
}
if (record.getRequestBody() != null) {
sql.SET("request_body = #{requestBody,jdbcType=VARCHAR}");
}
if (record.getResponseBody() != null) {
sql.SET("response_body = #{responseBody,jdbcType=VARCHAR}");
}
if (record.getNotifyBody() != null) {
sql.SET("notify_body = #{notifyBody,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{rejectReason,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, BsMerLedgerReceiverApplyExample 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());
}
}
}

@ -0,0 +1,147 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerReceiver;
import com.hfkj.entity.BsMerLedgerReceiverExample;
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 BsMerLedgerReceiverMapper extends BsMerLedgerReceiverMapperExt {
@SelectProvider(type=BsMerLedgerReceiverSqlProvider.class, method="countByExample")
long countByExample(BsMerLedgerReceiverExample example);
@DeleteProvider(type=BsMerLedgerReceiverSqlProvider.class, method="deleteByExample")
int deleteByExample(BsMerLedgerReceiverExample example);
@Delete({
"delete from bs_mer_ledger_receiver",
"where id = #{id,jdbcType=BIGINT}"
})
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_ledger_receiver (mer_id, mer_ledger_id, ",
"platform_type, platform_no, ",
"cup_no, receiver_no, ",
"receiver_name, entrust_file_name, ",
"entrust_file_path, `status`, ",
"reject_reason, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ",
"#{platformType,jdbcType=INTEGER}, #{platformNo,jdbcType=VARCHAR}, ",
"#{cupNo,jdbcType=VARCHAR}, #{receiverNo,jdbcType=VARCHAR}, ",
"#{receiverName,jdbcType=VARCHAR}, #{entrustFileName,jdbcType=VARCHAR}, ",
"#{entrustFilePath,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
"#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMerLedgerReceiver record);
@InsertProvider(type=BsMerLedgerReceiverSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="id")
int insertSelective(BsMerLedgerReceiver record);
@SelectProvider(type=BsMerLedgerReceiverSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="entrust_file_name", property="entrustFileName", jdbcType=JdbcType.VARCHAR),
@Result(column="entrust_file_path", property="entrustFilePath", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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<BsMerLedgerReceiver> selectByExample(BsMerLedgerReceiverExample example);
@Select({
"select",
"id, mer_id, mer_ledger_id, platform_type, platform_no, cup_no, receiver_no, ",
"receiver_name, entrust_file_name, entrust_file_path, `status`, reject_reason, ",
"create_time, update_time, ext_1, ext_2, ext_3",
"from bs_mer_ledger_receiver",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
@Result(column="entrust_file_name", property="entrustFileName", jdbcType=JdbcType.VARCHAR),
@Result(column="entrust_file_path", property="entrustFilePath", jdbcType=JdbcType.VARCHAR),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="reject_reason", property="rejectReason", 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)
})
BsMerLedgerReceiver selectByPrimaryKey(Long id);
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByExampleSelective")
int updateByExampleSelective(@Param("record") BsMerLedgerReceiver record, @Param("example") BsMerLedgerReceiverExample example);
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByExample")
int updateByExample(@Param("record") BsMerLedgerReceiver record, @Param("example") BsMerLedgerReceiverExample example);
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(BsMerLedgerReceiver record);
@Update({
"update bs_mer_ledger_receiver",
"set mer_id = #{merId,jdbcType=BIGINT},",
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_no = #{platformNo,jdbcType=VARCHAR},",
"cup_no = #{cupNo,jdbcType=VARCHAR},",
"receiver_no = #{receiverNo,jdbcType=VARCHAR},",
"receiver_name = #{receiverName,jdbcType=VARCHAR},",
"entrust_file_name = #{entrustFileName,jdbcType=VARCHAR},",
"entrust_file_path = #{entrustFilePath,jdbcType=VARCHAR},",
"`status` = #{status,jdbcType=INTEGER},",
"reject_reason = #{rejectReason,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(BsMerLedgerReceiver record);
}

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

@ -0,0 +1,402 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedgerReceiver;
import com.hfkj.entity.BsMerLedgerReceiverExample.Criteria;
import com.hfkj.entity.BsMerLedgerReceiverExample.Criterion;
import com.hfkj.entity.BsMerLedgerReceiverExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMerLedgerReceiverSqlProvider {
public String countByExample(BsMerLedgerReceiverExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_mer_ledger_receiver");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMerLedgerReceiverExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_mer_ledger_receiver");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMerLedgerReceiver record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_mer_ledger_receiver");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.VALUES("platform_no", "#{platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.VALUES("cup_no", "#{cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.VALUES("receiver_name", "#{receiverName,jdbcType=VARCHAR}");
}
if (record.getEntrustFileName() != null) {
sql.VALUES("entrust_file_name", "#{entrustFileName,jdbcType=VARCHAR}");
}
if (record.getEntrustFilePath() != null) {
sql.VALUES("entrust_file_path", "#{entrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.VALUES("reject_reason", "#{rejectReason,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(BsMerLedgerReceiverExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("mer_ledger_id");
sql.SELECT("platform_type");
sql.SELECT("platform_no");
sql.SELECT("cup_no");
sql.SELECT("receiver_no");
sql.SELECT("receiver_name");
sql.SELECT("entrust_file_name");
sql.SELECT("entrust_file_path");
sql.SELECT("`status`");
sql.SELECT("reject_reason");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_mer_ledger_receiver");
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) {
BsMerLedgerReceiver record = (BsMerLedgerReceiver) parameter.get("record");
BsMerLedgerReceiverExample example = (BsMerLedgerReceiverExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_receiver");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}");
}
if (record.getEntrustFileName() != null) {
sql.SET("entrust_file_name = #{record.entrustFileName,jdbcType=VARCHAR}");
}
if (record.getEntrustFilePath() != null) {
sql.SET("entrust_file_path = #{record.entrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{record.rejectReason,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_mer_ledger_receiver");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}");
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}");
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}");
sql.SET("entrust_file_name = #{record.entrustFileName,jdbcType=VARCHAR}");
sql.SET("entrust_file_path = #{record.entrustFilePath,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("reject_reason = #{record.rejectReason,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}");
BsMerLedgerReceiverExample example = (BsMerLedgerReceiverExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMerLedgerReceiver record) {
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger_receiver");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getMerLedgerId() != null) {
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.SET("platform_no = #{platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.SET("cup_no = #{cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}");
}
if (record.getReceiverName() != null) {
sql.SET("receiver_name = #{receiverName,jdbcType=VARCHAR}");
}
if (record.getEntrustFileName() != null) {
sql.SET("entrust_file_name = #{entrustFileName,jdbcType=VARCHAR}");
}
if (record.getEntrustFilePath() != null) {
sql.SET("entrust_file_path = #{entrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{rejectReason,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, BsMerLedgerReceiverExample 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());
}
}
}

@ -0,0 +1,388 @@
package com.hfkj.dao;
import com.hfkj.entity.BsMerLedger;
import com.hfkj.entity.BsMerLedgerExample.Criteria;
import com.hfkj.entity.BsMerLedgerExample.Criterion;
import com.hfkj.entity.BsMerLedgerExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.jdbc.SQL;
public class BsMerLedgerSqlProvider {
public String countByExample(BsMerLedgerExample example) {
SQL sql = new SQL();
sql.SELECT("count(*)").FROM("bs_mer_ledger");
applyWhere(sql, example, false);
return sql.toString();
}
public String deleteByExample(BsMerLedgerExample example) {
SQL sql = new SQL();
sql.DELETE_FROM("bs_mer_ledger");
applyWhere(sql, example, false);
return sql.toString();
}
public String insertSelective(BsMerLedger record) {
SQL sql = new SQL();
sql.INSERT_INTO("bs_mer_ledger");
if (record.getMerId() != null) {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.VALUES("platform_no", "#{platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.VALUES("cup_no", "#{cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}");
}
if (record.getSplitLowestRatio() != null) {
sql.VALUES("split_lowest_ratio", "#{splitLowestRatio,jdbcType=DECIMAL}");
}
if (record.getSplitEntrustFileName() != null) {
sql.VALUES("split_entrust_file_name", "#{splitEntrustFileName,jdbcType=VARCHAR}");
}
if (record.getSplitEntrustFilePath() != null) {
sql.VALUES("split_entrust_file_path", "#{splitEntrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.VALUES("reject_reason", "#{rejectReason,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(BsMerLedgerExample example) {
SQL sql = new SQL();
if (example != null && example.isDistinct()) {
sql.SELECT_DISTINCT("id");
} else {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("platform_type");
sql.SELECT("platform_no");
sql.SELECT("cup_no");
sql.SELECT("receiver_no");
sql.SELECT("split_lowest_ratio");
sql.SELECT("split_entrust_file_name");
sql.SELECT("split_entrust_file_path");
sql.SELECT("`status`");
sql.SELECT("reject_reason");
sql.SELECT("create_time");
sql.SELECT("update_time");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
sql.FROM("bs_mer_ledger");
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) {
BsMerLedger record = (BsMerLedger) parameter.get("record");
BsMerLedgerExample example = (BsMerLedgerExample) parameter.get("example");
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger");
if (record.getId() != null) {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getMerId() != null) {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
}
if (record.getSplitLowestRatio() != null) {
sql.SET("split_lowest_ratio = #{record.splitLowestRatio,jdbcType=DECIMAL}");
}
if (record.getSplitEntrustFileName() != null) {
sql.SET("split_entrust_file_name = #{record.splitEntrustFileName,jdbcType=VARCHAR}");
}
if (record.getSplitEntrustFilePath() != null) {
sql.SET("split_entrust_file_path = #{record.splitEntrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{record.rejectReason,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_mer_ledger");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}");
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}");
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}");
sql.SET("split_lowest_ratio = #{record.splitLowestRatio,jdbcType=DECIMAL}");
sql.SET("split_entrust_file_name = #{record.splitEntrustFileName,jdbcType=VARCHAR}");
sql.SET("split_entrust_file_path = #{record.splitEntrustFilePath,jdbcType=VARCHAR}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("reject_reason = #{record.rejectReason,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}");
BsMerLedgerExample example = (BsMerLedgerExample) parameter.get("example");
applyWhere(sql, example, true);
return sql.toString();
}
public String updateByPrimaryKeySelective(BsMerLedger record) {
SQL sql = new SQL();
sql.UPDATE("bs_mer_ledger");
if (record.getMerId() != null) {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}");
}
if (record.getPlatformNo() != null) {
sql.SET("platform_no = #{platformNo,jdbcType=VARCHAR}");
}
if (record.getCupNo() != null) {
sql.SET("cup_no = #{cupNo,jdbcType=VARCHAR}");
}
if (record.getReceiverNo() != null) {
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}");
}
if (record.getSplitLowestRatio() != null) {
sql.SET("split_lowest_ratio = #{splitLowestRatio,jdbcType=DECIMAL}");
}
if (record.getSplitEntrustFileName() != null) {
sql.SET("split_entrust_file_name = #{splitEntrustFileName,jdbcType=VARCHAR}");
}
if (record.getSplitEntrustFilePath() != null) {
sql.SET("split_entrust_file_path = #{splitEntrustFilePath,jdbcType=VARCHAR}");
}
if (record.getStatus() != null) {
sql.SET("`status` = #{status,jdbcType=INTEGER}");
}
if (record.getRejectReason() != null) {
sql.SET("reject_reason = #{rejectReason,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, BsMerLedgerExample 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());
}
}
}

@ -39,7 +39,8 @@ public interface BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitShari
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_trade_order_profit_sharing (trade_order_id, trade_order_no, ",
"insert into bs_trade_order_profit_sharing (cmd_type, trade_order_id, ",
"trade_order_no, origin_profit_sharing_order_no, ",
"profit_sharing_order_no, platform_type, ",
"platform_profit_sharing_order_no, platform_mer_no, ",
"platform_trade_no, platform_appid, ",
@ -47,7 +48,8 @@ public interface BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitShari
"`status`, create_time, ",
"profit_sharing_time, finish_time, ",
"ext_1, ext_2, ext_3)",
"values (#{tradeOrderId,jdbcType=BIGINT}, #{tradeOrderNo,jdbcType=VARCHAR}, ",
"values (#{cmdType,jdbcType=INTEGER}, #{tradeOrderId,jdbcType=BIGINT}, ",
"#{tradeOrderNo,jdbcType=VARCHAR}, #{originProfitSharingOrderNo,jdbcType=VARCHAR}, ",
"#{profitSharingOrderNo,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ",
"#{platformProfitSharingOrderNo,jdbcType=VARCHAR}, #{platformMerNo,jdbcType=VARCHAR}, ",
"#{platformTradeNo,jdbcType=VARCHAR}, #{platformAppid,jdbcType=VARCHAR}, ",
@ -66,8 +68,10 @@ public interface BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitShari
@SelectProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="selectByExample")
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="cmd_type", property="cmdType", jdbcType=JdbcType.INTEGER),
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="origin_profit_sharing_order_no", property="originProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_order_no", property="profitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_profit_sharing_order_no", property="platformProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@ -88,17 +92,19 @@ public interface BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitShari
@Select({
"select",
"id, trade_order_id, trade_order_no, profit_sharing_order_no, platform_type, ",
"platform_profit_sharing_order_no, platform_mer_no, platform_trade_no, platform_appid, ",
"ratio, profit_sharing_amoun, `status`, create_time, profit_sharing_time, finish_time, ",
"ext_1, ext_2, ext_3",
"id, cmd_type, trade_order_id, trade_order_no, origin_profit_sharing_order_no, ",
"profit_sharing_order_no, platform_type, platform_profit_sharing_order_no, platform_mer_no, ",
"platform_trade_no, platform_appid, ratio, profit_sharing_amoun, `status`, create_time, ",
"profit_sharing_time, finish_time, ext_1, ext_2, ext_3",
"from bs_trade_order_profit_sharing",
"where id = #{id,jdbcType=BIGINT}"
})
@Results({
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
@Result(column="cmd_type", property="cmdType", jdbcType=JdbcType.INTEGER),
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
@Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="origin_profit_sharing_order_no", property="originProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="profit_sharing_order_no", property="profitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
@Result(column="platform_profit_sharing_order_no", property="platformProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
@ -128,8 +134,10 @@ public interface BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitShari
@Update({
"update bs_trade_order_profit_sharing",
"set trade_order_id = #{tradeOrderId,jdbcType=BIGINT},",
"set cmd_type = #{cmdType,jdbcType=INTEGER},",
"trade_order_id = #{tradeOrderId,jdbcType=BIGINT},",
"trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR},",
"origin_profit_sharing_order_no = #{originProfitSharingOrderNo,jdbcType=VARCHAR},",
"profit_sharing_order_no = #{profitSharingOrderNo,jdbcType=VARCHAR},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"platform_profit_sharing_order_no = #{platformProfitSharingOrderNo,jdbcType=VARCHAR},",

@ -28,6 +28,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("bs_trade_order_profit_sharing");
if (record.getCmdType() != null) {
sql.VALUES("cmd_type", "#{cmdType,jdbcType=INTEGER}");
}
if (record.getTradeOrderId() != null) {
sql.VALUES("trade_order_id", "#{tradeOrderId,jdbcType=BIGINT}");
}
@ -36,6 +40,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
sql.VALUES("trade_order_no", "#{tradeOrderNo,jdbcType=VARCHAR}");
}
if (record.getOriginProfitSharingOrderNo() != null) {
sql.VALUES("origin_profit_sharing_order_no", "#{originProfitSharingOrderNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingOrderNo() != null) {
sql.VALUES("profit_sharing_order_no", "#{profitSharingOrderNo,jdbcType=VARCHAR}");
}
@ -106,8 +114,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
} else {
sql.SELECT("id");
}
sql.SELECT("cmd_type");
sql.SELECT("trade_order_id");
sql.SELECT("trade_order_no");
sql.SELECT("origin_profit_sharing_order_no");
sql.SELECT("profit_sharing_order_no");
sql.SELECT("platform_type");
sql.SELECT("platform_profit_sharing_order_no");
@ -144,6 +154,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
sql.SET("id = #{record.id,jdbcType=BIGINT}");
}
if (record.getCmdType() != null) {
sql.SET("cmd_type = #{record.cmdType,jdbcType=INTEGER}");
}
if (record.getTradeOrderId() != null) {
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}");
}
@ -152,6 +166,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
sql.SET("trade_order_no = #{record.tradeOrderNo,jdbcType=VARCHAR}");
}
if (record.getOriginProfitSharingOrderNo() != null) {
sql.SET("origin_profit_sharing_order_no = #{record.originProfitSharingOrderNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingOrderNo() != null) {
sql.SET("profit_sharing_order_no = #{record.profitSharingOrderNo,jdbcType=VARCHAR}");
}
@ -221,8 +239,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
sql.UPDATE("bs_trade_order_profit_sharing");
sql.SET("id = #{record.id,jdbcType=BIGINT}");
sql.SET("cmd_type = #{record.cmdType,jdbcType=INTEGER}");
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}");
sql.SET("trade_order_no = #{record.tradeOrderNo,jdbcType=VARCHAR}");
sql.SET("origin_profit_sharing_order_no = #{record.originProfitSharingOrderNo,jdbcType=VARCHAR}");
sql.SET("profit_sharing_order_no = #{record.profitSharingOrderNo,jdbcType=VARCHAR}");
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
sql.SET("platform_profit_sharing_order_no = #{record.platformProfitSharingOrderNo,jdbcType=VARCHAR}");
@ -248,6 +268,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
SQL sql = new SQL();
sql.UPDATE("bs_trade_order_profit_sharing");
if (record.getCmdType() != null) {
sql.SET("cmd_type = #{cmdType,jdbcType=INTEGER}");
}
if (record.getTradeOrderId() != null) {
sql.SET("trade_order_id = #{tradeOrderId,jdbcType=BIGINT}");
}
@ -256,6 +280,10 @@ public class BsTradeOrderProfitSharingSqlProvider {
sql.SET("trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR}");
}
if (record.getOriginProfitSharingOrderNo() != null) {
sql.SET("origin_profit_sharing_order_no = #{originProfitSharingOrderNo,jdbcType=VARCHAR}");
}
if (record.getProfitSharingOrderNo() != null) {
sql.SET("profit_sharing_order_no = #{profitSharingOrderNo,jdbcType=VARCHAR}");
}

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

@ -0,0 +1,297 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* bs_mer_ledger
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMerLedger implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 平台
*/
private Integer platformType;
/**
* 平台商户号
*/
private String platformNo;
/**
* 银联商户号
*/
private String cupNo;
/**
* 接收编号
*/
private String receiverNo;
/**
* 最低分账比例
*/
private BigDecimal splitLowestRatio;
/**
* 分账结算委托书文件名称
*/
private String splitEntrustFileName;
/**
* 分账结算委托书文件路径
*/
private String splitEntrustFilePath;
/**
* 状态 0不可用 1可用 2审核中 3审核驳回
*/
private Integer status;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 创建时间
*/
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 getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformNo() {
return platformNo;
}
public void setPlatformNo(String platformNo) {
this.platformNo = platformNo;
}
public String getCupNo() {
return cupNo;
}
public void setCupNo(String cupNo) {
this.cupNo = cupNo;
}
public String getReceiverNo() {
return receiverNo;
}
public void setReceiverNo(String receiverNo) {
this.receiverNo = receiverNo;
}
public BigDecimal getSplitLowestRatio() {
return splitLowestRatio;
}
public void setSplitLowestRatio(BigDecimal splitLowestRatio) {
this.splitLowestRatio = splitLowestRatio;
}
public String getSplitEntrustFileName() {
return splitEntrustFileName;
}
public void setSplitEntrustFileName(String splitEntrustFileName) {
this.splitEntrustFileName = splitEntrustFileName;
}
public String getSplitEntrustFilePath() {
return splitEntrustFilePath;
}
public void setSplitEntrustFilePath(String splitEntrustFilePath) {
this.splitEntrustFilePath = splitEntrustFilePath;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
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;
}
BsMerLedger other = (BsMerLedger) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformNo() == null ? other.getPlatformNo() == null : this.getPlatformNo().equals(other.getPlatformNo()))
&& (this.getCupNo() == null ? other.getCupNo() == null : this.getCupNo().equals(other.getCupNo()))
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo()))
&& (this.getSplitLowestRatio() == null ? other.getSplitLowestRatio() == null : this.getSplitLowestRatio().equals(other.getSplitLowestRatio()))
&& (this.getSplitEntrustFileName() == null ? other.getSplitEntrustFileName() == null : this.getSplitEntrustFileName().equals(other.getSplitEntrustFileName()))
&& (this.getSplitEntrustFilePath() == null ? other.getSplitEntrustFilePath() == null : this.getSplitEntrustFilePath().equals(other.getSplitEntrustFilePath()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason()))
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformNo() == null) ? 0 : getPlatformNo().hashCode());
result = prime * result + ((getCupNo() == null) ? 0 : getCupNo().hashCode());
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode());
result = prime * result + ((getSplitLowestRatio() == null) ? 0 : getSplitLowestRatio().hashCode());
result = prime * result + ((getSplitEntrustFileName() == null) ? 0 : getSplitEntrustFileName().hashCode());
result = prime * result + ((getSplitEntrustFilePath() == null) ? 0 : getSplitEntrustFilePath().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().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(", merId=").append(merId);
sb.append(", platformType=").append(platformType);
sb.append(", platformNo=").append(platformNo);
sb.append(", cupNo=").append(cupNo);
sb.append(", receiverNo=").append(receiverNo);
sb.append(", splitLowestRatio=").append(splitLowestRatio);
sb.append(", splitEntrustFileName=").append(splitEntrustFileName);
sb.append(", splitEntrustFilePath=").append(splitEntrustFilePath);
sb.append(", status=").append(status);
sb.append(", rejectReason=").append(rejectReason);
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();
}
}

@ -0,0 +1,264 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_mer_ledger_apply
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMerLedgerApply implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 商户分账id
*/
private Long merLedgerId;
/**
* 订单编号
*/
private String orderNo;
/**
* 受理编号
*/
private String applyId;
/**
* 请求报文
*/
private String requestBody;
/**
* 响应报文
*/
private String responseBody;
/**
* 异步通知报文
*/
private String notifyBody;
/**
* 状态 0删除 1正常
*/
private Integer status;
/**
* 创建时间
*/
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 getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public Long getMerLedgerId() {
return merLedgerId;
}
public void setMerLedgerId(Long merLedgerId) {
this.merLedgerId = merLedgerId;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getApplyId() {
return applyId;
}
public void setApplyId(String applyId) {
this.applyId = applyId;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
public String getNotifyBody() {
return notifyBody;
}
public void setNotifyBody(String notifyBody) {
this.notifyBody = notifyBody;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
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;
}
BsMerLedgerApply other = (BsMerLedgerApply) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getApplyId() == null ? other.getApplyId() == null : this.getApplyId().equals(other.getApplyId()))
&& (this.getRequestBody() == null ? other.getRequestBody() == null : this.getRequestBody().equals(other.getRequestBody()))
&& (this.getResponseBody() == null ? other.getResponseBody() == null : this.getResponseBody().equals(other.getResponseBody()))
&& (this.getNotifyBody() == null ? other.getNotifyBody() == null : this.getNotifyBody().equals(other.getNotifyBody()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getApplyId() == null) ? 0 : getApplyId().hashCode());
result = prime * result + ((getRequestBody() == null) ? 0 : getRequestBody().hashCode());
result = prime * result + ((getResponseBody() == null) ? 0 : getResponseBody().hashCode());
result = prime * result + ((getNotifyBody() == null) ? 0 : getNotifyBody().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", merId=").append(merId);
sb.append(", merLedgerId=").append(merLedgerId);
sb.append(", orderNo=").append(orderNo);
sb.append(", applyId=").append(applyId);
sb.append(", requestBody=").append(requestBody);
sb.append(", responseBody=").append(responseBody);
sb.append(", notifyBody=").append(notifyBody);
sb.append(", status=").append(status);
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();
}
}

@ -0,0 +1,312 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_mer_ledger_receiver
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMerLedgerReceiver implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 商户分账id
*/
private Long merLedgerId;
/**
* 平台 1拉卡拉
*/
private Integer platformType;
/**
* 平台商户号
*/
private String platformNo;
/**
* 银联商户号
*/
private String cupNo;
/**
* 接收方编号
*/
private String receiverNo;
/**
* 接收方名称
*/
private String receiverName;
/**
* 合作协议附件名称
*/
private String entrustFileName;
/**
* 合作协议附件路径
*/
private String entrustFilePath;
/**
* 状态 0删除 1可用 2审核中 3审核驳回
*/
private Integer status;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 创建时间
*/
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 getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public Long getMerLedgerId() {
return merLedgerId;
}
public void setMerLedgerId(Long merLedgerId) {
this.merLedgerId = merLedgerId;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public String getPlatformNo() {
return platformNo;
}
public void setPlatformNo(String platformNo) {
this.platformNo = platformNo;
}
public String getCupNo() {
return cupNo;
}
public void setCupNo(String cupNo) {
this.cupNo = cupNo;
}
public String getReceiverNo() {
return receiverNo;
}
public void setReceiverNo(String receiverNo) {
this.receiverNo = receiverNo;
}
public String getReceiverName() {
return receiverName;
}
public void setReceiverName(String receiverName) {
this.receiverName = receiverName;
}
public String getEntrustFileName() {
return entrustFileName;
}
public void setEntrustFileName(String entrustFileName) {
this.entrustFileName = entrustFileName;
}
public String getEntrustFilePath() {
return entrustFilePath;
}
public void setEntrustFilePath(String entrustFilePath) {
this.entrustFilePath = entrustFilePath;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
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;
}
BsMerLedgerReceiver other = (BsMerLedgerReceiver) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformNo() == null ? other.getPlatformNo() == null : this.getPlatformNo().equals(other.getPlatformNo()))
&& (this.getCupNo() == null ? other.getCupNo() == null : this.getCupNo().equals(other.getCupNo()))
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo()))
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName()))
&& (this.getEntrustFileName() == null ? other.getEntrustFileName() == null : this.getEntrustFileName().equals(other.getEntrustFileName()))
&& (this.getEntrustFilePath() == null ? other.getEntrustFilePath() == null : this.getEntrustFilePath().equals(other.getEntrustFilePath()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason()))
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformNo() == null) ? 0 : getPlatformNo().hashCode());
result = prime * result + ((getCupNo() == null) ? 0 : getCupNo().hashCode());
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode());
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode());
result = prime * result + ((getEntrustFileName() == null) ? 0 : getEntrustFileName().hashCode());
result = prime * result + ((getEntrustFilePath() == null) ? 0 : getEntrustFilePath().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().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(", merId=").append(merId);
sb.append(", merLedgerId=").append(merLedgerId);
sb.append(", platformType=").append(platformType);
sb.append(", platformNo=").append(platformNo);
sb.append(", cupNo=").append(cupNo);
sb.append(", receiverNo=").append(receiverNo);
sb.append(", receiverName=").append(receiverName);
sb.append(", entrustFileName=").append(entrustFileName);
sb.append(", entrustFilePath=").append(entrustFilePath);
sb.append(", status=").append(status);
sb.append(", rejectReason=").append(rejectReason);
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();
}
}

@ -0,0 +1,312 @@
package com.hfkj.entity;
import java.io.Serializable;
import java.util.Date;
/**
* bs_mer_ledger_receiver_apply
* @author
*/
/**
*
* 代码由工具生成
*
**/
public class BsMerLedgerReceiverApply implements Serializable {
/**
* 主键
*/
private Long id;
/**
* 商户id
*/
private Long merId;
/**
* 商户分账id
*/
private Long merLedgerId;
/**
* 商户分账接收方id
*/
private Long merLedgerReceiverId;
/**
* 接受编号
*/
private String receiverNo;
/**
* 订单编号
*/
private String orderNo;
/**
* 受理编号
*/
private String applyId;
/**
* 请求报文
*/
private String requestBody;
/**
* 响应报文
*/
private String responseBody;
/**
* 异步通知报文
*/
private String notifyBody;
/**
* 状态 0删除 1审核中 2通过 3驳回
*/
private Integer status;
/**
* 驳回原因
*/
private String rejectReason;
/**
* 创建时间
*/
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 getMerId() {
return merId;
}
public void setMerId(Long merId) {
this.merId = merId;
}
public Long getMerLedgerId() {
return merLedgerId;
}
public void setMerLedgerId(Long merLedgerId) {
this.merLedgerId = merLedgerId;
}
public Long getMerLedgerReceiverId() {
return merLedgerReceiverId;
}
public void setMerLedgerReceiverId(Long merLedgerReceiverId) {
this.merLedgerReceiverId = merLedgerReceiverId;
}
public String getReceiverNo() {
return receiverNo;
}
public void setReceiverNo(String receiverNo) {
this.receiverNo = receiverNo;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getApplyId() {
return applyId;
}
public void setApplyId(String applyId) {
this.applyId = applyId;
}
public String getRequestBody() {
return requestBody;
}
public void setRequestBody(String requestBody) {
this.requestBody = requestBody;
}
public String getResponseBody() {
return responseBody;
}
public void setResponseBody(String responseBody) {
this.responseBody = responseBody;
}
public String getNotifyBody() {
return notifyBody;
}
public void setNotifyBody(String notifyBody) {
this.notifyBody = notifyBody;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getRejectReason() {
return rejectReason;
}
public void setRejectReason(String rejectReason) {
this.rejectReason = rejectReason;
}
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;
}
BsMerLedgerReceiverApply other = (BsMerLedgerReceiverApply) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId()))
&& (this.getMerLedgerReceiverId() == null ? other.getMerLedgerReceiverId() == null : this.getMerLedgerReceiverId().equals(other.getMerLedgerReceiverId()))
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo()))
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo()))
&& (this.getApplyId() == null ? other.getApplyId() == null : this.getApplyId().equals(other.getApplyId()))
&& (this.getRequestBody() == null ? other.getRequestBody() == null : this.getRequestBody().equals(other.getRequestBody()))
&& (this.getResponseBody() == null ? other.getResponseBody() == null : this.getResponseBody().equals(other.getResponseBody()))
&& (this.getNotifyBody() == null ? other.getNotifyBody() == null : this.getNotifyBody().equals(other.getNotifyBody()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason()))
&& (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 + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode());
result = prime * result + ((getMerLedgerReceiverId() == null) ? 0 : getMerLedgerReceiverId().hashCode());
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode());
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode());
result = prime * result + ((getApplyId() == null) ? 0 : getApplyId().hashCode());
result = prime * result + ((getRequestBody() == null) ? 0 : getRequestBody().hashCode());
result = prime * result + ((getResponseBody() == null) ? 0 : getResponseBody().hashCode());
result = prime * result + ((getNotifyBody() == null) ? 0 : getNotifyBody().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().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(", merId=").append(merId);
sb.append(", merLedgerId=").append(merLedgerId);
sb.append(", merLedgerReceiverId=").append(merLedgerReceiverId);
sb.append(", receiverNo=").append(receiverNo);
sb.append(", orderNo=").append(orderNo);
sb.append(", applyId=").append(applyId);
sb.append(", requestBody=").append(requestBody);
sb.append(", responseBody=").append(responseBody);
sb.append(", notifyBody=").append(notifyBody);
sb.append(", status=").append(status);
sb.append(", rejectReason=").append(rejectReason);
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();
}
}

@ -19,6 +19,12 @@ public class BsTradeOrderProfitSharing implements Serializable {
*/
private Long id;
/**
* 指令类型 1分账 2分账撤销
3分账回退
*/
private Integer cmdType;
/**
* 交易id
*/
@ -29,6 +35,11 @@ public class BsTradeOrderProfitSharing implements Serializable {
*/
private String tradeOrderNo;
/**
* 原分账单号
*/
private String originProfitSharingOrderNo;
/**
* 分账单号
*/
@ -70,7 +81,7 @@ public class BsTradeOrderProfitSharing implements Serializable {
private BigDecimal profitSharingAmoun;
/**
* 分账状态 0未分账 1已分账 2已完成
* 分账状态 0未分账 1已分账 2处理中 3已受理 4分账失败
*/
private Integer status;
@ -105,6 +116,14 @@ public class BsTradeOrderProfitSharing implements Serializable {
this.id = id;
}
public Integer getCmdType() {
return cmdType;
}
public void setCmdType(Integer cmdType) {
this.cmdType = cmdType;
}
public Long getTradeOrderId() {
return tradeOrderId;
}
@ -121,6 +140,14 @@ public class BsTradeOrderProfitSharing implements Serializable {
this.tradeOrderNo = tradeOrderNo;
}
public String getOriginProfitSharingOrderNo() {
return originProfitSharingOrderNo;
}
public void setOriginProfitSharingOrderNo(String originProfitSharingOrderNo) {
this.originProfitSharingOrderNo = originProfitSharingOrderNo;
}
public String getProfitSharingOrderNo() {
return profitSharingOrderNo;
}
@ -254,8 +281,10 @@ public class BsTradeOrderProfitSharing implements Serializable {
}
BsTradeOrderProfitSharing other = (BsTradeOrderProfitSharing) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCmdType() == null ? other.getCmdType() == null : this.getCmdType().equals(other.getCmdType()))
&& (this.getTradeOrderId() == null ? other.getTradeOrderId() == null : this.getTradeOrderId().equals(other.getTradeOrderId()))
&& (this.getTradeOrderNo() == null ? other.getTradeOrderNo() == null : this.getTradeOrderNo().equals(other.getTradeOrderNo()))
&& (this.getOriginProfitSharingOrderNo() == null ? other.getOriginProfitSharingOrderNo() == null : this.getOriginProfitSharingOrderNo().equals(other.getOriginProfitSharingOrderNo()))
&& (this.getProfitSharingOrderNo() == null ? other.getProfitSharingOrderNo() == null : this.getProfitSharingOrderNo().equals(other.getProfitSharingOrderNo()))
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType()))
&& (this.getPlatformProfitSharingOrderNo() == null ? other.getPlatformProfitSharingOrderNo() == null : this.getPlatformProfitSharingOrderNo().equals(other.getPlatformProfitSharingOrderNo()))
@ -278,8 +307,10 @@ public class BsTradeOrderProfitSharing implements Serializable {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCmdType() == null) ? 0 : getCmdType().hashCode());
result = prime * result + ((getTradeOrderId() == null) ? 0 : getTradeOrderId().hashCode());
result = prime * result + ((getTradeOrderNo() == null) ? 0 : getTradeOrderNo().hashCode());
result = prime * result + ((getOriginProfitSharingOrderNo() == null) ? 0 : getOriginProfitSharingOrderNo().hashCode());
result = prime * result + ((getProfitSharingOrderNo() == null) ? 0 : getProfitSharingOrderNo().hashCode());
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode());
result = prime * result + ((getPlatformProfitSharingOrderNo() == null) ? 0 : getPlatformProfitSharingOrderNo().hashCode());
@ -305,8 +336,10 @@ public class BsTradeOrderProfitSharing implements Serializable {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", cmdType=").append(cmdType);
sb.append(", tradeOrderId=").append(tradeOrderId);
sb.append(", tradeOrderNo=").append(tradeOrderNo);
sb.append(", originProfitSharingOrderNo=").append(originProfitSharingOrderNo);
sb.append(", profitSharingOrderNo=").append(profitSharingOrderNo);
sb.append(", platformType=").append(platformType);
sb.append(", platformProfitSharingOrderNo=").append(platformProfitSharingOrderNo);

@ -186,6 +186,66 @@ public class BsTradeOrderProfitSharingExample {
return (Criteria) this;
}
public Criteria andCmdTypeIsNull() {
addCriterion("cmd_type is null");
return (Criteria) this;
}
public Criteria andCmdTypeIsNotNull() {
addCriterion("cmd_type is not null");
return (Criteria) this;
}
public Criteria andCmdTypeEqualTo(Integer value) {
addCriterion("cmd_type =", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeNotEqualTo(Integer value) {
addCriterion("cmd_type <>", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeGreaterThan(Integer value) {
addCriterion("cmd_type >", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("cmd_type >=", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeLessThan(Integer value) {
addCriterion("cmd_type <", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeLessThanOrEqualTo(Integer value) {
addCriterion("cmd_type <=", value, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeIn(List<Integer> values) {
addCriterion("cmd_type in", values, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeNotIn(List<Integer> values) {
addCriterion("cmd_type not in", values, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeBetween(Integer value1, Integer value2) {
addCriterion("cmd_type between", value1, value2, "cmdType");
return (Criteria) this;
}
public Criteria andCmdTypeNotBetween(Integer value1, Integer value2) {
addCriterion("cmd_type not between", value1, value2, "cmdType");
return (Criteria) this;
}
public Criteria andTradeOrderIdIsNull() {
addCriterion("trade_order_id is null");
return (Criteria) this;
@ -316,6 +376,76 @@ public class BsTradeOrderProfitSharingExample {
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoIsNull() {
addCriterion("origin_profit_sharing_order_no is null");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoIsNotNull() {
addCriterion("origin_profit_sharing_order_no is not null");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoEqualTo(String value) {
addCriterion("origin_profit_sharing_order_no =", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoNotEqualTo(String value) {
addCriterion("origin_profit_sharing_order_no <>", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoGreaterThan(String value) {
addCriterion("origin_profit_sharing_order_no >", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoGreaterThanOrEqualTo(String value) {
addCriterion("origin_profit_sharing_order_no >=", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoLessThan(String value) {
addCriterion("origin_profit_sharing_order_no <", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoLessThanOrEqualTo(String value) {
addCriterion("origin_profit_sharing_order_no <=", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoLike(String value) {
addCriterion("origin_profit_sharing_order_no like", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoNotLike(String value) {
addCriterion("origin_profit_sharing_order_no not like", value, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoIn(List<String> values) {
addCriterion("origin_profit_sharing_order_no in", values, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoNotIn(List<String> values) {
addCriterion("origin_profit_sharing_order_no not in", values, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoBetween(String value1, String value2) {
addCriterion("origin_profit_sharing_order_no between", value1, value2, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andOriginProfitSharingOrderNoNotBetween(String value1, String value2) {
addCriterion("origin_profit_sharing_order_no not between", value1, value2, "originProfitSharingOrderNo");
return (Criteria) this;
}
public Criteria andProfitSharingOrderNoIsNull() {
addCriterion("profit_sharing_order_no is null");
return (Criteria) this;

@ -0,0 +1,31 @@
package com.hfkj.service;
import com.hfkj.entity.BsMerLedgerApply;
/**
* @className: BsMerLedgerApplyService
* @author: HuRui
* @date: 2023/4/18
**/
public interface BsMerLedgerApplyService {
/**
* 编辑商户分账申请记录
* @param merLedgerApply
*/
void editMerLedgerApply(BsMerLedgerApply merLedgerApply);
/**
* 获取商户分账申请记录
* @param orderNo
* @return
*/
BsMerLedgerApply getApplyByOrderNo(String orderNo);
/**
* 获取商户分账申请记录
* @param applyId
* @return
*/
BsMerLedgerApply getApplyByApplyId(String applyId);
}

@ -0,0 +1,24 @@
package com.hfkj.service;
import com.hfkj.entity.BsMerLedgerReceiverApply;
/**
* @className: BsMerLedgerReceiverApplyService
* @author: HuRui
* @date: 2023/4/19
**/
public interface BsMerLedgerReceiverApplyService {
/**
* 编辑接收方申请
* @param merLedgerReceiverApply
*/
void editReceiverApply(BsMerLedgerReceiverApply merLedgerReceiverApply);
/**
* 根据受理编号查询
* @param applyId
* @return
*/
BsMerLedgerReceiverApply getReceiverApplyByApplyId(String applyId);
}

@ -0,0 +1,55 @@
package com.hfkj.service;
import com.hfkj.entity.BsMerLedgerReceiver;
import com.hfkj.sysenum.PlatformTypeEnum;
import java.util.List;
import java.util.Map;
/**
* @className: BsMerLedgerReceiverService
* @author: HuRui
* @date: 2023/4/19
**/
public interface BsMerLedgerReceiverService {
/**
* 编辑分账接收方
* @param merLedgerReceiver
*/
void editMerLedgerReceiver(BsMerLedgerReceiver merLedgerReceiver);
/**
* 商户分账接收方申请
* @param merLedgerReceiver
*/
void merLedgerReceiverApply(BsMerLedgerReceiver merLedgerReceiver);
/**
* 商户分账接收方申请
* @param merLedgerReceiver
*/
void merLedgerReceiverDel(BsMerLedgerReceiver merLedgerReceiver);
/**
* 查询分账接收方详情
* @param merId
* @param receiverNo
* @return
*/
BsMerLedgerReceiver getMerLedgerReceiver(Long merId,String receiverNo);
/**
* 查询商户的接收方
* @param merId
* @return
*/
List<BsMerLedgerReceiver> getMerLedgerReceiverByMer(Long merId, PlatformTypeEnum platformType);
/**
* 查询分账接收方列表
* @param param
* @return
*/
List<BsMerLedgerReceiver> getMerLedgerReceiverList(Map<String,Object> param);
}

@ -0,0 +1,41 @@
package com.hfkj.service;
import com.hfkj.entity.BsMerLedger;
import com.hfkj.sysenum.PlatformTypeEnum;
/**
* @className: BsMerLedgerService
* @author: HuRui
* @date: 2023/4/18
**/
public interface BsMerLedgerService {
/**
* 编辑商户分账信息
* @param merLedger
*/
void editMerLedger(BsMerLedger merLedger);
/**
* 商户分账功能申请
* @param merLedger
*/
void merLedgerApply(BsMerLedger merLedger);
/**
* 查询商户分账信息
* @param merId
* @param platformType
* @return
*/
BsMerLedger getMerLedger(Long merId, PlatformTypeEnum platformType);
/**
* 查询商户分账信息
* @param id
* @return
*/
BsMerLedger getMerLedgerById(Long id);
}

@ -19,6 +19,13 @@ public interface BsTradeOrderProfitSharingReceiverService {
*/
void editData(BsTradeOrderProfitSharingReceiver profitSharingReceiver);
/**
* 根据分账记录查询接收方
* @param profitSharingId
* @return
*/
List<BsTradeOrderProfitSharingReceiver> getReceiverListByProfitSharingId(Long profitSharingId);
/**
* 查询分账列表
* @param param

@ -25,6 +25,13 @@ public interface BsTradeOrderProfitSharingService {
*/
void createProfitSharing(BsTradeOrder tradeOrder);
/**
* 根据分账单号 查询详情
* @param profitSharingOrderNo
* @return
*/
BsTradeOrderProfitSharing getDetailByProfitSharingOrderNo(String profitSharingOrderNo);
/**
* 获取需要分账的订单
* @return

@ -0,0 +1,53 @@
package com.hfkj.service.impl;
import com.hfkj.dao.BsMerLedgerApplyMapper;
import com.hfkj.dao.BsMerLedgerMapper;
import com.hfkj.entity.BsMerLedgerApply;
import com.hfkj.entity.BsMerLedgerApplyExample;
import com.hfkj.service.BsMerLedgerApplyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsMerLedgerApplyServiceImpl
* @author: HuRui
* @date: 2023/4/18
**/
@Service("merLedgerApplyService")
public class BsMerLedgerApplyServiceImpl implements BsMerLedgerApplyService {
@Resource
private BsMerLedgerApplyMapper merLedgerApplyMapper;
@Override
public void editMerLedgerApply(BsMerLedgerApply merLedgerApply) {
if (merLedgerApply.getId() == null) {
merLedgerApply.setStatus(1);
merLedgerApply.setCreateTime(new Date());
merLedgerApply.setUpdateTime(new Date());
merLedgerApplyMapper.insert(merLedgerApply);
} else {
merLedgerApply.setUpdateTime(new Date());
merLedgerApplyMapper.updateByPrimaryKey(merLedgerApply);
}
}
@Override
public BsMerLedgerApply getApplyByOrderNo(String orderNo) {
return null;
}
@Override
public BsMerLedgerApply getApplyByApplyId(String applyId) {
BsMerLedgerApplyExample example = new BsMerLedgerApplyExample();
example.createCriteria().andApplyIdEqualTo(applyId).andStatusNotEqualTo(0);
List<BsMerLedgerApply> list = merLedgerApplyMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -0,0 +1,46 @@
package com.hfkj.service.impl;
import com.hfkj.dao.BsMerLedgerReceiverApplyMapper;
import com.hfkj.entity.BsMerLedgerReceiverApply;
import com.hfkj.entity.BsMerLedgerReceiverApplyExample;
import com.hfkj.service.BsMerLedgerReceiverApplyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsMerLedgerReceiverApplyServiceImpl
* @author: HuRui
* @date: 2023/4/19
**/
@Service("merLedgerReceiverApplyService")
public class BsMerLedgerReceiverApplyServiceImpl implements BsMerLedgerReceiverApplyService {
@Resource
private BsMerLedgerReceiverApplyMapper merLedgerReceiverApplyMapper;
@Override
public void editReceiverApply(BsMerLedgerReceiverApply merLedgerReceiverApply) {
if (merLedgerReceiverApply.getId() == null) {
merLedgerReceiverApply.setUpdateTime(new Date());
merLedgerReceiverApply.setCreateTime(new Date());
merLedgerReceiverApplyMapper.insert(merLedgerReceiverApply);
} else {
merLedgerReceiverApply.setUpdateTime(new Date());
merLedgerReceiverApplyMapper.updateByPrimaryKey(merLedgerReceiverApply);
}
}
@Override
public BsMerLedgerReceiverApply getReceiverApplyByApplyId(String applyId) {
BsMerLedgerReceiverApplyExample example = new BsMerLedgerReceiverApplyExample();
example.createCriteria().andApplyIdEqualTo(applyId);
List<BsMerLedgerReceiverApply> list = merLedgerReceiverApplyMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
}

@ -0,0 +1,104 @@
package com.hfkj.service.impl;
import com.hfkj.channel.lakala.LaKaLaLedgerService;
import com.hfkj.channel.lakala.LaKaLaMerService;
import com.hfkj.dao.BsMerLedgerReceiverMapper;
import com.hfkj.entity.BsMerLedgerReceiver;
import com.hfkj.entity.BsMerLedgerReceiverExample;
import com.hfkj.service.BsMerLedgerReceiverService;
import com.hfkj.sysenum.MerLedgerReceiverStatusEnum;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @className: BsMerLedgerReceiverServiceImpl
* @author: HuRui
* @date: 2023/4/19
**/
@Service("merLedgerReceiverService")
public class BsMerLedgerReceiverServiceImpl implements BsMerLedgerReceiverService {
@Resource
private BsMerLedgerReceiverMapper merLedgerReceiverMapper;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
@Override
public void editMerLedgerReceiver(BsMerLedgerReceiver merLedgerReceiver) {
if (merLedgerReceiver.getId() == null) {
merLedgerReceiver.setCreateTime(new Date());
merLedgerReceiver.setUpdateTime(new Date());
merLedgerReceiverMapper.insert(merLedgerReceiver);
} else {
merLedgerReceiver.setUpdateTime(new Date());
merLedgerReceiverMapper.updateByPrimaryKey(merLedgerReceiver);
}
}
@Override
public void merLedgerReceiverApply(BsMerLedgerReceiver merLedgerReceiver) {
editMerLedgerReceiver(merLedgerReceiver);
if (merLedgerReceiver.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
laKaLaLedgerService.applyBind(merLedgerReceiver.getMerId(), merLedgerReceiver.getReceiverNo());
}
}
@Override
public void merLedgerReceiverDel(BsMerLedgerReceiver merLedgerReceiver) {
editMerLedgerReceiver(merLedgerReceiver);
if (merLedgerReceiver.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
laKaLaLedgerService.applyUnBind(merLedgerReceiver.getMerId(), merLedgerReceiver.getReceiverNo());
}
}
@Override
public BsMerLedgerReceiver getMerLedgerReceiver(Long merId, String receiverNo) {
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample();
example.createCriteria().andMerIdEqualTo(merId).andReceiverNoEqualTo(receiverNo).andStatusNotEqualTo(0);
List<BsMerLedgerReceiver> list = merLedgerReceiverMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public List<BsMerLedgerReceiver> getMerLedgerReceiverByMer(Long merId, PlatformTypeEnum platformType) {
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample();
example.createCriteria().andMerIdEqualTo(merId).andStatusNotEqualTo(0).andPlatformTypeEqualTo(platformType.getNumber());
return merLedgerReceiverMapper.selectByExample(example);
}
@Override
public List<BsMerLedgerReceiver> getMerLedgerReceiverList(Map<String, Object> param) {
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample();
BsMerLedgerReceiverExample.Criteria criteria = example.createCriteria()
.andStatusNotEqualTo(MerLedgerReceiverStatusEnum.status0.getNumber());
if (MapUtils.getInteger(param, "platformType") != null) {
criteria.andPlatformTypeEqualTo(MapUtils.getInteger(param, "platformType"));
}
if (MapUtils.getInteger(param, "status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status"));
}
if (MapUtils.getBoolean(param, "receiverNoNotNull") != null) {
criteria.andReceiverNoIsNotNull();
}
example.setOrderByClause("create_time desc");
return merLedgerReceiverMapper.selectByExample(example);
}
}

@ -0,0 +1,68 @@
package com.hfkj.service.impl;
import com.hfkj.channel.lakala.LaKaLaLedgerService;
import com.hfkj.dao.BsMerLedgerMapper;
import com.hfkj.entity.BsMerLedger;
import com.hfkj.entity.BsMerLedgerExample;
import com.hfkj.service.BsMerLedgerService;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* @className: BsMerLedgerServiceImpl
* @author: HuRui
* @date: 2023/4/18
**/
@Service("merLedgerService")
public class BsMerLedgerServiceImpl implements BsMerLedgerService {
@Resource
private BsMerLedgerMapper merLedgerMapper;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
@Override
public void editMerLedger(BsMerLedger merLedger) {
if (merLedger.getId() == null) {
merLedger.setCreateTime(new Date());
merLedger.setUpdateTime(new Date());
merLedgerMapper.insert(merLedger);
} else {
merLedger.setUpdateTime(new Date());
merLedgerMapper.updateByPrimaryKey(merLedger);
}
}
@Override
public void merLedgerApply(BsMerLedger merLedger) {
editMerLedger(merLedger);
if (merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
laKaLaLedgerService.applyLedger(merLedger.getId());
}
}
@Override
public BsMerLedger getMerLedger(Long merId, PlatformTypeEnum platformType) {
BsMerLedgerExample example = new BsMerLedgerExample();
example.createCriteria()
.andMerIdEqualTo(merId)
.andStatusNotEqualTo(0)
.andPlatformTypeEqualTo(platformType.getNumber());
List<BsMerLedger> list = merLedgerMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public BsMerLedger getMerLedgerById(Long id) {
return merLedgerMapper.selectByPrimaryKey(id);
}
}

@ -37,6 +37,13 @@ public class BsTradeOrderProfitSharingReceiverServiceImpl implements BsTradeOrde
}
}
@Override
public List<BsTradeOrderProfitSharingReceiver> getReceiverListByProfitSharingId(Long profitSharingId) {
BsTradeOrderProfitSharingReceiverExample example = new BsTradeOrderProfitSharingReceiverExample();
example.createCriteria().andTradeOrderProfitSharingIdEqualTo(profitSharingId);
return tradeOrderProfitSharingReceiverMapper.selectByExample(example);
}
@Override
public List<BsTradeOrderProfitSharingReceiver> getProfitSharingList(Map<String, Object> param) {
BsTradeOrderProfitSharingReceiverExample example = new BsTradeOrderProfitSharingReceiverExample();

@ -8,10 +8,7 @@ import com.hfkj.common.utils.IDGenerator;
import com.hfkj.dao.BsTradeOrderProfitSharingMapper;
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 com.hfkj.sysenum.*;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
@ -48,7 +45,6 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
public void editData(BsTradeOrderProfitSharing profitSharing) {
if (profitSharing.getId() == null) {
profitSharing.setCreateTime(new Date());
profitSharing.setStatus(0);
tradeOrderProfitSharingMapper.insert(profitSharing);
} else {
tradeOrderProfitSharingMapper.updateByPrimaryKeySelective(profitSharing);
@ -59,13 +55,8 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void createProfitSharing(BsTradeOrder tradeOrder) {
if (tradeOrder.getProfitSharingStatus() != null && tradeOrder.getProfitSharingStatus().equals(true)) {
// 比例
BsMerPlatformNoRate rate = merPlatformNoRateService.getDetail(tradeOrder.getMerId(), PlatformTypeEnum.type4.getNumber(), null);
if (rate == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置比例");
}
BsTradeOrderProfitSharing tradeOrderProfitSharing = new BsTradeOrderProfitSharing();
tradeOrderProfitSharing.setCmdType(ProfitSharingCmdTypeEnum.CMD_TYPE_1.getNumber());
tradeOrderProfitSharing.setProfitSharingOrderNo("1530"+ DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(10));
tradeOrderProfitSharing.setTradeOrderId(tradeOrder.getId());
tradeOrderProfitSharing.setTradeOrderNo(tradeOrder.getOutTradeNo());
@ -73,16 +64,26 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
tradeOrderProfitSharing.setPlatformMerNo(tradeOrder.getPlatformMerNo());
tradeOrderProfitSharing.setPlatformTradeNo(tradeOrder.getPlatformTradeNo());
tradeOrderProfitSharing.setPlatformAppid(tradeOrder.getPlatformAppid());
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status0.getNumber());
editData(tradeOrderProfitSharing);
// 比例
BsMerPlatformNoRate rate = merPlatformNoRateService.getDetail(tradeOrder.getMerId(), PlatformTypeEnum.getDataByNumber(tradeOrder.getPlatformType()).getNumber(), null);
if (rate == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置比例");
}
// 渠道平台手续费
BigDecimal platformServiceCharge = null;
if (tradeOrder.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) {
if (tradeOrder.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
platformServiceCharge = new BigDecimal("0.002");
} else 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 platformServiceAmount = tradeOrder.getTradeAmount().multiply(rate.getRatePct()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
@ -387,6 +388,17 @@ public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitS
}
}
@Override
public BsTradeOrderProfitSharing getDetailByProfitSharingOrderNo(String profitSharingOrderNo) {
BsTradeOrderProfitSharingExample example = new BsTradeOrderProfitSharingExample();
example.createCriteria().andProfitSharingOrderNoEqualTo(profitSharingOrderNo);
List<BsTradeOrderProfitSharing> list = tradeOrderProfitSharingMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public List<BsTradeOrderProfitSharing> getNeedProfitSharingOrder() {
return tradeOrderProfitSharingMapper.getNeedProfitSharingOrder();

@ -8,7 +8,7 @@ import java.util.Objects;
*/
public enum DeviceOrderTypeEnum {
type1(1, "押金"),
type2(1, "购买"),
type2(2, "购买"),
;
private Integer number;

@ -8,31 +8,33 @@ import java.util.Objects;
*/
public enum MerAttachType {
type1(1, "营业执照", "BUSINESS_LICENCE"),
type2(2, "法人身份证正面", "ID_CARD_FRONT"),
type3(3, "法人身份证反面", "ID_CARD_BEHIND"),
type4(4, "场所门头照片", "SHOP_OUTSIDE_IMG"),
type5(5, "场所内部照片", "SHOP_INSIDE_IMG"),
type6(6, "场所收银台照片", "CHECKSTAND_IMG"),
type7(7, "银行卡照片", "BANK_CARD"),
type8(8, "开户许可证", "OPENING_PERMIT"),
type9(9, "结算人身份证人像面", "SETTLE_ID_CARD_FRONT"),
type10(10, "结算人身份证国徽面", "SETTLE_ID_CARD_BEHIND"),
type11(11, "协议", "AGREE_MENT"),
type12(12, "法人授权涵", "LETTER_OF_AUTHORIZATION"),
type99(99, "补充资料", "OTHERS"),
type1(1, "营业执照", "BUSINESS_LICENCE", "BUSINESS_LICENCE"),
type2(2, "法人身份证正面", "ID_CARD_FRONT", "FR_ID_CARD_FRONT"),
type3(3, "法人身份证反面", "ID_CARD_BEHIND", "FR_ID_CARD_BEHIND"),
type4(4, "场所门头照片", "SHOP_OUTSIDE_IMG", "MERCHANT_PHOTO"),
type5(5, "场所内部照片", "SHOP_INSIDE_IMG", "SHOPINNER"),
type6(6, "场所收银台照片", "CHECKSTAND_IMG", ""),
type7(7, "银行卡照片", "BANK_CARD", "BANK_CARD"),
type8(8, "开户许可证", "OPENING_PERMIT",""),
type9(9, "结算人身份证人像面", "SETTLE_ID_CARD_FRONT",""),
type10(10, "结算人身份证国徽面", "SETTLE_ID_CARD_BEHIND",""),
type11(11, "协议", "AGREE_MENT",""),
type12(12, "法人授权涵", "LETTER_OF_AUTHORIZATION",""),
type99(99, "补充资料", "OTHERS","OTHERS"),
;
private Integer number;
private String name;
private String lakalaCode;
private String lklSaasCode;
private String lklCode;
MerAttachType(int number, String name, String lakalaCode) {
MerAttachType(int number, String name, String lklSaasCode, String lklCode) {
this.number = number;
this.name = name;
this.lakalaCode = lakalaCode;
this.lklSaasCode = lklSaasCode;
this.lklCode = lklCode;
}
public static MerAttachType getDataByNumber(Integer number) {
@ -60,11 +62,19 @@ public enum MerAttachType {
this.name = name;
}
public String getLakalaCode() {
return lakalaCode;
public String getLklSaasCode() {
return lklSaasCode;
}
public void setLakalaCode(String lakalaCode) {
this.lakalaCode = lakalaCode;
public void setLklSaasCode(String lklSaasCode) {
this.lklSaasCode = lklSaasCode;
}
public String getLklCode() {
return lklCode;
}
public void setLklCode(String lklCode) {
this.lklCode = lklCode;
}
}

@ -0,0 +1,52 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum MerLedgerReceiverApplyStatusEnum {
status0(0, "不可用"),
status1(1, "审核中"),
status2(2, "通过"),
status3(3, "驳回"),
;
private Integer number;
private String name;
MerLedgerReceiverApplyStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static MerLedgerReceiverApplyStatusEnum getDataByNumber(Integer number) {
for (MerLedgerReceiverApplyStatusEnum 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;
}
}

@ -0,0 +1,52 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum MerLedgerReceiverStatusEnum {
status0(0, "不可用"),
status1(1, "可用"),
status2(2, "审核中"),
status3(3, "审核驳回"),
;
private Integer number;
private String name;
MerLedgerReceiverStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static MerLedgerReceiverStatusEnum getDataByNumber(Integer number) {
for (MerLedgerReceiverStatusEnum 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;
}
}

@ -0,0 +1,52 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum MerLedgerStatusEnum {
status0(0, "不可用"),
status1(1, "可用"),
status2(2, "审核中"),
status3(3, "审核驳回"),
;
private Integer number;
private String name;
MerLedgerStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static MerLedgerStatusEnum getDataByNumber(Integer number) {
for (MerLedgerStatusEnum 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;
}
}

@ -0,0 +1,52 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* 分账指令类型
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum ProfitSharingCmdTypeEnum {
CMD_TYPE_1(1, "分账"),
CMD_TYPE_2(2, "分账撤销"),
CMD_TYPE_3(3, "分账回退"),
;
private Integer number;
private String name;
ProfitSharingCmdTypeEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static ProfitSharingCmdTypeEnum getDataByNumber(Integer number) {
for (ProfitSharingCmdTypeEnum 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;
}
}

@ -0,0 +1,50 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum ProfitSharingReceiverStatusEnum {
status0(0, "待分账"),
status1(1, "已分账"),
;
private Integer number;
private String name;
ProfitSharingReceiverStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static ProfitSharingReceiverStatusEnum getDataByNumber(Integer number) {
for (ProfitSharingReceiverStatusEnum 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;
}
}

@ -0,0 +1,53 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* @className: MerLedgerStatusEnum
* @author: HuRui
* @date: 2023/4/18
**/
public enum ProfitSharingStatusEnum {
status0(0, "待处理"),
status1(1, "已完成"),
status2(2, "处理中"),
status3(3, "已受理"),
status4(4, "失败"),
;
private Integer number;
private String name;
ProfitSharingStatusEnum(int number, String name) {
this.number = number;
this.name = name;
}
public static ProfitSharingStatusEnum getDataByNumber(Integer number) {
for (ProfitSharingStatusEnum 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;
}
}

@ -36,6 +36,5 @@ wechat_pay_notify_url=https://gratia-pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file
filesystem=/home/project/gratia-pay/filesystem
domainName=https://gratia-pay.dctpay.com
hsg_domain_name=https://hsgcs.dctpay.com/

@ -33,5 +33,5 @@ wechat_pay_notify_url=https://pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file
filesystem=/home/project/gratia-pay/filesystem
domainName=https://pay.dctpay.com
hsg_domain_name=https://hsg.dctpay.com/

Loading…
Cancel
Save