提交代码

yy_dev
胡锐 2 years ago
parent 6fc542f739
commit 1404a31e3b
  1. 1
      cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 32
      cweb/src/main/java/com/cweb/controller/BsMerController.java
  3. 7
      cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java
  4. 59
      cweb/src/main/java/com/cweb/controller/CommonController.java
  5. 28
      cweb/src/main/java/com/cweb/controller/LoginController.java
  6. 12
      cweb/src/main/java/com/cweb/controller/OcrController.java
  7. 7
      cweb/src/main/java/com/cweb/controller/PayController.java
  8. 124
      cweb/src/main/java/com/cweb/controller/TestController.java
  9. 23
      cweb/src/main/java/com/cweb/notify/LaKaLaController.java
  10. 118
      schedule/src/main/java/com/hfkj/schedule/Merchant.java
  11. 3
      service/src/main/java/com/hfkj/channel/alipay/AlipayMerService.java
  12. 6
      service/src/main/java/com/hfkj/channel/alipay/utils/AlipayUtils.java
  13. 60
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaMerService.java
  14. 15
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaTradeService.java
  15. 6
      service/src/main/java/com/hfkj/channel/lakala/config/LaKaLaConfig.java
  16. 338
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  17. 31
      service/src/main/java/com/hfkj/channel/saas/config/SaasConfig.java
  18. 67
      service/src/main/java/com/hfkj/channel/saas/saasenum/FileImgType.java
  19. 109
      service/src/main/java/com/hfkj/channel/saas/utils/RSAUtil.java
  20. 196
      service/src/main/java/com/hfkj/channel/saas/utils/SaasCommon.java
  21. 55
      service/src/main/java/com/hfkj/channel/saas/utils/SaasMerRequest.java
  22. 33
      service/src/main/java/com/hfkj/channel/saas/utils/SaasUtils.java
  23. 4
      service/src/main/java/com/hfkj/channel/weixin/WeiXinMerService.java
  24. 191
      service/src/main/java/com/hfkj/common/utils/HttpsUtils.java
  25. 11
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  26. 27
      service/src/main/java/com/hfkj/dao/BsMerAttachMapper.java
  27. 14
      service/src/main/java/com/hfkj/dao/BsMerAttachSqlProvider.java
  28. 1
      service/src/main/java/com/hfkj/dao/BsMerContractRecordMsgMapperExt.java
  29. 57
      service/src/main/java/com/hfkj/dao/BsMerMapper.java
  30. 25
      service/src/main/java/com/hfkj/dao/BsMerRateMapper.java
  31. 14
      service/src/main/java/com/hfkj/dao/BsMerRateSqlProvider.java
  32. 14
      service/src/main/java/com/hfkj/dao/BsMerSqlProvider.java
  33. 24
      service/src/main/java/com/hfkj/dao/SecRegionMapper.java
  34. 32
      service/src/main/java/com/hfkj/dao/SecRegionSqlProvider.java
  35. 16
      service/src/main/java/com/hfkj/entity/BsMer.java
  36. 18
      service/src/main/java/com/hfkj/entity/BsMerAttach.java
  37. 60
      service/src/main/java/com/hfkj/entity/BsMerAttachExample.java
  38. 70
      service/src/main/java/com/hfkj/entity/BsMerExample.java
  39. 16
      service/src/main/java/com/hfkj/entity/BsMerRate.java
  40. 70
      service/src/main/java/com/hfkj/entity/BsMerRateExample.java
  41. 32
      service/src/main/java/com/hfkj/entity/SecRegion.java
  42. 140
      service/src/main/java/com/hfkj/entity/SecRegionExample.java
  43. 17
      service/src/main/java/com/hfkj/ocr/AliYunOcrService.java
  44. 12
      service/src/main/java/com/hfkj/service/BsLklMccService.java
  45. 3
      service/src/main/java/com/hfkj/service/BsMerAttachService.java
  46. 4
      service/src/main/java/com/hfkj/service/impl/BsDeviceOrderServiceImpl.java
  47. 42
      service/src/main/java/com/hfkj/service/impl/BsLklMccServiceImpl.java
  48. 4
      service/src/main/java/com/hfkj/service/impl/BsMerAttachServiceImpl.java
  49. 15
      service/src/main/java/com/hfkj/service/impl/BsMerContractServiceImpl.java
  50. 163
      service/src/main/java/com/hfkj/service/impl/BsMerServiceImpl.java
  51. 4
      service/src/main/java/com/hfkj/service/impl/BsTradeOrderServiceImpl.java
  52. 43
      service/src/main/java/com/hfkj/sysenum/MerAttachType.java
  53. 1
      service/src/main/java/com/hfkj/sysenum/PlatformTypeEnum.java
  54. 21
      service/src/main/resources/dev/commonConfig.properties
  55. 15
      service/src/main/resources/prod/commonConfig.properties

@ -112,6 +112,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/login/*")
.excludePathPatterns("/test/*")
.excludePathPatterns("/sms/*")
.excludePathPatterns("/ocr/*")
;
}

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.cweb.config.SysConfig;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hfkj.channel.lakala.LaKaLaMerService;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
@ -60,6 +61,9 @@ public class BsMerController {
@Resource
private BsIndustryService industryService;
@Resource
private BsLklMccService mccService;
@Resource
private BsStoreService storeService;
@ -175,7 +179,7 @@ public class BsMerController {
|| mer.getMerType() == null
|| StringUtils.isBlank(mer.getMerName())
|| StringUtils.isBlank(mer.getMerAbbreviate())
// || StringUtils.isBlank(mer.getMerMccCode())
|| StringUtils.isBlank(mer.getMerMccCode())
|| StringUtils.isBlank(mer.getLarName())
|| StringUtils.isBlank(mer.getLarIdCard())
@ -205,6 +209,7 @@ public class BsMerController {
if (StringUtils.isBlank(mer.getBlisUrl())
|| StringUtils.isBlank(mer.getBlisName())
|| StringUtils.isBlank(mer.getBlisNo())
|| StringUtils.isBlank(mer.getBlisNo())
|| StringUtils.isBlank(mer.getBlisRegAddress())
|| mer.getBlisPeriodType() == null
|| StringUtils.isBlank(mer.getBlisPeriodStart())
@ -226,6 +231,14 @@ public class BsMerController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, "");
}
// MCC编码
BsLklMcc mcc = mccService.getMccByCode(mer.getMerMccCode());
if (mcc == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的MCC编码");
}
bsMer.setMerMccCode(mcc.getMaccCode());
bsMer.setMerMccName(mcc.getName());
// 行业
Map<String, BsIndustry> industry = industryService.getChildIndustry(mer.getMerIndustry().getChildId());
if (industry == null) {
@ -298,10 +311,21 @@ public class BsMerController {
|| merSettleAcct.getOpenningBankAreaCode() == null
|| merSettleAcct.getMerRateList() == null
|| merSettleAcct.getMerRateList().size() == 0
|| (merSettleAcct.getSettleType().equals(MerSettleType.status1.getNumber()) && StringUtils.isBlank(merSettleAcct.getOpenningBankLicenseUrl()))
|| (merSettleAcct.getSettleType().equals(MerSettleType.status2.getNumber()) && StringUtils.isBlank(merSettleAcct.getBankCardImg()))
|| (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) && StringUtils.isBlank(merSettleAcct.getBankCardImg()))
) {
log.error("configMerBasis error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (StringUtils.isBlank(merSettleAcct.getOpenningBankName())
|| StringUtils.isBlank(merSettleAcct.getOpenningBankCode())
|| StringUtils.isBlank(merSettleAcct.getClearingBankCode())) {
log.error("configMerBasis error!","参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
SecRegion openningBankArea = commonService.getRegionsById(merSettleAcct.getOpenningBankAreaCode());
if (openningBankArea == null) {
log.error("configMerBasis error!","参数错误");
@ -340,7 +364,7 @@ public class BsMerController {
// 对私非法人结算
if (merSettleAcct.getSettleType().equals(MerSettleType.status3.getNumber()) &&
(StringUtils.isBlank(merSettleAcct.getSettleIdCardPortraitImg())
|| StringUtils.isBlank(merSettleAcct.getCommissionImg())
// || StringUtils.isBlank(merSettleAcct.getCommissionImg())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardNationalEmblemImg())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardName())
|| StringUtils.isBlank(merSettleAcct.getSettleIdCardNo())
@ -360,7 +384,7 @@ public class BsMerController {
merSettleAcct.setSettleIdCardPeriodStart(bsMer.getLarIdCardPeriodStart());
merSettleAcct.setSettleIdCardPeriodEnd(bsMer.getLarIdCardPeriodEnd());
}
/*
// 查询开户行
JSONObject cardBin = LaKaLaConfig.queryCardBin(merSettleAcct.getBankCardNo());
if (cardBin == null) {
@ -375,7 +399,7 @@ public class BsMerController {
merSettleAcct.setOpenningBankName(cardBin.getString("bankName"));
merSettleAcct.setOpenningBankCode(cardBin.getString("bankCode"));
merSettleAcct.setClearingBankCode(cardBin.getString("clearingBankCode"));
merSettleAcct.setClearingBankCode(cardBin.getString("clearingBankCode"));*/
merService.configMerSettlement(merSettleAcct);

