parent
1404a31e3b
commit
47b8987997
@ -0,0 +1,264 @@ |
||||
package com.cweb.controller; |
||||
|
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.service.BsMerLedgerReceiverService; |
||||
import com.hfkj.service.BsMerLedgerService; |
||||
import com.hfkj.service.BsMerPlatformNoService; |
||||
import com.hfkj.sysenum.*; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerController |
||||
* @author: HuRui |
||||
* @date: 2023/4/21 |
||||
**/ |
||||
@Controller |
||||
@Api(value = "设备管理") |
||||
@RequestMapping(value = "/merLedger") |
||||
public class BsMerLedgerController { |
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BsMerLedgerController.class); |
||||
|
||||
@Resource |
||||
private BsMerPlatformNoService merPlatformNoService; |
||||
@Resource |
||||
private BsMerLedgerService merLedgerService; |
||||
@Resource |
||||
private BsMerLedgerReceiverService merLedgerReceiverService; |
||||
|
||||
@RequestMapping(value="/merLedgerApply",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "商户分账功能申请") |
||||
public ResponseData merLedgerApply(@RequestBody BsMerLedger body) { |
||||
try { |
||||
if (body.getMerId() == null || body.getPlatformType() == null) { |
||||
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
if (body.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
if (body.getSplitLowestRatio() == null || StringUtils.isBlank(body.getSplitEntrustFilePath())) { |
||||
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
} |
||||
// 商户平台
|
||||
BsMerPlatformNo merPlatform = merPlatformNoService.getPlatformNo(body.getMerId(), PlatformTypeEnum.getDataByNumber(body.getPlatformType())); |
||||
if (merPlatform == null) { |
||||
log.error("BsDeviceOrderPayController -> payOrder error!","参数校验失败"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前平台未进件"); |
||||
} |
||||
// 设备订单
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedger(body.getMerId(), PlatformTypeEnum.getDataByNumber(body.getPlatformType())); |
||||
if (merLedger == null) { |
||||
merLedger = new BsMerLedger(); |
||||
merLedger.setMerId(merPlatform.getMerId()); |
||||
merLedger.setPlatformType(merPlatform.getPlatformType()); |
||||
merLedger.setPlatformNo(merPlatform.getPlatformNo()); |
||||
merLedger.setCupNo(merPlatform.getCupNo()); |
||||
merLedger.setSplitLowestRatio(body.getSplitLowestRatio()); |
||||
merLedger.setSplitEntrustFileName(body.getSplitEntrustFilePath().substring(body.getSplitEntrustFilePath().lastIndexOf("/")+1)); |
||||
merLedger.setSplitEntrustFilePath(body.getSplitEntrustFilePath()); |
||||
if (PlatformTypeEnum.type1.getNumber().equals(merPlatform.getPlatformType())) { |
||||
merLedger.setStatus(MerLedgerStatusEnum.status2.getNumber()); |
||||
} else { |
||||
merLedger.setStatus(MerLedgerStatusEnum.status1.getNumber()); |
||||
} |
||||
} else { |
||||
if (merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber()) |
||||
|| merLedger.getStatus().equals(MerLedgerStatusEnum.status2.getNumber()) ) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "暂时无法修改"); |
||||
} |
||||
merLedger = new BsMerLedger(); |
||||
merLedger.setMerId(merPlatform.getMerId()); |
||||
merLedger.setPlatformType(merPlatform.getPlatformType()); |
||||
merLedger.setPlatformNo(merPlatform.getPlatformNo()); |
||||
merLedger.setCupNo(merPlatform.getCupNo()); |
||||
merLedger.setSplitLowestRatio(body.getSplitLowestRatio()); |
||||
merLedger.setSplitEntrustFileName(body.getSplitEntrustFilePath().substring(body.getSplitEntrustFilePath().lastIndexOf("/")+1)); |
||||
merLedger.setSplitEntrustFilePath(body.getSplitEntrustFilePath()); |
||||
} |
||||
merLedgerService.merLedgerApply(merLedger); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getMerLedgerApply",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询商户分账功能") |
||||
public ResponseData getMerLedgerApply(@RequestParam(name = "merId", required = true) Long merId, |
||||
@RequestParam(name = "platformType", required = true) Integer platformType) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(merLedgerService.getMerLedger(merId, PlatformTypeEnum.getDataByNumber(platformType))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/merLedgerReceiverApply",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "商户分账绑定接受方申请") |
||||
public ResponseData merLedgerReceiverApply(@RequestBody BsMerLedgerReceiver body) { |
||||
try { |
||||
|
||||
if (body == null |
||||
|| body.getMerLedgerId() == null |
||||
|| StringUtils.isBlank(body.getReceiverNo()) |
||||
|| StringUtils.isBlank(body.getReceiverName()) |
||||
|| StringUtils.isBlank(body.getEntrustFilePath()) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); |
||||
} |
||||
|
||||
// 查询分账开通信息
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedgerById(body.getMerLedgerId()); |
||||
if (merLedger == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能未开通"); |
||||
} |
||||
if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能状态无法申请"); |
||||
} |
||||
|
||||
// 查询接收方数据
|
||||
BsMerLedgerReceiver receiver = merLedgerReceiverService.getMerLedgerReceiver(merLedger.getMerId(), body.getReceiverNo()); |
||||
if (receiver == null) { |
||||
receiver = new BsMerLedgerReceiver(); |
||||
receiver.setMerId(merLedger.getMerId()); |
||||
receiver.setMerLedgerId(merLedger.getId()); |
||||
receiver.setPlatformType(merLedger.getPlatformType()); |
||||
receiver.setPlatformNo(merLedger.getPlatformNo()); |
||||
receiver.setCupNo(merLedger.getCupNo()); |
||||
receiver.setReceiverNo(body.getReceiverNo()); |
||||
receiver.setReceiverName(body.getReceiverName()); |
||||
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1)); |
||||
receiver.setEntrustFilePath(body.getEntrustFilePath()); |
||||
} else { |
||||
receiver.setReceiverNo(body.getReceiverNo()); |
||||
receiver.setReceiverName(body.getReceiverName()); |
||||
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1)); |
||||
receiver.setEntrustFilePath(body.getEntrustFilePath()); |
||||
} |
||||
merLedgerReceiverService.merLedgerReceiverApply(receiver); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/merLedgerReceiverSecure",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "商户分账绑定接受方申请") |
||||
public ResponseData merLedgerReceiverSecure(@RequestBody BsMerLedgerReceiver body) { |
||||
try { |
||||
if (body == null |
||||
|| body.getMerLedgerId() == null |
||||
|| StringUtils.isBlank(body.getReceiverNo()) |
||||
|| StringUtils.isBlank(body.getReceiverName()) |
||||
|| StringUtils.isBlank(body.getEntrustFilePath()) |
||||
) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠类型"); |
||||
} |
||||
|
||||
// 查询分账开通信息
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedgerById(body.getMerLedgerId()); |
||||
if (merLedger == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能未开通"); |
||||
} |
||||
if (!merLedger.getStatus().equals(MerLedgerStatusEnum.status1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户分账功能状态无法申请"); |
||||
} |
||||
|
||||
// 查询接收方数据
|
||||
BsMerLedgerReceiver receiver = merLedgerReceiverService.getMerLedgerReceiver(merLedger.getMerId(), body.getReceiverNo()); |
||||
if (receiver == null) { |
||||
receiver = new BsMerLedgerReceiver(); |
||||
receiver.setMerId(merLedger.getMerId()); |
||||
receiver.setMerLedgerId(merLedger.getId()); |
||||
receiver.setPlatformType(merLedger.getPlatformType()); |
||||
receiver.setPlatformNo(merLedger.getPlatformNo()); |
||||
receiver.setCupNo(merLedger.getCupNo()); |
||||
receiver.setReceiverNo(body.getReceiverNo()); |
||||
receiver.setReceiverName(body.getReceiverName()); |
||||
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1)); |
||||
receiver.setEntrustFilePath(body.getEntrustFilePath()); |
||||
} else { |
||||
receiver.setReceiverNo(body.getReceiverNo()); |
||||
receiver.setReceiverName(body.getReceiverName()); |
||||
receiver.setEntrustFileName(body.getEntrustFilePath().substring(body.getEntrustFilePath().lastIndexOf("/")+1)); |
||||
receiver.setEntrustFilePath(body.getEntrustFilePath()); |
||||
} |
||||
merLedgerReceiverService.merLedgerReceiverApply(receiver); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getLedgerReceiverListByMer",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询接收方列表") |
||||
public ResponseData getLedgerReceiverListByMer(@RequestParam(name = "merId", required = true) Long merId, |
||||
@RequestParam(name = "platformType", required = true) Integer platformType) { |
||||
try { |
||||
|
||||
return ResponseMsgUtil.success(merLedgerReceiverService.getMerLedgerReceiverByMer(merId, PlatformTypeEnum.getDataByNumber(platformType))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/getLedgerReceiverList",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询接收方列表") |
||||
public ResponseData getLedgerReceiverList(@RequestParam(name = "platformType", required = true) Integer platformType, |
||||
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||
try { |
||||
|
||||
Map<String, Object> param = new HashMap<>(); |
||||
param.put("platformType", platformType); |
||||
param.put("status", MerLedgerReceiverStatusEnum.status1.getNumber()); |
||||
param.put("receiverNoNotNull", "true"); |
||||
|
||||
PageHelper.startPage(pageNum, pageSize); |
||||
return ResponseMsgUtil.success(new PageInfo<>(merLedgerReceiverService.getMerLedgerReceiverList(param))); |
||||
|
||||
} catch (Exception e) { |
||||
log.error(e.getMessage(), e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,382 @@ |
||||
package com.hfkj.channel.lakala; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.channel.lakala.config.LaKaLaConfig; |
||||
import com.hfkj.channel.saas.utils.SaasCommon; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.HttpsUtils; |
||||
import com.hfkj.common.utils.ImageUtils; |
||||
import com.hfkj.common.utils.UnionUtils; |
||||
import com.hfkj.config.CommonSysConst; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.MerBasisModel; |
||||
import com.hfkj.service.*; |
||||
import com.hfkj.sysenum.*; |
||||
import com.hfkj.sysenum.lakala.UploadFileTypeEnum; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.io.File; |
||||
import java.math.BigDecimal; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 拉卡拉分账 |
||||
* @author hurui |
||||
*/ |
||||
@Service |
||||
public class LaKaLaLedgerService { |
||||
|
||||
@Resource |
||||
private BsMerLedgerService merLedgerService; |
||||
@Resource |
||||
private BsMerLedgerApplyService merLedgerApplyService; |
||||
@Resource |
||||
private BsMerLedgerReceiverService merLedgerReceiverService; |
||||
@Resource |
||||
private BsMerService merService; |
||||
@Resource |
||||
private BsMerAttachService merAttachService; |
||||
|
||||
/** |
||||
* 商户分账业务开通申请 |
||||
* @param merLedgerId |
||||
* @return |
||||
*/ |
||||
public JSONObject applyLedger(Long merLedgerId) { |
||||
//
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedgerById(merLedgerId); |
||||
if (merLedger == null || merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 商户
|
||||
MerBasisModel merDetail = merService.getMerDetail(merLedger.getId()); |
||||
if (merDetail == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
||||
} |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
String orderNo = System.currentTimeMillis()+""; |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", orderNo); |
||||
map.put("orgCode", "1"); |
||||
map.put("merCupNo", merLedger.getCupNo()); |
||||
map.put("contactMobile", merDetail.getRegPhone()); |
||||
map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); |
||||
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName()); |
||||
// 转换成bas64
|
||||
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedger.getSplitEntrustFilePath()); |
||||
String fileType = merLedger.getSplitEntrustFilePath().substring(merLedger.getSplitEntrustFilePath().lastIndexOf(".") + 1); |
||||
map.put("splitEntrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId")); |
||||
map.put("splitRange", "MARK"); |
||||
map.put("retUrl", CommonSysConst.getSysConfig() + "/crest/laKaLaNotify/applyLedgerMer"); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
// 请求记录
|
||||
Map<String, Object> requestMap = new HashMap<>(); |
||||
requestMap.put("Authorization", reqParam.get("Authorization")); |
||||
requestMap.put("req_data", JSONObject.toJSONString(commonParam)); |
||||
|
||||
BsMerLedgerApply merLedgerApply = new BsMerLedgerApply(); |
||||
merLedgerApply.setMerLedgerId(merLedger.getId()); |
||||
merLedgerApply.setMerId(merLedger.getId()); |
||||
merLedgerApply.setOrderNo(orderNo); |
||||
merLedgerApply.setRequestBody(JSONObject.toJSONString(requestMap)); |
||||
merLedgerApplyService.editMerLedgerApply(merLedgerApply); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerMer", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
merLedgerApply.setApplyId(responseBody.getJSONObject("respData").getString("applyId")); |
||||
merLedgerApply.setResponseBody(responseBody.toJSONString()); |
||||
merLedgerApplyService.editMerLedgerApply(merLedgerApply); |
||||
|
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
|
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 商户分账信息变更申请 |
||||
* @param merLedgerId |
||||
* @return |
||||
*/ |
||||
public JSONObject applyLedgerModify(Long merLedgerId) { |
||||
//
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedgerById(merLedgerId); |
||||
if (merLedger == null || merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
// 商户
|
||||
MerBasisModel merDetail = merService.getMerDetail(merLedger.getId()); |
||||
if (merDetail == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
||||
} |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
String orderNo = System.currentTimeMillis()+""; |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", orderNo); |
||||
map.put("orgCode", "1"); |
||||
map.put("merCupNo", merLedger.getCupNo()); |
||||
map.put("contactMobile", merDetail.getRegPhone()); |
||||
map.put("splitLowestRatio", merLedger.getSplitLowestRatio()); |
||||
map.put("splitEntrustFileName", merLedger.getSplitEntrustFileName()); |
||||
// map.put("splitEntrustFilePath", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ merLedger.getSplitEntrustFilePath()), "SPLIT_ENTRUST_FILE", "0").getString("url"));
|
||||
map.put("splitRange", "MARK"); |
||||
map.put("retUrl", CommonSysConst.getSysConfig() + "/crest/laKaLaNotify/applyLedgerMer"); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
// 请求记录
|
||||
Map<String, Object> requestMap = new HashMap<>(); |
||||
requestMap.put("Authorization", reqParam.get("Authorization")); |
||||
requestMap.put("req_data", JSONObject.toJSONString(commonParam)); |
||||
|
||||
BsMerLedgerApply merLedgerApply = new BsMerLedgerApply(); |
||||
merLedgerApply.setMerLedgerId(merLedger.getId()); |
||||
merLedgerApply.setMerId(merLedger.getId()); |
||||
merLedgerApply.setOrderNo(orderNo); |
||||
merLedgerApply.setRequestBody(JSONObject.toJSONString(requestMap)); |
||||
merLedgerApplyService.editMerLedgerApply(merLedgerApply); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerMer", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
merLedgerApply.setApplyId(responseBody.getJSONObject("respData").getString("applyId")); |
||||
merLedgerApply.setResponseBody(responseBody.toJSONString()); |
||||
merLedgerApplyService.editMerLedgerApply(merLedgerApply); |
||||
|
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
|
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 分账商户信息查询 |
||||
* @param merCupNo 银联商户号 |
||||
* @return |
||||
*/ |
||||
public JSONObject queryLedgerMer(String merCupNo) { |
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
String orderNo = System.currentTimeMillis()+""; |
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", orderNo); |
||||
map.put("orgCode", "1"); |
||||
map.put("merCupNo", merCupNo); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/queryLedgerMer", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
|
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
|
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 创建分账接收方 |
||||
*/ |
||||
public void applyLedgerReceiver(Long merId) { |
||||
// 商户
|
||||
MerBasisModel merDetail = merService.getMerDetail(merId); |
||||
if (merDetail == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户"); |
||||
} |
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", System.currentTimeMillis()+""); |
||||
map.put("orgCode", "1"); |
||||
map.put("receiverName", merDetail.getMerName()); |
||||
map.put("contactMobile", merDetail.getRegPhone()); |
||||
map.put("acctTypeCode", merDetail.getMerType().equals(MerSettleType.status1.getNumber())?57:58);// 57:对公 58:对私
|
||||
map.put("acctNo", merDetail.getMerSettleAcct().getBankCardNo()); |
||||
map.put("acctName", merDetail.getMerSettleAcct().getBankCardHolder()); |
||||
map.put("acctCertificateType", "17"); |
||||
map.put("acctCertificateNo", merDetail.getMerSettleAcct().getSettleIdCardNo()); |
||||
map.put("acctOpenBankCode", merDetail.getMerSettleAcct().getOpenningBankCode()); |
||||
map.put("acctOpenBankName", merDetail.getMerSettleAcct().getOpenningBankName()); |
||||
map.put("acctClearBankCode", merDetail.getMerSettleAcct().getClearingBankCode()); |
||||
|
||||
if (merDetail.getMerType().equals(MerSettleType.status1.getNumber()) == true) { |
||||
map.put("licenseNo", merDetail.getBlisNo()); |
||||
map.put("licenseName", merDetail.getBlisName()); |
||||
map.put("legalPersonName", merDetail.getLarName()); |
||||
map.put("legalPersonCertificateType", "17"); |
||||
map.put("legalPersonCertificateNo", merDetail.getLarIdCard()); |
||||
} |
||||
|
||||
List<Map<String, Object>> attachMapList = new ArrayList<>(); |
||||
Map<String, Object> attachMap; |
||||
|
||||
List<BsMerAttach> attachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null); |
||||
for (BsMerAttach attach : attachList) { |
||||
if (StringUtils.isNotBlank(attach.getFileUrl())) { |
||||
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType()); |
||||
if (attachType != null && StringUtils.isNotBlank(attachType.getLklCode())) { |
||||
attachMap = new HashMap<>(); |
||||
|
||||
// 转换成bas64
|
||||
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ attach.getFileUrl()); |
||||
String fileType = attach.getFileUrl().substring(attach.getFileUrl().lastIndexOf(".") + 1); |
||||
attachMap.put("attachType", attachType.getLklCode()); |
||||
attachMap.put("attachName", attachType.getName()); |
||||
attachMap.put("attachStorePath", LaKaLaConfig.uploadFile(attachType.getLklSaasCode(), fileType, base64ImgUrl).getString("attFileId")); |
||||
attachMapList.add(attachMap); |
||||
} |
||||
} |
||||
} |
||||
map.put("attachList", attachMapList); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyLedgerReceiver", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
|
||||
// 查询分账信息
|
||||
BsMerLedger merLedger = merLedgerService.getMerLedger(merId, PlatformTypeEnum.type1); |
||||
if (merLedger != null) { |
||||
merLedger.setReceiverNo(responseBody.getJSONObject("respData").getString("receiverNo")); |
||||
merLedgerService.editMerLedger(merLedger); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 绑定分账关系 |
||||
*/ |
||||
public void applyBind(Long merId,String receiverNo) { |
||||
// 查询
|
||||
BsMerLedgerReceiver merLedgerReceiver = merLedgerReceiverService.getMerLedgerReceiver(merId, receiverNo); |
||||
if (merLedgerReceiver == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系"); |
||||
} |
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", System.currentTimeMillis()+""); |
||||
map.put("orgCode", "1"); |
||||
map.put("merCupNo", merLedgerReceiver.getCupNo()); |
||||
map.put("receiverNo", merLedgerReceiver.getReceiverNo()); |
||||
|
||||
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedgerReceiver.getEntrustFilePath()); |
||||
String fileType = merLedgerReceiver.getEntrustFilePath().substring(merLedgerReceiver.getEntrustFilePath().lastIndexOf(".") + 1); |
||||
map.put("entrustFileName", merLedgerReceiver.getEntrustFileName()); |
||||
map.put("entrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId")); |
||||
map.put("retUrl", CommonSysConst.getSysConfig().getDomainName()+"/crest/laKaLaNotify/applyLedgerMer"); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyBind", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
merLedgerReceiver.setStatus(MerLedgerStatusEnum.status1.getNumber()); |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 分账关系解绑申请 |
||||
*/ |
||||
public void applyUnBind(Long merId,String receiverNo) { |
||||
// 查询
|
||||
BsMerLedgerReceiver merLedgerReceiver = merLedgerReceiverService.getMerLedgerReceiver(merId, receiverNo); |
||||
if (merLedgerReceiver == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到分账关系"); |
||||
} |
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("reqTime", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "1.0.0"); |
||||
commonParam.put("reqId", UnionUtils.createNonceStr()); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("version", "1.0"); |
||||
map.put("orderNo", System.currentTimeMillis()+""); |
||||
map.put("orgCode", "1"); |
||||
map.put("merCupNo", "8226900581208NT"); |
||||
map.put("receiverNo", ""); |
||||
map.put("entrustFileName", "123"); |
||||
|
||||
String base64ImgUrl = ImageUtils.getBase64ByImgUrl(CommonSysConst.getSysConfig().getObs_url() + "/"+ merLedgerReceiver.getEntrustFilePath()); |
||||
String fileType = merLedgerReceiver.getEntrustFilePath().substring(merLedgerReceiver.getEntrustFilePath().lastIndexOf(".") + 1); |
||||
map.put("entrustFileName", merLedgerReceiver.getEntrustFileName()); |
||||
map.put("entrustFilePath", LaKaLaConfig.uploadFile("COOPERATION_QUALIFICATION_PROOF", fileType, base64ImgUrl).getString("attFileId")); |
||||
map.put("retUrl", "123"); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/ledger/applyUnBind", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,243 @@ |
||||
package com.hfkj.channel.lakala; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.channel.lakala.config.LaKaLaConfig; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.HttpsUtils; |
||||
import com.hfkj.common.utils.ImageUtils; |
||||
import com.hfkj.common.utils.UnionUtils; |
||||
import com.hfkj.config.CommonSysConst; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.MerBasisModel; |
||||
import com.hfkj.service.*; |
||||
import com.hfkj.sysenum.*; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.*; |
||||
|
||||
/** |
||||
* 拉卡拉分账 |
||||
* @author hurui |
||||
*/ |
||||
@Service |
||||
public class LaKaLaTradeSeparateService { |
||||
|
||||
@Resource |
||||
private BsTradeOrderService tradeOrderService; |
||||
@Resource |
||||
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService; |
||||
@Resource |
||||
private BsTradeOrderProfitSharingReceiverService tradeOrderProfitSharingReceiverService; |
||||
|
||||
/** |
||||
* 创建分账 |
||||
* @param profitSharingOrderNo |
||||
* @return |
||||
*/ |
||||
public JSONObject separate(String profitSharingOrderNo) { |
||||
// 交易分账
|
||||
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); |
||||
if (null == tradeOrderProfitSharing) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录"); |
||||
} |
||||
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态"); |
||||
} |
||||
// 查询交易详情
|
||||
BsTradeOrder tradeOrder = tradeOrderService.getOrderByTradeNoId(tradeOrderProfitSharing.getTradeOrderId()); |
||||
|
||||
// 分账接收方
|
||||
List<BsTradeOrderProfitSharingReceiver> profitSharingReceiverList = tradeOrderProfitSharingReceiverService.getReceiverListByProfitSharingId(tradeOrderProfitSharing.getId()); |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "3.0"); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("merchant_no", tradeOrder.getPlatformMerNo()); |
||||
map.put("log_no", tradeOrder.getPlatformLogNo()); |
||||
map.put("log_date", DateUtil.date2String(tradeOrder.getPayTime(), "yyyy-MM-dd")); |
||||
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo()); |
||||
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun()); |
||||
map.put("lkl_org_no", "1"); |
||||
map.put("cal_type", "0"); |
||||
|
||||
List<Map<String,Object>> recvDatasMapList = new ArrayList<>(); |
||||
Map<String,Object> recvDatasMap; |
||||
|
||||
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceiverList) { |
||||
recvDatasMap = new HashMap<>(); |
||||
recvDatasMap.put("recv_merchant_no", receiver.getReceiverAccount()); |
||||
recvDatasMap.put("separate_value", receiver.getProfitSharingAmount()); |
||||
recvDatasMapList.add(recvDatasMap); |
||||
} |
||||
commonParam.put("recv_datas", recvDatasMapList); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/separate", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
|
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
|
||||
JSONObject respData = responseBody.getJSONObject("resp_data"); |
||||
// 分账状态 处理中:PROCESSING, 已受理:ACCEPTED, 成功:SUCCESS, 失败:FAIL
|
||||
String statusCode = respData.getString("status"); |
||||
if (statusCode.equals("PROCESSING")) { |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber()); |
||||
} else if (statusCode.equals("ACCEPTED")) { |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status3.getNumber()); |
||||
} else if (statusCode.equals("SUCCESS")) { |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status1.getNumber()); |
||||
tradeOrderProfitSharing.setProfitSharingTime(new Date()); |
||||
tradeOrderProfitSharing.setFinishTime(new Date()); |
||||
} else if (statusCode.equals("FAIL")) { |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status4.getNumber()); |
||||
} |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
|
||||
// 处理接收方数据
|
||||
if (tradeOrderProfitSharing.equals(ProfitSharingStatusEnum.status1.getName())) { |
||||
for (BsTradeOrderProfitSharingReceiver receiver : profitSharingReceiverList) { |
||||
receiver.setStatus(ProfitSharingReceiverStatusEnum.status1.getNumber()); |
||||
receiver.setProfitSharingTime(new Date()); |
||||
receiver.setFinishTime(new Date()); |
||||
tradeOrderProfitSharingReceiverService.editData(receiver); |
||||
} |
||||
} |
||||
|
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 分账撤销 |
||||
* @param profitSharingOrderNo |
||||
* @return |
||||
*/ |
||||
public JSONObject cancel(String profitSharingOrderNo) { |
||||
// 交易订单分账
|
||||
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); |
||||
if (null == tradeOrderProfitSharing) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录"); |
||||
} |
||||
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态"); |
||||
} |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "3.0"); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo()); |
||||
map.put("origin_separate_no", tradeOrderProfitSharing.getOriginProfitSharingOrderNo()); |
||||
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo()); |
||||
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun()); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/cancel", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber()); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 分账回退 |
||||
* @param profitSharingOrderNo 交易订单号 |
||||
* @return |
||||
*/ |
||||
public JSONObject fallback(String profitSharingOrderNo) { |
||||
// 交易订单分账
|
||||
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); |
||||
if (null == tradeOrderProfitSharing) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录"); |
||||
} |
||||
if (tradeOrderProfitSharing.getStatus().equals(ProfitSharingStatusEnum.status0.getNumber())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "业务不处于待处理状态"); |
||||
} |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "3.0"); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo()); |
||||
map.put("origin_separate_no", tradeOrderProfitSharing.getOriginProfitSharingOrderNo()); |
||||
map.put("out_separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo()); |
||||
map.put("total_amt", tradeOrderProfitSharing.getProfitSharingAmoun()); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/fallback", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
tradeOrderProfitSharing.setStatus(ProfitSharingStatusEnum.status2.getNumber()); |
||||
tradeOrderProfitSharingService.editData(tradeOrderProfitSharing); |
||||
return responseBody; |
||||
} |
||||
|
||||
/** |
||||
* 分账结果查询 |
||||
* @param profitSharingOrderNo 交易订单号 |
||||
* @return |
||||
*/ |
||||
public JSONObject query(String profitSharingOrderNo) { |
||||
// 交易订单分账
|
||||
BsTradeOrderProfitSharing tradeOrderProfitSharing = tradeOrderProfitSharingService.getDetailByProfitSharingOrderNo(profitSharingOrderNo); |
||||
if (null == tradeOrderProfitSharing) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到交易分账记录"); |
||||
} |
||||
|
||||
Map<String, Object> commonParam = new HashMap<>(); |
||||
commonParam.put("req_time", DateUtil.format(new Date(), "yyyyMMddHHmmss")); |
||||
commonParam.put("version", "3.0"); |
||||
|
||||
Map<String, Object> map = new HashMap<>(); |
||||
map.put("merchant_no", tradeOrderProfitSharing.getPlatformMerNo()); |
||||
map.put("separate_no", tradeOrderProfitSharing.getProfitSharingOrderNo()); |
||||
commonParam.put("reqData", map); |
||||
|
||||
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(commonParam))); |
||||
// 头部参数
|
||||
Map<String, Object> heard = new HashMap<>(); |
||||
heard.put("Authorization", reqParam.get("Authorization")); |
||||
|
||||
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v3/sacs/query", commonParam, heard); |
||||
System.out.println("body:" + JSONObject.toJSONString(commonParam)); |
||||
System.out.println("response:" + responseBody.toJSONString()); |
||||
if (!responseBody.getString("retCode").equals("000000")) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg")); |
||||
} |
||||
return responseBody.getJSONObject("resp_data"); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,133 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerApply; |
||||
import com.hfkj.entity.BsMerLedgerApplyExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsMerLedgerApplyMapper extends BsMerLedgerApplyMapperExt { |
||||
@SelectProvider(type=BsMerLedgerApplySqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerLedgerApplyExample example); |
||||
|
||||
@DeleteProvider(type=BsMerLedgerApplySqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerLedgerApplyExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_mer_ledger_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_mer_ledger_apply (mer_id, mer_ledger_id, ", |
||||
"order_no, apply_id, ", |
||||
"request_body, response_body, ", |
||||
"notify_body, `status`, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ", |
||||
"#{orderNo,jdbcType=VARCHAR}, #{applyId,jdbcType=VARCHAR}, ", |
||||
"#{requestBody,jdbcType=VARCHAR}, #{responseBody,jdbcType=VARCHAR}, ", |
||||
"#{notifyBody,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsMerLedgerApply record); |
||||
|
||||
@InsertProvider(type=BsMerLedgerApplySqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerLedgerApply record); |
||||
|
||||
@SelectProvider(type=BsMerLedgerApplySqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsMerLedgerApply> selectByExample(BsMerLedgerApplyExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_id, mer_ledger_id, order_no, apply_id, request_body, response_body, ", |
||||
"notify_body, `status`, create_time, update_time, ext_1, ext_2, ext_3", |
||||
"from bs_mer_ledger_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsMerLedgerApply selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerLedgerApply record, @Param("example") BsMerLedgerApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerLedgerApply record, @Param("example") BsMerLedgerApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerApplySqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerLedgerApply record); |
||||
|
||||
@Update({ |
||||
"update bs_mer_ledger_apply", |
||||
"set mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"apply_id = #{applyId,jdbcType=VARCHAR},", |
||||
"request_body = #{requestBody,jdbcType=VARCHAR},", |
||||
"response_body = #{responseBody,jdbcType=VARCHAR},", |
||||
"notify_body = #{notifyBody,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsMerLedgerApply record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerLedgerApplyMapperExt { |
||||
} |
@ -0,0 +1,360 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerApply; |
||||
import com.hfkj.entity.BsMerLedgerApplyExample.Criteria; |
||||
import com.hfkj.entity.BsMerLedgerApplyExample.Criterion; |
||||
import com.hfkj.entity.BsMerLedgerApplyExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerLedgerApplySqlProvider { |
||||
|
||||
public String countByExample(BsMerLedgerApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_mer_ledger_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerLedgerApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_mer_ledger_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerLedgerApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_mer_ledger_apply"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.VALUES("apply_id", "#{applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.VALUES("request_body", "#{requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.VALUES("response_body", "#{responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.VALUES("notify_body", "#{notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsMerLedgerApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_ledger_id"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("apply_id"); |
||||
sql.SELECT("request_body"); |
||||
sql.SELECT("response_body"); |
||||
sql.SELECT("notify_body"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_mer_ledger_apply"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerLedgerApply record = (BsMerLedgerApply) parameter.get("record"); |
||||
BsMerLedgerApplyExample example = (BsMerLedgerApplyExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_apply"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_apply"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}"); |
||||
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}"); |
||||
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}"); |
||||
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsMerLedgerApplyExample example = (BsMerLedgerApplyExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerLedgerApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_apply"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.SET("apply_id = #{applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.SET("request_body = #{requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.SET("response_body = #{responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.SET("notify_body = #{notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsMerLedgerApplyExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,142 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedger; |
||||
import com.hfkj.entity.BsMerLedgerExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsMerLedgerMapper extends BsMerLedgerMapperExt { |
||||
@SelectProvider(type=BsMerLedgerSqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerLedgerExample example); |
||||
|
||||
@DeleteProvider(type=BsMerLedgerSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerLedgerExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_mer_ledger", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_mer_ledger (mer_id, platform_type, ", |
||||
"platform_no, cup_no, ", |
||||
"receiver_no, split_lowest_ratio, ", |
||||
"split_entrust_file_name, split_entrust_file_path, ", |
||||
"`status`, reject_reason, ", |
||||
"create_time, update_time, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ", |
||||
"#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ", |
||||
"#{receiverNo,jdbcType=VARCHAR}, #{splitLowestRatio,jdbcType=DECIMAL}, ", |
||||
"#{splitEntrustFileName,jdbcType=VARCHAR}, #{splitEntrustFilePath,jdbcType=VARCHAR}, ", |
||||
"#{status,jdbcType=INTEGER}, #{rejectReason,jdbcType=VARCHAR}, ", |
||||
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsMerLedger record); |
||||
|
||||
@InsertProvider(type=BsMerLedgerSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerLedger record); |
||||
|
||||
@SelectProvider(type=BsMerLedgerSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="split_lowest_ratio", property="splitLowestRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="split_entrust_file_name", property="splitEntrustFileName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="split_entrust_file_path", property="splitEntrustFilePath", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsMerLedger> selectByExample(BsMerLedgerExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_id, platform_type, platform_no, cup_no, receiver_no, split_lowest_ratio, ", |
||||
"split_entrust_file_name, split_entrust_file_path, `status`, reject_reason, create_time, ", |
||||
"update_time, ext_1, ext_2, ext_3", |
||||
"from bs_mer_ledger", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="split_lowest_ratio", property="splitLowestRatio", jdbcType=JdbcType.DECIMAL), |
||||
@Result(column="split_entrust_file_name", property="splitEntrustFileName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="split_entrust_file_path", property="splitEntrustFilePath", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsMerLedger selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerLedger record, @Param("example") BsMerLedgerExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerLedger record, @Param("example") BsMerLedgerExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerLedger record); |
||||
|
||||
@Update({ |
||||
"update bs_mer_ledger", |
||||
"set mer_id = #{merId,jdbcType=BIGINT},", |
||||
"platform_type = #{platformType,jdbcType=INTEGER},", |
||||
"platform_no = #{platformNo,jdbcType=VARCHAR},", |
||||
"cup_no = #{cupNo,jdbcType=VARCHAR},", |
||||
"receiver_no = #{receiverNo,jdbcType=VARCHAR},", |
||||
"split_lowest_ratio = #{splitLowestRatio,jdbcType=DECIMAL},", |
||||
"split_entrust_file_name = #{splitEntrustFileName,jdbcType=VARCHAR},", |
||||
"split_entrust_file_path = #{splitEntrustFilePath,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"reject_reason = #{rejectReason,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsMerLedger record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerLedgerMapperExt { |
||||
} |
@ -0,0 +1,147 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiverApply; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApplyExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsMerLedgerReceiverApplyMapper extends BsMerLedgerReceiverApplyMapperExt { |
||||
@SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerLedgerReceiverApplyExample example); |
||||
|
||||
@DeleteProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerLedgerReceiverApplyExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_mer_ledger_receiver_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_mer_ledger_receiver_apply (mer_id, mer_ledger_id, ", |
||||
"mer_ledger_receiver_id, receiver_no, ", |
||||
"order_no, apply_id, ", |
||||
"request_body, response_body, ", |
||||
"notify_body, `status`, ", |
||||
"reject_reason, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ", |
||||
"#{merLedgerReceiverId,jdbcType=BIGINT}, #{receiverNo,jdbcType=VARCHAR}, ", |
||||
"#{orderNo,jdbcType=VARCHAR}, #{applyId,jdbcType=VARCHAR}, ", |
||||
"#{requestBody,jdbcType=VARCHAR}, #{responseBody,jdbcType=VARCHAR}, ", |
||||
"#{notifyBody,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
||||
"#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsMerLedgerReceiverApply record); |
||||
|
||||
@InsertProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerLedgerReceiverApply record); |
||||
|
||||
@SelectProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsMerLedgerReceiverApply> selectByExample(BsMerLedgerReceiverApplyExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_id, mer_ledger_id, mer_ledger_receiver_id, receiver_no, order_no, apply_id, ", |
||||
"request_body, response_body, notify_body, `status`, reject_reason, create_time, ", |
||||
"update_time, ext_1, ext_2, ext_3", |
||||
"from bs_mer_ledger_receiver_apply", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_receiver_id", property="merLedgerReceiverId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="apply_id", property="applyId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="request_body", property="requestBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="response_body", property="responseBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="notify_body", property="notifyBody", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsMerLedgerReceiverApply selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerLedgerReceiverApply record, @Param("example") BsMerLedgerReceiverApplyExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverApplySqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerLedgerReceiverApply record); |
||||
|
||||
@Update({ |
||||
"update bs_mer_ledger_receiver_apply", |
||||
"set mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},", |
||||
"mer_ledger_receiver_id = #{merLedgerReceiverId,jdbcType=BIGINT},", |
||||
"receiver_no = #{receiverNo,jdbcType=VARCHAR},", |
||||
"order_no = #{orderNo,jdbcType=VARCHAR},", |
||||
"apply_id = #{applyId,jdbcType=VARCHAR},", |
||||
"request_body = #{requestBody,jdbcType=VARCHAR},", |
||||
"response_body = #{responseBody,jdbcType=VARCHAR},", |
||||
"notify_body = #{notifyBody,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"reject_reason = #{rejectReason,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsMerLedgerReceiverApply record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerLedgerReceiverApplyMapperExt { |
||||
} |
@ -0,0 +1,402 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiverApply; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApplyExample.Criteria; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApplyExample.Criterion; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApplyExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerLedgerReceiverApplySqlProvider { |
||||
|
||||
public String countByExample(BsMerLedgerReceiverApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_mer_ledger_receiver_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerLedgerReceiverApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_mer_ledger_receiver_apply"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerLedgerReceiverApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_mer_ledger_receiver_apply"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerReceiverId() != null) { |
||||
sql.VALUES("mer_ledger_receiver_id", "#{merLedgerReceiverId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.VALUES("apply_id", "#{applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.VALUES("request_body", "#{requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.VALUES("response_body", "#{responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.VALUES("notify_body", "#{notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.VALUES("reject_reason", "#{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsMerLedgerReceiverApplyExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_ledger_id"); |
||||
sql.SELECT("mer_ledger_receiver_id"); |
||||
sql.SELECT("receiver_no"); |
||||
sql.SELECT("order_no"); |
||||
sql.SELECT("apply_id"); |
||||
sql.SELECT("request_body"); |
||||
sql.SELECT("response_body"); |
||||
sql.SELECT("notify_body"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("reject_reason"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_mer_ledger_receiver_apply"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerLedgerReceiverApply record = (BsMerLedgerReceiverApply) parameter.get("record"); |
||||
BsMerLedgerReceiverApplyExample example = (BsMerLedgerReceiverApplyExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver_apply"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerReceiverId() != null) { |
||||
sql.SET("mer_ledger_receiver_id = #{record.merLedgerReceiverId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver_apply"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_ledger_receiver_id = #{record.merLedgerReceiverId,jdbcType=BIGINT}"); |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); |
||||
sql.SET("apply_id = #{record.applyId,jdbcType=VARCHAR}"); |
||||
sql.SET("request_body = #{record.requestBody,jdbcType=VARCHAR}"); |
||||
sql.SET("response_body = #{record.responseBody,jdbcType=VARCHAR}"); |
||||
sql.SET("notify_body = #{record.notifyBody,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsMerLedgerReceiverApplyExample example = (BsMerLedgerReceiverApplyExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerLedgerReceiverApply record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver_apply"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerReceiverId() != null) { |
||||
sql.SET("mer_ledger_receiver_id = #{merLedgerReceiverId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getOrderNo() != null) { |
||||
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getApplyId() != null) { |
||||
sql.SET("apply_id = #{applyId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getRequestBody() != null) { |
||||
sql.SET("request_body = #{requestBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getResponseBody() != null) { |
||||
sql.SET("response_body = #{responseBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getNotifyBody() != null) { |
||||
sql.SET("notify_body = #{notifyBody,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsMerLedgerReceiverApplyExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,147 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiver; |
||||
import com.hfkj.entity.BsMerLedgerReceiverExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface BsMerLedgerReceiverMapper extends BsMerLedgerReceiverMapperExt { |
||||
@SelectProvider(type=BsMerLedgerReceiverSqlProvider.class, method="countByExample") |
||||
long countByExample(BsMerLedgerReceiverExample example); |
||||
|
||||
@DeleteProvider(type=BsMerLedgerReceiverSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(BsMerLedgerReceiverExample example); |
||||
|
||||
@Delete({ |
||||
"delete from bs_mer_ledger_receiver", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into bs_mer_ledger_receiver (mer_id, mer_ledger_id, ", |
||||
"platform_type, platform_no, ", |
||||
"cup_no, receiver_no, ", |
||||
"receiver_name, entrust_file_name, ", |
||||
"entrust_file_path, `status`, ", |
||||
"reject_reason, create_time, ", |
||||
"update_time, ext_1, ", |
||||
"ext_2, ext_3)", |
||||
"values (#{merId,jdbcType=BIGINT}, #{merLedgerId,jdbcType=BIGINT}, ", |
||||
"#{platformType,jdbcType=INTEGER}, #{platformNo,jdbcType=VARCHAR}, ", |
||||
"#{cupNo,jdbcType=VARCHAR}, #{receiverNo,jdbcType=VARCHAR}, ", |
||||
"#{receiverName,jdbcType=VARCHAR}, #{entrustFileName,jdbcType=VARCHAR}, ", |
||||
"#{entrustFilePath,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", |
||||
"#{rejectReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ", |
||||
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(BsMerLedgerReceiver record); |
||||
|
||||
@InsertProvider(type=BsMerLedgerReceiverSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(BsMerLedgerReceiver record); |
||||
|
||||
@SelectProvider(type=BsMerLedgerReceiverSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="entrust_file_name", property="entrustFileName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="entrust_file_path", property="entrustFilePath", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<BsMerLedgerReceiver> selectByExample(BsMerLedgerReceiverExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, mer_id, mer_ledger_id, platform_type, platform_no, cup_no, receiver_no, ", |
||||
"receiver_name, entrust_file_name, entrust_file_path, `status`, reject_reason, ", |
||||
"create_time, update_time, ext_1, ext_2, ext_3", |
||||
"from bs_mer_ledger_receiver", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="mer_ledger_id", property="merLedgerId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="entrust_file_name", property="entrustFileName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="entrust_file_path", property="entrustFilePath", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="reject_reason", property="rejectReason", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
BsMerLedgerReceiver selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") BsMerLedgerReceiver record, @Param("example") BsMerLedgerReceiverExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") BsMerLedgerReceiver record, @Param("example") BsMerLedgerReceiverExample example); |
||||
|
||||
@UpdateProvider(type=BsMerLedgerReceiverSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(BsMerLedgerReceiver record); |
||||
|
||||
@Update({ |
||||
"update bs_mer_ledger_receiver", |
||||
"set mer_id = #{merId,jdbcType=BIGINT},", |
||||
"mer_ledger_id = #{merLedgerId,jdbcType=BIGINT},", |
||||
"platform_type = #{platformType,jdbcType=INTEGER},", |
||||
"platform_no = #{platformNo,jdbcType=VARCHAR},", |
||||
"cup_no = #{cupNo,jdbcType=VARCHAR},", |
||||
"receiver_no = #{receiverNo,jdbcType=VARCHAR},", |
||||
"receiver_name = #{receiverName,jdbcType=VARCHAR},", |
||||
"entrust_file_name = #{entrustFileName,jdbcType=VARCHAR},", |
||||
"entrust_file_path = #{entrustFilePath,jdbcType=VARCHAR},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"reject_reason = #{rejectReason,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(BsMerLedgerReceiver record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface BsMerLedgerReceiverMapperExt { |
||||
} |
@ -0,0 +1,402 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiver; |
||||
import com.hfkj.entity.BsMerLedgerReceiverExample.Criteria; |
||||
import com.hfkj.entity.BsMerLedgerReceiverExample.Criterion; |
||||
import com.hfkj.entity.BsMerLedgerReceiverExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerLedgerReceiverSqlProvider { |
||||
|
||||
public String countByExample(BsMerLedgerReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_mer_ledger_receiver"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerLedgerReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_mer_ledger_receiver"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerLedgerReceiver record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_mer_ledger_receiver"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.VALUES("mer_ledger_id", "#{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.VALUES("platform_no", "#{platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.VALUES("cup_no", "#{cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.VALUES("receiver_name", "#{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFileName() != null) { |
||||
sql.VALUES("entrust_file_name", "#{entrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFilePath() != null) { |
||||
sql.VALUES("entrust_file_path", "#{entrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.VALUES("reject_reason", "#{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsMerLedgerReceiverExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("mer_ledger_id"); |
||||
sql.SELECT("platform_type"); |
||||
sql.SELECT("platform_no"); |
||||
sql.SELECT("cup_no"); |
||||
sql.SELECT("receiver_no"); |
||||
sql.SELECT("receiver_name"); |
||||
sql.SELECT("entrust_file_name"); |
||||
sql.SELECT("entrust_file_path"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("reject_reason"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_mer_ledger_receiver"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerLedgerReceiver record = (BsMerLedgerReceiver) parameter.get("record"); |
||||
BsMerLedgerReceiverExample example = (BsMerLedgerReceiverExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFileName() != null) { |
||||
sql.SET("entrust_file_name = #{record.entrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFilePath() != null) { |
||||
sql.SET("entrust_file_path = #{record.entrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("mer_ledger_id = #{record.merLedgerId,jdbcType=BIGINT}"); |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}"); |
||||
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_name = #{record.receiverName,jdbcType=VARCHAR}"); |
||||
sql.SET("entrust_file_name = #{record.entrustFileName,jdbcType=VARCHAR}"); |
||||
sql.SET("entrust_file_path = #{record.entrustFilePath,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsMerLedgerReceiverExample example = (BsMerLedgerReceiverExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerLedgerReceiver record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger_receiver"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerLedgerId() != null) { |
||||
sql.SET("mer_ledger_id = #{merLedgerId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.SET("platform_no = #{platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.SET("cup_no = #{cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverName() != null) { |
||||
sql.SET("receiver_name = #{receiverName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFileName() != null) { |
||||
sql.SET("entrust_file_name = #{entrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getEntrustFilePath() != null) { |
||||
sql.SET("entrust_file_path = #{entrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsMerLedgerReceiverExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,388 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.BsMerLedger; |
||||
import com.hfkj.entity.BsMerLedgerExample.Criteria; |
||||
import com.hfkj.entity.BsMerLedgerExample.Criterion; |
||||
import com.hfkj.entity.BsMerLedgerExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class BsMerLedgerSqlProvider { |
||||
|
||||
public String countByExample(BsMerLedgerExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("bs_mer_ledger"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(BsMerLedgerExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("bs_mer_ledger"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(BsMerLedger record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("bs_mer_ledger"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.VALUES("platform_no", "#{platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.VALUES("cup_no", "#{cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.VALUES("receiver_no", "#{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitLowestRatio() != null) { |
||||
sql.VALUES("split_lowest_ratio", "#{splitLowestRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFileName() != null) { |
||||
sql.VALUES("split_entrust_file_name", "#{splitEntrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFilePath() != null) { |
||||
sql.VALUES("split_entrust_file_path", "#{splitEntrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.VALUES("reject_reason", "#{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(BsMerLedgerExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("mer_id"); |
||||
sql.SELECT("platform_type"); |
||||
sql.SELECT("platform_no"); |
||||
sql.SELECT("cup_no"); |
||||
sql.SELECT("receiver_no"); |
||||
sql.SELECT("split_lowest_ratio"); |
||||
sql.SELECT("split_entrust_file_name"); |
||||
sql.SELECT("split_entrust_file_path"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("reject_reason"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("bs_mer_ledger"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
BsMerLedger record = (BsMerLedger) parameter.get("record"); |
||||
BsMerLedgerExample example = (BsMerLedgerExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitLowestRatio() != null) { |
||||
sql.SET("split_lowest_ratio = #{record.splitLowestRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFileName() != null) { |
||||
sql.SET("split_entrust_file_name = #{record.splitEntrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFilePath() != null) { |
||||
sql.SET("split_entrust_file_path = #{record.splitEntrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); |
||||
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}"); |
||||
sql.SET("platform_no = #{record.platformNo,jdbcType=VARCHAR}"); |
||||
sql.SET("cup_no = #{record.cupNo,jdbcType=VARCHAR}"); |
||||
sql.SET("receiver_no = #{record.receiverNo,jdbcType=VARCHAR}"); |
||||
sql.SET("split_lowest_ratio = #{record.splitLowestRatio,jdbcType=DECIMAL}"); |
||||
sql.SET("split_entrust_file_name = #{record.splitEntrustFileName,jdbcType=VARCHAR}"); |
||||
sql.SET("split_entrust_file_path = #{record.splitEntrustFilePath,jdbcType=VARCHAR}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("reject_reason = #{record.rejectReason,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
BsMerLedgerExample example = (BsMerLedgerExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(BsMerLedger record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("bs_mer_ledger"); |
||||
|
||||
if (record.getMerId() != null) { |
||||
sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getPlatformType() != null) { |
||||
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getPlatformNo() != null) { |
||||
sql.SET("platform_no = #{platformNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCupNo() != null) { |
||||
sql.SET("cup_no = #{cupNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getReceiverNo() != null) { |
||||
sql.SET("receiver_no = #{receiverNo,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitLowestRatio() != null) { |
||||
sql.SET("split_lowest_ratio = #{splitLowestRatio,jdbcType=DECIMAL}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFileName() != null) { |
||||
sql.SET("split_entrust_file_name = #{splitEntrustFileName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSplitEntrustFilePath() != null) { |
||||
sql.SET("split_entrust_file_path = #{splitEntrustFilePath,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getRejectReason() != null) { |
||||
sql.SET("reject_reason = #{rejectReason,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, BsMerLedgerExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,297 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_mer_ledger |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerLedger implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 平台 |
||||
*/ |
||||
private Integer platformType; |
||||
|
||||
/** |
||||
* 平台商户号 |
||||
*/ |
||||
private String platformNo; |
||||
|
||||
/** |
||||
* 银联商户号 |
||||
*/ |
||||
private String cupNo; |
||||
|
||||
/** |
||||
* 接收编号 |
||||
*/ |
||||
private String receiverNo; |
||||
|
||||
/** |
||||
* 最低分账比例 |
||||
*/ |
||||
private BigDecimal splitLowestRatio; |
||||
|
||||
/** |
||||
* 分账结算委托书文件名称 |
||||
*/ |
||||
private String splitEntrustFileName; |
||||
|
||||
/** |
||||
* 分账结算委托书文件路径 |
||||
*/ |
||||
private String splitEntrustFilePath; |
||||
|
||||
/** |
||||
* 状态 0:不可用 1:可用 2:审核中 3:审核驳回 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 驳回原因 |
||||
*/ |
||||
private String rejectReason; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public Integer getPlatformType() { |
||||
return platformType; |
||||
} |
||||
|
||||
public void setPlatformType(Integer platformType) { |
||||
this.platformType = platformType; |
||||
} |
||||
|
||||
public String getPlatformNo() { |
||||
return platformNo; |
||||
} |
||||
|
||||
public void setPlatformNo(String platformNo) { |
||||
this.platformNo = platformNo; |
||||
} |
||||
|
||||
public String getCupNo() { |
||||
return cupNo; |
||||
} |
||||
|
||||
public void setCupNo(String cupNo) { |
||||
this.cupNo = cupNo; |
||||
} |
||||
|
||||
public String getReceiverNo() { |
||||
return receiverNo; |
||||
} |
||||
|
||||
public void setReceiverNo(String receiverNo) { |
||||
this.receiverNo = receiverNo; |
||||
} |
||||
|
||||
public BigDecimal getSplitLowestRatio() { |
||||
return splitLowestRatio; |
||||
} |
||||
|
||||
public void setSplitLowestRatio(BigDecimal splitLowestRatio) { |
||||
this.splitLowestRatio = splitLowestRatio; |
||||
} |
||||
|
||||
public String getSplitEntrustFileName() { |
||||
return splitEntrustFileName; |
||||
} |
||||
|
||||
public void setSplitEntrustFileName(String splitEntrustFileName) { |
||||
this.splitEntrustFileName = splitEntrustFileName; |
||||
} |
||||
|
||||
public String getSplitEntrustFilePath() { |
||||
return splitEntrustFilePath; |
||||
} |
||||
|
||||
public void setSplitEntrustFilePath(String splitEntrustFilePath) { |
||||
this.splitEntrustFilePath = splitEntrustFilePath; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getRejectReason() { |
||||
return rejectReason; |
||||
} |
||||
|
||||
public void setRejectReason(String rejectReason) { |
||||
this.rejectReason = rejectReason; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsMerLedger other = (BsMerLedger) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) |
||||
&& (this.getPlatformNo() == null ? other.getPlatformNo() == null : this.getPlatformNo().equals(other.getPlatformNo())) |
||||
&& (this.getCupNo() == null ? other.getCupNo() == null : this.getCupNo().equals(other.getCupNo())) |
||||
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo())) |
||||
&& (this.getSplitLowestRatio() == null ? other.getSplitLowestRatio() == null : this.getSplitLowestRatio().equals(other.getSplitLowestRatio())) |
||||
&& (this.getSplitEntrustFileName() == null ? other.getSplitEntrustFileName() == null : this.getSplitEntrustFileName().equals(other.getSplitEntrustFileName())) |
||||
&& (this.getSplitEntrustFilePath() == null ? other.getSplitEntrustFilePath() == null : this.getSplitEntrustFilePath().equals(other.getSplitEntrustFilePath())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); |
||||
result = prime * result + ((getPlatformNo() == null) ? 0 : getPlatformNo().hashCode()); |
||||
result = prime * result + ((getCupNo() == null) ? 0 : getCupNo().hashCode()); |
||||
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode()); |
||||
result = prime * result + ((getSplitLowestRatio() == null) ? 0 : getSplitLowestRatio().hashCode()); |
||||
result = prime * result + ((getSplitEntrustFileName() == null) ? 0 : getSplitEntrustFileName().hashCode()); |
||||
result = prime * result + ((getSplitEntrustFilePath() == null) ? 0 : getSplitEntrustFilePath().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", platformType=").append(platformType); |
||||
sb.append(", platformNo=").append(platformNo); |
||||
sb.append(", cupNo=").append(cupNo); |
||||
sb.append(", receiverNo=").append(receiverNo); |
||||
sb.append(", splitLowestRatio=").append(splitLowestRatio); |
||||
sb.append(", splitEntrustFileName=").append(splitEntrustFileName); |
||||
sb.append(", splitEntrustFilePath=").append(splitEntrustFilePath); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", rejectReason=").append(rejectReason); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,264 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_mer_ledger_apply |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerLedgerApply implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户分账id |
||||
*/ |
||||
private Long merLedgerId; |
||||
|
||||
/** |
||||
* 订单编号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 受理编号 |
||||
*/ |
||||
private String applyId; |
||||
|
||||
/** |
||||
* 请求报文 |
||||
*/ |
||||
private String requestBody; |
||||
|
||||
/** |
||||
* 响应报文 |
||||
*/ |
||||
private String responseBody; |
||||
|
||||
/** |
||||
* 异步通知报文 |
||||
*/ |
||||
private String notifyBody; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:正常 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public Long getMerLedgerId() { |
||||
return merLedgerId; |
||||
} |
||||
|
||||
public void setMerLedgerId(Long merLedgerId) { |
||||
this.merLedgerId = merLedgerId; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getApplyId() { |
||||
return applyId; |
||||
} |
||||
|
||||
public void setApplyId(String applyId) { |
||||
this.applyId = applyId; |
||||
} |
||||
|
||||
public String getRequestBody() { |
||||
return requestBody; |
||||
} |
||||
|
||||
public void setRequestBody(String requestBody) { |
||||
this.requestBody = requestBody; |
||||
} |
||||
|
||||
public String getResponseBody() { |
||||
return responseBody; |
||||
} |
||||
|
||||
public void setResponseBody(String responseBody) { |
||||
this.responseBody = responseBody; |
||||
} |
||||
|
||||
public String getNotifyBody() { |
||||
return notifyBody; |
||||
} |
||||
|
||||
public void setNotifyBody(String notifyBody) { |
||||
this.notifyBody = notifyBody; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsMerLedgerApply other = (BsMerLedgerApply) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getApplyId() == null ? other.getApplyId() == null : this.getApplyId().equals(other.getApplyId())) |
||||
&& (this.getRequestBody() == null ? other.getRequestBody() == null : this.getRequestBody().equals(other.getRequestBody())) |
||||
&& (this.getResponseBody() == null ? other.getResponseBody() == null : this.getResponseBody().equals(other.getResponseBody())) |
||||
&& (this.getNotifyBody() == null ? other.getNotifyBody() == null : this.getNotifyBody().equals(other.getNotifyBody())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getApplyId() == null) ? 0 : getApplyId().hashCode()); |
||||
result = prime * result + ((getRequestBody() == null) ? 0 : getRequestBody().hashCode()); |
||||
result = prime * result + ((getResponseBody() == null) ? 0 : getResponseBody().hashCode()); |
||||
result = prime * result + ((getNotifyBody() == null) ? 0 : getNotifyBody().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", merLedgerId=").append(merLedgerId); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", applyId=").append(applyId); |
||||
sb.append(", requestBody=").append(requestBody); |
||||
sb.append(", responseBody=").append(responseBody); |
||||
sb.append(", notifyBody=").append(notifyBody); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,312 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_mer_ledger_receiver |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerLedgerReceiver implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户分账id |
||||
*/ |
||||
private Long merLedgerId; |
||||
|
||||
/** |
||||
* 平台 1:拉卡拉 |
||||
*/ |
||||
private Integer platformType; |
||||
|
||||
/** |
||||
* 平台商户号 |
||||
*/ |
||||
private String platformNo; |
||||
|
||||
/** |
||||
* 银联商户号 |
||||
*/ |
||||
private String cupNo; |
||||
|
||||
/** |
||||
* 接收方编号 |
||||
*/ |
||||
private String receiverNo; |
||||
|
||||
/** |
||||
* 接收方名称 |
||||
*/ |
||||
private String receiverName; |
||||
|
||||
/** |
||||
* 合作协议附件名称 |
||||
*/ |
||||
private String entrustFileName; |
||||
|
||||
/** |
||||
* 合作协议附件路径 |
||||
*/ |
||||
private String entrustFilePath; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:可用 2:审核中 3:审核驳回 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 驳回原因 |
||||
*/ |
||||
private String rejectReason; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public Long getMerLedgerId() { |
||||
return merLedgerId; |
||||
} |
||||
|
||||
public void setMerLedgerId(Long merLedgerId) { |
||||
this.merLedgerId = merLedgerId; |
||||
} |
||||
|
||||
public Integer getPlatformType() { |
||||
return platformType; |
||||
} |
||||
|
||||
public void setPlatformType(Integer platformType) { |
||||
this.platformType = platformType; |
||||
} |
||||
|
||||
public String getPlatformNo() { |
||||
return platformNo; |
||||
} |
||||
|
||||
public void setPlatformNo(String platformNo) { |
||||
this.platformNo = platformNo; |
||||
} |
||||
|
||||
public String getCupNo() { |
||||
return cupNo; |
||||
} |
||||
|
||||
public void setCupNo(String cupNo) { |
||||
this.cupNo = cupNo; |
||||
} |
||||
|
||||
public String getReceiverNo() { |
||||
return receiverNo; |
||||
} |
||||
|
||||
public void setReceiverNo(String receiverNo) { |
||||
this.receiverNo = receiverNo; |
||||
} |
||||
|
||||
public String getReceiverName() { |
||||
return receiverName; |
||||
} |
||||
|
||||
public void setReceiverName(String receiverName) { |
||||
this.receiverName = receiverName; |
||||
} |
||||
|
||||
public String getEntrustFileName() { |
||||
return entrustFileName; |
||||
} |
||||
|
||||
public void setEntrustFileName(String entrustFileName) { |
||||
this.entrustFileName = entrustFileName; |
||||
} |
||||
|
||||
public String getEntrustFilePath() { |
||||
return entrustFilePath; |
||||
} |
||||
|
||||
public void setEntrustFilePath(String entrustFilePath) { |
||||
this.entrustFilePath = entrustFilePath; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getRejectReason() { |
||||
return rejectReason; |
||||
} |
||||
|
||||
public void setRejectReason(String rejectReason) { |
||||
this.rejectReason = rejectReason; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsMerLedgerReceiver other = (BsMerLedgerReceiver) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId())) |
||||
&& (this.getPlatformType() == null ? other.getPlatformType() == null : this.getPlatformType().equals(other.getPlatformType())) |
||||
&& (this.getPlatformNo() == null ? other.getPlatformNo() == null : this.getPlatformNo().equals(other.getPlatformNo())) |
||||
&& (this.getCupNo() == null ? other.getCupNo() == null : this.getCupNo().equals(other.getCupNo())) |
||||
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo())) |
||||
&& (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName())) |
||||
&& (this.getEntrustFileName() == null ? other.getEntrustFileName() == null : this.getEntrustFileName().equals(other.getEntrustFileName())) |
||||
&& (this.getEntrustFilePath() == null ? other.getEntrustFilePath() == null : this.getEntrustFilePath().equals(other.getEntrustFilePath())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode()); |
||||
result = prime * result + ((getPlatformType() == null) ? 0 : getPlatformType().hashCode()); |
||||
result = prime * result + ((getPlatformNo() == null) ? 0 : getPlatformNo().hashCode()); |
||||
result = prime * result + ((getCupNo() == null) ? 0 : getCupNo().hashCode()); |
||||
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode()); |
||||
result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode()); |
||||
result = prime * result + ((getEntrustFileName() == null) ? 0 : getEntrustFileName().hashCode()); |
||||
result = prime * result + ((getEntrustFilePath() == null) ? 0 : getEntrustFilePath().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", merLedgerId=").append(merLedgerId); |
||||
sb.append(", platformType=").append(platformType); |
||||
sb.append(", platformNo=").append(platformNo); |
||||
sb.append(", cupNo=").append(cupNo); |
||||
sb.append(", receiverNo=").append(receiverNo); |
||||
sb.append(", receiverName=").append(receiverName); |
||||
sb.append(", entrustFileName=").append(entrustFileName); |
||||
sb.append(", entrustFilePath=").append(entrustFilePath); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", rejectReason=").append(rejectReason); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,312 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* bs_mer_ledger_receiver_apply |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class BsMerLedgerReceiverApply implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 商户id |
||||
*/ |
||||
private Long merId; |
||||
|
||||
/** |
||||
* 商户分账id |
||||
*/ |
||||
private Long merLedgerId; |
||||
|
||||
/** |
||||
* 商户分账接收方id |
||||
*/ |
||||
private Long merLedgerReceiverId; |
||||
|
||||
/** |
||||
* 接受编号 |
||||
*/ |
||||
private String receiverNo; |
||||
|
||||
/** |
||||
* 订单编号 |
||||
*/ |
||||
private String orderNo; |
||||
|
||||
/** |
||||
* 受理编号 |
||||
*/ |
||||
private String applyId; |
||||
|
||||
/** |
||||
* 请求报文 |
||||
*/ |
||||
private String requestBody; |
||||
|
||||
/** |
||||
* 响应报文 |
||||
*/ |
||||
private String responseBody; |
||||
|
||||
/** |
||||
* 异步通知报文 |
||||
*/ |
||||
private String notifyBody; |
||||
|
||||
/** |
||||
* 状态 0:删除 1:审核中 2:通过 3:驳回 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* 驳回原因 |
||||
*/ |
||||
private String rejectReason; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 修改时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
private String ext1; |
||||
|
||||
private String ext2; |
||||
|
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Long getMerId() { |
||||
return merId; |
||||
} |
||||
|
||||
public void setMerId(Long merId) { |
||||
this.merId = merId; |
||||
} |
||||
|
||||
public Long getMerLedgerId() { |
||||
return merLedgerId; |
||||
} |
||||
|
||||
public void setMerLedgerId(Long merLedgerId) { |
||||
this.merLedgerId = merLedgerId; |
||||
} |
||||
|
||||
public Long getMerLedgerReceiverId() { |
||||
return merLedgerReceiverId; |
||||
} |
||||
|
||||
public void setMerLedgerReceiverId(Long merLedgerReceiverId) { |
||||
this.merLedgerReceiverId = merLedgerReceiverId; |
||||
} |
||||
|
||||
public String getReceiverNo() { |
||||
return receiverNo; |
||||
} |
||||
|
||||
public void setReceiverNo(String receiverNo) { |
||||
this.receiverNo = receiverNo; |
||||
} |
||||
|
||||
public String getOrderNo() { |
||||
return orderNo; |
||||
} |
||||
|
||||
public void setOrderNo(String orderNo) { |
||||
this.orderNo = orderNo; |
||||
} |
||||
|
||||
public String getApplyId() { |
||||
return applyId; |
||||
} |
||||
|
||||
public void setApplyId(String applyId) { |
||||
this.applyId = applyId; |
||||
} |
||||
|
||||
public String getRequestBody() { |
||||
return requestBody; |
||||
} |
||||
|
||||
public void setRequestBody(String requestBody) { |
||||
this.requestBody = requestBody; |
||||
} |
||||
|
||||
public String getResponseBody() { |
||||
return responseBody; |
||||
} |
||||
|
||||
public void setResponseBody(String responseBody) { |
||||
this.responseBody = responseBody; |
||||
} |
||||
|
||||
public String getNotifyBody() { |
||||
return notifyBody; |
||||
} |
||||
|
||||
public void setNotifyBody(String notifyBody) { |
||||
this.notifyBody = notifyBody; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getRejectReason() { |
||||
return rejectReason; |
||||
} |
||||
|
||||
public void setRejectReason(String rejectReason) { |
||||
this.rejectReason = rejectReason; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
BsMerLedgerReceiverApply other = (BsMerLedgerReceiverApply) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) |
||||
&& (this.getMerLedgerId() == null ? other.getMerLedgerId() == null : this.getMerLedgerId().equals(other.getMerLedgerId())) |
||||
&& (this.getMerLedgerReceiverId() == null ? other.getMerLedgerReceiverId() == null : this.getMerLedgerReceiverId().equals(other.getMerLedgerReceiverId())) |
||||
&& (this.getReceiverNo() == null ? other.getReceiverNo() == null : this.getReceiverNo().equals(other.getReceiverNo())) |
||||
&& (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) |
||||
&& (this.getApplyId() == null ? other.getApplyId() == null : this.getApplyId().equals(other.getApplyId())) |
||||
&& (this.getRequestBody() == null ? other.getRequestBody() == null : this.getRequestBody().equals(other.getRequestBody())) |
||||
&& (this.getResponseBody() == null ? other.getResponseBody() == null : this.getResponseBody().equals(other.getResponseBody())) |
||||
&& (this.getNotifyBody() == null ? other.getNotifyBody() == null : this.getNotifyBody().equals(other.getNotifyBody())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getRejectReason() == null ? other.getRejectReason() == null : this.getRejectReason().equals(other.getRejectReason())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); |
||||
result = prime * result + ((getMerLedgerId() == null) ? 0 : getMerLedgerId().hashCode()); |
||||
result = prime * result + ((getMerLedgerReceiverId() == null) ? 0 : getMerLedgerReceiverId().hashCode()); |
||||
result = prime * result + ((getReceiverNo() == null) ? 0 : getReceiverNo().hashCode()); |
||||
result = prime * result + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); |
||||
result = prime * result + ((getApplyId() == null) ? 0 : getApplyId().hashCode()); |
||||
result = prime * result + ((getRequestBody() == null) ? 0 : getRequestBody().hashCode()); |
||||
result = prime * result + ((getResponseBody() == null) ? 0 : getResponseBody().hashCode()); |
||||
result = prime * result + ((getNotifyBody() == null) ? 0 : getNotifyBody().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getRejectReason() == null) ? 0 : getRejectReason().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", merId=").append(merId); |
||||
sb.append(", merLedgerId=").append(merLedgerId); |
||||
sb.append(", merLedgerReceiverId=").append(merLedgerReceiverId); |
||||
sb.append(", receiverNo=").append(receiverNo); |
||||
sb.append(", orderNo=").append(orderNo); |
||||
sb.append(", applyId=").append(applyId); |
||||
sb.append(", requestBody=").append(requestBody); |
||||
sb.append(", responseBody=").append(responseBody); |
||||
sb.append(", notifyBody=").append(notifyBody); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", rejectReason=").append(rejectReason); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,31 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerApply; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerApplyService |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public interface BsMerLedgerApplyService { |
||||
|
||||
/** |
||||
* 编辑商户分账申请记录 |
||||
* @param merLedgerApply |
||||
*/ |
||||
void editMerLedgerApply(BsMerLedgerApply merLedgerApply); |
||||
|
||||
/** |
||||
* 获取商户分账申请记录 |
||||
* @param orderNo |
||||
* @return |
||||
*/ |
||||
BsMerLedgerApply getApplyByOrderNo(String orderNo); |
||||
|
||||
/** |
||||
* 获取商户分账申请记录 |
||||
* @param applyId |
||||
* @return |
||||
*/ |
||||
BsMerLedgerApply getApplyByApplyId(String applyId); |
||||
} |
@ -0,0 +1,24 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiverApply; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerReceiverApplyService |
||||
* @author: HuRui |
||||
* @date: 2023/4/19 |
||||
**/ |
||||
public interface BsMerLedgerReceiverApplyService { |
||||
|
||||
/** |
||||
* 编辑接收方申请 |
||||
* @param merLedgerReceiverApply |
||||
*/ |
||||
void editReceiverApply(BsMerLedgerReceiverApply merLedgerReceiverApply); |
||||
|
||||
/** |
||||
* 根据受理编号查询 |
||||
* @param applyId |
||||
* @return |
||||
*/ |
||||
BsMerLedgerReceiverApply getReceiverApplyByApplyId(String applyId); |
||||
} |
@ -0,0 +1,55 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsMerLedgerReceiver; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerReceiverService |
||||
* @author: HuRui |
||||
* @date: 2023/4/19 |
||||
**/ |
||||
public interface BsMerLedgerReceiverService { |
||||
|
||||
/** |
||||
* 编辑分账接收方 |
||||
* @param merLedgerReceiver |
||||
*/ |
||||
void editMerLedgerReceiver(BsMerLedgerReceiver merLedgerReceiver); |
||||
|
||||
/** |
||||
* 商户分账接收方申请 |
||||
* @param merLedgerReceiver |
||||
*/ |
||||
void merLedgerReceiverApply(BsMerLedgerReceiver merLedgerReceiver); |
||||
|
||||
/** |
||||
* 商户分账接收方申请 |
||||
* @param merLedgerReceiver |
||||
*/ |
||||
void merLedgerReceiverDel(BsMerLedgerReceiver merLedgerReceiver); |
||||
|
||||
/** |
||||
* 查询分账接收方详情 |
||||
* @param merId |
||||
* @param receiverNo |
||||
* @return |
||||
*/ |
||||
BsMerLedgerReceiver getMerLedgerReceiver(Long merId,String receiverNo); |
||||
|
||||
/** |
||||
* 查询商户的接收方 |
||||
* @param merId |
||||
* @return |
||||
*/ |
||||
List<BsMerLedgerReceiver> getMerLedgerReceiverByMer(Long merId, PlatformTypeEnum platformType); |
||||
|
||||
/** |
||||
* 查询分账接收方列表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BsMerLedgerReceiver> getMerLedgerReceiverList(Map<String,Object> param); |
||||
} |
@ -0,0 +1,41 @@ |
||||
package com.hfkj.service; |
||||
|
||||
import com.hfkj.entity.BsMerLedger; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerService |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public interface BsMerLedgerService { |
||||
|
||||
/** |
||||
* 编辑商户分账信息 |
||||
* @param merLedger |
||||
*/ |
||||
void editMerLedger(BsMerLedger merLedger); |
||||
|
||||
/** |
||||
* 商户分账功能申请 |
||||
* @param merLedger |
||||
*/ |
||||
void merLedgerApply(BsMerLedger merLedger); |
||||
|
||||
/** |
||||
* 查询商户分账信息 |
||||
* @param merId |
||||
* @param platformType |
||||
* @return |
||||
*/ |
||||
BsMerLedger getMerLedger(Long merId, PlatformTypeEnum platformType); |
||||
|
||||
/** |
||||
* 查询商户分账信息 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
BsMerLedger getMerLedgerById(Long id); |
||||
|
||||
|
||||
} |
@ -0,0 +1,53 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsMerLedgerApplyMapper; |
||||
import com.hfkj.dao.BsMerLedgerMapper; |
||||
import com.hfkj.entity.BsMerLedgerApply; |
||||
import com.hfkj.entity.BsMerLedgerApplyExample; |
||||
import com.hfkj.service.BsMerLedgerApplyService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerApplyServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
@Service("merLedgerApplyService") |
||||
public class BsMerLedgerApplyServiceImpl implements BsMerLedgerApplyService { |
||||
|
||||
@Resource |
||||
private BsMerLedgerApplyMapper merLedgerApplyMapper; |
||||
|
||||
@Override |
||||
public void editMerLedgerApply(BsMerLedgerApply merLedgerApply) { |
||||
if (merLedgerApply.getId() == null) { |
||||
merLedgerApply.setStatus(1); |
||||
merLedgerApply.setCreateTime(new Date()); |
||||
merLedgerApply.setUpdateTime(new Date()); |
||||
merLedgerApplyMapper.insert(merLedgerApply); |
||||
} else { |
||||
merLedgerApply.setUpdateTime(new Date()); |
||||
merLedgerApplyMapper.updateByPrimaryKey(merLedgerApply); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedgerApply getApplyByOrderNo(String orderNo) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedgerApply getApplyByApplyId(String applyId) { |
||||
BsMerLedgerApplyExample example = new BsMerLedgerApplyExample(); |
||||
example.createCriteria().andApplyIdEqualTo(applyId).andStatusNotEqualTo(0); |
||||
List<BsMerLedgerApply> list = merLedgerApplyMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,46 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.dao.BsMerLedgerReceiverApplyMapper; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApply; |
||||
import com.hfkj.entity.BsMerLedgerReceiverApplyExample; |
||||
import com.hfkj.service.BsMerLedgerReceiverApplyService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerReceiverApplyServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/4/19 |
||||
**/ |
||||
@Service("merLedgerReceiverApplyService") |
||||
public class BsMerLedgerReceiverApplyServiceImpl implements BsMerLedgerReceiverApplyService { |
||||
|
||||
@Resource |
||||
private BsMerLedgerReceiverApplyMapper merLedgerReceiverApplyMapper; |
||||
|
||||
@Override |
||||
public void editReceiverApply(BsMerLedgerReceiverApply merLedgerReceiverApply) { |
||||
if (merLedgerReceiverApply.getId() == null) { |
||||
merLedgerReceiverApply.setUpdateTime(new Date()); |
||||
merLedgerReceiverApply.setCreateTime(new Date()); |
||||
merLedgerReceiverApplyMapper.insert(merLedgerReceiverApply); |
||||
} else { |
||||
merLedgerReceiverApply.setUpdateTime(new Date()); |
||||
merLedgerReceiverApplyMapper.updateByPrimaryKey(merLedgerReceiverApply); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedgerReceiverApply getReceiverApplyByApplyId(String applyId) { |
||||
BsMerLedgerReceiverApplyExample example = new BsMerLedgerReceiverApplyExample(); |
||||
example.createCriteria().andApplyIdEqualTo(applyId); |
||||
List<BsMerLedgerReceiverApply> list = merLedgerReceiverApplyMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,104 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.channel.lakala.LaKaLaLedgerService; |
||||
import com.hfkj.channel.lakala.LaKaLaMerService; |
||||
import com.hfkj.dao.BsMerLedgerReceiverMapper; |
||||
import com.hfkj.entity.BsMerLedgerReceiver; |
||||
import com.hfkj.entity.BsMerLedgerReceiverExample; |
||||
import com.hfkj.service.BsMerLedgerReceiverService; |
||||
import com.hfkj.sysenum.MerLedgerReceiverStatusEnum; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerReceiverServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/4/19 |
||||
**/ |
||||
@Service("merLedgerReceiverService") |
||||
public class BsMerLedgerReceiverServiceImpl implements BsMerLedgerReceiverService { |
||||
|
||||
@Resource |
||||
private BsMerLedgerReceiverMapper merLedgerReceiverMapper; |
||||
|
||||
@Resource |
||||
private LaKaLaLedgerService laKaLaLedgerService; |
||||
|
||||
@Override |
||||
public void editMerLedgerReceiver(BsMerLedgerReceiver merLedgerReceiver) { |
||||
if (merLedgerReceiver.getId() == null) { |
||||
merLedgerReceiver.setCreateTime(new Date()); |
||||
merLedgerReceiver.setUpdateTime(new Date()); |
||||
merLedgerReceiverMapper.insert(merLedgerReceiver); |
||||
} else { |
||||
merLedgerReceiver.setUpdateTime(new Date()); |
||||
merLedgerReceiverMapper.updateByPrimaryKey(merLedgerReceiver); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void merLedgerReceiverApply(BsMerLedgerReceiver merLedgerReceiver) { |
||||
editMerLedgerReceiver(merLedgerReceiver); |
||||
|
||||
if (merLedgerReceiver.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
laKaLaLedgerService.applyBind(merLedgerReceiver.getMerId(), merLedgerReceiver.getReceiverNo()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void merLedgerReceiverDel(BsMerLedgerReceiver merLedgerReceiver) { |
||||
editMerLedgerReceiver(merLedgerReceiver); |
||||
|
||||
if (merLedgerReceiver.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
laKaLaLedgerService.applyUnBind(merLedgerReceiver.getMerId(), merLedgerReceiver.getReceiverNo()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedgerReceiver getMerLedgerReceiver(Long merId, String receiverNo) { |
||||
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample(); |
||||
example.createCriteria().andMerIdEqualTo(merId).andReceiverNoEqualTo(receiverNo).andStatusNotEqualTo(0); |
||||
List<BsMerLedgerReceiver> list = merLedgerReceiverMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<BsMerLedgerReceiver> getMerLedgerReceiverByMer(Long merId, PlatformTypeEnum platformType) { |
||||
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample(); |
||||
example.createCriteria().andMerIdEqualTo(merId).andStatusNotEqualTo(0).andPlatformTypeEqualTo(platformType.getNumber()); |
||||
return merLedgerReceiverMapper.selectByExample(example); |
||||
} |
||||
|
||||
@Override |
||||
public List<BsMerLedgerReceiver> getMerLedgerReceiverList(Map<String, Object> param) { |
||||
BsMerLedgerReceiverExample example = new BsMerLedgerReceiverExample(); |
||||
BsMerLedgerReceiverExample.Criteria criteria = example.createCriteria() |
||||
.andStatusNotEqualTo(MerLedgerReceiverStatusEnum.status0.getNumber()); |
||||
|
||||
if (MapUtils.getInteger(param, "platformType") != null) { |
||||
criteria.andPlatformTypeEqualTo(MapUtils.getInteger(param, "platformType")); |
||||
} |
||||
|
||||
if (MapUtils.getInteger(param, "status") != null) { |
||||
criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); |
||||
} |
||||
|
||||
if (MapUtils.getBoolean(param, "receiverNoNotNull") != null) { |
||||
criteria.andReceiverNoIsNotNull(); |
||||
} |
||||
|
||||
example.setOrderByClause("create_time desc"); |
||||
return merLedgerReceiverMapper.selectByExample(example); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.service.impl; |
||||
|
||||
import com.hfkj.channel.lakala.LaKaLaLedgerService; |
||||
import com.hfkj.dao.BsMerLedgerMapper; |
||||
import com.hfkj.entity.BsMerLedger; |
||||
import com.hfkj.entity.BsMerLedgerExample; |
||||
import com.hfkj.service.BsMerLedgerService; |
||||
import com.hfkj.sysenum.PlatformTypeEnum; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* @className: BsMerLedgerServiceImpl |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
@Service("merLedgerService") |
||||
public class BsMerLedgerServiceImpl implements BsMerLedgerService { |
||||
|
||||
@Resource |
||||
private BsMerLedgerMapper merLedgerMapper; |
||||
|
||||
@Resource |
||||
private LaKaLaLedgerService laKaLaLedgerService; |
||||
|
||||
@Override |
||||
public void editMerLedger(BsMerLedger merLedger) { |
||||
if (merLedger.getId() == null) { |
||||
merLedger.setCreateTime(new Date()); |
||||
merLedger.setUpdateTime(new Date()); |
||||
merLedgerMapper.insert(merLedger); |
||||
} else { |
||||
merLedger.setUpdateTime(new Date()); |
||||
merLedgerMapper.updateByPrimaryKey(merLedger); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void merLedgerApply(BsMerLedger merLedger) { |
||||
editMerLedger(merLedger); |
||||
|
||||
if (merLedger.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { |
||||
laKaLaLedgerService.applyLedger(merLedger.getId()); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedger getMerLedger(Long merId, PlatformTypeEnum platformType) { |
||||
BsMerLedgerExample example = new BsMerLedgerExample(); |
||||
example.createCriteria() |
||||
.andMerIdEqualTo(merId) |
||||
.andStatusNotEqualTo(0) |
||||
.andPlatformTypeEqualTo(platformType.getNumber()); |
||||
List<BsMerLedger> list = merLedgerMapper.selectByExample(example); |
||||
if (list.size() > 0) { |
||||
return list.get(0); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public BsMerLedger getMerLedgerById(Long id) { |
||||
return merLedgerMapper.selectByPrimaryKey(id); |
||||
} |
||||
} |
@ -0,0 +1,52 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum MerLedgerReceiverApplyStatusEnum { |
||||
status0(0, "不可用"), |
||||
status1(1, "审核中"), |
||||
status2(2, "通过"), |
||||
status3(3, "驳回"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
MerLedgerReceiverApplyStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static MerLedgerReceiverApplyStatusEnum getDataByNumber(Integer number) { |
||||
for (MerLedgerReceiverApplyStatusEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,52 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum MerLedgerReceiverStatusEnum { |
||||
status0(0, "不可用"), |
||||
status1(1, "可用"), |
||||
status2(2, "审核中"), |
||||
status3(3, "审核驳回"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
MerLedgerReceiverStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static MerLedgerReceiverStatusEnum getDataByNumber(Integer number) { |
||||
for (MerLedgerReceiverStatusEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,52 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum MerLedgerStatusEnum { |
||||
status0(0, "不可用"), |
||||
status1(1, "可用"), |
||||
status2(2, "审核中"), |
||||
status3(3, "审核驳回"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
MerLedgerStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static MerLedgerStatusEnum getDataByNumber(Integer number) { |
||||
for (MerLedgerStatusEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,52 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 分账指令类型 |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum ProfitSharingCmdTypeEnum { |
||||
CMD_TYPE_1(1, "分账"), |
||||
CMD_TYPE_2(2, "分账撤销"), |
||||
CMD_TYPE_3(3, "分账回退"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
ProfitSharingCmdTypeEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static ProfitSharingCmdTypeEnum getDataByNumber(Integer number) { |
||||
for (ProfitSharingCmdTypeEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,50 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum ProfitSharingReceiverStatusEnum { |
||||
status0(0, "待分账"), |
||||
status1(1, "已分账"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
ProfitSharingReceiverStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static ProfitSharingReceiverStatusEnum getDataByNumber(Integer number) { |
||||
for (ProfitSharingReceiverStatusEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,53 @@ |
||||
package com.hfkj.sysenum; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* @className: MerLedgerStatusEnum |
||||
* @author: HuRui |
||||
* @date: 2023/4/18 |
||||
**/ |
||||
public enum ProfitSharingStatusEnum { |
||||
status0(0, "待处理"), |
||||
status1(1, "已完成"), |
||||
status2(2, "处理中"), |
||||
status3(3, "已受理"), |
||||
status4(4, "失败"), |
||||
; |
||||
|
||||
private Integer number; |
||||
|
||||
private String name; |
||||
|
||||
|
||||
ProfitSharingStatusEnum(int number, String name) { |
||||
this.number = number; |
||||
this.name = name; |
||||
} |
||||
|
||||
public static ProfitSharingStatusEnum getDataByNumber(Integer number) { |
||||
for (ProfitSharingStatusEnum ele : values()) { |
||||
if (Objects.equals(number,ele.getNumber())) { |
||||
return ele; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public Integer getNumber() { |
||||
return number; |
||||
} |
||||
|
||||
public void setNumber(Integer number) { |
||||
this.number = number; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue