提交代码

yy_dev
胡锐 1 year ago
parent f2cfd90ef9
commit ee8742fe0e
  1. 11
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 39
      cweb/src/main/java/com/cweb/controller/TestController.java
  3. 34
      service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java
  4. 2
      service/src/main/java/com/hfkj/service/impl/BsBankActivityRosterServiceImpl.java

@ -131,13 +131,16 @@ public class TestController {
} }
} }
@RequestMapping(value="/saas",method = RequestMethod.GET) @RequestMapping(value="/getSaasToken",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "saas") @ApiOperation(value = "getSaasToken")
public ResponseData saas(@RequestParam(value = "code", required = true) String code) { public ResponseData getSaasToken(@RequestParam(value = "code", required = true) String code) {
try { try {
return ResponseMsgUtil.success(saasCommon.getToken()); Map<String, Object> param = new HashMap<>();
param.put("SAAS_TOKEN", saasCommon.getToken());
param.put("SAAS_UPDATE_TOKEN", saasCommon.getUpdateToken());
return ResponseMsgUtil.success(param);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);

@ -462,17 +462,39 @@ public class TestController {
// return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB")); // return ResponseMsgUtil.success(saasActivityService.queryCustomerActivityStatus("73", "8226900445800HB"));
/*********** 活动报名 *************/ /*********** 活动报名 *************/
/* List<String> externalCustomerNos = new ArrayList<>(); List<String> externalCustomerNos = new ArrayList<>();
externalCustomerNos.add("8226900549903LG"); externalCustomerNos.add(code);
externalCustomerNos.add("8226900445800HQ"); // externalCustomerNos.add("8226900566100K0");
return ResponseMsgUtil.success(saasActivityService.customerRegisterActivity("73", null, externalCustomerNos)); // externalCustomerNos.add("82269005714051G");
*/ // externalCustomerNos.add("8226900899900CW");
// externalCustomerNos.add("822690058121BAY");
// externalCustomerNos.add("8226900899900CY");
// externalCustomerNos.add("822690058121BDR");
// externalCustomerNos.add("8226900729808JR");
// externalCustomerNos.add("8226900566100JV");
// externalCustomerNos.add("8226900566100JY");
// externalCustomerNos.add("8226900899900DF");
// 冉家坝支行
/* externalCustomerNos.add("8226900445800HS");
externalCustomerNos.add("82269005072004T");
externalCustomerNos.add("8226900421500NJ");
externalCustomerNos.add("822690053310F23");*/
// 合川支行
// externalCustomerNos.add("82269005399025K");
// externalCustomerNos.add("822690058121C65");
// externalCustomerNos.add("8226900899900DB");
// externalCustomerNos.add("822690053310F6C");
// return ResponseMsgUtil.success(saasActivityService.customerRegisterActivity("73", "315653022016", "110274",externalCustomerNos));
// return ResponseMsgUtil.success(saasActivityService.referee("8226900445800HS"));
/******* 配置活动费率 *******/ /******* 配置活动费率 *******/
String activityId = "73"; String activityId = "73";
String externalCustomerNo = code; String externalCustomerNo = code;
JSONArray jsonArray = saasActivityService.queryCustomerRates(activityId, externalCustomerNo); JSONArray jsonArray = saasActivityService.queryCustomerRates(activityId, externalCustomerNo);
return ResponseMsgUtil.success(jsonArray); return ResponseMsgUtil.success(jsonArray);
/* Map<String, Object> rate; /*Map<String, Object> rate;
List<Map<String,Object>> rates = new ArrayList<>(); List<Map<String,Object>> rates = new ArrayList<>();
for (Object obj : jsonArray) { for (Object obj : jsonArray) {
@ -482,8 +504,7 @@ public class TestController {
rate.put("discountedRates", "0.0025"); rate.put("discountedRates", "0.0025");
rates.add(rate); rates.add(rate);
} }
return ResponseMsgUtil.success(saasActivityService.customerRatesUpdate(activityId,externalCustomerNo, rates)); return ResponseMsgUtil.success(saasActivityService.customerRatesUpdate(activityId,externalCustomerNo, rates));*/
*/
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

@ -146,11 +146,11 @@ public class SaasActivityService {
* 商户报名活动 * 商户报名活动
* @return * @return
*/ */
public JSONObject customerRegisterActivity(String activityId, String branchBankNo, List<String> externalCustomerNos) throws Exception { public JSONObject customerRegisterActivity(String activityId, String branchBankNo, String refereeId, List<String> externalCustomerNos) throws Exception {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("activityId", activityId); param.put("activityId", activityId);
param.put("refereeId", refereeId);
param.put("branchBankNo", branchBankNo); param.put("branchBankNo", branchBankNo);
param.put("refereeId", 0);
param.put("externalCustomerNos", externalCustomerNos); param.put("externalCustomerNos", externalCustomerNos);
Map<String,Object> header = new HashMap<>(); Map<String,Object> header = new HashMap<>();
@ -171,6 +171,36 @@ public class SaasActivityService {
} }
/**
* 商户报名活动
* @return
*/
public JSONArray referee(String externalCustomerNo) throws Exception {
Map<String,Object> param = new HashMap<>();
param.put("externalCustomerNo", externalCustomerNo);
param.put("nameOrJobNumber", 0);
param.put("page", 3);
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.requestUrl + "htkmarketing/open/welfare/referee", obj, header);
System.out.println("参数:" + JSONObject.toJSONString(param));
System.out.println("加密:" + obj.getString("data"));
System.out.println("request:" + obj.toJSONString());
System.out.println("response:" + responseObj.toJSONString());
if (responseObj == null || !responseObj.getString("code").equals("000000")) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, responseObj.getString("message"));
}
JSONObject responseData = JSONObject.parseObject(new String(RSAUtil.decryptByPublicKey(Base64.decodeBase64(responseObj.getString("data")), Base64.decodeBase64(RSAUtil.PUBLIC_KEY))));
System.out.println("responseData:" + responseData);
return responseData.getJSONArray("referees");
}
/** /**
* 商户费率修改 * 商户费率修改
* @param activityId * @param activityId

@ -71,7 +71,7 @@ public class BsBankActivityRosterServiceImpl implements BsBankActivityRosterServ
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户");
} }
// 渠道报名 // 渠道报名
saasActivityService.customerRegisterActivity(activity.getActivityNo().toString(), branchBankNo, Arrays.asList(merPlatform.getCupNo())); saasActivityService.customerRegisterActivity(activity.getActivityNo().toString(), branchBankNo, "110287", Arrays.asList(merPlatform.getCupNo()));
BsBankActivityRoster bankActivityRoster = new BsBankActivityRoster(); BsBankActivityRoster bankActivityRoster = new BsBankActivityRoster();
bankActivityRoster.setBankActivityId(bankActivityId); bankActivityRoster.setBankActivityId(bankActivityId);

Loading…
Cancel
Save