提交代码

yy_dev
胡锐 1 year ago
parent 271c5a94e0
commit 69aa528791
  1. 17
      open-api/src/main/java/com/api/controller/v1/MerController.java
  2. 36
      service/src/main/java/com/hfkj/channel/lakala/LaKaLaConfigService.java

@ -32,7 +32,7 @@ public class MerController {
@RequestMapping(value="/wechatParamConf",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "wechatParamConf")
@ApiOperation(value = "微信参数配置")
public ResponseData wechatParamConf(@RequestParam(value = "merCupNo" , required = true) String merCupNo,
@RequestParam(value = "channlId" , required = true) String channlId,
@RequestParam(value = "subMchId" , required = true) String subMchId,
@ -64,4 +64,19 @@ public class MerController {
}
}
@RequestMapping(value="/queryWechatConfig",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "微信服务商子商户开发配置查询")
public ResponseData queryWechatConfig(@RequestParam(value = "subMchId" , required = true) String subMchId,
@RequestParam(value = "merCupNo" , required = true) String merCupNo) {
try {
return ResponseMsgUtil.success(laKaLaConfigService.queryWechatConfig(subMchId,merCupNo));
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -102,4 +102,40 @@ public class LaKaLaConfigService {
return responseBody.getJSONObject("respData");
}
/**
* 商户报备结果查询
* @param merCupNo
* @return
*/
public JSONObject queryWechatConfig(String subMerchantId,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("subMerchantId", subMerchantId);
map.put("merchantNo", merCupNo);
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/sme/queryWechatConfig", 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