@ -187,7 +187,6 @@ public class BsTradeOrderController {
if (body == null
|| StringUtils.isBlank(body.getString("qrCodeSN"))
|| StringUtils.isBlank(body.getString("payMode"))
|| StringUtils.isBlank(body.getString("payUserId"))
|| body.getBigDecimal("totalAmount") == null
) {
log.error("configStore error!", "参数错误");
@ -199,6 +198,12 @@ public class BsTradeOrderController {
log.error("configStore error!", "未知支付方式");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知支付方式");
}
if ((TradeOrderPayModeEnum.ALIPAY.getCode().equals(payMode.getCode())
|| TradeOrderPayModeEnum.WECHAT.getCode().equals(payMode.getCode()))
&& StringUtils.isBlank(body.getString("payUserId"))) {
log.error("configStore error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
if (body.getBigDecimal("totalAmount").compareTo(new BigDecimal("0.01")) == -1) {
log.error("configStore error!", "参数错误");

@ -2,6 +2,11 @@ package com.cweb.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
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.ResponseMsgUtil;
import com.hfkj.entity.BsCompany;
import com.hfkj.entity.SecRegion;
@ -44,6 +49,9 @@ public class CommonController {
@Resource
private BsLklMccService lklMccService;
@Resource
private SaasCommon saasCommon;
@RequestMapping(value="/getDredgeProvince",method= RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询已开通的省份")
@ -208,21 +216,13 @@ public class CommonController {
}
}
@RequestMapping(value="/getLklMcc",method = RequestMethod.GET)
@RequestMapping(value="/getMccList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取拉卡拉MCC数据")
public ResponseData getLklMcc(@RequestParam(name = "name", required = false) String name,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize) {
@ApiOperation(value = "获取MCC数据")
public ResponseData getMccList() {
try {
Map<String, Object> param = new HashMap<>();
if (StringUtils.isNotBlank(name)) {
param.put("name", name);
}
PageHelper.startPage(pageNum,pageSize);
return ResponseMsgUtil.success(new PageInfo<>(lklMccService.getMccList(param)));
return ResponseMsgUtil.success(lklMccService.getMccList());
} catch (Exception e) {
log.error("CommonController --> getLklMcc() error!", e);
@ -230,4 +230,39 @@ public class CommonController {
}
}
@RequestMapping(value="/getBankCardBin",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取银行卡bin信息")
public ResponseData getBankCardBin(@RequestParam(value = "cardNo" , required = true) String cardNo) {
try {
return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin(cardNo));
} catch (Exception e) {
log.error("CommonController --> getBankCardBin() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getBankList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取银行支行列表")
public ResponseData getBankList(@RequestParam(value = "regionId" , required = true) Long regionId,
@RequestParam(value = "bankName" , required = true) String bankName) {
try {
SecRegion region = commonService.getRegionsById(regionId);
if (region == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的区域");
}
if (StringUtils.isBlank(region.getSaasBankCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "地区暂无法查询");
}
return ResponseMsgUtil.success(saasCommon.getBank(region.getSaasBankCode(), bankName));
} catch (Exception e) {
log.error("CommonController --> getBankCardBin() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,6 +1,9 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.hfkj.channel.alipay.utils.AlipayUtils;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
@ -19,10 +22,7 @@ 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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -272,4 +272,24 @@ public class LoginController {
}
}
@RequestMapping(value="/getAlipayUserId",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "获取支付宝用户id")
public ResponseData getAlipayUserId(@RequestParam(value = "code", required = true) String code) {
try {
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
request.setGrantType("authorization_code");
request.setCode(code);
AlipaySystemOauthTokenResponse response = AlipayUtils.initClient().certificateExecute(request);
if(response.isSuccess()){
return ResponseMsgUtil.success(response);
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取用户失败");
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -64,6 +64,18 @@ public class OcrController {
}
}
@RequestMapping(value="/recognizeBankAccount",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "银行开户许可证识别")
public ResponseData recognizeBankAccount(@RequestParam(name = "url", required = true) String url) {
try {
return ResponseMsgUtil.success(AliYunOcrService.recognizeBankAccount(url));
} catch (Exception e) {
log.error("recognizeBankCard error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/recognizeBusinessLicense",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "营业执照识别")

@ -106,9 +106,8 @@ public class PayController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
return ResponseMsgUtil.success(weiXinPayService.preorder(body.getString("outTradeNo")));
/* // 查询当前支付
// return ResponseMsgUtil.success(weiXinPayService.preorder(body.getString("outTradeNo")));
// 查询当前支付
List<BsPlatform> platformList = platformService.getPlatformList();
for (BsPlatform platform : platformList) {
@ -125,7 +124,7 @@ public class PayController {
}
}
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付失败");*/
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "支付失败");
} catch (Exception e) {
log.error(e.getMessage(), e);

@ -1,27 +1,42 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.hfkj.channel.alipay.utils.AlipayRequest;
import com.hfkj.channel.alipay.utils.AlipayUtils;
import com.hfkj.channel.lakala.LaKaLaTradeService;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.channel.saas.saasenum.FileImgType;
import com.hfkj.channel.saas.utils.SaasMerRequest;
import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.channel.weixin.utils.HttpClientBuilder;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.device.SoundService;
import com.hfkj.config.mqtt.MqttProviderService;
import com.hfkj.entity.BsLklMcc;
import com.hfkj.entity.SecRegion;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsLklMccService;
import com.hfkj.service.CommonService;
import com.hfkj.service.SecRegionService;
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.math.BigDecimal;
import java.io.File;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@ -40,13 +55,31 @@ public class TestController {
@Resource
private SoundService soundService;
@Resource
private SaasCommon saasCommon;
@Resource
private SaasMerRequest saasMerRequest;
@Resource
private SaasMerService saasMerService;
@Resource
private LaKaLaTradeService laKaLaTradeService;
@Resource
private CommonService commonService;
@Resource
private BsLklMccService lklMccService;
@RequestMapping(value="/rotationQueryTrade",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "交易【被扫】")
public ResponseData rotationQueryTrade() {
try {
return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("8113201013200109140"));
// return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("3100020709200056842"));
return ResponseMsgUtil.success(laKaLaTradeService.preorder(""));
} catch (Exception e) {
log.error(e.getMessage(), e);
@ -54,21 +87,96 @@ public class TestController {
}
}
@RequestMapping(value="/getApplyment",method = RequestMethod.GET)
@RequestMapping(value="/saasGetToken",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "上传文件")
public ResponseData getApplyment() {
@ApiOperation(value = "saasGetToken")
public ResponseData saasGetToken() {
try {
// return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("3100020709200056842"));
return ResponseMsgUtil.success(saasCommon.getToken());
return ResponseMsgUtil.success(LaKaLaConfig.queryCardBin("6226633602992094"));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/saasTest",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "saasTest")
public ResponseData saasTest(@RequestParam(value = "code", required = true) String code) {
try {
// return ResponseMsgUtil.success(saasCommon.fileUpload(new File("D:/home/project/gratia-pay/filesystem/share/1680164428924.png"), "OTHERS", "0"));
// 996900 6900 6905
// return ResponseMsgUtil.success(saasCommon.getArea("1"));
// return ResponseMsgUtil.success(saasCommon.getBank("1240", "工商银行"));
return ResponseMsgUtil.success(saasMerService.merchantInfo(code));
// 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));
/* AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
request.setGrantType("authorization_code");
request.setCode(code);
AlipaySystemOauthTokenResponse response = AlipayUtils.initClient().certificateExecute(request);
if(response.isSuccess()){
System.out.println("调用成功");
return ResponseMsgUtil.success(response);
} else {
System.out.println("调用失败");
return ResponseMsgUtil.success("调用失败");
}*/
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
public static void main(String[] args) {
System.out.println(test("邯郸市", 1));
}
public static String test(String str, Integer type) {
char[] chars = str.toCharArray();
// oP: '省' 的偏移, oC: '市' 的偏移, oR: "自治区" 的偏移
int oP = -1, oC = -1, oR = -1;
char ch;
for (int i = 0; i < chars.length; i++) {
ch = chars[i];
// 一般来说 '省' 的位置会比 '市' 早出现
if (ch == '省') {
oP = i;
} else if (ch == '市') {
oC = i;
// 找到 '市' 后就可以跳出循环了
break;
} else if (ch == '自'
&& i + 2 < chars.length
&& chars[i + 1] == '治'
&& chars[i + 2] == '区') {
// "自治区" 出现的几率挺小
oR = i + 2;
}
}
if (type == 1) {
if (oC != -1) {
str = str.substring(oC + 1);
} else if (oP != -1) {
str = str.substring(oP + 1);
} else if (oR != -1) {
str = str.substring(oR + 1);
}
} else if (type == 2) {
if (oP != -1) {
str = str.substring(oP + 1);
} else if (oR != -1) {
str = str.substring(oR + 1);
}
}
return str;
}
@RequestMapping(value="/soundSendMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "音响发送消息")

@ -1,15 +1,10 @@
package com.cweb.notify;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.entity.BsMerContractRecord;
import com.hfkj.entity.BsMerContractRecordMsg;
import com.hfkj.entity.BsTradeOrder;
import com.hfkj.entity.BsTradeOrderMsg;
import com.hfkj.service.*;
import com.hfkj.sysenum.MerStatusEnum;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.TradeOrderMsgTypeEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum;
import com.hfkj.sysenum.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -24,9 +19,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
@ -65,7 +57,16 @@ public class LaKaLaController {
// 查询订单
BsTradeOrder order = tradeOrderService.getOrderByOutTradeNo(body.getString("out_trade_no"));
if (order != null){
order.setPayMode(body.getString("account_type"));
tradeOrderService.paySuccess(
body.getString("out_trade_no"),
body.getString("trade_no"),
PlatformTypeEnum.type1,
TradeOrderPayModeEnum.getNameByCode(body.getString("account_type")),
body.getBigDecimal("payer_amount").divide(new BigDecimal("100")),
body.getString("settle_merchant_no")
);
/* order.setPayMode(body.getString("account_type"));
order.setPlatformType(PlatformTypeEnum.type1.getNumber());
order.setPlatformTradeNo(body.getString("trade_no"));
order.setPlatformLogNo(body.getString("log_no"));
@ -80,7 +81,7 @@ public class LaKaLaController {
if (body.getString("acc_mdiscount_amount") != null) {
order.setAccMdiscountAmount(body.getBigDecimal("acc_mdiscount_amount").divide(new BigDecimal("100")));
}
tradeOrderService.editOrder(order);
tradeOrderService.editOrder(order);*/
}
BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());

@ -2,7 +2,11 @@ package com.hfkj.schedule;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.entity.*;
import com.hfkj.service.*;
import com.hfkj.sysenum.*;
@ -13,6 +17,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -40,16 +45,23 @@ public class Merchant {
@Resource
private BsMerPlatformNoService merPlatformNoService;
@Resource
private BsMerPlatformTermService merPlatformTermService;
@Resource
private BsMerContractRecordMsgService merContractRecordMsgService;
@Resource
private WeiXinMerService weiXinMerService;
@Resource
private SaasMerService saasMerService;
/**
* 审批状态查询
*/
@SneakyThrows
/* @SneakyThrows
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void applyment() {
Map<String, Object> param = new HashMap<>();
@ -70,14 +82,14 @@ public class Merchant {
merContractRecordMsgService.insertRecordMsg(msg);
if (applyment != null) {
/*1APPLYMENT_STATE_EDITTING编辑中提交申请发生错误导致请尝试重新提交
*//*1、APPLYMENT_STATE_EDITTING(编辑中):提交申请发生错误导致,请尝试重新提交。
2APPLYMENT_STATE_AUDITING审核中申请单正在审核中超级管理员用微信打开签约链接完成绑定微信号后申请单进度将通过微信公众号通知超级管理员引导完成后续步骤
3APPLYMENT_STATE_REJECTED已驳回请按照驳回原因修改申请资料超级管理员用微信打开签约链接完成绑定微信号后续申请单进度将通过微信公众号通知超级管理员
4APPLYMENT_STATE_TO_BE_CONFIRMED待账户验证请超级管理员使用微信打开返回的签约链接根据页面指引完成账户验证
5APPLYMENT_STATE_TO_BE_SIGNED待签约请超级管理员使用微信打开返回的签约链接根据页面指引完成签约
6APPLYMENT_STATE_SIGNING开通权限中系统开通相关权限中请耐心等待
7APPLYMENT_STATE_FINISHED已完成商户入驻申请已完成
8APPLYMENT_STATE_CANCELED已作废申请单已被撤销*/
8APPLYMENT_STATE_CANCELED已作废申请单已被撤销*//*
String applymentState = applyment.getString("applyment_state");
if (applymentState.equals("APPLYMENT_STATE_FINISHED")) {
contractRecord.setStatus(2);
@ -153,6 +165,106 @@ public class Merchant {
}
}
}*/
/**
* 审批状态查询
*/
@SneakyThrows
@Scheduled(cron="0 0/1 * * * ?") //每1分钟执行一次
public void lklSaasApplyment() {
Map<String, Object> param = new HashMap<>();
param.put("status", 1);
List<BsMerContractRecord> list = merContractRecordService.getContractRecordList(param);
for (BsMerContractRecord contractRecord : list) {
try {
BsMer mer = merService.getMer(contractRecord.getMerId());
if (mer != null && mer.getMerStatus().equals(MerStatusEnum.status3.getNumber())) {
BsMerPlatformNo platform = merPlatformNoService.getPlatformNo(mer.getId(), PlatformTypeEnum.type1);
if (platform != null) {
JSONObject merchantInfo = saasMerService.merchantInfo(platform.getPlatformNo());
// 查询申请记录
BsMerContractRecordMsg msg = new BsMerContractRecordMsg();
msg.setOrderNo(contractRecord.getOrderNo());
msg.setType(1);
msg.setResponseContent(merchantInfo.toJSONString());
merContractRecordMsgService.insertRecordMsg(msg);
JSONObject customer = merchantInfo.getJSONObject("customer");
// 商户状态 OPEN:开通,CLOSE:关闭,LOSS:流失, REJECT:拒绝。可用值:OPEN,ACTIVITY,WAIT_COMMIT,WAIT_AUDI,REJECT, CLOSE,INIT
if (customer.getString("customerStatus").equals("OPEN")) {
contractRecord.setStatus(2);
merContractRecordService.updateRecord(contractRecord);
mer.setMerStatus(MerStatusEnum.status1.getNumber());
merService.editMer(mer);
List<BsStore> storeList = storeService.getStoreByMerId(mer.getId(), StoreCreateTypeEnum.type1);
if (storeList.size() > 0) {
BsStore store = storeList.get(0);
store.setStatus(StoreStatusEnum.status2.getNumber());
storeService.editStore(store);
}
platform.setCupNo(customer.getString("externalCustomerNo"));
merPlatformNoService.editMerPlatformNo(platform);
// 终端信息
BsMerPlatformTerm term = new BsMerPlatformTerm();
term.setMerPlatformNoId(platform.getId());
term.setMerId(platform.getMerId());
term.setActiveNo(customer.getString("activeNo"));
term.setBusiTypeCode(customer.getString("bzPos"));
term.setBusiTypeName("码牌");
term.setProductCode(customer.getString("bzPos"));
term.setProductName("码牌");
term.setTermNo(customer.getString("termNo"));
merPlatformTermService.editMerPlatformTerm(term);
JSONArray terminalList = merchantInfo.getJSONArray("terminalInfo");
for (Object terminalObj : terminalList) {
JSONObject terminal = (JSONObject) terminalObj;
// 终端编号
JSONArray termNoList = terminal.getJSONArray("termNoList");
for (Object termNo : termNoList) {
term = new BsMerPlatformTerm();
term.setMerPlatformNoId(platform.getId());
term.setMerId(platform.getMerId());
term.setActiveNo(customer.getString("activeNo"));
term.setBusiTypeCode(terminal.getString("termTypeCode"));
term.setBusiTypeName(terminal.getString("termTypeName"));
term.setProductCode(terminal.getString("termTypeCode"));
term.setProductName(terminal.getString("termTypeName"));
term.setTermId(terminal.getString("coreTermId"));
term.setTermNo(termNo.toString());
merPlatformTermService.editMerPlatformTerm(term);
}
}
} else if (customer.getString("customerStatus").equals("REJECT")) {
contractRecord.setStatus(3);
merContractRecordService.updateRecord(contractRecord);
mer.setMerStatus(MerStatusEnum.status4.getNumber());
merService.editMer(mer);
BsMerContractRecordMsg merContractRecordMsg = new BsMerContractRecordMsg();
merContractRecordMsg.setOrderNo(contractRecord.getOrderNo());
merContractRecordMsg.setType(1);
merContractRecordMsg.setResponseCode(customer.getString("customerStatus"));
merContractRecordMsg.setResponseMsg(customer.getString("auditRemark"));
merContractRecordMsg.setResponseMsg(customer.getString("auditRemark"));
merContractRecordMsgService.insertRecordMsg(merContractRecordMsg);
}
}
}
} catch (Exception e) {
}
}
}
}

@ -9,6 +9,7 @@ import com.hfkj.service.BsMerAttachService;
import com.hfkj.service.BsMerContractRecordService;
import com.hfkj.service.BsMerService;
import com.hfkj.sysenum.MerAttachType;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -38,7 +39,7 @@ public class AlipayMerService {
MerBasisModel basisModel = merService.getMerDetail(merId);
// 查询商户附件列表
merAttachList = merAttachService.getAttachListByMer(merId, null);
merAttachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null);
Map<String,Object> body = new HashMap<>();
body.put("external_id", basisModel.getMerNo());

@ -16,9 +16,9 @@ public class AlipayUtils {
private final static String serverUrl = "https://openapi.alipay.com/gateway.do";
private final static String appId = "2021003176605875";
private final static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD8W2fFUHki5Qyt6m9LO00u6AoW/XjsLtVP1uvwYbRRcRDnTk3lTEAPcopULgqjUgMIIY7xaEan3EnVQbrV+OAXA2Xs0CmBTC5kR5zfZnytUameAmkJlo5ixAfT8om6gkKOTIm0PmqcW7WvcOZtHl28G8RXFH676YBnaCS58/j3w+N9vom4tqADcHLfg9HkhFnRn2mfXbvmasgXIIPSP5XgrirLoYz3YK7OXhChFHUaip675oTHMSGe/iYcaNXfOENpI2z8RDyGwXHVFojdLX45gRkS0odGPeskuMh27wfMf9BGfeGrSSs7xjcjtauG1g8fcRpnnW1aBUD5tA0C370DAgMBAAECggEAW0tCDkrfl/UfEifWnXPVp1uAkvKd9Wu39cs9zde64R+zSsq0OXjNUAlS68NAS/dWa3GggcsEjKOP/ltqGRCRGSI8lGB2M3V47wRNRzCPeDAr2aLrlvFlj2t1nYKHuvZ2133u70sJTImM/+wrIFy08mFlNU+PzbFap44wgyk074Sxdxh3tj1a6NRfLOiBFwqI54wxoXMtvbS+YJ4rTR2PWBtv3NQrGs2AvcNHhZHsnyRDaSz0RmJ+4ifi9rGhOhfSfAvn53+r+ycJ/5rTDqZ67TWd51LkO2KyqEkPqFzN7J8cZ3tnR5+Mmlkz3QPmDsCL1n5vmZO9n2pL7I/hiDDZIQKBgQD/W92MoX+tCqPht3CjO+XQPn0h3tYrUYdyIofKUu89fw2kHhwi+nagUqEu5mrEKyC8rhlNu+KQPCEutZeflgd6CIlsJV2EINfTh5hXWlRSMW6bumAHOTEBgEnu1jNkvRhw78S8K38Wa1JWvgh5b23Zrj4hbwgN2Mzo7q6YmR5HUQKBgQD8/ZxJIWVjTtePFJP0TXhYz9vFJfbSMGD8g9/p+bS8eoSSSwv8LUJiwXJi2SwJnXYOhkFssZecVrUiAK0rqgBPXbQfiFp3G2MtDPft1mexpOxD08/ZorSsoBWpo4kMEqoO26H/wCJRFmbJn2nvzErjDmBrJ8asNYppp8soVSDSEwKBgE2iy2/XJe8hPgQA9oDaVBuE9BxZGHohFnHv56LupgfnWelcsic8SNajaJfOvAUaK6DRuaW1isNZVKlT0l5Vib5jXAyCK7VhGt0X64wbTWmT19IGzu1DSQ/wxgmUHBnzl7u2WfTvsHrLdEQlEISDCT3WSNN3Y1Z6ZIopDvIcE2WRAoGBAM+uwiWmrLyhdIOYuPzMvAbsW9W0HLLf1D53Y9GHk79GNJ6DzQrvfJflhilvbp9WDBxQSlUYVQWaiIepVn+Jx0df/QYFwX4VlYzeIIm2gNlsMihcMTzQPNGZeS8ReOfYSpJ36r0w1PsMEMVjgGvCoZdTrgNJW+by7PVfMX+iopbRAoGAQo17bUcWI72CxMRVYkaqTbkbyGdLLHMUp9XoUhYsmzWGdvbwas9OF0tPEfIjfBIfue2yTWnQRDMV7X13uvt6nvZDpeGf+eLekd/GQMZZzoKHSqIP3NjQFC+Ao9QkGRYcRcEiWd7M9fwysKudQ78oSqdbGYmH+hejKDyS5mUNVCs=";
private final static String APP_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/appCertPublicKey_2021003176605875.crt";
private final static String ALIPAY_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/alipayCertPublicKey_RSA2.crt";
private final static String ALIPAY_ROOT_CERT_PATH = "D:/home/project/gratia-pay/cert/alipay/alipayRootCert.crt";
private final static String APP_CERT_PATH = "/home/project/gratia-pay/cert/alipay/appCertPublicKey_2021003176605875.crt";
private final static String ALIPAY_CERT_PATH = "/home/project/gratia-pay/cert/alipay/alipayCertPublicKey_RSA2.crt";
private final static String ALIPAY_ROOT_CERT_PATH = "/home/project/gratia-pay/cert/alipay/alipayRootCert.crt";
/**
* 初始化客户端请求

@ -1,6 +1,9 @@
package com.hfkj.channel.lakala;
import com.alibaba.fastjson.JSONObject;
import com.ccb.wlpt.config.SysConfig;
import com.hfkj.channel.saas.saasenum.FileImgType;
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;
@ -11,10 +14,13 @@ import com.hfkj.entity.*;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.model.MerBasisModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.MerAttachType;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
/**
@ -51,6 +57,9 @@ public class LaKaLaMerService {
@Resource
private BsMerAttachService merAttachService;
@Resource
private SaasCommon saasCommon;
/**
* 商户进件
* @param merId
@ -73,7 +82,7 @@ public class LaKaLaMerService {
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merRegName", basisModel.getMerName());
map.put("merRegDistCode", regionService.getRegionById(basisModel.getMerRegion().getAreaCode()).getLakala());
map.put("merRegAddr", basisModel.getMerRegion().getAddress());
map.put("merRegAddr", LaKaLaMerService.dislodge(basisModel.getMerRegion().getAddress()));
map.put("mccCode", basisModel.getMerMccCode());
map.put("merBlisName", basisModel.getMerName());
map.put("merBlis", basisModel.getBlisNo());
@ -150,15 +159,18 @@ public class LaKaLaMerService {
}
map.put("feeData", feeDataMap);
List<Map<String, Object>> attachListMap = new ArrayList<>();
Map<String, Object> attachMap;
// 查询商户附件列表
List<BsMerAttach> attachList = merAttachService.getAttachListByMer(merId, null);
List<BsMerAttach> attachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null);
for (BsMerAttach attach : attachList) {
attachMap = new HashMap<>();
attachMap.put("attType", attach.getType());
attachMap.put("attFileId", attach.getFileUrl());
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType());
if (attachType == null || StringUtils.isBlank(attachType.getLakalaCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的附件类型");
}
attachMap.put("attType", attachType.getLakalaCode());
attachMap.put("attFileId", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLakalaCode(), "0").getString("url"));
attachListMap.add(attachMap);
}
map.put("fileData", attachListMap);
@ -210,4 +222,42 @@ public class LaKaLaMerService {
merContractRecordMsgService.insertRecordMsg(recordMsg);
}
/**
* 地址去除省
* @param str
* @return
*/
public static String dislodge(String str) {
char[] chars = str.toCharArray();
// oP: '省' 的偏移, oC: '市' 的偏移, oR: "自治区" 的偏移
int oP = -1, oC = -1, oR = -1;
char ch;
for (int i = 0; i < chars.length; i++) {
ch = chars[i];
// 一般来说 '省' 的位置会比 '市' 早出现
if (ch == '省') {
oP = i;
} else if (ch == '市') {
oC = i;
// 找到 '市' 后就可以跳出循环了
break;
} else if (ch == '自'
&& i + 2 < chars.length
&& chars[i + 1] == '治'
&& chars[i + 2] == '区') {
// "自治区" 出现的几率挺小
oR = i + 2;
}
}
if (oC != -1) {
str = str.substring(oC + 1);
} else if (oP != -1) {
str = str.substring(oP + 1);
} else if (oR != -1) {
str = str.substring(oR + 1);
}
return str;
}
}

@ -10,10 +10,7 @@ import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.service.*;
import com.hfkj.sysenum.PlatformTypeEnum;
import com.hfkj.sysenum.TradeOrderMsgTypeEnum;
import com.hfkj.sysenum.TradeOrderRefundStatusEnum;
import com.hfkj.sysenum.TradeOrderStatusEnum;
import com.hfkj.sysenum.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -171,12 +168,12 @@ public class LaKaLaTradeService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户号");
}
// 查询终端号
BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "QR_CODE_CARD");
BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "PAPER_CODE");
if (merPlatformTerm == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户终端号");
}
// 查询商户
BsMer mer = merService.getMer(merPlatformTerm.getMerId());
BsMer mer = merService.getMer(order.getMerId());
if (mer == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户信息");
}
@ -201,6 +198,9 @@ public class LaKaLaTradeService {
map.put("location_info", locationInfo);
Map<String, Object> accBusiFieldsMap = new HashMap<>();
if (order.getPayMode().equals(TradeOrderPayModeEnum.WECHAT.getCode())) {
accBusiFieldsMap.put("sub_appid", "wxa075e8509802f826");
}
accBusiFieldsMap.put("user_id", order.getPayUserId());
map.put("acc_busi_fields", accBusiFieldsMap);
@ -233,6 +233,7 @@ public class LaKaLaTradeService {
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("order", order);
returnMap.put("payMode", order.getPayMode());
returnMap.put("platformType", PlatformTypeEnum.type1.getNumber());
returnMap.put("payParam", responseBody.getJSONObject("resp_data"));
return returnMap;
}
@ -262,7 +263,7 @@ public class LaKaLaTradeService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户号");
}
// 查询终端号
BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "QR_CODE_CARD");
BsMerPlatformTerm merPlatformTerm = merPlatformTermService.getMerPlatformTerm(platformNo.getId(), "PAPER_CODE");
if (merPlatformTerm == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到商户终端号");
}

@ -8,10 +8,16 @@ import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.config.CommonSysConst;
import org.apache.commons.collections4.MapUtils;
import java.io.FileInputStream;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.SecureRandom;
import java.security.Signature;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

@ -0,0 +1,338 @@
package com.hfkj.channel.saas;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.config.SaasConfig;
import com.hfkj.channel.saas.utils.RSAUtil;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.channel.saas.utils.SaasMerRequest;
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.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.model.MerBasisModel;
import com.hfkj.service.*;
import com.hfkj.sysenum.MerAttachType;
import com.hfkj.sysenum.MerSettleType;
import com.hfkj.sysenum.MerTypeEnum;
import com.hfkj.sysenum.PlatformTypeEnum;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
/**
* 公共
* @className: SasaCommon
* @author: HuRui
* @date: 2023/4/4
**/
@Component
public class SaasMerService {
@Resource
private BsMerContractRecordService merContractRecordService;
@Resource
private BsMerContractRecordMsgService merContractRecordMsgService;
@Resource
private BsMerService merService;
@Resource
private BsIndustryService industryService;
@Resource
private SecRegionService regionService;
@Resource
private BsMerRateService merRateService;
@Resource
private BsMerPlatformNoService merPlatformNoService;
@Resource
private BsMerPlatformNoRateService merPlatformNoRateService;
@Resource
private BsMerAttachService merAttachService;
@Resource
private CommonService commonService;
@Resource
private SaasCommon saasCommon;
@Resource
private SaasMerRequest saasMerRequest;
public void addMer(Long merId) throws Exception {
MerBasisModel basisModel = merService.getMerDetail(merId);
SecRegion province = commonService.getRegionsById(basisModel.getMerRegion().getProvinceCode());
if (province == null || StringUtils.isBlank(province.getSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户地址未配置正确,请联系客服!");
}
SecRegion city = commonService.getRegionsById(basisModel.getMerRegion().getCityCode());
if (city == null || StringUtils.isBlank(city.getSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户地址未配置正确,请联系客服!");
}
SecRegion area = commonService.getRegionsById(basisModel.getMerRegion().getAreaCode());
if (area == null || StringUtils.isBlank(area.getSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户地址未配置正确,请联系客服!");
}
// 经营内容
BsIndustry industry = industryService.getDetailById(basisModel.getMerIndustry().getChildId());
if (industry == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到经营范围");
}
Map<String,Object> body = new HashMap<>();
body.put("userNo", SaasConfig.userNo);
body.put("email", basisModel.getRegEmail());
body.put("busiCode", "PAPER_CODE");
body.put("merRegName", basisModel.getMerName());
body.put("merType", basisModel.getMerType().equals(MerTypeEnum.status2.getNumber())?"TP_MERCHANT":"TP_PERSONAL");
body.put("merName", basisModel.getMerName());
body.put("merAddr", SaasMerService.dislodge(basisModel.getMerRegion().getAddress()));
body.put("provinceCode", province.getSaasCode());
body.put("cityCode", city.getSaasCode());
body.put("countyCode", area.getSaasCode());
body.put("licenseName", basisModel.getMerName());
// 小微商户可不传营业执照信息
if (!basisModel.getMerType().equals(MerTypeEnum.status3.getNumber())) {
body.put("licenseNo", basisModel.getBlisNo());
body.put("licenseDtStart", basisModel.getBlisPeriodStart().replace("年", "-").replace("月", "-").replace("日", ""));
if (basisModel.getBlisPeriodType().equals(2)) {
body.put("licenseDtEnd", "长期有效");
} else {
body.put("licenseDtEnd", basisModel.getBlisPeriodEnd().replace("年", "-").replace("月", "-").replace("日", ""));
}
}
// 法人信息
body.put("larName", basisModel.getLarName());
body.put("larIdType", "01");
body.put("larIdCard", basisModel.getLarIdCard());
body.put("larIdCardStart", basisModel.getLarIdCardPeriodStart().replace(".", "-"));
if (basisModel.getLarIdCardPeriodType().equals(2)) {
Calendar larIdCardEnd = Calendar.getInstance();
larIdCardEnd.set(Calendar.YEAR, 2099);
larIdCardEnd.set(Calendar.MONTH, 12);
body.put("larIdCardEnd", DateUtil.date2String(larIdCardEnd.getTime(), "yyyy-MM-dd"));
} else {
body.put("larIdCardEnd", basisModel.getLarIdCardPeriodEnd().replace(".", "-"));
}
body.put("contactMobile", basisModel.getRegPhone());
body.put("contactName", basisModel.getRegName());
/** --------- 结算信息---------- **/
SecRegion settleProvince = commonService.getRegionsById(basisModel.getMerSettleAcct().getOpenningBankProvinceCode());
if (settleProvince == null || StringUtils.isBlank(settleProvince.getSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "结算地区未配置正确,请联系客服!");
}
SecRegion settleCity = commonService.getRegionsById(basisModel.getMerSettleAcct().getOpenningBankCityCode());
if (settleCity == null || StringUtils.isBlank(settleCity.getSaasCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "结算地区未配置正确,请联系客服!");
}
body.put("openningBankCode", basisModel.getMerSettleAcct().getOpenningBankCode());
body.put("openningBankName", basisModel.getMerSettleAcct().getOpenningBankName());
body.put("clearingBankCode", basisModel.getMerSettleAcct().getClearingBankCode());
body.put("settleProvinceCode", settleProvince.getSaasCode());
body.put("settleProvinceName", basisModel.getMerSettleAcct().getOpenningBankProvinceName());
body.put("settleCityCode", settleCity.getSaasCode());
body.put("settleCityName", basisModel.getMerSettleAcct().getOpenningBankCityName());
body.put("accountNo", basisModel.getMerSettleAcct().getBankCardNo());
body.put("accountName", basisModel.getMerSettleAcct().getBankName());
if (basisModel.getMerSettleAcct().getSettleType().equals(MerSettleType.status1.getNumber())) {
body.put("accountType", "57");
} else {
body.put("accountType", "58");
}
body.put("accountIdCard", basisModel.getMerSettleAcct().getSettleIdCardNo());
// 非法人结算
if (basisModel.getMerSettleAcct().getSettleType().equals(MerSettleType.status3.getNumber())) {
body.put("accountIdType", basisModel.getLarName());
body.put("accountIdDtStart", basisModel.getMerSettleAcct().getSettleIdCardPeriodStart().replace(".", "-"));
if (basisModel.getLarIdCardPeriodType().equals(2)) {
Calendar accountIdDtEnd = Calendar.getInstance();
accountIdDtEnd.set(Calendar.YEAR, 2099);
accountIdDtEnd.set(Calendar.MONTH, 12);
accountIdDtEnd.set(Calendar.DATE , 31);
body.put("accountIdDtEnd", DateUtil.date2String(accountIdDtEnd.getTime(), "yyyy-MM-dd"));
} else {
body.put("accountIdDtEnd", basisModel.getLarIdCardPeriodEnd().replace(".", "-"));
}
}
/** --------- 结算信息---------- **/
Map<String,Object> bizContent = new HashMap<>();
bizContent.put("termNum", "1");
Map<String, Object> feesMap;
List<Map<String,Object>> feesMapList = new ArrayList<>();
// 商户费率
List<BsMerRate> rateList = merRateService.getRateListByMerId(merId);
for (BsMerRate rate : rateList) {
feesMap = new HashMap<>();
feesMap.put("feeCode", rate.getRateSaasTypeCode());
feesMap.put("feeValue", rate.getRatePct());
feesMapList.add(feesMap);
}
bizContent.put("fees", feesMapList);
bizContent.put("mcc", basisModel.getMerMccCode());
bizContent.put("activityId", SaasConfig.activityId);
Map<String,Object> attchMap;
List<Map<String,Object>> attchMapList = new ArrayList<>();
List<BsMerAttach> attachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null);
for (BsMerAttach attach : attachList) {
attchMap = new HashMap<>();
MerAttachType attachType = MerAttachType.getDataByNumber(attach.getType());
if (attachType == null || StringUtils.isBlank(attachType.getLakalaCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的附件类型");
}
attchMap.put("type", attachType.getLakalaCode());
attchMap.put("id", saasCommon.fileUpload(new File(CommonSysConst.getSysConfig().getFile_url() +"/"+ attach.getFileUrl()), attachType.getLakalaCode(), "0").getString("url"));
attchMapList.add(attchMap);
}
body.put("bizContent", bizContent);
body.put("attchments", attchMapList);
body.put("businessContent", basisModel.getMerIndustry().getChildName());
body.put("latitude", "0.0");
body.put("longtude", "0.0");
body.put("source", "H5");
body.put("settleType", "D1");
saasMerRequest.addMerchant(body);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getToken());
JSONObject responseBody = HttpsUtils.doPost(SaasConfig.requestMerRegistrationCommonUrl+"merchant", body, header);
System.out.println("body:" + JSONObject.toJSONString(body));
System.out.println("response:" + responseBody);
if (responseBody == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求进件失败");
}
if (StringUtils.isBlank(responseBody.getString("state"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("message"));
}
if (!responseBody.getString("state").equals("1")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求进件失败");
}
BsMerPlatformNo platform = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1);
if (platform != null) {
platform.setStatus(0);
merPlatformNoService.editMerPlatformNo(platform);
}
platform = new BsMerPlatformNo();
platform.setCompanyId(basisModel.getCompanyId());
platform.setAgentId(basisModel.getAgentId());
platform.setMerId(basisModel.getId());
platform.setMerNo(basisModel.getMerNo());
platform.setPlatformType(PlatformTypeEnum.type1.getNumber());
platform.setPlatformNo(responseBody.getString("merchantNo"));
merPlatformNoService.editMerPlatformNo(platform);
String orderNo = System.currentTimeMillis()+"";
// 增加进件记录
BsMerContractRecord record = new BsMerContractRecord();
record.setMerId(merId);
record.setPlatformType(PlatformTypeEnum.type1.getNumber());
record.setOrderNo(orderNo);
record.setContractId(responseBody.toJSONString());
record.setStatus(1);
merContractRecordService.insertRecord(record);
// 增加进件记录消息
BsMerContractRecordMsg recordMsg = new BsMerContractRecordMsg();
recordMsg.setOrderNo(orderNo);
recordMsg.setType(1);
recordMsg.setRequestContent(JSONObject.toJSONString(body));
recordMsg.setResponseCode(responseBody.getString("state"));
recordMsg.setResponseMsg(null);
recordMsg.setResponseContent(responseBody.toJSONString());
merContractRecordMsgService.insertRecordMsg(recordMsg);
}
/**
* 查询银行地区编码
* @param customerNo
* @return
*/
public JSONObject merchantInfo(String customerNo) {
try {
Map<String,Object> param = new HashMap<>();
param.put("customerNo", customerNo);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getToken());
JSONObject obj = new JSONObject();
obj.put("data", Base64.encodeBase64String(RSAUtil.encryptByPrivateKey(JSONObject.toJSONString(param).getBytes(), Base64.decodeBase64(RSAUtil.PRIVATE_KEY))));
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "open/merchant/info", obj, header);
System.out.println(responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("code").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
return JSONObject.parseObject(new String(RSAUtil.decryptByPublicKey(Base64.decodeBase64(responseObj.getString("data")), Base64.decodeBase64(RSAUtil.PUBLIC_KEY))));
} catch (Exception e) {
System.out.println(e);
return null;
}
}
/**
* 地址去除省
* @param str
* @return
*/
public static String dislodge(String str) {
char[] chars = str.toCharArray();
// oP: '省' 的偏移, oC: '市' 的偏移, oR: "自治区" 的偏移
int oP = -1, oC = -1, oR = -1;
char ch;
for (int i = 0; i < chars.length; i++) {
ch = chars[i];
// 一般来说 '省' 的位置会比 '市' 早出现
if (ch == '省') {
oP = i;
} else if (ch == '市') {
oC = i;
// 找到 '市' 后就可以跳出循环了
break;
} else if (ch == '自'
&& i + 2 < chars.length
&& chars[i + 1] == '治'
&& chars[i + 2] == '区') {
// "自治区" 出现的几率挺小
oR = i + 2;
}
}
if (oC != -1) {
str = str.substring(oC + 1);
} else if (oP != -1) {
str = str.substring(oP + 1);
} else if (oR != -1) {
str = str.substring(oR + 1);
}
return str;
}
}

@ -0,0 +1,31 @@
package com.hfkj.channel.saas.config;
import com.hfkj.config.CommonSysConst;
/**
* @className: SaasConfig
* @author: HuRui
* @date: 2023/4/4
**/
public class SaasConfig {
public static String requestMerRegistrationTokenUrl = CommonSysConst.getSysConfig().getLkl_saas_request_mer_registration_token_url();
public static String requestMerRegistrationUrl = CommonSysConst.getSysConfig().getLkl_saas_request_mer_registration_url();
public static String requestMerRegistrationCommonUrl = CommonSysConst.getSysConfig().getLkl_saas_request_mer_registration_common_url();
public static String requestMerUrl = CommonSysConst.getSysConfig().getLkl_saas_request_mer_url();
public static String client_id = CommonSysConst.getSysConfig().getLkl_saas_client_id();
public static String client_secret = CommonSysConst.getSysConfig().getLkl_saas_client_secret();
public static String activityId = CommonSysConst.getSysConfig().getLkl_saas_activity_id();
public static String userNo = CommonSysConst.getSysConfig().getLkl_saas_user_no();
/* public static String requestMerRegistrationTokenUrl = "https://test.wsmsd.cn/sit/htkauth/oauth/token";
public static String requestMerRegistrationUrl = "https://test.wsmsd.cn/sit/htkregistration/merchant/";
public static String requestMerRegistrationCommonUrl = "https://test.wsmsd.cn/sit/htkregistration/";
public static String requestMerUrl = "https://test.wsmsd.cn/sit/htkmerchants/";
public static String client_id = "testsit";
public static String client_secret = "EguwEckByf2I6u6z";
public static String activityId = "37";
public static String userNo = "20000101";*/
}

@ -0,0 +1,67 @@
package com.hfkj.channel.saas.saasenum;
import java.util.Objects;
/**
* SAAS 文件图片
* @className: FileImgType
* @author: HuRui
* @date: 2023/4/5
**/
public enum FileImgType {
ID_CARD_FRONT("ID_CARD_FRONT", "身份证正⾯"),
ID_CARD_BEHIND("ID_CARD_BEHIND", "身份证反⾯"),
BUSINESS_LICENCE("BUSINESS_LICENCE", "营业执照照⽚"),
BANK_CARD("BANK_CARD", "银行卡"),
AGREE_MENT("AGREE_MENT", "协议"),
OPENING_PERMIT("OPENING_PERMIT", "开户许可证"),
CHECKSTAND_IMG("CHECKSTAND_IMG", "收银台照片(仅对公进件需传)"),
SHOP_OUTSIDE_IMG("SHOP_OUTSIDE_IMG", "上传门头照片(仅对公进件需传"),
SHOP_INSIDE_IMG("SHOP_INSIDE_IMG", "商铺内部照片(仅对公进件需传)"),
OTHERS("OTHERS", "其他 无对应类型图片,请传其他类型"),
SETTLE_ID_CARD_FRONT("SETTLE_ID_CARD_FRONT", "结算人身份证人像面"),
SETTLE_ID_CARD_BEHIND("SETTLE_ID_CARD_BEHIND", "结算人身份证国徽面"),
LETTER_OF_AUTHORIZATION("LETTER_OF_AUTHORIZATION", "法人授权涵"),
;
private String code;
private String name;
FileImgType(String code, String name) {
this.code = code;
this.name = name;
}
/**
* 查询数据
* @param code
* @return
*/
public static FileImgType getDataByCode(String code) {
for (FileImgType ele : values()) {
if (Objects.equals(code,ele.getCode())) {
return ele;
}
}
return null;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,196 @@
package com.hfkj.channel.saas.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.config.SaasConfig;
import com.hfkj.channel.saas.saasenum.FileImgType;
import com.hfkj.common.Base64Util;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.HttpsUtils;
import com.hfkj.common.utils.RedisUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.mime.content.FileBody;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 公共
* @className: SasaCommon
* @author: HuRui
* @date: 2023/4/4
**/
@Component
public class SaasCommon {
private static final Logger log = LoggerFactory.getLogger(SaasCommon.class);
@Autowired
private RedisUtil redisUtil;
/**
* 获取token
* @return
*/
public Object getToken() {
try {
Object saasToken = redisUtil.get("SAAS_TOKEN");
if (saasToken != null) {
return saasToken.toString();
}
Map<String,Object> param = new HashMap<>();
param.put("grant_type", "client_credentials");
param.put("client_id", SaasConfig.client_id);
param.put("client_secret", SaasConfig.client_secret);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "Basic " + Base64Util.encode(SaasConfig.client_id+":"+SaasConfig.client_secret));
// 请求参数
String requestParam = SaasUtils.paramSort(param);
log.info("==============start 获取token start ==============");
log.info("请求header:" + JSONObject.toJSONString(header));
log.info("请求参数:" + requestParam);
JSONObject jsonObject = HttpsUtils.doPostForm(SaasConfig.requestMerRegistrationTokenUrl, requestParam, header);
log.info("响应参数:" + jsonObject);
if (StringUtils.isNotBlank(jsonObject.getString("access_token"))) {
redisUtil.set("SAAS_TOKEN", jsonObject.getString("access_token"), jsonObject.getLong("expires_in"));
return jsonObject.getString("access_token");
}
} catch (Exception e) {
log.info("出现异常:", e);
return null;
} finally {
log.info("==============end 获取token end ==============");
}
return null;
}
/**
* 文件上传
* @param file 文件
* @param attType 文件类型
* @param sourcechnl 来源 0:PC,1:安卓,2:IOS
* @return
*/
public JSONObject fileUpload(File file, String attType, String sourcechnl) {
try {
Map<String,Object> param = new HashMap<>();
param.put("file", new FileBody(file));
param.put("imgType", attType);
param.put("sourcechnl", sourcechnl);
param.put("isOcr", false);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + getToken());
JSONObject jsonObject = HttpsUtils.doPostSaasUpload(SaasConfig.requestMerRegistrationCommonUrl+"/file/upload",file,param, header);
if (!jsonObject.getString("status").equals("00")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "文件上传失败");
}
return jsonObject;
} catch (Exception e) {
System.out.println(e);
return null;
}
}
/**
* 查询商户类别父类
* @param parentCode
* @return
*/
public JSONArray getCategory(String parentCode) {
try {
Map<String,Object> param = new HashMap<>();
param.put("businessScene", 2);
if (StringUtils.isNotBlank(parentCode)) {
param.put("parentCode", parentCode);
}
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + getToken());
String result = HttpsUtils.doSaasGet(SaasConfig.requestMerRegistrationCommonUrl+"customer/category", param, header, true);
return JSONArray.parseArray(result);
} catch (Exception e) {
System.out.println(e);
return null;
}
}
/**
* 查询地区编码
* @param parentCode
* @return
*/
public JSONArray getArea(String parentCode) {
try {
Map<String,Object> param = new HashMap<>();
param.put("parentCode", parentCode);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + getToken());
String result = HttpsUtils.doSaasGet(SaasConfig.requestMerRegistrationCommonUrl+"organization", param, header, false);
return JSONArray.parseArray(result);
} catch (Exception e) {
System.out.println(e);
return null;
}
}
/**
* 查询银行地区编码
* @param parentCode
* @return
*/
public JSONArray getBankArea(String parentCode) {
try {
Map<String,Object> param = new HashMap<>();
param.put("parentCode", parentCode);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + getToken());
String result = HttpsUtils.doSaasGet(SaasConfig.requestMerRegistrationCommonUrl + "/organization/bank", param, header, false);
return JSONArray.parseArray(result);
} catch (Exception e) {
System.out.println(e);
return null;
}
}
/**
* 查询银行列表
* @param areaCode 地区编码
* @param bankName 银行名称
* @return
*/
public JSONArray getBank(String areaCode,String bankName) {
try {
Map<String,Object> param = new HashMap<>();
param.put("areaCode", areaCode);
param.put("bankName", bankName);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + getToken());
String result = HttpsUtils.doSaasGet(SaasConfig.requestMerRegistrationCommonUrl + "/bank", param, header, true);
return JSONArray.parseArray(result);
} catch (Exception e) {
System.out.println(e);
return null;
}
}
}

@ -0,0 +1,55 @@
package com.hfkj.channel.saas.utils;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.RSAUtils;
import com.hfkj.channel.saas.config.SaasConfig;
import com.hfkj.common.Base64Util;
import com.hfkj.common.utils.HttpsUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* @className: SaasMerRequest
* @author: HuRui
* @date: 2023/4/5
**/
@Component
public class SaasMerRequest {
private static final Logger log = LoggerFactory.getLogger(SaasMerRequest.class);
@Resource
private SaasCommon saasCommon;
/**
* 增加进件
* @param body 参数
* @return
*/
public Object addMerchant(Map<String, Object> body) {
try {
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getToken());
log.info("==============start 商户进件 start ==============");
log.info("请求header:" + JSONObject.toJSONString(header));
log.info("请求参数:" + JSONObject.toJSONString(body));
JSONObject jsonObject = HttpsUtils.doPost(SaasConfig.requestMerRegistrationUrl, body, header);
log.info("响应参数:" + jsonObject);
return jsonObject;
} catch (Exception e) {
log.info("出现异常:", e);
return null;
} finally {
log.info("==============end 商户进件 end ==============");
}
}
}

@ -0,0 +1,33 @@
package com.hfkj.channel.saas.utils;
import org.apache.commons.lang3.StringUtils;
import java.util.Map;
import java.util.Set;
/**
* @className: SaasUtils
* @author: HuRui
* @date: 2023/4/5
**/
public class SaasUtils {
/**
* 参数排序
* @param param
* @return
*/
public static String paramSort(final Map<String, Object> param) {
Set<String> keySet = param.keySet();
String[] keyArray = keySet.toArray(new String[keySet.size()]);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (StringUtils.isBlank(sb.toString())) {
sb.append(k).append("=").append(param.get(k));
} else {
sb.append("&").append(k).append("=").append(param.get(k));
}
}
return sb.toString();
}
}

@ -69,7 +69,7 @@ public class WeiXinMerService {
MerBasisModel basisModel = merService.getMerDetail(merId);
// 查询商户附件列表
merAttachList = merAttachService.getAttachListByMer(merId, null);
merAttachList = merAttachService.getAttachListByMer(merId, PlatformTypeEnum.type0, null);
JSONObject body = new JSONObject();
body.put("business_code", ""+merId+""+System.currentTimeMillis());
@ -218,7 +218,7 @@ public class WeiXinMerService {
// 补充材料
JSONObject additionInfo = new JSONObject();
List<String> additionPicsList = new ArrayList<>();
List<BsMerAttach> merAdditionPicsList = getMerAttach(MerAttachType.type6, false);
List<BsMerAttach> merAdditionPicsList = getMerAttach(MerAttachType.type99, false);
if (merAdditionPicsList != null) {
for (BsMerAttach merAttach : merAdditionPicsList) {
additionPicsList.add(merAttach.getFileUrl());

@ -2,7 +2,9 @@ package com.hfkj.common.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.saas.saasenum.FileImgType;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
@ -17,6 +19,8 @@ import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLContexts;
import org.apache.http.conn.ssl.TrustStrategy;
import org.apache.http.entity.StringEntity;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
@ -29,6 +33,7 @@ import org.slf4j.LoggerFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
@ -48,7 +53,7 @@ public class HttpsUtils {
private static PoolingHttpClientConnectionManager connMgr;
private static RequestConfig requestConfig;
private static final int MAX_TIMEOUT = 7000;
private static final int MAX_TIMEOUT = 15000;
static {
// 设置连接池
@ -541,7 +546,13 @@ public class HttpsUtils {
return null;
}
public static JSONObject doSmsPost(String apiUrl, Map<String,Object> body, Map<String,Object> header) {
/**
* 发送 POST 请求JSON形式
*
* @param apiUrl
* @return
*/
public static JSONObject doPost(String apiUrl, String str) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
@ -555,12 +566,9 @@ public class HttpsUtils {
try {
HttpPost httpPost = new HttpPost(apiUrl);
httpPost.setConfig(requestConfig);
for (Map.Entry<String, Object> entry : header.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue().toString());
}
StringEntity stringEntity = new StringEntity(body.get("from").toString());// 解决中文乱码问题
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/x-www-form-urlencoded");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
@ -580,7 +588,7 @@ public class HttpsUtils {
return null;
}
public static JSONObject doWxH5PayPost(String apiUrl, Map<String,Object> body, Map<String,Object> header) {
public static JSONObject doPost(String apiUrl, String str, String token, String sign, Long ts) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
@ -594,12 +602,12 @@ public class HttpsUtils {
try {
HttpPost httpPost = new HttpPost(apiUrl);
httpPost.setConfig(requestConfig);
for (Map.Entry<String, Object> entry : header.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue().toString());
}
StringEntity stringEntity = new StringEntity(body.get("from").toString());// 解决中文乱码问题
httpPost.setHeader("token", token);
httpPost.setHeader("sign", sign);
httpPost.setHeader("ts", ts.toString());
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/x-www-form-urlencoded");
stringEntity.setContentType("application/json");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
@ -620,14 +628,15 @@ public class HttpsUtils {
}
/**
* 发送 POST 请求JSON形式
*
* @param apiUrl
* @return
*/
public static JSONObject doPost(String apiUrl, String str) {
* @Author Sum1Dream
* @Description // 不带证书请求xml
* @Date 11:42 2021/6/8
* @Param [url, str]
* @return com.alibaba.fastjson.JSONObject
**/
public static JSONObject postData(String url, String str) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
if (url.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
@ -637,11 +646,12 @@ public class HttpsUtils {
CloseableHttpResponse response = null;
try {
HttpPost httpPost = new HttpPost(apiUrl);
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
@ -661,10 +671,17 @@ public class HttpsUtils {
return null;
}
public static JSONObject doPost(String apiUrl, String str, String token, String sign, Long ts) {
/**
* @Author Sum1Dream
* @Description // 带证书请求 xml
* @Date 11:45 2021/6/8
* @Param [url, mchId, str]
* @return com.alibaba.fastjson.JSONObject
**/
public static JSONObject postData(String url, String mchId , String str) {
CloseableHttpClient httpClient = null;
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
if (url.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(readCertificate(mchId))
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
@ -673,14 +690,12 @@ public class HttpsUtils {
CloseableHttpResponse response = null;
try {
HttpPost httpPost = new HttpPost(apiUrl);
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
httpPost.setHeader("token", token);
httpPost.setHeader("sign", sign);
httpPost.setHeader("ts", ts.toString());
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
stringEntity.setContentType("application/json");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
@ -700,35 +715,44 @@ public class HttpsUtils {
return null;
}
/**
* @Author Sum1Dream
* @Description // 不带证书请求xml
* @Date 11:42 2021/6/8
* @Param [url, str]
* @return com.alibaba.fastjson.JSONObject
**/
public static JSONObject postData(String url, String str) {
public static JSONObject doPostSaasUpload(String apiUrl, File file, Map<String,Object> params, Map<String,Object> header) {
CloseableHttpClient httpClient = null;
if (url.startsWith("https")) {
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
StringBuffer param = new StringBuffer();
int i = 0;
for (String key : params.keySet()) {
if (i == 0)
param.append("?");
else
param.append("&");
param.append(key).append("=").append(params.get(key));
i++;
}
String httpStr = null;
CloseableHttpResponse response = null;
try {
HttpPost httpPost = new HttpPost(url);
apiUrl += param;
HttpPost httpPost = new HttpPost(apiUrl);
httpPost.setConfig(requestConfig);
for (Map.Entry<String, Object> entry : header.entrySet()) {
httpPost.setHeader(entry.getKey(), entry.getValue().toString());
}
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.setEntity(stringEntity);
MultipartEntity entity = new MultipartEntity();
entity.addPart("file", new FileBody(file));
httpPost.setEntity(entity);
response = httpClient.execute(httpPost);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
HttpEntity responseEntity = response.getEntity();
httpStr = EntityUtils.toString(responseEntity, "UTF-8");
return JSON.parseObject(httpStr);
} catch (Exception e) {
log.error(e.getMessage(),e);
@ -745,45 +769,58 @@ public class HttpsUtils {
}
/**
* @Author Sum1Dream
* @Description // 带证书请求 xml
* @Date 11:45 2021/6/8
* @Param [url, mchId, str]
* @return com.alibaba.fastjson.JSONObject
**/
public static JSONObject postData(String url, String mchId , String str) {
CloseableHttpClient httpClient = null;
if (url.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(readCertificate(mchId))
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
* Saas 请求
* @param url
* @param params
* @param headers
* @param formType
* @return
*/
public static String doSaasGet(String url, Map<String, Object> params , Map<String , Object> headers, Boolean formType) {
String apiUrl = url;
StringBuffer param = new StringBuffer();
if (formType == true) {
int i = 0;
for (String key : params.keySet()) {
if (i == 0)
param.append("?");
else
param.append("&");
param.append(key).append("=").append(params.get(key));
i++;
}
} else {
httpClient = HttpClients.createDefault();
for (String key : params.keySet()) {
param.append("/" + params.get(key));
}
}
String httpStr = null;
CloseableHttpResponse response = null;
apiUrl += param;
String result = null;
HttpClient httpClient = null;
try {
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题
stringEntity.setContentEncoding("UTF-8");
httpPost.addHeader("Content-Type", "text/xml");
httpPost.setEntity(stringEntity);
response = httpClient.execute(httpPost);
if (apiUrl.startsWith("https")) {
httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory())
.setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build();
} else {
httpClient = HttpClients.createDefault();
}
HttpGet httpGet = new HttpGet(apiUrl);
for (Map.Entry<String, Object> e : headers.entrySet()) {
httpGet.addHeader(e.getKey(), e.getValue().toString());
}
HttpResponse response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
httpStr = EntityUtils.toString(entity, "UTF-8");
return JSON.parseObject(httpStr);
if (entity != null) {
InputStream instream = entity.getContent();
result = IOUtils.toString(instream, "UTF-8");
}
return result;
} catch (Exception e) {
log.error(e.getMessage(),e);
} finally {
if (response != null) {
try {
EntityUtils.consume(response.getEntity());
} catch (IOException e) {
log.error(e.getMessage(),e);
}
}
}
return null;
}

@ -89,6 +89,17 @@ public class CommonSysConfig {
*/
private String lkl_micro_pay_ret_url;
private String lkl_saas_client_id;
private String lkl_saas_client_secret;
private String lkl_saas_activity_id;
private String lkl_saas_user_no;
private String lkl_saas_request_mer_registration_token_url;
private String lkl_saas_request_mer_registration_url;
private String lkl_saas_request_mer_registration_common_url;
private String lkl_saas_request_mer_url;
private String lkl_saas_public_key;
private String lkl_saas_private_key;
/**
* 微信支付回调
*/

@ -39,16 +39,16 @@ public interface BsMerAttachMapper extends BsMerAttachMapperExt {
int deleteByPrimaryKey(Long id);
@Insert({
"insert into bs_mer_attach (mer_id, `type`, ",
"type_code, file_url, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ",
"#{typeCode,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, ",
"#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"insert into bs_mer_attach (mer_id, platform_type, ",
"`type`, type_code, ",
"file_url, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{platformType,jdbcType=INTEGER}, ",
"#{type,jdbcType=INTEGER}, #{typeCode,jdbcType=VARCHAR}, ",
"#{fileUrl,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(BsMerAttach record);
@ -61,6 +61,7 @@ public interface BsMerAttachMapper extends BsMerAttachMapperExt {
@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="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="type_code", property="typeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="file_url", property="fileUrl", jdbcType=JdbcType.VARCHAR),
@ -75,14 +76,15 @@ public interface BsMerAttachMapper extends BsMerAttachMapperExt {
@Select({
"select",
"id, mer_id, `type`, type_code, file_url, `status`, create_time, update_time, ",
"ext_1, ext_2, ext_3",
"id, mer_id, platform_type, `type`, type_code, file_url, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"from bs_mer_attach",
"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="type", property="type", jdbcType=JdbcType.INTEGER),
@Result(column="type_code", property="typeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="file_url", property="fileUrl", jdbcType=JdbcType.VARCHAR),
@ -107,6 +109,7 @@ public interface BsMerAttachMapper extends BsMerAttachMapperExt {
@Update({
"update bs_mer_attach",
"set mer_id = #{merId,jdbcType=BIGINT},",
"platform_type = #{platformType,jdbcType=INTEGER},",
"`type` = #{type,jdbcType=INTEGER},",
"type_code = #{typeCode,jdbcType=VARCHAR},",
"file_url = #{fileUrl,jdbcType=VARCHAR},",

@ -32,6 +32,10 @@ public class BsMerAttachSqlProvider {
sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.VALUES("platform_type", "#{platformType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}");
}
@ -79,6 +83,7 @@ public class BsMerAttachSqlProvider {
sql.SELECT("id");
}
sql.SELECT("mer_id");
sql.SELECT("platform_type");
sql.SELECT("`type`");
sql.SELECT("type_code");
sql.SELECT("file_url");
@ -113,6 +118,10 @@ public class BsMerAttachSqlProvider {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{record.platformType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{record.type,jdbcType=INTEGER}");
}
@ -159,6 +168,7 @@ public class BsMerAttachSqlProvider {
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("`type` = #{record.type,jdbcType=INTEGER}");
sql.SET("type_code = #{record.typeCode,jdbcType=VARCHAR}");
sql.SET("file_url = #{record.fileUrl,jdbcType=VARCHAR}");
@ -182,6 +192,10 @@ public class BsMerAttachSqlProvider {
sql.SET("mer_id = #{merId,jdbcType=BIGINT}");
}
if (record.getPlatformType() != null) {
sql.SET("platform_type = #{platformType,jdbcType=INTEGER}");
}
if (record.getType() != null) {
sql.SET("`type` = #{type,jdbcType=INTEGER}");
}

@ -12,6 +12,7 @@ public interface BsMerContractRecordMsgMapperExt {
@Select({"select order_no,response_code,response_msg,response_content,create_time from bs_mer_contract_record_msg" +
" where order_no = (SELECT order_no FROM `bs_mer_contract_record` where mer_id = #{merId} ORDER BY create_time desc LIMIT 1)" +
" and response_code = 'REJECT' " +
" ORDER BY create_time desc LIMIT 1"})
Map<String, Object> selectMerContractRecordMsg(@Param("merId") Long merId);

@ -46,17 +46,17 @@ public interface BsMerMapper extends BsMerMapperExt {
"reg_email, mer_type, ",
"mer_no, mer_name, ",
"mer_abbreviate, mer_mcc_code, ",
"blis_url, blis_name, ",
"blis_no, blis_reg_address, ",
"blis_period_type, blis_period_start, ",
"blis_period_end, lar_name, ",
"lar_id_card, lar_id_card_portrait_img, ",
"lar_id_card_national_emblem_img, lar_id_card_address, ",
"lar_id_card_period_type, lar_id_card_period_start, ",
"lar_id_card_period_end, complete_status, ",
"mer_status, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"mer_mcc_name, blis_url, ",
"blis_name, blis_no, ",
"blis_reg_address, blis_period_type, ",
"blis_period_start, blis_period_end, ",
"lar_name, lar_id_card, ",
"lar_id_card_portrait_img, lar_id_card_national_emblem_img, ",
"lar_id_card_address, lar_id_card_period_type, ",
"lar_id_card_period_start, lar_id_card_period_end, ",
"complete_status, mer_status, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
"#{agentId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR}, ",
"#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
@ -64,17 +64,17 @@ public interface BsMerMapper extends BsMerMapperExt {
"#{regEmail,jdbcType=VARCHAR}, #{merType,jdbcType=INTEGER}, ",
"#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
"#{merAbbreviate,jdbcType=VARCHAR}, #{merMccCode,jdbcType=VARCHAR}, ",
"#{blisUrl,jdbcType=VARCHAR}, #{blisName,jdbcType=VARCHAR}, ",
"#{blisNo,jdbcType=VARCHAR}, #{blisRegAddress,jdbcType=VARCHAR}, ",
"#{blisPeriodType,jdbcType=INTEGER}, #{blisPeriodStart,jdbcType=VARCHAR}, ",
"#{blisPeriodEnd,jdbcType=VARCHAR}, #{larName,jdbcType=VARCHAR}, ",
"#{larIdCard,jdbcType=VARCHAR}, #{larIdCardPortraitImg,jdbcType=VARCHAR}, ",
"#{larIdCardNationalEmblemImg,jdbcType=VARCHAR}, #{larIdCardAddress,jdbcType=VARCHAR}, ",
"#{larIdCardPeriodType,jdbcType=INTEGER}, #{larIdCardPeriodStart,jdbcType=VARCHAR}, ",
"#{larIdCardPeriodEnd,jdbcType=VARCHAR}, #{completeStatus,jdbcType=INTEGER}, ",
"#{merStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
"#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{merMccName,jdbcType=VARCHAR}, #{blisUrl,jdbcType=VARCHAR}, ",
"#{blisName,jdbcType=VARCHAR}, #{blisNo,jdbcType=VARCHAR}, ",
"#{blisRegAddress,jdbcType=VARCHAR}, #{blisPeriodType,jdbcType=INTEGER}, ",
"#{blisPeriodStart,jdbcType=VARCHAR}, #{blisPeriodEnd,jdbcType=VARCHAR}, ",
"#{larName,jdbcType=VARCHAR}, #{larIdCard,jdbcType=VARCHAR}, ",
"#{larIdCardPortraitImg,jdbcType=VARCHAR}, #{larIdCardNationalEmblemImg,jdbcType=VARCHAR}, ",
"#{larIdCardAddress,jdbcType=VARCHAR}, #{larIdCardPeriodType,jdbcType=INTEGER}, ",
"#{larIdCardPeriodStart,jdbcType=VARCHAR}, #{larIdCardPeriodEnd,jdbcType=VARCHAR}, ",
"#{completeStatus,jdbcType=INTEGER}, #{merStatus,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="id")
int insert(BsMer record);
@ -100,6 +100,7 @@ public interface BsMerMapper extends BsMerMapperExt {
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_mcc_code", property="merMccCode", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_mcc_name", property="merMccName", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_url", property="blisUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_name", property="blisName", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_no", property="blisNo", jdbcType=JdbcType.VARCHAR),
@ -129,11 +130,11 @@ public interface BsMerMapper extends BsMerMapperExt {
"select",
"id, company_id, company_name, agent_id, agent_name, salesman_id, salesman_name, ",
"reg_phone, reg_name, reg_email, mer_type, mer_no, mer_name, mer_abbreviate, ",
"mer_mcc_code, blis_url, blis_name, blis_no, blis_reg_address, blis_period_type, ",
"blis_period_start, blis_period_end, lar_name, lar_id_card, lar_id_card_portrait_img, ",
"lar_id_card_national_emblem_img, lar_id_card_address, lar_id_card_period_type, ",
"lar_id_card_period_start, lar_id_card_period_end, complete_status, mer_status, ",
"create_time, update_time, ext_1, ext_2, ext_3",
"mer_mcc_code, mer_mcc_name, blis_url, blis_name, blis_no, blis_reg_address, ",
"blis_period_type, blis_period_start, blis_period_end, lar_name, lar_id_card, ",
"lar_id_card_portrait_img, lar_id_card_national_emblem_img, lar_id_card_address, ",
"lar_id_card_period_type, lar_id_card_period_start, lar_id_card_period_end, complete_status, ",
"mer_status, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_mer",
"where id = #{id,jdbcType=BIGINT}"
})
@ -153,6 +154,7 @@ public interface BsMerMapper extends BsMerMapperExt {
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_mcc_code", property="merMccCode", jdbcType=JdbcType.VARCHAR),
@Result(column="mer_mcc_name", property="merMccName", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_url", property="blisUrl", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_name", property="blisName", jdbcType=JdbcType.VARCHAR),
@Result(column="blis_no", property="blisNo", jdbcType=JdbcType.VARCHAR),
@ -203,6 +205,7 @@ public interface BsMerMapper extends BsMerMapperExt {
"mer_name = #{merName,jdbcType=VARCHAR},",
"mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR},",
"mer_mcc_code = #{merMccCode,jdbcType=VARCHAR},",
"mer_mcc_name = #{merMccName,jdbcType=VARCHAR},",
"blis_url = #{blisUrl,jdbcType=VARCHAR},",
"blis_name = #{blisName,jdbcType=VARCHAR},",
"blis_no = #{blisNo,jdbcType=VARCHAR},",

@ -40,15 +40,17 @@ public interface BsMerRateMapper extends BsMerRateMapperExt {
@Insert({
"insert into bs_mer_rate (mer_id, mer_no, ",
"rate_type_code, rate_type_name, ",
"rate_pct, `status`, ",
"create_time, update_time, ",
"ext_1, ext_2, ext_3)",
"rate_type_code, rate_saas_type_code, ",
"rate_type_name, rate_pct, ",
"`status`, create_time, ",
"update_time, ext_1, ",
"ext_2, ext_3)",
"values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
"#{rateTypeCode,jdbcType=INTEGER}, #{rateTypeName,jdbcType=VARCHAR}, ",
"#{ratePct,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
"#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
"#{rateTypeCode,jdbcType=INTEGER}, #{rateSaasTypeCode,jdbcType=VARCHAR}, ",
"#{rateTypeName,jdbcType=VARCHAR}, #{ratePct,jdbcType=DECIMAL}, ",
"#{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(BsMerRate record);
@ -63,6 +65,7 @@ public interface BsMerRateMapper extends BsMerRateMapperExt {
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_type_code", property="rateTypeCode", jdbcType=JdbcType.INTEGER),
@Result(column="rate_saas_type_code", property="rateSaasTypeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_type_name", property="rateTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_pct", property="ratePct", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -76,8 +79,8 @@ public interface BsMerRateMapper extends BsMerRateMapperExt {
@Select({
"select",
"id, mer_id, mer_no, rate_type_code, rate_type_name, rate_pct, `status`, create_time, ",
"update_time, ext_1, ext_2, ext_3",
"id, mer_id, mer_no, rate_type_code, rate_saas_type_code, rate_type_name, rate_pct, ",
"`status`, create_time, update_time, ext_1, ext_2, ext_3",
"from bs_mer_rate",
"where id = #{id,jdbcType=BIGINT}"
})
@ -86,6 +89,7 @@ public interface BsMerRateMapper extends BsMerRateMapperExt {
@Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
@Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_type_code", property="rateTypeCode", jdbcType=JdbcType.INTEGER),
@Result(column="rate_saas_type_code", property="rateSaasTypeCode", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_type_name", property="rateTypeName", jdbcType=JdbcType.VARCHAR),
@Result(column="rate_pct", property="ratePct", jdbcType=JdbcType.DECIMAL),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@ -111,6 +115,7 @@ public interface BsMerRateMapper extends BsMerRateMapperExt {
"set mer_id = #{merId,jdbcType=BIGINT},",
"mer_no = #{merNo,jdbcType=VARCHAR},",
"rate_type_code = #{rateTypeCode,jdbcType=INTEGER},",
"rate_saas_type_code = #{rateSaasTypeCode,jdbcType=VARCHAR},",
"rate_type_name = #{rateTypeName,jdbcType=VARCHAR},",
"rate_pct = #{ratePct,jdbcType=DECIMAL},",
"`status` = #{status,jdbcType=INTEGER},",

@ -40,6 +40,10 @@ public class BsMerRateSqlProvider {
sql.VALUES("rate_type_code", "#{rateTypeCode,jdbcType=INTEGER}");
}
if (record.getRateSaasTypeCode() != null) {
sql.VALUES("rate_saas_type_code", "#{rateSaasTypeCode,jdbcType=VARCHAR}");
}
if (record.getRateTypeName() != null) {
sql.VALUES("rate_type_name", "#{rateTypeName,jdbcType=VARCHAR}");
}
@ -85,6 +89,7 @@ public class BsMerRateSqlProvider {
sql.SELECT("mer_id");
sql.SELECT("mer_no");
sql.SELECT("rate_type_code");
sql.SELECT("rate_saas_type_code");
sql.SELECT("rate_type_name");
sql.SELECT("rate_pct");
sql.SELECT("`status`");
@ -126,6 +131,10 @@ public class BsMerRateSqlProvider {
sql.SET("rate_type_code = #{record.rateTypeCode,jdbcType=INTEGER}");
}
if (record.getRateSaasTypeCode() != null) {
sql.SET("rate_saas_type_code = #{record.rateSaasTypeCode,jdbcType=VARCHAR}");
}
if (record.getRateTypeName() != null) {
sql.SET("rate_type_name = #{record.rateTypeName,jdbcType=VARCHAR}");
}
@ -170,6 +179,7 @@ public class BsMerRateSqlProvider {
sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}");
sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}");
sql.SET("rate_type_code = #{record.rateTypeCode,jdbcType=INTEGER}");
sql.SET("rate_saas_type_code = #{record.rateSaasTypeCode,jdbcType=VARCHAR}");
sql.SET("rate_type_name = #{record.rateTypeName,jdbcType=VARCHAR}");
sql.SET("rate_pct = #{record.ratePct,jdbcType=DECIMAL}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
@ -200,6 +210,10 @@ public class BsMerRateSqlProvider {
sql.SET("rate_type_code = #{rateTypeCode,jdbcType=INTEGER}");
}
if (record.getRateSaasTypeCode() != null) {
sql.SET("rate_saas_type_code = #{rateSaasTypeCode,jdbcType=VARCHAR}");
}
if (record.getRateTypeName() != null) {
sql.SET("rate_type_name = #{rateTypeName,jdbcType=VARCHAR}");
}

@ -84,6 +84,10 @@ public class BsMerSqlProvider {
sql.VALUES("mer_mcc_code", "#{merMccCode,jdbcType=VARCHAR}");
}
if (record.getMerMccName() != null) {
sql.VALUES("mer_mcc_name", "#{merMccName,jdbcType=VARCHAR}");
}
if (record.getBlisUrl() != null) {
sql.VALUES("blis_url", "#{blisUrl,jdbcType=VARCHAR}");
}
@ -196,6 +200,7 @@ public class BsMerSqlProvider {
sql.SELECT("mer_name");
sql.SELECT("mer_abbreviate");
sql.SELECT("mer_mcc_code");
sql.SELECT("mer_mcc_name");
sql.SELECT("blis_url");
sql.SELECT("blis_name");
sql.SELECT("blis_no");
@ -295,6 +300,10 @@ public class BsMerSqlProvider {
sql.SET("mer_mcc_code = #{record.merMccCode,jdbcType=VARCHAR}");
}
if (record.getMerMccName() != null) {
sql.SET("mer_mcc_name = #{record.merMccName,jdbcType=VARCHAR}");
}
if (record.getBlisUrl() != null) {
sql.SET("blis_url = #{record.blisUrl,jdbcType=VARCHAR}");
}
@ -406,6 +415,7 @@ public class BsMerSqlProvider {
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}");
sql.SET("mer_abbreviate = #{record.merAbbreviate,jdbcType=VARCHAR}");
sql.SET("mer_mcc_code = #{record.merMccCode,jdbcType=VARCHAR}");
sql.SET("mer_mcc_name = #{record.merMccName,jdbcType=VARCHAR}");
sql.SET("blis_url = #{record.blisUrl,jdbcType=VARCHAR}");
sql.SET("blis_name = #{record.blisName,jdbcType=VARCHAR}");
sql.SET("blis_no = #{record.blisNo,jdbcType=VARCHAR}");
@ -494,6 +504,10 @@ public class BsMerSqlProvider {
sql.SET("mer_mcc_code = #{merMccCode,jdbcType=VARCHAR}");
}
if (record.getMerMccName() != null) {
sql.SET("mer_mcc_name = #{merMccName,jdbcType=VARCHAR}");
}
if (record.getBlisUrl() != null) {
sql.SET("blis_url = #{blisUrl,jdbcType=VARCHAR}");
}

@ -7,7 +7,6 @@ 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;
@ -39,18 +38,20 @@ public interface SecRegionMapper extends SecRegionMapperExt {
int deleteByPrimaryKey(Long regionId);
@Insert({
"insert into sec_region (region_name, parent_id, ",
"`status`, lakala, ext_1, ",
"insert into sec_region (region_id, region_name, ",
"parent_id, `status`, ",
"lakala, saas_code, ",
"saas_bank_code, ext_1, ",
"ext_2, ext_3)",
"values (#{regionName,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, ",
"#{status,jdbcType=INTEGER}, #{lakala,jdbcType=BIGINT}, #{ext1,jdbcType=VARCHAR}, ",
"values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ",
"#{parentId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ",
"#{lakala,jdbcType=BIGINT}, #{saasCode,jdbcType=VARCHAR}, ",
"#{saasBankCode,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
"#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
})
@Options(useGeneratedKeys=true,keyProperty="regionId")
int insert(SecRegion record);
@InsertProvider(type=SecRegionSqlProvider.class, method="insertSelective")
@Options(useGeneratedKeys=true,keyProperty="regionId")
int insertSelective(SecRegion record);
@SelectProvider(type=SecRegionSqlProvider.class, method="selectByExample")
@ -60,6 +61,8 @@ public interface SecRegionMapper extends SecRegionMapperExt {
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="lakala", property="lakala", jdbcType=JdbcType.BIGINT),
@Result(column="saas_code", property="saasCode", jdbcType=JdbcType.VARCHAR),
@Result(column="saas_bank_code", property="saasBankCode", jdbcType=JdbcType.VARCHAR),
@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)
@ -68,7 +71,8 @@ public interface SecRegionMapper extends SecRegionMapperExt {
@Select({
"select",
"region_id, region_name, parent_id, `status`, lakala, ext_1, ext_2, ext_3",
"region_id, region_name, parent_id, `status`, lakala, saas_code, saas_bank_code, ",
"ext_1, ext_2, ext_3",
"from sec_region",
"where region_id = #{regionId,jdbcType=BIGINT}"
})
@ -78,6 +82,8 @@ public interface SecRegionMapper extends SecRegionMapperExt {
@Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT),
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
@Result(column="lakala", property="lakala", jdbcType=JdbcType.BIGINT),
@Result(column="saas_code", property="saasCode", jdbcType=JdbcType.VARCHAR),
@Result(column="saas_bank_code", property="saasBankCode", jdbcType=JdbcType.VARCHAR),
@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)
@ -99,6 +105,8 @@ public interface SecRegionMapper extends SecRegionMapperExt {
"parent_id = #{parentId,jdbcType=BIGINT},",
"`status` = #{status,jdbcType=INTEGER},",
"lakala = #{lakala,jdbcType=BIGINT},",
"saas_code = #{saasCode,jdbcType=VARCHAR},",
"saas_bank_code = #{saasBankCode,jdbcType=VARCHAR},",
"ext_1 = #{ext1,jdbcType=VARCHAR},",
"ext_2 = #{ext2,jdbcType=VARCHAR},",
"ext_3 = #{ext3,jdbcType=VARCHAR}",

@ -28,6 +28,10 @@ public class SecRegionSqlProvider {
SQL sql = new SQL();
sql.INSERT_INTO("sec_region");
if (record.getRegionId() != null) {
sql.VALUES("region_id", "#{regionId,jdbcType=BIGINT}");
}
if (record.getRegionName() != null) {
sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}");
}
@ -44,6 +48,14 @@ public class SecRegionSqlProvider {
sql.VALUES("lakala", "#{lakala,jdbcType=BIGINT}");
}
if (record.getSaasCode() != null) {
sql.VALUES("saas_code", "#{saasCode,jdbcType=VARCHAR}");
}
if (record.getSaasBankCode() != null) {
sql.VALUES("saas_bank_code", "#{saasBankCode,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}");
}
@ -70,6 +82,8 @@ public class SecRegionSqlProvider {
sql.SELECT("parent_id");
sql.SELECT("`status`");
sql.SELECT("lakala");
sql.SELECT("saas_code");
sql.SELECT("saas_bank_code");
sql.SELECT("ext_1");
sql.SELECT("ext_2");
sql.SELECT("ext_3");
@ -110,6 +124,14 @@ public class SecRegionSqlProvider {
sql.SET("lakala = #{record.lakala,jdbcType=BIGINT}");
}
if (record.getSaasCode() != null) {
sql.SET("saas_code = #{record.saasCode,jdbcType=VARCHAR}");
}
if (record.getSaasBankCode() != null) {
sql.SET("saas_bank_code = #{record.saasBankCode,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
}
@ -135,6 +157,8 @@ public class SecRegionSqlProvider {
sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}");
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
sql.SET("lakala = #{record.lakala,jdbcType=BIGINT}");
sql.SET("saas_code = #{record.saasCode,jdbcType=VARCHAR}");
sql.SET("saas_bank_code = #{record.saasBankCode,jdbcType=VARCHAR}");
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}");
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}");
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}");
@ -164,6 +188,14 @@ public class SecRegionSqlProvider {
sql.SET("lakala = #{lakala,jdbcType=BIGINT}");
}
if (record.getSaasCode() != null) {
sql.SET("saas_code = #{saasCode,jdbcType=VARCHAR}");
}
if (record.getSaasBankCode() != null) {
sql.SET("saas_bank_code = #{saasBankCode,jdbcType=VARCHAR}");
}
if (record.getExt1() != null) {
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}");
}

@ -88,6 +88,11 @@ public class BsMer implements Serializable {
*/
private String merMccCode;
/**
* 商户MCC名称
*/
private String merMccName;
/**
* 商户营业执照图片
*/
@ -311,6 +316,14 @@ public class BsMer implements Serializable {
this.merMccCode = merMccCode;
}
public String getMerMccName() {
return merMccName;
}
public void setMerMccName(String merMccName) {
this.merMccName = merMccName;
}
public String getBlisUrl() {
return blisUrl;
}
@ -514,6 +527,7 @@ public class BsMer implements Serializable {
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName()))
&& (this.getMerAbbreviate() == null ? other.getMerAbbreviate() == null : this.getMerAbbreviate().equals(other.getMerAbbreviate()))
&& (this.getMerMccCode() == null ? other.getMerMccCode() == null : this.getMerMccCode().equals(other.getMerMccCode()))
&& (this.getMerMccName() == null ? other.getMerMccName() == null : this.getMerMccName().equals(other.getMerMccName()))
&& (this.getBlisUrl() == null ? other.getBlisUrl() == null : this.getBlisUrl().equals(other.getBlisUrl()))
&& (this.getBlisName() == null ? other.getBlisName() == null : this.getBlisName().equals(other.getBlisName()))
&& (this.getBlisNo() == null ? other.getBlisNo() == null : this.getBlisNo().equals(other.getBlisNo()))
@ -557,6 +571,7 @@ public class BsMer implements Serializable {
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode());
result = prime * result + ((getMerAbbreviate() == null) ? 0 : getMerAbbreviate().hashCode());
result = prime * result + ((getMerMccCode() == null) ? 0 : getMerMccCode().hashCode());
result = prime * result + ((getMerMccName() == null) ? 0 : getMerMccName().hashCode());
result = prime * result + ((getBlisUrl() == null) ? 0 : getBlisUrl().hashCode());
result = prime * result + ((getBlisName() == null) ? 0 : getBlisName().hashCode());
result = prime * result + ((getBlisNo() == null) ? 0 : getBlisNo().hashCode());
@ -603,6 +618,7 @@ public class BsMer implements Serializable {
sb.append(", merName=").append(merName);
sb.append(", merAbbreviate=").append(merAbbreviate);
sb.append(", merMccCode=").append(merMccCode);
sb.append(", merMccName=").append(merMccName);
sb.append(", blisUrl=").append(blisUrl);
sb.append(", blisName=").append(blisName);
sb.append(", blisNo=").append(blisNo);

@ -24,7 +24,12 @@ public class BsMerAttach implements Serializable {
private Long merId;
/**
* 附近类型 数据字典MER_ATTACH_TYPE
* 平台类型
*/
private Integer platformType;
/**
* 附件类型 数据字典MER_ATTACH_TYPE
*/
private Integer type;
@ -77,6 +82,14 @@ public class BsMerAttach implements Serializable {
this.merId = merId;
}
public Integer getPlatformType() {
return platformType;
}
public void setPlatformType(Integer platformType) {
this.platformType = platformType;
}
public Integer getType() {
return type;
}
@ -163,6 +176,7 @@ public class BsMerAttach implements Serializable {
BsMerAttach other = (BsMerAttach) 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.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getTypeCode() == null ? other.getTypeCode() == null : this.getTypeCode().equals(other.getTypeCode()))
&& (this.getFileUrl() == null ? other.getFileUrl() == null : this.getFileUrl().equals(other.getFileUrl()))
@ -180,6 +194,7 @@ public class BsMerAttach implements Serializable {
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 + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getTypeCode() == null) ? 0 : getTypeCode().hashCode());
result = prime * result + ((getFileUrl() == null) ? 0 : getFileUrl().hashCode());
@ -200,6 +215,7 @@ public class BsMerAttach implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", merId=").append(merId);
sb.append(", platformType=").append(platformType);
sb.append(", type=").append(type);
sb.append(", typeCode=").append(typeCode);
sb.append(", fileUrl=").append(fileUrl);

@ -245,6 +245,66 @@ public class BsMerAttachExample {
return (Criteria) this;
}
public Criteria andPlatformTypeIsNull() {
addCriterion("platform_type is null");
return (Criteria) this;
}
public Criteria andPlatformTypeIsNotNull() {
addCriterion("platform_type is not null");
return (Criteria) this;
}
public Criteria andPlatformTypeEqualTo(Integer value) {
addCriterion("platform_type =", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeNotEqualTo(Integer value) {
addCriterion("platform_type <>", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeGreaterThan(Integer value) {
addCriterion("platform_type >", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("platform_type >=", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeLessThan(Integer value) {
addCriterion("platform_type <", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeLessThanOrEqualTo(Integer value) {
addCriterion("platform_type <=", value, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeIn(List<Integer> values) {
addCriterion("platform_type in", values, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeNotIn(List<Integer> values) {
addCriterion("platform_type not in", values, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeBetween(Integer value1, Integer value2) {
addCriterion("platform_type between", value1, value2, "platformType");
return (Criteria) this;
}
public Criteria andPlatformTypeNotBetween(Integer value1, Integer value2) {
addCriterion("platform_type not between", value1, value2, "platformType");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("`type` is null");
return (Criteria) this;

@ -1125,6 +1125,76 @@ public class BsMerExample {
return (Criteria) this;
}
public Criteria andMerMccNameIsNull() {
addCriterion("mer_mcc_name is null");
return (Criteria) this;
}
public Criteria andMerMccNameIsNotNull() {
addCriterion("mer_mcc_name is not null");
return (Criteria) this;
}
public Criteria andMerMccNameEqualTo(String value) {
addCriterion("mer_mcc_name =", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameNotEqualTo(String value) {
addCriterion("mer_mcc_name <>", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameGreaterThan(String value) {
addCriterion("mer_mcc_name >", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameGreaterThanOrEqualTo(String value) {
addCriterion("mer_mcc_name >=", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameLessThan(String value) {
addCriterion("mer_mcc_name <", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameLessThanOrEqualTo(String value) {
addCriterion("mer_mcc_name <=", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameLike(String value) {
addCriterion("mer_mcc_name like", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameNotLike(String value) {
addCriterion("mer_mcc_name not like", value, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameIn(List<String> values) {
addCriterion("mer_mcc_name in", values, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameNotIn(List<String> values) {
addCriterion("mer_mcc_name not in", values, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameBetween(String value1, String value2) {
addCriterion("mer_mcc_name between", value1, value2, "merMccName");
return (Criteria) this;
}
public Criteria andMerMccNameNotBetween(String value1, String value2) {
addCriterion("mer_mcc_name not between", value1, value2, "merMccName");
return (Criteria) this;
}
public Criteria andBlisUrlIsNull() {
addCriterion("blis_url is null");
return (Criteria) this;

@ -34,6 +34,11 @@ public class BsMerRate implements Serializable {
*/
private Integer rateTypeCode;
/**
* 费率类型代码拉卡拉SAAS平台代码
*/
private String rateSaasTypeCode;
/**
* 费率类型名称
*/
@ -99,6 +104,14 @@ public class BsMerRate implements Serializable {
this.rateTypeCode = rateTypeCode;
}
public String getRateSaasTypeCode() {
return rateSaasTypeCode;
}
public void setRateSaasTypeCode(String rateSaasTypeCode) {
this.rateSaasTypeCode = rateSaasTypeCode;
}
public String getRateTypeName() {
return rateTypeName;
}
@ -179,6 +192,7 @@ public class BsMerRate implements Serializable {
&& (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId()))
&& (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo()))
&& (this.getRateTypeCode() == null ? other.getRateTypeCode() == null : this.getRateTypeCode().equals(other.getRateTypeCode()))
&& (this.getRateSaasTypeCode() == null ? other.getRateSaasTypeCode() == null : this.getRateSaasTypeCode().equals(other.getRateSaasTypeCode()))
&& (this.getRateTypeName() == null ? other.getRateTypeName() == null : this.getRateTypeName().equals(other.getRateTypeName()))
&& (this.getRatePct() == null ? other.getRatePct() == null : this.getRatePct().equals(other.getRatePct()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@ -197,6 +211,7 @@ public class BsMerRate implements Serializable {
result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode());
result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode());
result = prime * result + ((getRateTypeCode() == null) ? 0 : getRateTypeCode().hashCode());
result = prime * result + ((getRateSaasTypeCode() == null) ? 0 : getRateSaasTypeCode().hashCode());
result = prime * result + ((getRateTypeName() == null) ? 0 : getRateTypeName().hashCode());
result = prime * result + ((getRatePct() == null) ? 0 : getRatePct().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@ -218,6 +233,7 @@ public class BsMerRate implements Serializable {
sb.append(", merId=").append(merId);
sb.append(", merNo=").append(merNo);
sb.append(", rateTypeCode=").append(rateTypeCode);
sb.append(", rateSaasTypeCode=").append(rateSaasTypeCode);
sb.append(", rateTypeName=").append(rateTypeName);
sb.append(", ratePct=").append(ratePct);
sb.append(", status=").append(status);

@ -376,6 +376,76 @@ public class BsMerRateExample {
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeIsNull() {
addCriterion("rate_saas_type_code is null");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeIsNotNull() {
addCriterion("rate_saas_type_code is not null");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeEqualTo(String value) {
addCriterion("rate_saas_type_code =", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeNotEqualTo(String value) {
addCriterion("rate_saas_type_code <>", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeGreaterThan(String value) {
addCriterion("rate_saas_type_code >", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeGreaterThanOrEqualTo(String value) {
addCriterion("rate_saas_type_code >=", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeLessThan(String value) {
addCriterion("rate_saas_type_code <", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeLessThanOrEqualTo(String value) {
addCriterion("rate_saas_type_code <=", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeLike(String value) {
addCriterion("rate_saas_type_code like", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeNotLike(String value) {
addCriterion("rate_saas_type_code not like", value, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeIn(List<String> values) {
addCriterion("rate_saas_type_code in", values, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeNotIn(List<String> values) {
addCriterion("rate_saas_type_code not in", values, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeBetween(String value1, String value2) {
addCriterion("rate_saas_type_code between", value1, value2, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateSaasTypeCodeNotBetween(String value1, String value2) {
addCriterion("rate_saas_type_code not between", value1, value2, "rateSaasTypeCode");
return (Criteria) this;
}
public Criteria andRateTypeNameIsNull() {
addCriterion("rate_type_name is null");
return (Criteria) this;

@ -37,6 +37,16 @@ public class SecRegion implements Serializable {
*/
private Long lakala;
/**
* SAAS系统地区编码
*/
private String saasCode;
/**
* SAAS系统银行地区编码
*/
private String saasBankCode;
private String ext1;
private String ext2;
@ -85,6 +95,22 @@ public class SecRegion implements Serializable {
this.lakala = lakala;
}
public String getSaasCode() {
return saasCode;
}
public void setSaasCode(String saasCode) {
this.saasCode = saasCode;
}
public String getSaasBankCode() {
return saasBankCode;
}
public void setSaasBankCode(String saasBankCode) {
this.saasBankCode = saasBankCode;
}
public String getExt1() {
return ext1;
}
@ -126,6 +152,8 @@ public class SecRegion implements Serializable {
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
&& (this.getLakala() == null ? other.getLakala() == null : this.getLakala().equals(other.getLakala()))
&& (this.getSaasCode() == null ? other.getSaasCode() == null : this.getSaasCode().equals(other.getSaasCode()))
&& (this.getSaasBankCode() == null ? other.getSaasBankCode() == null : this.getSaasBankCode().equals(other.getSaasBankCode()))
&& (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()));
@ -140,6 +168,8 @@ public class SecRegion implements Serializable {
result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
result = prime * result + ((getLakala() == null) ? 0 : getLakala().hashCode());
result = prime * result + ((getSaasCode() == null) ? 0 : getSaasCode().hashCode());
result = prime * result + ((getSaasBankCode() == null) ? 0 : getSaasBankCode().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());
@ -157,6 +187,8 @@ public class SecRegion implements Serializable {
sb.append(", parentId=").append(parentId);
sb.append(", status=").append(status);
sb.append(", lakala=").append(lakala);
sb.append(", saasCode=").append(saasCode);
sb.append(", saasBankCode=").append(saasBankCode);
sb.append(", ext1=").append(ext1);
sb.append(", ext2=").append(ext2);
sb.append(", ext3=").append(ext3);

@ -434,6 +434,146 @@ public class SecRegionExample {
return (Criteria) this;
}
public Criteria andSaasCodeIsNull() {
addCriterion("saas_code is null");
return (Criteria) this;
}
public Criteria andSaasCodeIsNotNull() {
addCriterion("saas_code is not null");
return (Criteria) this;
}
public Criteria andSaasCodeEqualTo(String value) {
addCriterion("saas_code =", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeNotEqualTo(String value) {
addCriterion("saas_code <>", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeGreaterThan(String value) {
addCriterion("saas_code >", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeGreaterThanOrEqualTo(String value) {
addCriterion("saas_code >=", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeLessThan(String value) {
addCriterion("saas_code <", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeLessThanOrEqualTo(String value) {
addCriterion("saas_code <=", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeLike(String value) {
addCriterion("saas_code like", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeNotLike(String value) {
addCriterion("saas_code not like", value, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeIn(List<String> values) {
addCriterion("saas_code in", values, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeNotIn(List<String> values) {
addCriterion("saas_code not in", values, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeBetween(String value1, String value2) {
addCriterion("saas_code between", value1, value2, "saasCode");
return (Criteria) this;
}
public Criteria andSaasCodeNotBetween(String value1, String value2) {
addCriterion("saas_code not between", value1, value2, "saasCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeIsNull() {
addCriterion("saas_bank_code is null");
return (Criteria) this;
}
public Criteria andSaasBankCodeIsNotNull() {
addCriterion("saas_bank_code is not null");
return (Criteria) this;
}
public Criteria andSaasBankCodeEqualTo(String value) {
addCriterion("saas_bank_code =", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeNotEqualTo(String value) {
addCriterion("saas_bank_code <>", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeGreaterThan(String value) {
addCriterion("saas_bank_code >", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeGreaterThanOrEqualTo(String value) {
addCriterion("saas_bank_code >=", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeLessThan(String value) {
addCriterion("saas_bank_code <", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeLessThanOrEqualTo(String value) {
addCriterion("saas_bank_code <=", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeLike(String value) {
addCriterion("saas_bank_code like", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeNotLike(String value) {
addCriterion("saas_bank_code not like", value, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeIn(List<String> values) {
addCriterion("saas_bank_code in", values, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeNotIn(List<String> values) {
addCriterion("saas_bank_code not in", values, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeBetween(String value1, String value2) {
addCriterion("saas_bank_code between", value1, value2, "saasBankCode");
return (Criteria) this;
}
public Criteria andSaasBankCodeNotBetween(String value1, String value2) {
addCriterion("saas_bank_code not between", value1, value2, "saasBankCode");
return (Criteria) this;
}
public Criteria andExt1IsNull() {
addCriterion("ext_1 is null");
return (Criteria) this;

@ -60,6 +60,23 @@ public class AliYunOcrService {
return null;
}
/**
* 银行开户许可证识别
* @param url 访问地址
* @return
*/
public static RecognizeBankAccountLicenseResponseBody recognizeBankAccount(String url) {
try {
Client client = createClient();
RecognizeBankAccountLicenseRequest recognizeBankAccountLicenseRequest = new RecognizeBankAccountLicenseRequest().setUrl(url);
RecognizeBankAccountLicenseResponse response = client.recognizeBankAccountLicense(recognizeBankAccountLicenseRequest);
return response.getBody();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 营业执照识别

@ -13,9 +13,17 @@ public interface BsLklMccService {
/**
* 查询Macc列表
* @param param
* @return
*/
List<BsLklMcc> getMccList(Map<String, Object> param);
List<BsLklMcc> getMccList();
/**
* 查询mcc
* @param code
* @return
*/
BsLklMcc getMccByCode(String code);
void insert(BsLklMcc lklMcc);
}

@ -1,6 +1,7 @@
package com.hfkj.service;
import com.hfkj.entity.BsMerAttach;
import com.hfkj.sysenum.PlatformTypeEnum;
import java.util.List;
@ -27,6 +28,6 @@ public interface BsMerAttachService {
* @param merId
* @return
*/
List<BsMerAttach> getAttachListByMer(Long merId, Integer type);
List<BsMerAttach> getAttachListByMer(Long merId, PlatformTypeEnum platformType, Integer type);
}

@ -242,7 +242,11 @@ public class BsDeviceOrderServiceImpl implements BsDeviceOrderService {
if (deviceOrder.getDeviceType().equals(DeviceTypeEnum.type1.getNumber()) && deviceOrder.getOrderType().equals(DeviceOrderTypeEnum.type1.getNumber())) {
// 退款条件
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未满足退款条件,暂时无法退款");
} else if (deviceOrder.getOrderType().equals(DeviceOrderTypeEnum.type2.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "购买设备订单无法退款");
}
// 查询订单
BsDeviceOrder order = getDetailOrder(deviceOrder.getOrderNo());
if (order == null) {

@ -1,7 +1,10 @@
package com.hfkj.service.impl;
import com.hfkj.channel.lakala.LaKaLaMerService;
import com.hfkj.common.utils.RedisUtil;
import com.hfkj.dao.BsLklMccMapper;
import com.hfkj.entity.BsLklMcc;
import com.hfkj.entity.BsLklMccExample;
import com.hfkj.service.BsLklMccService;
import org.springframework.stereotype.Service;
@ -15,8 +18,43 @@ public class BsLklMccServiceImpl implements BsLklMccService {
@Resource
private BsLklMccMapper lklMccMapper;
@Resource
private RedisUtil redisUtil;
@Override
public List<BsLklMcc> getMccList() {
Object mccList = redisUtil.get("MCC_DATA");
if (mccList != null) {
return (List<BsLklMcc>) mccList;
}
// mcc大类
BsLklMccExample parentMccExample = new BsLklMccExample();
parentMccExample.createCriteria().andParentIdIsNull().andStatusNotEqualTo(0);
List<BsLklMcc> parentMccList = lklMccMapper.selectByExample(parentMccExample);
for (BsLklMcc parentMcc : parentMccList) {
// mcc小类
BsLklMccExample childMccExample = new BsLklMccExample();
childMccExample.createCriteria().andParentIdEqualTo(parentMcc.getId()).andStatusNotEqualTo(0);
parentMcc.setChildLklMccList(lklMccMapper.selectByExample(childMccExample));
}
redisUtil.set("MCC_DATA", parentMccList);
return parentMccList;
}
@Override
public BsLklMcc getMccByCode(String code) {
BsLklMccExample example = new BsLklMccExample();
example.createCriteria().andMaccCodeEqualTo(code).andStatusNotEqualTo(0);
List<BsLklMcc> list = lklMccMapper.selectByExample(example);
if (list.size() > 0) {
return list.get(0);
}
return null;
}
@Override
public List<BsLklMcc> getMccList(Map<String, Object> param) {
return lklMccMapper.getMccList(param);
public void insert(BsLklMcc lklMcc) {
lklMccMapper.insert(lklMcc);
}
}

@ -4,6 +4,7 @@ import com.hfkj.dao.BsMerAttachMapper;
import com.hfkj.entity.BsMerAttach;
import com.hfkj.entity.BsMerAttachExample;
import com.hfkj.service.BsMerAttachService;
import com.hfkj.sysenum.PlatformTypeEnum;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@ -40,10 +41,11 @@ public class BsMerAttachServiceImpl implements BsMerAttachService {
}
@Override
public List<BsMerAttach> getAttachListByMer(Long merId, Integer type) {
public List<BsMerAttach> getAttachListByMer(Long merId, PlatformTypeEnum platformType, Integer type) {
BsMerAttachExample example = new BsMerAttachExample();
BsMerAttachExample.Criteria criteria = example.createCriteria()
.andMerIdEqualTo(merId)
.andPlatformTypeEqualTo(platformType.getNumber())
.andStatusEqualTo(1);
if (type != null) {

@ -1,5 +1,6 @@
package com.hfkj.service.impl;
import com.hfkj.channel.saas.SaasMerService;
import com.hfkj.channel.weixin.WeiXinMerService;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
@ -32,6 +33,9 @@ public class BsMerContractServiceImpl implements BsMerContractService {
@Resource
private LaKaLaMerService laKaLaMerService;
@Resource
private SaasMerService saasMerService;
@Override
public void addMerContract(Long merId) throws Exception {
BsMer mer = merService.getMer(merId);
@ -44,10 +48,13 @@ public class BsMerContractServiceImpl implements BsMerContractService {
// 当前的进件平台
BsPlatform platform = platformService.getCurrentPlatform();
weiXinMerService.addMer(merId);
/* if (platform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
laKaLaMerService.addMer(merId);
}*/
if (platform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
// laKaLaMerService.addMer(merId);
saasMerService.addMer(merId);
} else if (platform.getPlatformType().equals(PlatformTypeEnum.type4.getNumber())) {
weiXinMerService.addMer(merId);
}
}

@ -166,49 +166,58 @@ public class BsMerServiceImpl implements BsMerService {
merRegion.setMerId(mer.getId());
merRegionService.editMerRegion(merRegion);
// 处理营业执照
List<BsMerAttach> blisUrl = merAttachService.getAttachListByMer(mer.getId(), MerAttachType.type1.getNumber());
BsMerAttach attach;
/******* 营业执照 *******/
List<BsMerAttach> blisUrl = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type1.getNumber());
if (blisUrl.size() > 0) {
for (BsMerAttach attach : blisUrl) {
attach.setStatus(0);
merAttachService.editMerAttach(attach);
for (BsMerAttach merAttach : blisUrl) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
BsMerAttach attach;
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setType(MerAttachType.type1.getNumber());
attach.setFileUrl(WeiXinUploadUtil.uploadMediaImgFile(CommonSysConst.getSysConfig().getFile_url()+"/"+ mer.getBlisUrl()));
merAttachService.editMerAttach(attach);
if (StringUtils.isNotBlank(mer.getBlisUrl())) {
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type1.getNumber());
attach.setFileUrl(mer.getBlisUrl());
merAttachService.editMerAttach(attach);
}
/******* 营业执照 *******/
/******* 法人身份证正面 *******/
// 处理法人身份证正面
List<BsMerAttach> larIdCardPortraitImg = merAttachService.getAttachListByMer(mer.getId(), MerAttachType.type2.getNumber());
List<BsMerAttach> larIdCardPortraitImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type2.getNumber());
if (larIdCardPortraitImg.size() > 0) {
for (BsMerAttach merAttach : larIdCardPortraitImg) {
attach.setStatus(0);
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type2.getNumber());
attach.setFileUrl(WeiXinUploadUtil.uploadMediaImgFile(CommonSysConst.getSysConfig().getFile_url() +"/"+ mer.getLarIdCardPortraitImg()));
attach.setFileUrl(mer.getLarIdCardPortraitImg());
merAttachService.editMerAttach(attach);
/******* 法人身份证正面 *******/
/******* 法人身份证反面 *******/
// 处理法人身份证反面
List<BsMerAttach> larIdCardNationalEmblemImg = merAttachService.getAttachListByMer(mer.getId(), MerAttachType.type3.getNumber());
List<BsMerAttach> larIdCardNationalEmblemImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type3.getNumber());
if (larIdCardNationalEmblemImg.size() > 0) {
for (BsMerAttach merAttach : larIdCardNationalEmblemImg) {
attach.setStatus(0);
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type3.getNumber());
attach.setFileUrl(WeiXinUploadUtil.uploadMediaImgFile(CommonSysConst.getSysConfig().getFile_url() +"/"+ mer.getLarIdCardNationalEmblemImg()));
attach.setFileUrl(mer.getLarIdCardNationalEmblemImg());
merAttachService.editMerAttach(attach);
/******* 法人身份证反面 *******/
}
@Override
@ -234,7 +243,9 @@ public class BsMerServiceImpl implements BsMerService {
} else {
merRate.setMerId(mer.getId());
merRate.setMerNo(mer.getMerNo());
merRate.setRateTypeName(commonService.getDictionaryCodeName("MER_PLATFORM_NO_RATE", merRate.getRateTypeCode().toString()));
SecDictionary platformNoRate = commonService.mappingSysCode("MER_PLATFORM_NO_RATE", merRate.getRateTypeCode().toString());
merRate.setRateTypeName(platformNoRate.getCodeName());
merRate.setRateSaasTypeCode(platformNoRate.getExt2());
merRateService.editMerRate(merRate);
}
}
@ -247,6 +258,82 @@ public class BsMerServiceImpl implements BsMerService {
merSettleAcct.setCreateTime(settle.getCreateTime());
}
BsMerAttach attach;
/******* 银行卡照片 *******/
// 处理法人身份证正面
List<BsMerAttach> bankCardImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type7.getNumber());
if (bankCardImg.size() > 0) {
for (BsMerAttach merAttach : bankCardImg) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
if (StringUtils.isNotBlank(merSettleAcct.getBankCardImg())){
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type7.getNumber());
attach.setFileUrl(merSettleAcct.getBankCardImg());
merAttachService.editMerAttach(attach);
}
/******* 银行卡照片 *******/
/******* 开户许可证照片 *******/
// 处理法人身份证正面
List<BsMerAttach> openningBankLicense = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type8.getNumber());
if (openningBankLicense.size() > 0) {
for (BsMerAttach merAttach : openningBankLicense) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
if (StringUtils.isNotBlank(merSettleAcct.getOpenningBankLicenseUrl())){
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type8.getNumber());
attach.setFileUrl(merSettleAcct.getOpenningBankLicenseUrl());
merAttachService.editMerAttach(attach);
}
/******* 开户许可证照片 *******/
/******* 结算人身份证人像面 *******/
// 处理法人身份证正面
List<BsMerAttach> larIdCardPortraitImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type9.getNumber());
if (larIdCardPortraitImg.size() > 0) {
for (BsMerAttach merAttach : larIdCardPortraitImg) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type9.getNumber());
attach.setFileUrl(merSettleAcct.getSettleIdCardPortraitImg());
merAttachService.editMerAttach(attach);
/******* 结算人身份证人像面 *******/
/******* 结算人身份证国徽面 *******/
// 处理法人身份证反面
List<BsMerAttach> larIdCardNationalEmblemImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type10.getNumber());
if (larIdCardNationalEmblemImg.size() > 0) {
for (BsMerAttach merAttach : larIdCardNationalEmblemImg) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type10.getNumber());
attach.setFileUrl(merSettleAcct.getSettleIdCardNationalEmblemImg());
merAttachService.editMerAttach(attach);
/******* 结算人身份证国徽面 *******/
merSettleAcctService.editMerSettleAcct(merSettleAcct);
}
@ -267,8 +354,8 @@ public class BsMerServiceImpl implements BsMerService {
BsMerAttach attach;
// 处理法人身份证反面
List<BsMerAttach> doorHeadImg = merAttachService.getAttachListByMer(mer.getId(), MerAttachType.type4.getNumber());
/**** 场所门头照片 ****/
List<BsMerAttach> doorHeadImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type4.getNumber());
if (doorHeadImg.size() > 0) {
for (BsMerAttach merAttach : doorHeadImg) {
merAttach.setStatus(0);
@ -277,12 +364,14 @@ public class BsMerServiceImpl implements BsMerService {
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type4.getNumber());
attach.setFileUrl(WeiXinUploadUtil.uploadMediaImgFile(CommonSysConst.getSysConfig().getFile_url() +"/"+ storeModel.getDoorHeadImg()));
attach.setFileUrl(storeModel.getDoorHeadImg());
merAttachService.editMerAttach(attach);
/**** 场所门头照片 ****/
// 处理法人身份证反面
List<BsMerAttach> internalImg = merAttachService.getAttachListByMer(mer.getId(), MerAttachType.type5.getNumber());
/**** 场所内部照片 ****/
List<BsMerAttach> internalImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type5.getNumber());
if (internalImg.size() > 0) {
for (BsMerAttach merAttach : internalImg) {
merAttach.setStatus(0);
@ -291,9 +380,27 @@ public class BsMerServiceImpl implements BsMerService {
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type5.getNumber());
attach.setFileUrl(WeiXinUploadUtil.uploadMediaImgFile(CommonSysConst.getSysConfig().getFile_url() +"/"+ storeModel.getInternalImg()));
attach.setFileUrl(storeModel.getInternalImg());
merAttachService.editMerAttach(attach);
/**** 场所内部照片 ****/
/**** 场所收银台照片 ****/
List<BsMerAttach> cashRegisterImg = merAttachService.getAttachListByMer(mer.getId(), PlatformTypeEnum.type0, MerAttachType.type6.getNumber());
if (cashRegisterImg.size() > 0) {
for (BsMerAttach merAttach : cashRegisterImg) {
merAttach.setStatus(0);
merAttachService.editMerAttach(merAttach);
}
}
attach = new BsMerAttach();
attach.setMerId(mer.getId());
attach.setPlatformType(PlatformTypeEnum.type0.getNumber());
attach.setType(MerAttachType.type6.getNumber());
attach.setFileUrl(storeModel.getCashRegisterImg());
merAttachService.editMerAttach(attach);
/**** 场所收银台照片 ****/
// 进件
merContractService.addMerContract(mer.getId());
@ -379,8 +486,7 @@ public class BsMerServiceImpl implements BsMerService {
// 查询错误消息
if (basisModel.getMerStatus().equals(MerStatusEnum.status4.getNumber())) {
Map<String, Object> recordMsg = merContractRecordMsgService.getMerContractRecordMsg(bsMer.getId());
JSONObject data = JSONObject.parseObject(MapUtils.getString(recordMsg, "response_content")).getJSONObject("data");
recordMsg.put("response_msg", data.getString("contractMemo"));
recordMsg.put("response_msg", recordMsg.get("response_msg"));
basisModel.setMerContractFailMsg(recordMsg);
}
return basisModel;
@ -394,6 +500,9 @@ public class BsMerServiceImpl implements BsMerService {
mer.setMerStatus(merStatus.getNumber());
mer.setCompleteStatus(MerCompleteStatusEnum.status1.getNumber());
List<BsStore> storeList = storeService.getStoreByMerId(mer.getId(), StoreCreateTypeEnum.type1);
// 审核通过
if (merStatus.getNumber().equals(MerStatusEnum.status1.getNumber())) {

@ -196,10 +196,6 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService {
return returnParam;
}
public static void main(String[] args) {
System.out.println(new BigDecimal("10").compareTo(new BigDecimal("10")));
}
@Override
public void paySuccess(String outTradeNo, String transactionId, PlatformTypeEnum platformType, TradeOrderPayModeEnum tradeOrderPayMode, BigDecimal tradeActualAmount, String subMchId) {
// 查询订单

@ -1,26 +1,47 @@
package com.hfkj.sysenum;
import java.util.Objects;
/**
* 商户附件类型
* @author hurui
*/
public enum MerAttachType {
type1(1, "营业执照"),
type2(2, "法人身份证正面"),
type3(3, "法人身份证反面"),
type4(4, "场所门头照片"),
type5(5, "场所内部照片"),
type6(6, "补充资料"),
type1(1, "营业执照", "BUSINESS_LICENCE"),
type2(2, "法人身份证正面", "ID_CARD_FRONT"),
type3(3, "法人身份证反面", "ID_CARD_BEHIND"),
type4(4, "场所门头照片", "SHOP_OUTSIDE_IMG"),
type5(5, "场所内部照片", "SHOP_INSIDE_IMG"),
type6(6, "场所收银台照片", "CHECKSTAND_IMG"),
type7(7, "银行卡照片", "BANK_CARD"),
type8(8, "开户许可证", "OPENING_PERMIT"),
type9(9, "结算人身份证人像面", "SETTLE_ID_CARD_FRONT"),
type10(10, "结算人身份证国徽面", "SETTLE_ID_CARD_BEHIND"),
type11(11, "协议", "AGREE_MENT"),
type12(12, "法人授权涵", "LETTER_OF_AUTHORIZATION"),
type99(99, "补充资料", "OTHERS"),
;
private Integer number;
private String name;
MerAttachType(int number, String name) {
private String lakalaCode;
MerAttachType(int number, String name, String lakalaCode) {
this.number = number;
this.name = name;
this.lakalaCode = lakalaCode;
}
public static MerAttachType getDataByNumber(Integer number) {
for (MerAttachType ele : values()) {
if (Objects.equals(number,ele.getNumber())) {
return ele;
}
}
return null;
}
public Integer getNumber() {
@ -38,4 +59,12 @@ public enum MerAttachType {
public void setName(String name) {
this.name = name;
}
public String getLakalaCode() {
return lakalaCode;
}
public void setLakalaCode(String lakalaCode) {
this.lakalaCode = lakalaCode;
}
}

@ -7,6 +7,7 @@ import java.util.Objects;
* @author hurui
*/
public enum PlatformTypeEnum {
type0(0, "惠支付"),
type1(1, "拉卡拉"),
type2(2, "国通"),
type3(3, "建行"),

@ -10,16 +10,27 @@ qr_code_url=https://gratia-pay.dctpay.com/filesystem/payQrCode/
lkl_request_url=https://test.wsmsd.cn/sit
lkl_org_code=1
lkl_v3_appid=OP00000003
lkl_v3_appid=OP00000392
lkl_v3_serial_no=00dfba8194c41b84cf
lkl_v3_private_key=/home/project/xuan-pay/cert/lakala/v3/private.text
lkl_v3_private_key=/home/project/gratia-pay/cert/lakala/v3/OP00000003_private_key.text
lkl_v2_appid=800000010334001
lkl_v2_serial_no=48066e7ce3551149cd9ebdaf924582794137feb6
lkl_v2_private_key=/home/project/xuan-pay/cert/lakala/v2/private.text
lkl_v2_appid=OP00000392
lkl_v2_serial_no=00dfba8194c41b84cf
lkl_v2_private_key=/home/project/gratia-pay/cert/lakala/v2/OP00000003_private_key.text
lkl_mer_contract_ret_url=https://gratia-pay.dctpay.com/brest/laKaLaNotify/merContract
lkl_micro_pay_ret_url=https://gratia-pay.dctpay.com/crest/laKaLaNotify/microPay
lkl_saas_client_id=testsit
lkl_saas_client_secret=EguwEckByf2I6u6z
lkl_saas_activity_id=37
lkl_saas_user_no=20000101
lkl_saas_request_mer_registration_token_url=https://test.wsmsd.cn/sit/htkauth/oauth/token
lkl_saas_request_mer_registration_url=https://test.wsmsd.cn/sit/htkregistration/merchant/
lkl_saas_request_mer_registration_common_url=https://test.wsmsd.cn/sit/htkregistration/
lkl_saas_request_mer_url=https://test.wsmsd.cn/sit/htkmerchants/
lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCp5aV3ZiXG2R8Yd8Nxocv+cF7VAUHBc0TF4MNne7mI8wM2yEP2QgI+rK1qDf6G7ZFPhutpIHKQchpolbSuC0vgaHpSjO9OUs1fpnK/JjZq9o8DatUsA0n4Fccec9NBbV5dy5yrwro7xmDpsevp1/IeiIssi1+iD+nBWqqVFx7GVQIDAQAB
lkl_saas_private_key="MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKnlpXdmJcbZHxh3w3Ghy/5wXtUBQcFzRMXgw2d7uYjzAzbIQ/ZCAj6srWoN/obtkU+G62kgcpByGmiVtK4LS+BoelKM705SzV+mcr8mNmr2jwNq1SwDSfgVxx5z00FtXl3LnKvCujvGYOmx6+nX8h6IiyyLX6IP6cFaqpUXHsZVAgMBAAECgYA4NpeM7etJ48T6H4Y3LsWEJkH6UDQlgbIblsaQkstMmLtTgOebrzN28UNfd8njcu9FVOrHGclOKbK7L+1cOLiduWsZKc/c/gAy9wAR4EhoLvlerH9EEPiPWFxdEDbMxPqlkpqLOo+PxHrhTn4vU4CaPdJtL2ujKn7nmsUdUDWo8QJBANS1TlM6nhPt2XlzN5kGfsJ4kBYNjuLXNA2YdNuC2ttYvEXHJ9T70FN/GnRBBIZu47uHH3Ie5nfep+qMk6a8RP8CQQDMecIyI0z1kVt+tOfWKw2ZFLsi74708qTaeR4W1ABtkngj1+bxoWWXr3KqhjqJkWxnhioSfXqu7CScNzjdM1CrAkAQd+ESjI1EmbumrYb2cAxMXi05p98SLPs4uj8B58WuCda5yEuLL9vXOxX/PjFtfxRepn2GxmGtki2J+UxNMnJdAkAFoORjlO0tZU7rcfdfwdeh+xwbnhSFUZiQGv1lC3jnizybX/oPdK3jOwUhBIjf+IzPXLYTxDh4UC/BzRNXo235AkEAhgYBk6H7RU2iIuvwz1c6CtE1gJ8DvEp1F0KOMWMFB0KCpDXUToix0dlMz962FozYENi4X4zYQo6nFwlXeS3Pfw==
wechat_pay_notify_url=https://gratia-pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file

@ -7,8 +7,8 @@ qr_code_url=https://pay.dctpay.com/filesystem/payQrCode/
lkl_request_url=https://s2.lakala.com
lkl_org_code=950386
lkl_v3_appid=OP00000066
lkl_v3_serial_no=017f2990c583
lkl_v3_appid=OP00000622
lkl_v3_serial_no=01752b7386f8
lkl_v3_private_key=/home/project/gratia-pay/cert/lakala/v3/prod_private.text
lkl_v2_appid=OP00000066
@ -17,6 +17,17 @@ lkl_v2_private_key=/home/project/gratia-pay/cert/lakala/v2/prod_private.text
lkl_mer_contract_ret_url=https://pay.dctpay.com/brest/laKaLaNotify/merContract
lkl_micro_pay_ret_url=https://pay.dctpay.com/crest/laKaLaNotify/microPay
lkl_saas_client_id=huifu
lkl_saas_client_secret=f65VVjqJfLtc177F
lkl_saas_activity_id=12
lkl_saas_user_no=22206482
lkl_saas_request_mer_registration_token_url=https://tkapi.lakala.com/auth/oauth/token
lkl_saas_request_mer_registration_url=https://htkactvi.lakala.com/registration/merchant/
lkl_saas_request_mer_registration_common_url=https://htkactvi.lakala.com/registration/
lkl_saas_request_mer_url=https://tkapi.lakala.com/htkmerchants/
lkl_saas_public_key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDAUkzRA+4GOS5OzYqxD/UJwM6p9to1dPvetL/7RbMa93o46qToPlPtaW61EvblOldHcBEHo7AGXXKmIYr7t2Up1PZC0g7UMpno/b5WkT6ieJ601Xreuj8hhyf2/xoej5vpi4/+lAr9YF+5GcyaVf4gfzTNJrmKj9PfvX5B3rUH2QIDAQAB
lkl_saas_private_key=MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMBSTNED7gY5Lk7NirEP9QnAzqn22jV0+960v/tFsxr3ejjqpOg+U+1pbrUS9uU6V0dwEQejsAZdcqYhivu3ZSnU9kLSDtQymej9vlaRPqJ4nrTVet66PyGHJ/b/Gh6Pm+mLj/6UCv1gX7kZzJpV/iB/NM0muYqP09+9fkHetQfZAgMBAAECgYB42D3kaC+8QVnTsluffoNeKYSyT6Y1SNiqy7CGVvl/zFlEQkx0khVybHlf1hbFWq9U+Bn7TuNgXH+Z3CHUoRwy4Ap/kMx637iRatoC8F/kcPaiB7JFQfdrxhgK858dSyHCQ2OXXQDJgJdth+oF9FylVsrDu5Sw3ha4OuzrmufuwQJBAPnPPSeFr1wu7kH6I+A5E49fMbAm7EU+3TYVzxNH1lr3X/LWuK9pi/LVPrSR4eNgAypyQWREIqdpBIiJ9bOnwa0CQQDFFl0zTQTVTWf5r/hwgCUMo4gHr2y/q7XMNe6n5fh4SQuQ+o4gW+BGHzDrT97G5hFGPL+w5niGuEBHWSo5/9xdAkEAnrxdM7vzDjSUGUCFg3lBQJ1QyYoyIF4t2qxJBQtk3jDKu1hNysjasNdoHP2F+CGOYW5wtvHEw3Qr+UcQ5bP3kQJABPAcga6KUnXQBxd7mAX956UpQVgJ13uL4IPxaM+APDNIUOeWLAVhRyB870hfAoi9Ig9fliUQG//9zEvVnQJmGQJBAOb8Z0mGMEbEeAyEKjqoNiQkkIcoBdmPKNFUoUJ6ohcBNOoMfklvNsf2+BPfuhs26tvhYDBRgCAfOVhqTQcGj6I=
wechat_pay_notify_url=https://pay.dctpay.com/crest/weiXinNotify/jsapiPay
file_url=/home/project/gratia-pay/file

Loading…
Cancel
Save