parent
f98143bc9d
commit
5f4f05cb6a
@ -1,2 +1,2 @@ |
||||
fileUrl=/home/project/xuan-pay/filesystem |
||||
cmsPath=/home/project/hsg/filesystem/cmsPath |
||||
fileUrl=/home/project/gratia-pay/filesystem |
||||
cmsPath=/home/project/gratia-pay/filesystem/cmsPath |
||||
|
@ -1,5 +1,5 @@ |
||||
fileUrl=/home/project/xuan-pay/filesystem |
||||
cmsPath=/home/project/xuan-pay/filesystem/cmsPath |
||||
fileUrl=/home/project/gratia-pay/filesystem |
||||
cmsPath=/home/project/gratia-pay/filesystem/cmsPath |
||||
|
||||
wxAppId=wxa075e8509802f826 |
||||
wxAppSecret=0e606fc1378d35e359fcf3f15570b2c5 |
||||
|
@ -0,0 +1,146 @@ |
||||
package com.hfkj.schedule; |
||||
|
||||
import com.hfkj.channel.weixin.utils.WxOrderConfig; |
||||
import com.hfkj.entity.BsTradeOrder; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService; |
||||
import com.hfkj.service.BsTradeOrderProfitSharingService; |
||||
import com.hfkj.service.BsTradeOrderService; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import com.hfkj.sysenum.TradeOrderPayModeEnum; |
||||
import com.hfkj.sysenum.TradeOrderStatusEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 交易订单定时任务 |
||||
* |
||||
*/ |
||||
@Configuration |
||||
public class TradeOrderSchedule { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TradeOrderSchedule.class); |
||||
|
||||
@Resource |
||||
private BsTradeOrderService tradeOrderService; |
||||
|
||||
@Resource |
||||
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService; |
||||
|
||||
@Resource |
||||
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; |
||||
|
||||
/** |
||||
* 订单发起分账 |
||||
* 5分钟扫描一次需要分账的订单 |
||||
*/ |
||||
@Scheduled(cron="0 0/1 * * * ?") |
||||
public void profitSharing() { |
||||
List<BsTradeOrderProfitSharing> tradeOrderProfitSharingList = tradeOrderProfitSharingService.getNeedProfitSharingOrder(); |
||||
for (BsTradeOrderProfitSharing tradeOrderProfitSharing : tradeOrderProfitSharingList) { |
||||
try { |
||||
|
||||
List<Map<String,Object>> receiversList = new ArrayList<>(); |
||||
Map<String,Object> receiversMap; |
||||
|
||||
// 分账接收方
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("tradeOrderProfitSharingId", tradeOrderProfitSharing.getId()); |
||||
List<BsTradeOrderProfitSharingReceiver> profitSharingReceivers = tradeOrderProfitSharingReceiverService.getProfitSharingList(param); |
||||
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceivers) { |
||||
receiversMap = new HashMap<>(); |
||||
receiversMap.put("type", "MERCHANT_ID"); |
||||
receiversMap.put("account", receiver.getReceiverAccount()); |
||||
receiversMap.put("amount", receiver.getReceiverAmount().multiply(new BigDecimal("100")).intValue()); |
||||
receiversMap.put("description", "分给商户:" + receiver.getReceiverName()); |
||||
receiversList.add(receiversMap); |
||||
} |
||||
|
||||
if (tradeOrderProfitSharing.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) { |
||||
// 微信分账
|
||||
TreeMap<String, String> refundModel = WxOrderConfig.createProfitsharing( |
||||
tradeOrderProfitSharing.getPlatformAppid(), |
||||
tradeOrderProfitSharing.getPlatformMerNo(), |
||||
tradeOrderProfitSharing.getPlatformTradeNo(), |
||||
tradeOrderProfitSharing.getTradeOrderNo(), |
||||
receiversList |
||||
); |
||||
if("SUCCESS".equals(MapUtils.getString(refundModel, "return_code")) |
||||
&& "SUCCESS".equals(MapUtils.getString(refundModel, "result_code"))) { |
||||
tradeOrderProfitSharing.setPlatformProfitSharingOrderNo(MapUtils.getString(refundModel, "order_id")); |
||||
tradeOrderProfitSharing.setStatus(1); |
||||
tradeOrderProfitSharing.setProfitSharingTime(new Date()); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
|
||||
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceivers) { |
||||
receiver.setStatus(1); |
||||
receiver.setProfitSharingTime(new Date()); |
||||
tradeOrderProfitSharingReceiverService.editData(receiver); |
||||
} |
||||
} else { |
||||
tradeOrderProfitSharing.setExt1(MapUtils.getString(refundModel,"description")); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
} |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
tradeOrderProfitSharing.setExt1("分账失败"); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 完结分账 |
||||
* 每分钟扫描一次需要完结的订单 |
||||
*/ |
||||
@Scheduled(cron="0 0/1 * * * ?") |
||||
public void profitSharingFinish() { |
||||
List<BsTradeOrderProfitSharing> tradeOrderProfitSharingList = tradeOrderProfitSharingService.getNeedFinishProfitSharingOrder(); |
||||
for (BsTradeOrderProfitSharing tradeOrderProfitSharing : tradeOrderProfitSharingList) { |
||||
try { |
||||
|
||||
TreeMap<String, String> refundModel = WxOrderConfig.profitSharingFinish( |
||||
tradeOrderProfitSharing.getPlatformAppid(), |
||||
tradeOrderProfitSharing.getPlatformMerNo(), |
||||
tradeOrderProfitSharing.getPlatformTradeNo(), |
||||
tradeOrderProfitSharing.getPlatformProfitSharingOrderNo(), |
||||
"分账已完成"); |
||||
|
||||
if("SUCCESS".equals(MapUtils.getString(refundModel, "return_code")) |
||||
&& "SUCCESS".equals(MapUtils.getString(refundModel, "result_code"))) { |
||||
tradeOrderProfitSharing.setPlatformProfitSharingOrderNo(MapUtils.getString(refundModel, "order_id")); |
||||
tradeOrderProfitSharing.setStatus(2); |
||||
tradeOrderProfitSharing.setFinishTime(new Date()); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
|
||||
// 分账接收方
|
||||
Map<String,Object> param = new HashMap<>(); |
||||
param.put("tradeOrderProfitSharingId", tradeOrderProfitSharing.getId()); |
||||
List<BsTradeOrderProfitSharingReceiver> profitSharingReceivers = tradeOrderProfitSharingReceiverService.getProfitSharingList(param); |
||||
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceivers) { |
||||
receiver.setStatus(2); |
||||
receiver.setFinishTime(new Date()); |
||||
tradeOrderProfitSharingReceiverService.editData(receiver); |
||||
} |
||||
} else { |
||||
tradeOrderProfitSharing.setExt1(MapUtils.getString(refundModel,"description")); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
} |
||||
|
||||
} catch (Exception e) { |
||||
tradeOrderProfitSharing.setExt1("完结分账失败"); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
} |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,81 @@ |
||||
package com.hfkj.channel.alipay; |
||||
|
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.entity.BsMerAttach; |
||||
import com.hfkj.model.MerBasisModel; |
||||
import com.hfkj.service.BsMerAttachService; |
||||
import com.hfkj.service.BsMerContractRecordService; |
||||
import com.hfkj.service.BsMerService; |
||||
import com.hfkj.sysenum.MerAttachType; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* @className: AlipayMerService |
||||
* @author: HuRui |
||||
* @date: 2023/2/20 |
||||
**/ |
||||
@Service("alipayMerService") |
||||
public class AlipayMerService { |
||||
|
||||
@Resource |
||||
private BsMerService merService; |
||||
@Resource |
||||
private BsMerAttachService merAttachService; |
||||
@Resource |
||||
private BsMerContractRecordService merContractRecordService; |
||||
|
||||
private List<BsMerAttach> merAttachList; |
||||
|
||||
public void add(Long merId) { |
||||
MerBasisModel basisModel = merService.getMerDetail(merId); |
||||
|
||||
// 查询商户附件列表
|
||||
merAttachList = merAttachService.getAttachListByMer(merId, null); |
||||
|
||||
Map<String,Object> body = new HashMap<>(); |
||||
body.put("external_id", basisModel.getMerNo()); |
||||
body.put("name", basisModel.getMerName()); |
||||
body.put("alias_name", basisModel.getMerAbbreviate()); |
||||
body.put("merchant_type", ""); |
||||
body.put("mcc", ""); |
||||
body.put("cert_no", ""); |
||||
body.put("cert_type", ""); |
||||
body.put("cert_image", ""); |
||||
body.put("cert_name", ""); |
||||
body.put("cert_image_back", ""); |
||||
body.put("legal_name", ""); |
||||
body.put("legal_cert_no", ""); |
||||
body.put("legal_cert_front_image", ""); |
||||
body.put("legal_cert_back_image", ""); |
||||
body.put("service_phone", ""); |
||||
|
||||
} |
||||
|
||||
|
||||
/** |
||||
* 获取商户附件 |
||||
* @param attachType |
||||
* @return |
||||
*/ |
||||
private List<BsMerAttach> getMerAttach(MerAttachType attachType) { |
||||
if (merAttachList == null || merAttachList.size() == 0) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未上传相关图片"); |
||||
} |
||||
List<BsMerAttach> collect = merAttachList.stream() |
||||
.filter(o -> o.getType().equals(attachType.getNumber())) |
||||
.collect(Collectors.toList()); |
||||
if (collect.size() == 0) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未上传" + attachType.getName() + "图片"); |
||||
} |
||||
return collect; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,182 @@ |
||||
package com.hfkj.channel.alipay.utils; |
||||
|
||||
import com.alipay.api.AlipayClient; |
||||
import com.alipay.api.FileItem; |
||||
import com.alipay.api.domain.ZftSubMerchantOrder; |
||||
import com.alipay.api.request.AntMerchantExpandIndirectImageUploadRequest; |
||||
import com.alipay.api.request.AntMerchantExpandIndirectZftConsultRequest; |
||||
import com.alipay.api.request.AntMerchantExpandIndirectZftSettlementmodifyRequest; |
||||
import com.alipay.api.request.AntMerchantExpandIndirectZftorderQueryRequest; |
||||
import com.alipay.api.response.AntMerchantExpandIndirectImageUploadResponse; |
||||
import com.alipay.api.response.AntMerchantExpandIndirectZftConsultResponse; |
||||
import com.alipay.api.response.AntMerchantExpandIndirectZftSettlementmodifyResponse; |
||||
import com.alipay.api.response.AntMerchantExpandIndirectZftorderQueryResponse; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 支付业务请求 |
||||
* @className: MerchantRequest |
||||
* @author: HuRui |
||||
* @date: 2023/2/17 |
||||
**/ |
||||
public class AlipayRequest { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(AlipayRequest.class); |
||||
|
||||
/** |
||||
* 商户创建预校验咨询 |
||||
* @param bizContent 进件参数 |
||||
* @return |
||||
* @throws Exception |
||||
*/ |
||||
public static void merchantIndirectConsult(String bizContent) { |
||||
log.info("========== START 商户创建预校验咨询 =========="); |
||||
log.info("请求参数:" + bizContent); |
||||
try { |
||||
AlipayClient alipayClient = AlipayUtils.initClient(); |
||||
AntMerchantExpandIndirectZftConsultRequest request = new AntMerchantExpandIndirectZftConsultRequest(); |
||||
request.setBizContent(bizContent); |
||||
AntMerchantExpandIndirectZftConsultResponse response = alipayClient.certificateExecute(request); |
||||
log.info("响应参数:" + response); |
||||
if (response.isSuccess() != true || response.getAccountAudit() != true || response.getRiskAudit() != true) { |
||||
throw new Exception(response.getSubMsg()); |
||||
} |
||||
} catch (Exception e) { |
||||
log.info("出现异常:" + e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); |
||||
} finally { |
||||
log.info("========== END 商户创建预校验咨询 =========="); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 商户创建 |
||||
* @param bizContent 进件参数 |
||||
* @return 申请单号 |
||||
* @throws Exception |
||||
*/ |
||||
public static String merchantIndirectCreate(String bizContent) { |
||||
log.info("========== START 商户创建 =========="); |
||||
log.info("请求参数:" + bizContent); |
||||
try { |
||||
AlipayClient alipayClient = AlipayUtils.initClient(); |
||||
AntMerchantExpandIndirectZftConsultRequest request = new AntMerchantExpandIndirectZftConsultRequest(); |
||||
request.setBizContent(bizContent); |
||||
AntMerchantExpandIndirectZftConsultResponse response = alipayClient.certificateExecute(request); |
||||
log.info("响应参数:" + response); |
||||
if (response.isSuccess()) { |
||||
return response.getOrderId(); |
||||
} |
||||
throw new Exception(response.getSubMsg()); |
||||
|
||||
} catch (Exception e) { |
||||
log.info("出现异常:" + e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); |
||||
|
||||
} finally { |
||||
log.info("========== END 商户创建 =========="); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 商户入驻进度查询 |
||||
* @param bizContent 进件参数 |
||||
* @return 申请单号 |
||||
* @throws Exception |
||||
*/ |
||||
public static List<ZftSubMerchantOrder> merchantIndirectQuery(String bizContent) { |
||||
log.info("========== START 商户入驻进度查询 =========="); |
||||
log.info("请求参数:" + bizContent); |
||||
try { |
||||
AlipayClient alipayClient = AlipayUtils.initClient(); |
||||
AntMerchantExpandIndirectZftorderQueryRequest request = new AntMerchantExpandIndirectZftorderQueryRequest(); |
||||
request.setBizContent(bizContent); |
||||
AntMerchantExpandIndirectZftorderQueryResponse response = alipayClient.certificateExecute(request); |
||||
log.info("响应参数:" + response); |
||||
if (response.isSuccess()) { |
||||
return response.getOrders(); |
||||
} |
||||
throw new Exception(response.getSubMsg()); |
||||
|
||||
} catch (Exception e) { |
||||
log.info("出现异常:" + e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); |
||||
|
||||
} finally { |
||||
log.info("========== END 商户入驻进度查询 =========="); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 商户结算信息修改 |
||||
* @param bizContent 参数 |
||||
* @return |
||||
* @throws Exception |
||||
*/ |
||||
public static String merchantIndirectSettlementModify(String bizContent) { |
||||
log.info("========== START 商户结算信息修改 =========="); |
||||
log.info("请求参数:" + bizContent); |
||||
try { |
||||
AlipayClient alipayClient = AlipayUtils.initClient(); |
||||
AntMerchantExpandIndirectZftSettlementmodifyRequest request = new AntMerchantExpandIndirectZftSettlementmodifyRequest (); |
||||
request.setBizContent(bizContent); |
||||
AntMerchantExpandIndirectZftSettlementmodifyResponse response = alipayClient.certificateExecute(request); |
||||
log.info("响应参数:" + response); |
||||
if (response.isSuccess()) { |
||||
return response.getOrderId(); |
||||
} |
||||
throw new Exception(response.getSubMsg()); |
||||
|
||||
} catch (Exception e) { |
||||
log.info("出现异常:" + e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); |
||||
|
||||
} finally { |
||||
log.info("========== END 商户结算信息修改 =========="); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 图片上传 |
||||
* @param fileUrl 本地路径 |
||||
* @return |
||||
* @throws Exception |
||||
*/ |
||||
public static String imageUpload(String fileUrl) { |
||||
log.info("========== START 图片上传 =========="); |
||||
log.info("请求参数:" + fileUrl); |
||||
try { |
||||
AlipayClient alipayClient = AlipayUtils.initClient(); |
||||
// 读取本地文件
|
||||
FileItem imageContent = new FileItem(fileUrl); |
||||
|
||||
// 截取文件格式
|
||||
String imageType = StringUtils.substringAfterLast(fileUrl, "."); |
||||
|
||||
AntMerchantExpandIndirectImageUploadRequest request = new AntMerchantExpandIndirectImageUploadRequest(); |
||||
request.setImageContent(imageContent); |
||||
request.setImageType(imageType); |
||||
AntMerchantExpandIndirectImageUploadResponse response = alipayClient.certificateExecute(request); |
||||
log.info("响应参数:" + response); |
||||
if (response.isSuccess()) { |
||||
return response.getImageId(); |
||||
} |
||||
throw new Exception(response.getSubMsg()); |
||||
|
||||
} catch (Exception e) { |
||||
log.info("出现异常:" + e); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getMessage()); |
||||
|
||||
} finally { |
||||
log.info("========== END 图片上传 =========="); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,51 @@ |
||||
package com.hfkj.channel.alipay.utils; |
||||
|
||||
import com.alipay.api.AlipayClient; |
||||
import com.alipay.api.AlipayConfig; |
||||
import com.alipay.api.DefaultAlipayClient; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
/** |
||||
* 支付宝配置 |
||||
* @className: AlipayConfig |
||||
* @author: HuRui |
||||
* @date: 2023/2/13 |
||||
**/ |
||||
public class AlipayUtils { |
||||
private final static String serverUrl = "https://openapi.alipay.com/gateway.do"; |
||||
private final static String appId = "2021003176605875"; |
||||
private final static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD8W2fFUHki5Qyt6m9LO00u6AoW/XjsLtVP1uvwYbRRcRDnTk3lTEAPcopULgqjUgMIIY7xaEan3EnVQbrV+OAXA2Xs0CmBTC5kR5zfZnytUameAmkJlo5ixAfT8om6gkKOTIm0PmqcW7WvcOZtHl28G8RXFH676YBnaCS58/j3w+N9vom4tqADcHLfg9HkhFnRn2mfXbvmasgXIIPSP5XgrirLoYz3YK7OXhChFHUaip675oTHMSGe/iYcaNXfOENpI2z8RDyGwXHVFojdLX45gRkS0odGPeskuMh27wfMf9BGfeGrSSs7xjcjtauG1g8fcRpnnW1aBUD5tA0C370DAgMBAAECggEAW0tCDkrfl/UfEifWnXPVp1uAkvKd9Wu39cs9zde64R+zSsq0OXjNUAlS68NAS/dWa3GggcsEjKOP/ltqGRCRGSI8lGB2M3V47wRNRzCPeDAr2aLrlvFlj2t1nYKHuvZ2133u70sJTImM/+wrIFy08mFlNU+PzbFap44wgyk074Sxdxh3tj1a6NRfLOiBFwqI54wxoXMtvbS+YJ4rTR2PWBtv3NQrGs2AvcNHhZHsnyRDaSz0RmJ+4ifi9rGhOhfSfAvn53+r+ycJ/5rTDqZ67TWd51LkO2KyqEkPqFzN7J8cZ3tnR5+Mmlkz3QPmDsCL1n5vmZO9n2pL7I/hiDDZIQKBgQD/W92MoX+tCqPht3CjO+XQPn0h3tYrUYdyIofKUu89fw2kHhwi+nagUqEu5mrEKyC8rhlNu+KQPCEutZeflgd6CIlsJV2EINfTh5hXWlRSMW6bumAHOTEBgEnu1jNkvRhw78S8K38Wa1JWvgh5b23Zrj4hbwgN2Mzo7q6YmR5HUQKBgQD8/ZxJIWVjTtePFJP0TXhYz9vFJfbSMGD8g9/p+bS8eoSSSwv8LUJiwXJi2SwJnXYOhkFssZecVrUiAK0rqgBPXbQfiFp3G2MtDPft1mexpOxD08/ZorSsoBWpo4kMEqoO26H/wCJRFmbJn2nvzErjDmBrJ8asNYppp8soVSDSEwKBgE2iy2/XJe8hPgQA9oDaVBuE9BxZGHohFnHv56LupgfnWelcsic8SNajaJfOvAUaK6DRuaW1isNZVKlT0l5Vib5jXAyCK7VhGt0X64wbTWmT19IGzu1DSQ/wxgmUHBnzl7u2WfTvsHrLdEQlEISDCT3WSNN3Y1Z6ZIopDvIcE2WRAoGBAM+uwiWmrLyhdIOYuPzMvAbsW9W0HLLf1D53Y9GHk79GNJ6DzQrvfJflhilvbp9WDBxQSlUYVQWaiIepVn+Jx0df/QYFwX4VlYzeIIm2gNlsMihcMTzQPNGZeS8ReOfYSpJ36r0w1PsMEMVjgGvCoZdTrgNJW+by7PVfMX+iopbRAoGAQo17bUcWI72CxMRVYkaqTbkbyGdLLHMUp9XoUhYsmzWGdvbwas9OF0tPEfIjfBIfue2yTWnQRDMV7X13uvt6nvZDpeGf+eLekd/GQMZZzoKHSqIP3NjQFC+Ao9QkGRYcRcEiWd7M9fwysKudQ78oSqdbGYmH+hejKDyS5mUNVCs="; |
||||
private final static String APP_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/appCertPublicKey_2021003176605875.crt"; |
||||
private final static String ALIPAY_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/alipayCertPublicKey_RSA2.crt"; |
||||
private final static String ALIPAY_ROOT_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/alipayRootCert.crt"; |
||||
|
||||
/** |
||||
* 初始化客户端请求 |
||||
* @return |
||||
*/ |
||||
public static AlipayClient initClient() throws Exception { |
||||
AlipayConfig alipayConfig = new AlipayConfig(); |
||||
// 设置网关地址
|
||||
alipayConfig.setServerUrl(serverUrl); |
||||
// 设置应用APPID
|
||||
alipayConfig.setAppId(appId); |
||||
// 设置应用私钥
|
||||
alipayConfig.setPrivateKey(APP_PRIVATE_KEY); |
||||
// 设置应用公钥证书路径
|
||||
alipayConfig.setAppCertPath(APP_CERT_PATH); |
||||
// 设置支付宝公钥证书路径
|
||||
alipayConfig.setAlipayPublicCertPath(ALIPAY_CERT_PATH); |
||||
// 设置支付宝根证书路径
|
||||
alipayConfig.setRootCertPath(ALIPAY_ROOT_CERT_PATH); |
||||
// 设置请求格式,固定值json
|
||||
alipayConfig.setFormat("json"); |
||||
// 设置字符集
|
||||
alipayConfig.setCharset("utf-8"); |
||||
// 设置签名类型
|
||||
alipayConfig.setSignType("RSA2"); |
||||
return new DefaultAlipayClient(alipayConfig); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,151 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingExample; |
||||
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 BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitSharingMapperExt { |
||||
@SelectProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="countByExample") |
||||
long countByExample(BsTradeOrderProfitSharingExample example); |
||||
|
||||
@DeleteProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsTradeOrderProfitSharingExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_trade_order_profit_sharing", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_trade_order_profit_sharing (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)", |
||||
"values (#{tradeOrderId,jdbcType=BIGINT}, #{tradeOrderNo,jdbcType=VARCHAR}, ", |
||||
"#{profitSharingOrderNo,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ", |
||||
"#{platformProfitSharingOrderNo,jdbcType=VARCHAR}, #{platformMerNo,jdbcType=VARCHAR}, ", |
||||
"#{platformTradeNo,jdbcType=VARCHAR}, #{platformAppid,jdbcType=VARCHAR}, ", |
||||
"#{ratio,jdbcType=DECIMAL}, #{profitSharingAmoun,jdbcType=DECIMAL}, ", |
||||
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{profitSharingTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsTradeOrderProfitSharing record); |
||||
|
||||
@InsertProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsTradeOrderProfitSharing record); |
||||
|
||||
@SelectProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", 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), |
||||
@Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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<BsTradeOrderProfitSharing> selectByExample(BsTradeOrderProfitSharingExample example); |
||||
|
||||
@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", |
||||
"from bs_trade_order_profit_sharing", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", 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), |
||||
@Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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) |
||||
}) |
||||
BsTradeOrderProfitSharing selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsTradeOrderProfitSharing record, @Param("example") BsTradeOrderProfitSharingExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsTradeOrderProfitSharing record, @Param("example") BsTradeOrderProfitSharingExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsTradeOrderProfitSharing record); |
||||
|
||||
@Update({ |
||||
"update bs_trade_order_profit_sharing", |
||||
"set trade_order_id = #{tradeOrderId,jdbcType=BIGINT},", |
||||
"trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR},", |
||||
"profit_sharing_order_no = #{profitSharingOrderNo,jdbcType=VARCHAR},", |
||||
"platform_type = #{platformType,jdbcType=INTEGER},", |
||||
"platform_profit_sharing_order_no = #{platformProfitSharingOrderNo,jdbcType=VARCHAR},", |
||||
"platform_mer_no = #{platformMerNo,jdbcType=VARCHAR},", |
||||
"platform_trade_no = #{platformTradeNo,jdbcType=VARCHAR},", |
||||
"platform_appid = #{platformAppid,jdbcType=VARCHAR},", |
||||
"ratio = #{ratio,jdbcType=DECIMAL},", |
||||
"profit_sharing_amoun = #{profitSharingAmoun,jdbcType=DECIMAL},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP},", |
||||
"finish_time = #{finishTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsTradeOrderProfitSharing record); |
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsTradeOrderProfitSharingMapperExt { |
||||
|
||||
@Select({" SELECT a.* FROM bs_trade_order_profit_sharing a " + |
||||
" LEFT JOIN bs_trade_order b on b.id = a.trade_order_id " + |
||||
" where b.`status` = 3 and a.`status` = 0 " + |
||||
" and a.create_time <= DATE_SUB(NOW(), INTERVAL 5 MINUTE) "}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", 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), |
||||
@Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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<BsTradeOrderProfitSharing> getNeedProfitSharingOrder(); |
||||
|
||||
|
||||
@Select({" SELECT a.* FROM bs_trade_order_profit_sharing a " + |
||||
" LEFT JOIN bs_trade_order b on b.id = a.trade_order_id " + |
||||
" where b.`status` = 3 and a.`status` = 1 " + |
||||
" and a.profit_sharing_time <= DATE_SUB(NOW(), INTERVAL 2 MINUTE) "}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", 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), |
||||
@Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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<BsTradeOrderProfitSharing> getNeedFinishProfitSharingOrder(); |
||||
} |
@ -0,0 +1,151 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample; |
||||
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 BsTradeOrderProfitSharingReceiverMapper extends BsTradeOrderProfitSharingReceiverMapperExt { |
||||
@SelectProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="countByExample") |
||||
long countByExample(BsTradeOrderProfitSharingReceiverExample example); |
||||
|
||||
@DeleteProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsTradeOrderProfitSharingReceiverExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_trade_order_profit_sharing_receiver", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_trade_order_profit_sharing_receiver (trade_order_profit_sharing_id, trade_order_id, ", |
||||
"trade_order_no, profit_sharing_amount, ", |
||||
"ratio, receiver_object_type, ", |
||||
"receiver_object_id, receiver_account, ", |
||||
"receiver_name, receiver_amount, ", |
||||
"`status`, create_time, ", |
||||
"profit_sharing_time, finish_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{tradeOrderProfitSharingId,jdbcType=BIGINT}, #{tradeOrderId,jdbcType=BIGINT}, ", |
||||
"#{tradeOrderNo,jdbcType=VARCHAR}, #{profitSharingAmount,jdbcType=DECIMAL}, ", |
||||
"#{ratio,jdbcType=DECIMAL}, #{receiverObjectType,jdbcType=INTEGER}, ", |
||||
"#{receiverObjectId,jdbcType=VARCHAR}, #{receiverAccount,jdbcType=VARCHAR}, ", |
||||
"#{receiverName,jdbcType=VARCHAR}, #{receiverAmount,jdbcType=DECIMAL}, ", |
||||
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{profitSharingTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsTradeOrderProfitSharingReceiver record); |
||||
|
||||
@InsertProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsTradeOrderProfitSharingReceiver record); |
||||
|
||||
@SelectProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_profit_sharing_id", property="tradeOrderProfitSharingId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="profit_sharing_amount", property="profitSharingAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="receiver_object_type", property="receiverObjectType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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<BsTradeOrderProfitSharingReceiver> selectByExample(BsTradeOrderProfitSharingReceiverExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, trade_order_profit_sharing_id, trade_order_id, trade_order_no, profit_sharing_amount, ", |
||||
"ratio, receiver_object_type, receiver_object_id, receiver_account, receiver_name, ", |
||||
"receiver_amount, `status`, create_time, profit_sharing_time, finish_time, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from bs_trade_order_profit_sharing_receiver", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="trade_order_profit_sharing_id", property="tradeOrderProfitSharingId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="profit_sharing_amount", property="profitSharingAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="receiver_object_type", property="receiverObjectType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="finish_time", property="finishTime", 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) |
||||
}) |
||||
BsTradeOrderProfitSharingReceiver selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsTradeOrderProfitSharingReceiver record, @Param("example") BsTradeOrderProfitSharingReceiverExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsTradeOrderProfitSharingReceiver record, @Param("example") BsTradeOrderProfitSharingReceiverExample example); |
||||
|
||||
@UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsTradeOrderProfitSharingReceiver record); |
||||
|
||||
@Update({ |
||||
"update bs_trade_order_profit_sharing_receiver", |
||||
"set trade_order_profit_sharing_id = #{tradeOrderProfitSharingId,jdbcType=BIGINT},", |
||||
"trade_order_id = #{tradeOrderId,jdbcType=BIGINT},", |
||||
"trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR},", |
||||
"profit_sharing_amount = #{profitSharingAmount,jdbcType=DECIMAL},", |
||||
"ratio = #{ratio,jdbcType=DECIMAL},", |
||||
"receiver_object_type = #{receiverObjectType,jdbcType=INTEGER},", |
||||
"receiver_object_id = #{receiverObjectId,jdbcType=VARCHAR},", |
||||
"receiver_account = #{receiverAccount,jdbcType=VARCHAR},", |
||||
"receiver_name = #{receiverName,jdbcType=VARCHAR},", |
||||
"receiver_amount = #{receiverAmount,jdbcType=DECIMAL},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP},", |
||||
"finish_time = #{finishTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsTradeOrderProfitSharingReceiver record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsTradeOrderProfitSharingReceiverMapperExt { |
||||
} |
@ -0,0 +1,416 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample.Criteria; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample.Criterion; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsTradeOrderProfitSharingReceiverSqlProvider { |
||||
|
||||
public String countByExample(BsTradeOrderProfitSharingReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_trade_order_profit_sharing_receiver"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsTradeOrderProfitSharingReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_trade_order_profit_sharing_receiver"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsTradeOrderProfitSharingReceiver record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_trade_order_profit_sharing_receiver"); |
||||
|
||||
if (record.getTradeOrderProfitSharingId() != null) { |
||||
sql.VALUES("trade_order_profit_sharing_id", "#{tradeOrderProfitSharingId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.VALUES("trade_order_id", "#{tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.VALUES("trade_order_no", "#{tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmount() != null) { |
||||
sql.VALUES("profit_sharing_amount", "#{profitSharingAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.VALUES("ratio", "#{ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectType() != null) { |
||||
sql.VALUES("receiver_object_type", "#{receiverObjectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.VALUES("receiver_object_id", "#{receiverObjectId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.VALUES("receiver_account", "#{receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.VALUES("receiver_name", "#{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAmount() != null) { |
||||
sql.VALUES("receiver_amount", "#{receiverAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingTime() != null) { |
||||
sql.VALUES("profit_sharing_time", "#{profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.VALUES("finish_time", "#{finishTime,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(BsTradeOrderProfitSharingReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("trade_order_profit_sharing_id"); |
||||
sql.SELECT("trade_order_id"); |
||||
sql.SELECT("trade_order_no"); |
||||
sql.SELECT("profit_sharing_amount"); |
||||
sql.SELECT("ratio"); |
||||
sql.SELECT("receiver_object_type"); |
||||
sql.SELECT("receiver_object_id"); |
||||
sql.SELECT("receiver_account"); |
||||
sql.SELECT("receiver_name"); |
||||
sql.SELECT("receiver_amount"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("profit_sharing_time"); |
||||
sql.SELECT("finish_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_trade_order_profit_sharing_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) { |
||||
BsTradeOrderProfitSharingReceiver record = (BsTradeOrderProfitSharingReceiver) parameter.get("record"); |
||||
BsTradeOrderProfitSharingReceiverExample example = (BsTradeOrderProfitSharingReceiverExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing_receiver"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderProfitSharingId() != null) { |
||||
sql.SET("trade_order_profit_sharing_id = #{record.tradeOrderProfitSharingId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.SET("trade_order_no = #{record.tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmount() != null) { |
||||
sql.SET("profit_sharing_amount = #{record.profitSharingAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectType() != null) { |
||||
sql.SET("receiver_object_type = #{record.receiverObjectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAmount() != null) { |
||||
sql.SET("receiver_amount = #{record.receiverAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
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.getProfitSharingTime() != null) { |
||||
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing_receiver"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("trade_order_profit_sharing_id = #{record.tradeOrderProfitSharingId,jdbcType=BIGINT}"); |
||||
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}"); |
||||
sql.SET("trade_order_no = #{record.tradeOrderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("profit_sharing_amount = #{record.profitSharingAmount,jdbcType=DECIMAL}"); |
||||
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}"); |
||||
sql.SET("receiver_object_type = #{record.receiverObjectType,jdbcType=INTEGER}"); |
||||
sql.SET("receiver_object_id = #{record.receiverObjectId,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_account = #{record.receiverAccount,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_amount = #{record.receiverAmount,jdbcType=DECIMAL}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("finish_time = #{record.finishTime,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}"); |
||||
|
||||
BsTradeOrderProfitSharingReceiverExample example = (BsTradeOrderProfitSharingReceiverExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsTradeOrderProfitSharingReceiver record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing_receiver"); |
||||
|
||||
if (record.getTradeOrderProfitSharingId() != null) { |
||||
sql.SET("trade_order_profit_sharing_id = #{tradeOrderProfitSharingId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.SET("trade_order_id = #{tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.SET("trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmount() != null) { |
||||
sql.SET("profit_sharing_amount = #{profitSharingAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.SET("ratio = #{ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectType() != null) { |
||||
sql.SET("receiver_object_type = #{receiverObjectType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getReceiverObjectId() != null) { |
||||
sql.SET("receiver_object_id = #{receiverObjectId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAccount() != null) { |
||||
sql.SET("receiver_account = #{receiverAccount,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverAmount() != null) { |
||||
sql.SET("receiver_amount = #{receiverAmount,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingTime() != null) { |
||||
sql.SET("profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{finishTime,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, BsTradeOrderProfitSharingReceiverExample 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,416 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingExample.Criteria; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingExample.Criterion; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsTradeOrderProfitSharingSqlProvider { |
||||
|
||||
public String countByExample(BsTradeOrderProfitSharingExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_trade_order_profit_sharing"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsTradeOrderProfitSharingExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_trade_order_profit_sharing"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsTradeOrderProfitSharing record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_trade_order_profit_sharing"); |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.VALUES("trade_order_id", "#{tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.VALUES("trade_order_no", "#{tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingOrderNo() != null) { |
||||
sql.VALUES("profit_sharing_order_no", "#{profitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformProfitSharingOrderNo() != null) { |
||||
sql.VALUES("platform_profit_sharing_order_no", "#{platformProfitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformMerNo() != null) { |
||||
sql.VALUES("platform_mer_no", "#{platformMerNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformTradeNo() != null) { |
||||
sql.VALUES("platform_trade_no", "#{platformTradeNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformAppid() != null) { |
||||
sql.VALUES("platform_appid", "#{platformAppid,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.VALUES("ratio", "#{ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmoun() != null) { |
||||
sql.VALUES("profit_sharing_amoun", "#{profitSharingAmoun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingTime() != null) { |
||||
sql.VALUES("profit_sharing_time", "#{profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.VALUES("finish_time", "#{finishTime,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(BsTradeOrderProfitSharingExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("trade_order_id"); |
||||
sql.SELECT("trade_order_no"); |
||||
sql.SELECT("profit_sharing_order_no"); |
||||
sql.SELECT("platform_type"); |
||||
sql.SELECT("platform_profit_sharing_order_no"); |
||||
sql.SELECT("platform_mer_no"); |
||||
sql.SELECT("platform_trade_no"); |
||||
sql.SELECT("platform_appid"); |
||||
sql.SELECT("ratio"); |
||||
sql.SELECT("profit_sharing_amoun"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("profit_sharing_time"); |
||||
sql.SELECT("finish_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_trade_order_profit_sharing"); |
||||
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) { |
||||
BsTradeOrderProfitSharing record = (BsTradeOrderProfitSharing) parameter.get("record"); |
||||
BsTradeOrderProfitSharingExample example = (BsTradeOrderProfitSharingExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.SET("trade_order_no = #{record.tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingOrderNo() != null) { |
||||
sql.SET("profit_sharing_order_no = #{record.profitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformProfitSharingOrderNo() != null) { |
||||
sql.SET("platform_profit_sharing_order_no = #{record.platformProfitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformMerNo() != null) { |
||||
sql.SET("platform_mer_no = #{record.platformMerNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformTradeNo() != null) { |
||||
sql.SET("platform_trade_no = #{record.platformTradeNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformAppid() != null) { |
||||
sql.SET("platform_appid = #{record.platformAppid,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmoun() != null) { |
||||
sql.SET("profit_sharing_amoun = #{record.profitSharingAmoun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
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.getProfitSharingTime() != null) { |
||||
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{record.finishTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("trade_order_id = #{record.tradeOrderId,jdbcType=BIGINT}"); |
||||
sql.SET("trade_order_no = #{record.tradeOrderNo,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}"); |
||||
sql.SET("platform_mer_no = #{record.platformMerNo,jdbcType=VARCHAR}"); |
||||
sql.SET("platform_trade_no = #{record.platformTradeNo,jdbcType=VARCHAR}"); |
||||
sql.SET("platform_appid = #{record.platformAppid,jdbcType=VARCHAR}"); |
||||
sql.SET("ratio = #{record.ratio,jdbcType=DECIMAL}"); |
||||
sql.SET("profit_sharing_amoun = #{record.profitSharingAmoun,jdbcType=DECIMAL}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("profit_sharing_time = #{record.profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("finish_time = #{record.finishTime,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}"); |
||||
|
||||
BsTradeOrderProfitSharingExample example = (BsTradeOrderProfitSharingExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsTradeOrderProfitSharing record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_trade_order_profit_sharing"); |
||||
|
||||
if (record.getTradeOrderId() != null) { |
||||
sql.SET("trade_order_id = #{tradeOrderId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getTradeOrderNo() != null) { |
||||
sql.SET("trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingOrderNo() != null) { |
||||
sql.SET("profit_sharing_order_no = #{profitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformProfitSharingOrderNo() != null) { |
||||
sql.SET("platform_profit_sharing_order_no = #{platformProfitSharingOrderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformMerNo() != null) { |
||||
sql.SET("platform_mer_no = #{platformMerNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformTradeNo() != null) { |
||||
sql.SET("platform_trade_no = #{platformTradeNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getPlatformAppid() != null) { |
||||
sql.SET("platform_appid = #{platformAppid,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRatio() != null) { |
||||
sql.SET("ratio = #{ratio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingAmoun() != null) { |
||||
sql.SET("profit_sharing_amoun = #{profitSharingAmoun,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getProfitSharingTime() != null) { |
||||
sql.SET("profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getFinishTime() != null) { |
||||
sql.SET("finish_time = #{finishTime,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, BsTradeOrderProfitSharingExample 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,329 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_trade_order_profit_sharing |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsTradeOrderProfitSharing implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 交易id |
||||
*/ |
||||
private Long tradeOrderId; |
||||
|
||||
/** |
||||
* 交易订单号 |
||||
*/ |
||||
private String tradeOrderNo; |
||||
|
||||
/** |
||||
* 分账单号 |
||||
*/ |
||||
private String profitSharingOrderNo; |
||||
|
||||
/** |
||||
* 平台类型 1:拉卡拉 |
||||
*/ |
||||
private Integer platformType; |
||||
|
||||
/** |
||||
* 平台分账单号 |
||||
*/ |
||||
private String platformProfitSharingOrderNo; |
||||
|
||||
/** |
||||
* 平台商户号 |
||||
*/ |
||||
private String platformMerNo; |
||||
|
||||
/** |
||||
* 平台流水号 |
||||
*/ |
||||
private String platformTradeNo; |
||||
|
||||
/** |
||||
* 平台appid |
||||
*/ |
||||
private String platformAppid; |
||||
|
||||
/** |
||||
* 分账比例 单位:% |
||||
*/ |
||||
private BigDecimal ratio; |
||||
|
||||
/** |
||||
* 分账金额 |
||||
*/ |
||||
private BigDecimal profitSharingAmoun; |
||||
|
||||
/** |
||||
* 分账状态 0:未分账 1:已分账 2:已完成 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 分账时间 |
||||
*/ |
||||
private Date profitSharingTime; |
||||
|
||||
/** |
||||
* 完成时间 |
||||
*/ |
||||
private Date finishTime; |
||||
|
||||
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 getTradeOrderId() { |
||||
return tradeOrderId; |
||||
} |
||||
|
||||
public void setTradeOrderId(Long tradeOrderId) { |
||||
this.tradeOrderId = tradeOrderId; |
||||
} |
||||
|
||||
public String getTradeOrderNo() { |
||||
return tradeOrderNo; |
||||
} |
||||
|
||||
public void setTradeOrderNo(String tradeOrderNo) { |
||||
this.tradeOrderNo = tradeOrderNo; |
||||
} |
||||
|
||||
public String getProfitSharingOrderNo() { |
||||
return profitSharingOrderNo; |
||||
} |
||||
|
||||
public void setProfitSharingOrderNo(String profitSharingOrderNo) { |
||||
this.profitSharingOrderNo = profitSharingOrderNo; |
||||
} |
||||
|
||||
public Integer getPlatformType() { |
||||
return platformType; |
||||
} |
||||
|
||||
public void setPlatformType(Integer platformType) { |
||||
this.platformType = platformType; |
||||
} |
||||
|
||||
public String getPlatformProfitSharingOrderNo() { |
||||
return platformProfitSharingOrderNo; |
||||
} |
||||
|
||||
public void setPlatformProfitSharingOrderNo(String platformProfitSharingOrderNo) { |
||||
this.platformProfitSharingOrderNo = platformProfitSharingOrderNo; |
||||
} |
||||
|
||||
public String getPlatformMerNo() { |
||||
return platformMerNo; |
||||
} |
||||
|
||||
public void setPlatformMerNo(String platformMerNo) { |
||||
this.platformMerNo = platformMerNo; |
||||
} |
||||
|
||||
public String getPlatformTradeNo() { |
||||
return platformTradeNo; |
||||
} |
||||
|
||||
public void setPlatformTradeNo(String platformTradeNo) { |
||||
this.platformTradeNo = platformTradeNo; |
||||
} |
||||
|
||||
public String getPlatformAppid() { |
||||
return platformAppid; |
||||
} |
||||
|
||||
public void setPlatformAppid(String platformAppid) { |
||||
this.platformAppid = platformAppid; |
||||
} |
||||
|
||||
public BigDecimal getRatio() { |
||||
return ratio; |
||||
} |
||||
|
||||
public void setRatio(BigDecimal ratio) { |
||||
this.ratio = ratio; |
||||
} |
||||
|
||||
public BigDecimal getProfitSharingAmoun() { |
||||
return profitSharingAmoun; |
||||
} |
||||
|
||||
public void setProfitSharingAmoun(BigDecimal profitSharingAmoun) { |
||||
this.profitSharingAmoun = profitSharingAmoun; |
||||
} |
||||
|
||||
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 getProfitSharingTime() { |
||||
return profitSharingTime; |
||||
} |
||||
|
||||
public void setProfitSharingTime(Date profitSharingTime) { |
||||
this.profitSharingTime = profitSharingTime; |
||||
} |
||||
|
||||
public Date getFinishTime() { |
||||
return finishTime; |
||||
} |
||||
|
||||
public void setFinishTime(Date finishTime) { |
||||
this.finishTime = finishTime; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsTradeOrderProfitSharing other = (BsTradeOrderProfitSharing) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getTradeOrderId() == null ? other.getTradeOrderId() == null : this.getTradeOrderId().equals(other.getTradeOrderId())) |
||||
&& (this.getTradeOrderNo() == null ? other.getTradeOrderNo() == null : this.getTradeOrderNo().equals(other.getTradeOrderNo())) |
||||
&& (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())) |
||||
&& (this.getPlatformMerNo() == null ? other.getPlatformMerNo() == null : this.getPlatformMerNo().equals(other.getPlatformMerNo())) |
||||
&& (this.getPlatformTradeNo() == null ? other.getPlatformTradeNo() == null : this.getPlatformTradeNo().equals(other.getPlatformTradeNo())) |
||||
&& (this.getPlatformAppid() == null ? other.getPlatformAppid() == null : this.getPlatformAppid().equals(other.getPlatformAppid())) |
||||
&& (this.getRatio() == null ? other.getRatio() == null : this.getRatio().equals(other.getRatio())) |
||||
&& (this.getProfitSharingAmoun() == null ? other.getProfitSharingAmoun() == null : this.getProfitSharingAmoun().equals(other.getProfitSharingAmoun())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getProfitSharingTime() == null ? other.getProfitSharingTime() == null : this.getProfitSharingTime().equals(other.getProfitSharingTime())) |
||||
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) |
||||
&& (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 + ((getTradeOrderId() == null) ? 0 : getTradeOrderId().hashCode()); |
||||
result = prime * result + ((getTradeOrderNo() == null) ? 0 : getTradeOrderNo().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()); |
||||
result = prime * result + ((getPlatformMerNo() == null) ? 0 : getPlatformMerNo().hashCode()); |
||||
result = prime * result + ((getPlatformTradeNo() == null) ? 0 : getPlatformTradeNo().hashCode()); |
||||
result = prime * result + ((getPlatformAppid() == null) ? 0 : getPlatformAppid().hashCode()); |
||||
result = prime * result + ((getRatio() == null) ? 0 : getRatio().hashCode()); |
||||
result = prime * result + ((getProfitSharingAmoun() == null) ? 0 : getProfitSharingAmoun().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getProfitSharingTime() == null) ? 0 : getProfitSharingTime().hashCode()); |
||||
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().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(", tradeOrderId=").append(tradeOrderId); |
||||
sb.append(", tradeOrderNo=").append(tradeOrderNo); |
||||
sb.append(", profitSharingOrderNo=").append(profitSharingOrderNo); |
||||
sb.append(", platformType=").append(platformType); |
||||
sb.append(", platformProfitSharingOrderNo=").append(platformProfitSharingOrderNo); |
||||
sb.append(", platformMerNo=").append(platformMerNo); |
||||
sb.append(", platformTradeNo=").append(platformTradeNo); |
||||
sb.append(", platformAppid=").append(platformAppid); |
||||
sb.append(", ratio=").append(ratio); |
||||
sb.append(", profitSharingAmoun=").append(profitSharingAmoun); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", profitSharingTime=").append(profitSharingTime); |
||||
sb.append(", finishTime=").append(finishTime); |
||||
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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,329 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_trade_order_profit_sharing_receiver |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsTradeOrderProfitSharingReceiver implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 交易分账记录id |
||||
*/ |
||||
private Long tradeOrderProfitSharingId; |
||||
|
||||
/** |
||||
* 交易id |
||||
*/ |
||||
private Long tradeOrderId; |
||||
|
||||
/** |
||||
* 交易订单号 |
||||
*/ |
||||
private String tradeOrderNo; |
||||
|
||||
/** |
||||
* 分账金额 |
||||
*/ |
||||
private BigDecimal profitSharingAmount; |
||||
|
||||
/** |
||||
* 分账比例 单位:% |
||||
*/ |
||||
private BigDecimal ratio; |
||||
|
||||
/** |
||||
* 分账接收方类型 1. 运营公司 2. 分公司 3. 代理商 |
||||
*/ |
||||
private Integer receiverObjectType; |
||||
|
||||
/** |
||||
* 分账接收方id |
||||
*/ |
||||
private String receiverObjectId; |
||||
|
||||
/** |
||||
* 分账接收方账户 |
||||
*/ |
||||
private String receiverAccount; |
||||
|
||||
/** |
||||
* 分账接收方姓名 |
||||
*/ |
||||
private String receiverName; |
||||
|
||||
/** |
||||
* 分账接收金额 |
||||
*/ |
||||
private BigDecimal receiverAmount; |
||||
|
||||
/** |
||||
* 分账状态 0:未分账 1:已分账 2:已完成 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 分账时间 |
||||
*/ |
||||
private Date profitSharingTime; |
||||
|
||||
/** |
||||
* 完成时间 |
||||
*/ |
||||
private Date finishTime; |
||||
|
||||
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 getTradeOrderProfitSharingId() { |
||||
return tradeOrderProfitSharingId; |
||||
} |
||||
|
||||
public void setTradeOrderProfitSharingId(Long tradeOrderProfitSharingId) { |
||||
this.tradeOrderProfitSharingId = tradeOrderProfitSharingId; |
||||
} |
||||
|
||||
public Long getTradeOrderId() { |
||||
return tradeOrderId; |
||||
} |
||||
|
||||
public void setTradeOrderId(Long tradeOrderId) { |
||||
this.tradeOrderId = tradeOrderId; |
||||
} |
||||
|
||||
public String getTradeOrderNo() { |
||||
return tradeOrderNo; |
||||
} |
||||
|
||||
public void setTradeOrderNo(String tradeOrderNo) { |
||||
this.tradeOrderNo = tradeOrderNo; |
||||
} |
||||
|
||||
public BigDecimal getProfitSharingAmount() { |
||||
return profitSharingAmount; |
||||
} |
||||
|
||||
public void setProfitSharingAmount(BigDecimal profitSharingAmount) { |
||||
this.profitSharingAmount = profitSharingAmount; |
||||
} |
||||
|
||||
public BigDecimal getRatio() { |
||||
return ratio; |
||||
} |
||||
|
||||
public void setRatio(BigDecimal ratio) { |
||||
this.ratio = ratio; |
||||
} |
||||
|
||||
public Integer getReceiverObjectType() { |
||||
return receiverObjectType; |
||||
} |
||||
|
||||
public void setReceiverObjectType(Integer receiverObjectType) { |
||||
this.receiverObjectType = receiverObjectType; |
||||
} |
||||
|
||||
public String getReceiverObjectId() { |
||||
return receiverObjectId; |
||||
} |
||||
|
||||
public void setReceiverObjectId(String receiverObjectId) { |
||||
this.receiverObjectId = receiverObjectId; |
||||
} |
||||
|
||||
public String getReceiverAccount() { |
||||
return receiverAccount; |
||||
} |
||||
|
||||
public void setReceiverAccount(String receiverAccount) { |
||||
this.receiverAccount = receiverAccount; |
||||
} |
||||
|
||||
public String getReceiverName() { |
||||
return receiverName; |
||||
} |
||||
|
||||
public void setReceiverName(String receiverName) { |
||||
this.receiverName = receiverName; |
||||
} |
||||
|
||||
public BigDecimal getReceiverAmount() { |
||||
return receiverAmount; |
||||
} |
||||
|
||||
public void setReceiverAmount(BigDecimal receiverAmount) { |
||||
this.receiverAmount = receiverAmount; |
||||
} |
||||
|
||||
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 getProfitSharingTime() { |
||||
return profitSharingTime; |
||||
} |
||||
|
||||
public void setProfitSharingTime(Date profitSharingTime) { |
||||
this.profitSharingTime = profitSharingTime; |
||||
} |
||||
|
||||
public Date getFinishTime() { |
||||
return finishTime; |
||||
} |
||||
|
||||
public void setFinishTime(Date finishTime) { |
||||
this.finishTime = finishTime; |
||||
} |
||||
|
||||
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; |
||||
} |
||||
BsTradeOrderProfitSharingReceiver other = (BsTradeOrderProfitSharingReceiver) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getTradeOrderProfitSharingId() == null ? other.getTradeOrderProfitSharingId() == null : this.getTradeOrderProfitSharingId().equals(other.getTradeOrderProfitSharingId())) |
||||
&& (this.getTradeOrderId() == null ? other.getTradeOrderId() == null : this.getTradeOrderId().equals(other.getTradeOrderId())) |
||||
&& (this.getTradeOrderNo() == null ? other.getTradeOrderNo() == null : this.getTradeOrderNo().equals(other.getTradeOrderNo())) |
||||
&& (this.getProfitSharingAmount() == null ? other.getProfitSharingAmount() == null : this.getProfitSharingAmount().equals(other.getProfitSharingAmount())) |
||||
&& (this.getRatio() == null ? other.getRatio() == null : this.getRatio().equals(other.getRatio())) |
||||
&& (this.getReceiverObjectType() == null ? other.getReceiverObjectType() == null : this.getReceiverObjectType().equals(other.getReceiverObjectType())) |
||||
&& (this.getReceiverObjectId() == null ? other.getReceiverObjectId() == null : this.getReceiverObjectId().equals(other.getReceiverObjectId())) |
||||
&& (this.getReceiverAccount() == null ? other.getReceiverAccount() == null : this.getReceiverAccount().equals(other.getReceiverAccount())) |
||||
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName())) |
||||
&& (this.getReceiverAmount() == null ? other.getReceiverAmount() == null : this.getReceiverAmount().equals(other.getReceiverAmount())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getProfitSharingTime() == null ? other.getProfitSharingTime() == null : this.getProfitSharingTime().equals(other.getProfitSharingTime())) |
||||
&& (this.getFinishTime() == null ? other.getFinishTime() == null : this.getFinishTime().equals(other.getFinishTime())) |
||||
&& (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 + ((getTradeOrderProfitSharingId() == null) ? 0 : getTradeOrderProfitSharingId().hashCode()); |
||||
result = prime * result + ((getTradeOrderId() == null) ? 0 : getTradeOrderId().hashCode()); |
||||
result = prime * result + ((getTradeOrderNo() == null) ? 0 : getTradeOrderNo().hashCode()); |
||||
result = prime * result + ((getProfitSharingAmount() == null) ? 0 : getProfitSharingAmount().hashCode()); |
||||
result = prime * result + ((getRatio() == null) ? 0 : getRatio().hashCode()); |
||||
result = prime * result + ((getReceiverObjectType() == null) ? 0 : getReceiverObjectType().hashCode()); |
||||
result = prime * result + ((getReceiverObjectId() == null) ? 0 : getReceiverObjectId().hashCode()); |
||||
result = prime * result + ((getReceiverAccount() == null) ? 0 : getReceiverAccount().hashCode()); |
||||
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode()); |
||||
result = prime * result + ((getReceiverAmount() == null) ? 0 : getReceiverAmount().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getProfitSharingTime() == null) ? 0 : getProfitSharingTime().hashCode()); |
||||
result = prime * result + ((getFinishTime() == null) ? 0 : getFinishTime().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(", tradeOrderProfitSharingId=").append(tradeOrderProfitSharingId); |
||||
sb.append(", tradeOrderId=").append(tradeOrderId); |
||||
sb.append(", tradeOrderNo=").append(tradeOrderNo); |
||||
sb.append(", profitSharingAmount=").append(profitSharingAmount); |
||||
sb.append(", ratio=").append(ratio); |
||||
sb.append(", receiverObjectType=").append(receiverObjectType); |
||||
sb.append(", receiverObjectId=").append(receiverObjectId); |
||||
sb.append(", receiverAccount=").append(receiverAccount); |
||||
sb.append(", receiverName=").append(receiverName); |
||||
sb.append(", receiverAmount=").append(receiverAmount); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", profitSharingTime=").append(profitSharingTime); |
||||
sb.append(", finishTime=").append(finishTime); |
||||
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(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,29 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsTradeOrderProfitSharingReceiverService |
||||
* @author: HuRui |
||||
* @date: 2023/2/22 |
||||
**/ |
||||
public interface BsTradeOrderProfitSharingReceiverService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param profitSharingReceiver |
||||
*/ |
||||
void editData(BsTradeOrderProfitSharingReceiver profitSharingReceiver); |
||||
|
||||
/** |
||||
* 查询分账列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsTradeOrderProfitSharingReceiver> getProfitSharingList(Map<String, Object> param); |
||||
|
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsTradeOrder; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 交易订单分账记录 |
||||
* @className: BsTradeOrderProfitSharingService |
||||
* @author: HuRui |
||||
* @date: 2023/2/22 |
||||
**/ |
||||
public interface BsTradeOrderProfitSharingService { |
||||
|
||||
/** |
||||
* 编辑数据 |
||||
* @param profitSharing |
||||
*/ |
||||
void editData(BsTradeOrderProfitSharing profitSharing); |
||||
|
||||
/** |
||||
* 创建分账 |
||||
* @param tradeOrder |
||||
*/ |
||||
void createProfitSharing(BsTradeOrder tradeOrder); |
||||
|
||||
/** |
||||
* 获取需要分账的订单 |
||||
* @return |
||||
*/ |
||||
List<BsTradeOrderProfitSharing> getNeedProfitSharingOrder(); |
||||
|
||||
/** |
||||
* 获取需要完结的订单 |
||||
* @return |
||||
*/ |
||||
List<BsTradeOrderProfitSharing> getNeedFinishProfitSharingOrder(); |
||||
} |
@ -0,0 +1,55 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsTradeOrderProfitSharingMapper; |
||||
import com.hfkj.dao.BsTradeOrderProfitSharingReceiverMapper; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingExample; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample; |
||||
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsTradeOrderProfitSharingReceiverServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/2/22 |
||||
**/ |
||||
@Service("tradeOrderProfitSharingReceiverService") |
||||
public class BsTradeOrderProfitSharingReceiverServiceImpl implements BsTradeOrderProfitSharingReceiverService { |
||||
|
||||
@Resource |
||||
private BsTradeOrderProfitSharingReceiverMapper tradeOrderProfitSharingReceiverMapper; |
||||
|
||||
@Override |
||||
public void editData(BsTradeOrderProfitSharingReceiver profitSharingReceiver) { |
||||
if (profitSharingReceiver.getId() == null) { |
||||
profitSharingReceiver.setCreateTime(new Date()); |
||||
profitSharingReceiver.setStatus(0); |
||||
tradeOrderProfitSharingReceiverMapper.insert(profitSharingReceiver); |
||||
} else { |
||||
tradeOrderProfitSharingReceiverMapper.updateByPrimaryKeySelective(profitSharingReceiver); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<BsTradeOrderProfitSharingReceiver> getProfitSharingList(Map<String, Object> param) { |
||||
BsTradeOrderProfitSharingReceiverExample example = new BsTradeOrderProfitSharingReceiverExample(); |
||||
BsTradeOrderProfitSharingReceiverExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(param, "tradeOrderProfitSharingId") != null) { |
||||
criteria.andTradeOrderProfitSharingIdEqualTo(MapUtils.getLong(param, "tradeOrderProfitSharingId")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); |
||||
} |
||||
|
||||
return tradeOrderProfitSharingReceiverMapper.selectByExample(example); |
||||
} |
||||
} |
@ -0,0 +1,126 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
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.IDGenerator; |
||||
import com.hfkj.dao.BsTradeOrderProfitSharingMapper; |
||||
import com.hfkj.entity.BsMerPlatformNoRate; |
||||
import com.hfkj.entity.BsTradeOrder; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharing; |
||||
import com.hfkj.entity.BsTradeOrderProfitSharingReceiver; |
||||
import com.hfkj.service.BsMerPlatformNoRateService; |
||||
import com.hfkj.service.BsTradeOrderProfitSharingReceiverService; |
||||
import com.hfkj.service.BsTradeOrderProfitSharingService; |
||||
import com.hfkj.service.BsTradeOrderService; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import com.hfkj.sysenum.ProfitSharingReceiverObjectType; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Propagation; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsTradeOrderProfitSharingServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/2/22 |
||||
**/ |
||||
@Service("tradeOrderProfitSharingService") |
||||
public class BsTradeOrderProfitSharingServiceImpl implements BsTradeOrderProfitSharingService { |
||||
|
||||
@Resource |
||||
private BsTradeOrderProfitSharingMapper tradeOrderProfitSharingMapper; |
||||
|
||||
@Resource |
||||
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; |
||||
|
||||
@Resource |
||||
private BsTradeOrderService tradeOrderService; |
||||
|
||||
@Resource |
||||
private BsMerPlatformNoRateService merPlatformNoRateService; |
||||
|
||||
@Override |
||||
public void editData(BsTradeOrderProfitSharing profitSharing) { |
||||
if (profitSharing.getId() == null) { |
||||
profitSharing.setCreateTime(new Date()); |
||||
profitSharing.setStatus(0); |
||||
tradeOrderProfitSharingMapper.insert(profitSharing); |
||||
} else { |
||||
tradeOrderProfitSharingMapper.updateByPrimaryKeySelective(profitSharing); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
@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.setProfitSharingOrderNo("1530"+ DateUtil.format(new Date(), DateUtil.YMDHMS) + IDGenerator.nextId(10)); |
||||
tradeOrderProfitSharing.setTradeOrderId(tradeOrder.getId()); |
||||
tradeOrderProfitSharing.setTradeOrderNo(tradeOrder.getOutTradeNo()); |
||||
tradeOrderProfitSharing.setPlatformType(tradeOrder.getPlatformType()); |
||||
tradeOrderProfitSharing.setPlatformMerNo(tradeOrder.getPlatformMerNo()); |
||||
tradeOrderProfitSharing.setPlatformTradeNo(tradeOrder.getPlatformTradeNo()); |
||||
tradeOrderProfitSharing.setPlatformAppid(tradeOrder.getPlatformAppid()); |
||||
editData(tradeOrderProfitSharing); |
||||
|
||||
// 平台手续费
|
||||
BigDecimal platformServiceCharge = null; |
||||
if (tradeOrder.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) { |
||||
platformServiceCharge = new BigDecimal("0.002"); |
||||
} |
||||
|
||||
// 平台手续费 (四舍五入向上取取整)
|
||||
BigDecimal platformServiceChargeAmount = tradeOrder.getTradeActualAmount().multiply(platformServiceCharge).setScale(2, BigDecimal.ROUND_HALF_DOWN); |
||||
// 实际到账金额 = 交易金额 - 平台手续费
|
||||
BigDecimal amount = tradeOrder.getTradeActualAmount().subtract(platformServiceChargeAmount); |
||||
|
||||
for (ProfitSharingReceiverObjectType receiverObjectType : ProfitSharingReceiverObjectType.getDataList()) { |
||||
if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.operating.getType())) { |
||||
|
||||
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.company.getType())) { |
||||
// 公司抽成
|
||||
BigDecimal companyAmount = amount.multiply(rate.getRatePct()).setScale(2, BigDecimal.ROUND_HALF_DOWN); |
||||
BsTradeOrderProfitSharingReceiver profitSharingReceiver = new BsTradeOrderProfitSharingReceiver(); |
||||
profitSharingReceiver.setTradeOrderProfitSharingId(tradeOrderProfitSharing.getId()); |
||||
profitSharingReceiver.setTradeOrderId(tradeOrder.getId()); |
||||
profitSharingReceiver.setTradeOrderNo(tradeOrder.getOutTradeNo()); |
||||
profitSharingReceiver.setProfitSharingAmount(amount); |
||||
profitSharingReceiver.setRatio(rate.getRatePct()); |
||||
profitSharingReceiver.setReceiverObjectType(2); |
||||
profitSharingReceiver.setReceiverObjectId(tradeOrder.getCompanyId()!=null?tradeOrder.getCompanyId().toString():null); |
||||
profitSharingReceiver.setReceiverAccount("1603942866"); |
||||
profitSharingReceiver.setReceiverName("惠昕石化"); |
||||
profitSharingReceiver.setReceiverAmount(companyAmount); |
||||
tradeOrderProfitSharingReceiverService.editData(profitSharingReceiver); |
||||
|
||||
} else if (receiverObjectType.getType().equals(ProfitSharingReceiverObjectType.agent.getType())) { |
||||
|
||||
} |
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public List<BsTradeOrderProfitSharing> getNeedProfitSharingOrder() { |
||||
return tradeOrderProfitSharingMapper.getNeedProfitSharingOrder(); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsTradeOrderProfitSharing> getNeedFinishProfitSharingOrder() { |
||||
return tradeOrderProfitSharingMapper.getNeedFinishProfitSharingOrder(); |
||||
} |
||||
} |
@ -0,0 +1,49 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.EnumSet; |
||||
|
||||
/** |
||||
* @className: TradeOrderProfitSharingReceiverObjectType |
||||
* @author: HuRui |
||||
* @date: 2023/2/22 |
||||
**/ |
||||
public enum ProfitSharingReceiverObjectType { |
||||
operating(1, "运营公司"), |
||||
company(2, "公司"), |
||||
|
||||
agent(3, "代理商"), |
||||
; |
||||
|
||||
private Integer type; |
||||
|
||||
private String name; |
||||
|
||||
ProfitSharingReceiverObjectType(int type, String name) { |
||||
this.type = type; |
||||
this.name = name; |
||||
} |
||||
|
||||
/** |
||||
* 获取枚举数据 |
||||
* @return |
||||
*/ |
||||
public static EnumSet<ProfitSharingReceiverObjectType> getDataList() { |
||||
return EnumSet.allOf(ProfitSharingReceiverObjectType.class); |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
@ -1,19 +1,26 @@ |
||||
obs_bucket_name=xuan-pay-private |
||||
obs_url=https://xuan-pay-private.obs.cn-southwest-2.myhuaweicloud.com |
||||
qr_code_data_url=https://paycs.dctpay.com/scanPay |
||||
qr_code_url=https://paycs.dctpay.com/filesystem/payQrCode/ |
||||
obs_end_point=https://obs.cn-east-3.myhuaweicloud.com |
||||
obs_url=https://gratia-pay-test.obs.cn-east-3.myhuaweicloud.com |
||||
|
||||
qr_code_data_url=https://pay.dctpay.com/scanPay |
||||
qr_code_url=https://pay.dctpay.com/filesystem/payQrCode/ |
||||
|
||||
lkl_request_url=https://s2.lakala.com |
||||
lkl_org_code=950386 |
||||
lkl_v3_appid=OP00000066 |
||||
lkl_v3_serial_no=017f2990c583 |
||||
lkl_v3_private_key=/home/project/xuan-pay/cert/lakala/v3/prod_private.text |
||||
lkl_v3_private_key=/home/project/gratia-pay/cert/lakala/v3/prod_private.text |
||||
|
||||
lkl_v2_appid=OP00000066 |
||||
lkl_v2_serial_no=017f2990c583 |
||||
lkl_v2_private_key=/home/project/xuan-pay/cert/lakala/v2/prod_private.text |
||||
lkl_mer_contract_ret_url=https://pay.bxb.cn/brest/laKaLaNotify/merContract |
||||
lkl_micro_pay_ret_url=https://pay.bxb.cn/crest/laKaLaNotify/microPay |
||||
lkl_v2_private_key=/home/project/gratia-pay/cert/lakala/v2/prod_private.text |
||||
lkl_mer_contract_ret_url=https://pay.dctpay.com/brest/laKaLaNotify/merContract |
||||
lkl_micro_pay_ret_url=https://pay.dctpay.com/crest/laKaLaNotify/microPay |
||||
|
||||
wechat_pay_notify_url=https://pay.dctpay.com/crest/weiXinNotify/jsapiPay |
||||
|
||||
file_url=/home/project/gratia-pay/file |
||||
filesystem=/home/project/gratia-pay/filesystem |
||||
|
||||
|
||||
file_url=/home/project/xuan-pay/file |
||||
filesystem=/home/project/xuan-pay/filesystem |
||||
hsg_domain_name=https://hsg.dctpay.com/ |
||||
|
Loading…
Reference in new issue