提交代码

yy_dev
胡锐 2 years ago
parent 407e746d57
commit 2b2c027697
  1. 25
      cweb/src/main/java/com/cweb/controller/TestController.java
  2. 1
      open-api/src/main/java/com/api/controller/v1/LedgerController.java
  3. 64
      open-api/src/main/java/com/api/controller/v1/MerController.java
  4. 115
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaConfigService.java

@ -82,27 +82,9 @@ public class TestController {
@Resource @Resource
private SaasMerService saasMerService; private SaasMerService saasMerService;
@Resource
private LaKaLaTradeService laKaLaTradeService;
@Resource
private LaKaLaTradeSeparateService laKaLaTradeSeparateService;
@Resource
private CommonService commonService;
@Resource
private BsLklMccService lklMccService;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
@Resource
private LaKaLaMerService laKaLaMerService;
@Resource @Resource
private BsTradeOrderService tradeOrderService; private BsTradeOrderService tradeOrderService;
@Resource @Resource
private BsTradeOrderProfitSharingService tradeOrderProfitSharingService;
@Resource
private BsMerService merService; private BsMerService merService;
@Resource @Resource
@ -121,6 +103,9 @@ public class TestController {
@Resource @Resource
private BsBankActivityRosterRateService bankActivityRosterRateService; private BsBankActivityRosterRateService bankActivityRosterRateService;
@Resource
private LaKaLaLedgerService laKaLaLedgerService;
@RequestMapping(value="/refreshMerStatus",method = RequestMethod.GET) @RequestMapping(value="/refreshMerStatus",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "refreshMerStatus") @ApiOperation(value = "refreshMerStatus")
@ -252,7 +237,9 @@ public class TestController {
// tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261734049211335408")); // tradeOrderProfitSharingService.createProfitSharing(tradeOrderService.getOrderByOutTradeNo("ZF1130202304261734049211335408"));
// return ResponseMsgUtil.success(saasCommon.getUpdateToken()); // return ResponseMsgUtil.success(saasCommon.getUpdateToken());
/* return ResponseMsgUtil.success(saasMerService.reconsiderSubmit("123364703"));*/ /* return ResponseMsgUtil.success(saasMerService.reconsiderSubmit("123364703"));*/
return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703")); //return ResponseMsgUtil.success(saasMerService.merchantInfo("123364703"));
// return ResponseMsgUtil.success(saasCommon.getCategory(null));
return ResponseMsgUtil.success(laKaLaLedgerService.queryLedgerMer(code));
// return ResponseMsgUtil.success(""); // return ResponseMsgUtil.success("");
// 1200 // 1200
// return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>())); // return ResponseMsgUtil.success(saasCommon.fileUpload(new HashMap<>()));

@ -111,6 +111,7 @@ public class LedgerController {
} }
log.info("返回参数:" + JSONObject.toJSONString(null)); log.info("返回参数:" + JSONObject.toJSONString(null));
return ResponseMsgUtil.success(null); return ResponseMsgUtil.success(null);

@ -0,0 +1,64 @@
package com.api.controller.v1;
import com.hfkj.channel.lakala.LaKaLaConfigService;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
/**
* @className: MerController
* @author: HuRui
* @date: 2023/5/23
**/
@Controller
@Api(value = "公共")
@RequestMapping(value = "/v1/mer")
public class MerController {
private static Logger log = LoggerFactory.getLogger(MerController.class);
@Resource
private LaKaLaConfigService laKaLaConfigService;
@RequestMapping(value="/wechatParamConf",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "wechatParamConf")
public ResponseData wechatParamConf(@RequestParam(value = "merCupNo" , required = true) String merCupNo,
@RequestParam(value = "subMchId" , required = true) String subMchId,
@RequestParam(value = "subAppid" , required = true) String subAppid,
@RequestParam(value = "jsapiPath" , required = true) String jsapiPath) {
try {
// return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf("822690053111ERC", "569999133","wxf30043187dc90829", "http://api2.ctpark.cn/"));
return ResponseMsgUtil.success(laKaLaConfigService.wechatParamConf(merCupNo, subMchId,subAppid, jsapiPath));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/querySubMerInfo",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "querySubMerInfo")
public ResponseData querySubMerInfo(@RequestParam(value = "merCupNo" , required = true) String merCupNo) {
try {
return ResponseMsgUtil.success(laKaLaConfigService.querySubMerInfo(merCupNo));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -0,0 +1,115 @@
package com.hfkj.channel.lakala;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hfkj.channel.lakala.config.LaKaLaConfig;
import com.hfkj.channel.saas.utils.SaasCommon;
import com.hfkj.common.exception.ErrorCode;
import com.hfkj.common.exception.ErrorHelp;
import com.hfkj.common.exception.SysCode;
import com.hfkj.common.utils.DateUtil;
import com.hfkj.common.utils.GenerateUtil;
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.PlatformTypeEnum;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.io.File;
import java.util.*;
/**
* 拉卡拉配置 服务
* @author hurui
*/
@Service("laKaLaConfigService")
public class LaKaLaConfigService {
/**
* 微信参数配置
* @param merCupNo 银联商户号
* @param subMchId 微信子商户号
* @param subAppid 关联APPID 绑定特约商户或渠道公众号小程序APP支付等对应的APPID
* @param jsapiPath 授权目录
* @return
*/
public JSONObject wechatParamConf(String merCupNo,String subMchId,String subAppid,String jsapiPath) {
// 请求参数
Map<String, Object> param = new HashMap<>();
param.put("timestamp", new Date().getTime());
param.put("rnd", GenerateUtil.generateRandomString(18));
param.put("ver", "1.0.0");
param.put("reqId", new Date().getTime());
Map<String, Object> map = new HashMap<>();
map.put("merCupNo", merCupNo);
map.put("channlId", "24006513"); // 微信渠道号 (仅支持拉卡拉渠道配置)
// map.put("channlId", "167048649"); // 微信渠道号 (仅支持拉卡拉渠道配置)
map.put("subMchId", subMchId);
map.put("subAppid", subAppid);
map.put("jsapiPath", jsapiPath);
map.put("confType", "SUB_APPID");
param.put("reqData", map);
// 生成签名
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(param)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/wechatParamConf", param, heard);
System.out.println("Authorization" + JSONObject.toJSONString(reqParam.get("Authorization")));
System.out.println("request:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody;
}
/**
* 商户报备结果查询
* @param merCupNo
* @return
*/
public JSONObject querySubMerInfo(String merCupNo) {
// 请求参数
Map<String, Object> param = new HashMap<>();
param.put("timestamp", new Date().getTime());
param.put("rnd", GenerateUtil.generateRandomString(18));
param.put("ver", "1.0.0");
param.put("reqId", new Date().getTime());
Map<String, Object> map = new HashMap<>();
map.put("version", "1.0");
map.put("orderNo", new Date().getTime());
map.put("orgCode", CommonSysConst.getSysConfig().getLkl_org_code());
map.put("merCupNo", merCupNo);
map.put("registerStatus", "SUCCESS");
param.put("reqData", map);
// 生成签名
Map<String, Object> reqParam = LaKaLaConfig.generateSignParamsV2(JSONObject.parseObject(JSONObject.toJSONString(param)));
// 头部参数
Map<String, Object> heard = new HashMap<>();
heard.put("Authorization", reqParam.get("Authorization"));
JSONObject responseBody = HttpsUtils.doPost(CommonSysConst.getSysConfig().getLkl_request_url() + "/api/v2/mms/openApi/querySubMerInfo", param, heard);
System.out.println("Authorization" + JSONObject.toJSONString(reqParam.get("Authorization")));
System.out.println("request:" + JSONObject.toJSONString(param));
System.out.println("response:" + responseBody.toJSONString());
if (!responseBody.getString("retCode").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseBody.getString("retMsg"));
}
return responseBody.getJSONObject("respData");
}
}
Loading…
Cancel
Save