提交代码

yy_dev
胡锐 1 year ago
parent 5956ab89d3
commit 29a75d02fd
  1. 6
      cweb/src/main/java/com/cweb/controller/BsTradeOrderController.java
  2. 2
      cweb/src/main/java/com/cweb/controller/PayController.java
  3. 7
      cweb/src/main/java/com/cweb/controller/TestController.java
  4. 30
      cweb/src/main/java/com/cweb/notify/TianQueController.java
  5. 44
      service/src/main/java/com/hfkj/channel/saas/SaasMerService.java
  6. 37
      service/src/main/java/com/hfkj/channel/tianque/service/TianQueMerService.java
  7. 3
      service/src/main/java/com/hfkj/channel/tianque/service/TianQueTradeService.java

@ -454,9 +454,9 @@ public class BsTradeOrderController {
param.put("resMsg","处理成功"); param.put("resMsg","处理成功");
Map<String,Object> respData = new HashMap<>(); Map<String,Object> respData = new HashMap<>();
respData.put("openld", unionInfo.getString("data")); respData.put("openId", unionInfo.getString("data"));
respData.put("subOpenld", unionInfo.getString("data")); respData.put("subOpenId", unionInfo.getString("data"));
respData.put("userld", unionInfo.getString("data")); respData.put("userId", unionInfo.getString("data"));
param.put("respData", respData); param.put("respData", respData);
return ResponseMsgUtil.success(param); return ResponseMsgUtil.success(param);

@ -118,6 +118,7 @@ public class PayController {
if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) { if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type1.getNumber())) {
try { try {
Map<String, Object> order = laKaLaTradeService.preorder(body.getString("outTradeNo")); Map<String, Object> order = laKaLaTradeService.preorder(body.getString("outTradeNo"));
System.out.println("返回参数:" + JSONObject.toJSONString(order));
if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) { if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) {
return ResponseMsgUtil.success(order); return ResponseMsgUtil.success(order);
} }
@ -128,6 +129,7 @@ public class PayController {
} else if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type5.getNumber())) { } else if (merPlatform.getPlatformType().equals(PlatformTypeEnum.type5.getNumber())) {
try { try {
Map<String, Object> order = tianQueTradeService.preorder(body.getString("outTradeNo")); Map<String, Object> order = tianQueTradeService.preorder(body.getString("outTradeNo"));
System.out.println("返回参数:" + JSONObject.toJSONString(order));
if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) { if (StringUtils.isNotBlank(MapUtils.getString(order, "order"))) {
return ResponseMsgUtil.success(order); return ResponseMsgUtil.success(order);
} }

@ -262,13 +262,16 @@ public class TestController {
public ResponseData tianQueTest(@RequestParam(value = "code", required = true) String code) { public ResponseData tianQueTest(@RequestParam(value = "code", required = true) String code) {
try { try {
// tianQueMerService.addMer(Long.parseLong(code)); // tianQueMerService.addMer(Long.parseLong(code));
return ResponseMsgUtil.success(tianQueMerService.queryMerchantInfo(code)); // return ResponseMsgUtil.success(tianQueMerService.queryMerchantInfo(code));
// return ResponseMsgUtil.success(tianQueTradeService.preorder(code)); // return ResponseMsgUtil.success(tianQueTradeService.preorder(code));
// return ResponseMsgUtil.success(tianQueTradeService.queryTrade(code)); // return ResponseMsgUtil.success(tianQueTradeService.queryTrade(code));
// return ResponseMsgUtil.success(tianQueTradeService.poundageQuery("399200427027644",code)); // return ResponseMsgUtil.success(tianQueTradeService.poundageQuery("399200427027644",code));
// return ResponseMsgUtil.success(tianQueTradeService.refund(code, new BigDecimal("0.01"))); // return ResponseMsgUtil.success(tianQueTradeService.refund(code, new BigDecimal("0.01")));
// return ResponseMsgUtil.success(tianQueTradeService.refundQuery(code)); // return ResponseMsgUtil.success(tianQueTradeService.refundQuery(code));
// return ResponseMsgUtil.success(""); //tianQueMerService.weChatPayConf("399230921077727", "597456493", "03", "", "", "https://pay.dctpay.com/scanPay/");
//return ResponseMsgUtil.success(tianQueMerService.weChatPayConf("399230921077727", "597456493", "01", "wxa075e8509802f826", "00", ""));
return ResponseMsgUtil.success(tianQueMerService.queryConf("399230921077727", "597456493"));
// 1200 // 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>())); // return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));
/* AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest(); /* AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();

@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.LaKaLaLedgerService; import com.hfkj.channel.lakala.LaKaLaLedgerService;
import com.hfkj.channel.lakala.LaKaLaWalletService; import com.hfkj.channel.lakala.LaKaLaWalletService;
import com.hfkj.channel.tianque.service.TianQueMerElecSignService; import com.hfkj.channel.tianque.service.TianQueMerElecSignService;
import com.hfkj.channel.tianque.service.TianQueMerService;
import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.config.CommonSysConst; import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*; import com.hfkj.entity.*;
import com.hfkj.service.*; import com.hfkj.service.*;
@ -58,6 +60,8 @@ public class TianQueController {
private BsMerContractRecordMsgService merContractRecordMsgService; private BsMerContractRecordMsgService merContractRecordMsgService;
@Resource @Resource
private TianQueMerElecSignService tianQueMerElecSignService; private TianQueMerElecSignService tianQueMerElecSignService;
@Resource
private TianQueMerService tianQueMerService;
@RequestMapping(value="/microPay",method = RequestMethod.POST) @RequestMapping(value="/microPay",method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -171,7 +175,19 @@ public class TianQueController {
merPlatformNo.setStatus(MerPlatformNoStatusEnum.status1.getNumber()); merPlatformNo.setStatus(MerPlatformNoStatusEnum.status1.getNumber());
merPlatformNoService.editMerPlatformNo(merPlatformNo); merPlatformNoService.editMerPlatformNo(merPlatformNo);
} }
JSONArray repoInfoArray = respData.getJSONArray("repoInfo");
// 签署协议
tianQueMerElecSignService.openElecSignature(respData.getString("mno"));
new Thread(() -> {
try {
Thread.sleep(1000 * 120); // 暂停120秒
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
JSONObject merchantInfo = tianQueMerService.queryMerchantInfo(respData.getString("applicationId"));
if (merchantInfo != null) {
JSONArray repoInfoArray = merchantInfo.getJSONArray("repoInfo");
for (Object obj : repoInfoArray) { for (Object obj : repoInfoArray) {
JSONObject repoInfo = (JSONObject) obj; JSONObject repoInfo = (JSONObject) obj;
BsMerPlatformTerm merPlatformTerm = new BsMerPlatformTerm(); BsMerPlatformTerm merPlatformTerm = new BsMerPlatformTerm();
@ -182,11 +198,15 @@ public class TianQueController {
merPlatformTerm.setShopId(repoInfo.getString("channelId")); merPlatformTerm.setShopId(repoInfo.getString("channelId"));
merPlatformTerm.setTermNo(repoInfo.getString("childNo")); merPlatformTerm.setTermNo(repoInfo.getString("childNo"));
merPlatformTermService.editMerPlatformTerm(merPlatformTerm); merPlatformTermService.editMerPlatformTerm(merPlatformTerm);
}
// 签署协议
tianQueMerElecSignService.openElecSignature(respData.getString("mno"));
if (repoInfo.getString("childNoType").equals("WX")) {
// 微信配置平台支付参数
tianQueMerService.weChatPayConf(merPlatformNo.getPlatformNo(), repoInfo.getString("childNo"), "01", "wxa075e8509802f826", "00", "");
tianQueMerService.weChatPayConf(merPlatformNo.getPlatformNo(), repoInfo.getString("childNo"), "03", "", "", "https://pay.dctpay.com/scanPay/");
}
}
}
});
} else { } else {
if (mer.getMerStatus().intValue() != MerStatusEnum.status1.getNumber().intValue()) { if (mer.getMerStatus().intValue() != MerStatusEnum.status1.getNumber().intValue()) {
mer.setMerStatus(MerStatusEnum.status4.getNumber()); mer.setMerStatus(MerStatusEnum.status4.getNumber());

@ -582,6 +582,50 @@ public class SaasMerService {
return responseObj; return responseObj;
} }
/**
* 修改费率
* @param merId 申请id
* @return
*/
public JSONObject updateMer(Long merId) {
// 平台商户
BsMerPlatformNo merPlatformNo = merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.type1);
if (merPlatformNo == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未找到平台商户号");
}
Map<String,Object> param = new HashMap<>();
param.put("productCode", "PAPER_CODE");
param.put("settlementType", "AUTOMATIC");
// 商户费率
List<Map<String, Object>> feesMapList = new ArrayList<>();
Map<String, Object> feesMap;
List<BsMerRate> rateList = merRateService.getRateListByMerId(merId);
for (BsMerRate rate : rateList) {
feesMap = new HashMap<>();
feesMap.put("fee", rate.getRatePct());
feesMap.put("feeType", rate.getRateSaasTypeCode());
if (StringUtils.isNotBlank(rate.getExt1())) {
feesMap.put("topFee", rate.getExt1());
}
feesMapList.add(feesMap);
}
param.put("fees", feesMapList);
Map<String,Object> header = new HashMap<>();
header.put("Authorization", "bearer " + saasCommon.getUpdateToken());
JSONObject responseObj = HttpsUtils.doPost(SaasConfig.requestMerUrl + "channel/customer/update/info/" + merPlatformNo.getPlatformNo(), param, header);
System.out.println("商户号:" + merPlatformNo.getPlatformNo() + " " + merPlatformNo.getCupNo());
System.out.println("body:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("message").equals("SUCCESS")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
merPlatformNo.setExt1(responseObj.getString("reviewRelatedId"));
merPlatformNoService.editMerPlatformNo(merPlatformNo);
return responseObj;
}
/** /**
* 查询费率 * 查询费率
* @param merId 申请id * @param merId 申请id

@ -181,7 +181,7 @@ public class TianQueMerService {
param.put("identityNo", basisModel.getLarIdCard()); param.put("identityNo", basisModel.getLarIdCard());
param.put("legalPersonLicStt", basisModel.getLarIdCardPeriodStart().replace(".", "").replace("年","").replace("月","").replace("日","")); param.put("legalPersonLicStt", basisModel.getLarIdCardPeriodStart().replace(".", "").replace("年","").replace("月","").replace("日",""));
if (basisModel.getLarIdCardPeriodType().equals(2)) { if (basisModel.getLarIdCardPeriodType().equals(2)) {
param.put("businessLicStt", "29991231"); param.put("legalPersonLicEnt", "29991231");
} else { } else {
param.put("legalPersonLicEnt", basisModel.getLarIdCardPeriodEnd().replace(".", "").replace("年","").replace("月","").replace("日","")); param.put("legalPersonLicEnt", basisModel.getLarIdCardPeriodEnd().replace(".", "").replace("年","").replace("月","").replace("日",""));
} }
@ -423,7 +423,7 @@ public class TianQueMerService {
param.put("identityNo", basisModel.getLarIdCard()); param.put("identityNo", basisModel.getLarIdCard());
param.put("legalPersonLicStt", basisModel.getLarIdCardPeriodStart().replace(".", "").replace("年","").replace("月","").replace("日","")); param.put("legalPersonLicStt", basisModel.getLarIdCardPeriodStart().replace(".", "").replace("年","").replace("月","").replace("日",""));
if (basisModel.getLarIdCardPeriodType().equals(2)) { if (basisModel.getLarIdCardPeriodType().equals(2)) {
param.put("businessLicStt", "29991231"); param.put("legalPersonLicEnt", "29991231");
} else { } else {
param.put("legalPersonLicEnt", basisModel.getLarIdCardPeriodEnd().replace(".", "").replace("年","").replace("月","").replace("日","")); param.put("legalPersonLicEnt", basisModel.getLarIdCardPeriodEnd().replace(".", "").replace("年","").replace("月","").replace("日",""));
} }
@ -558,5 +558,38 @@ public class TianQueMerService {
return RequestUtil.request(TianQueConfig.requestUrl + "/merchant/queryMerchantInfo", param); return RequestUtil.request(TianQueConfig.requestUrl + "/merchant/queryMerchantInfo", param);
} }
/**
* 微信配置
* @param mno 商户编号
* @param subMchId 微信子商户号
* @param type 配置类型 取值范围01 支付Appid=03 jsapi授权目录
* @param subAppid 微信subAppid type=="01"时必传
* @param accountType 支付Appid类型枚举值 取值范围 00 公众号 01 小程序 type="01"时必传
* @param jsapiPath jsapi授权目录 type="03"时必传
* @return
*/
public JSONObject weChatPayConf(String mno,String subMchId,String type,String subAppid,String accountType,String jsapiPath) {
Map<String,Object> param = new HashMap<>();
param.put("mno", mno);
param.put("subMchId", subMchId);
param.put("type", type);
param.put("subAppid", subAppid);
param.put("accountType", accountType);
param.put("jsapiPath", jsapiPath);
return RequestUtil.request(TianQueConfig.requestUrl + "/merchant/weChatPaySet/addConf", param);
}
/**
* 查询配置
* @param mno 商户编号
* @param subMchId 微信子商户号
* @return
*/
public JSONObject queryConf(String mno,String subMchId) {
Map<String,Object> param = new HashMap<>();
param.put("mno", mno);
param.put("subMchId", subMchId);
return RequestUtil.request(TianQueConfig.requestUrl + "/merchant/weChatPaySet/queryConf", param);
}
} }

@ -71,7 +71,8 @@ public class TianQueTradeService {
param.put("mno", platformNo.getPlatformNo()); param.put("mno", platformNo.getPlatformNo());
param.put("ordNo", order.getOutTradeNo()); param.put("ordNo", order.getOutTradeNo());
param.put("amt", order.getTradeActualAmount()); param.put("amt", order.getTradeActualAmount());
param.put("payType", order.getPayMode()); param.put("payType", order.getPayMode().equals("UQRCODEPAY")?"UNIONPAY":order.getPayMode());
param.put("customerIp", order.getPayMode().equals("UQRCODEPAY")?order.getRequestIp():"140.210.192.36");
param.put("payWay", "02"); param.put("payWay", "02");
if (StringUtils.isNotBlank(order.getSubject())) { if (StringUtils.isNotBlank(order.getSubject())) {
param.put("subject", order.getSubject()); param.put("subject", order.getSubject());

Loading…
Cancel
Save