提交代码

yy_dev
胡锐 1 year ago
commit fe1e1e348e
  1. 11
      bweb/src/main/java/com/bweb/controller/TestController.java
  2. 7
      cweb/src/main/java/com/cweb/controller/BsBankActivityController.java
  3. 43
      cweb/src/main/java/com/cweb/controller/TestController.java
  4. 33
      service/src/main/java/com/hfkj/channel/saas/SaasActivityService.java
  5. 2
      service/src/main/java/com/hfkj/service/BsBankActivityRosterService.java
  6. 4
      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);

@ -134,11 +134,14 @@ public class BsBankActivityController {
@ApiOperation(value = "报名活动") @ApiOperation(value = "报名活动")
public ResponseData enrollActivity(@RequestBody JSONObject body) { public ResponseData enrollActivity(@RequestBody JSONObject body) {
try { try {
if (body == null || body.getLong("bankActivityId") == null || body.getLong("merId") == null) { if (body == null
|| body.getLong("bankActivityId") == null
|| body.getLong("merId") == null
|| StringUtils.isBlank(body.getString("branchBankNo"))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
} }
bsBankActivityRosterService.enrollActivity(body.getLong("bankActivityId"),body.getLong("merId")); bsBankActivityRosterService.enrollActivity(body.getLong("bankActivityId"), body.getLong("merId"), body.getString("branchBankNo"));
return ResponseMsgUtil.success("操作成功"); return ResponseMsgUtil.success("操作成功");

@ -463,21 +463,45 @@ public class TestController {
@ApiOperation(value = "saasActivity") @ApiOperation(value = "saasActivity")
public ResponseData saasActivity(@RequestParam(value = "code", required = false) String code) { public ResponseData saasActivity(@RequestParam(value = "code", required = false) String code) {
try { try {
return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("73")); // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityStatus("73"));
// return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("73")); // return ResponseMsgUtil.success(saasActivityService.agentRegisterActivity("73"));
// return ResponseMsgUtil.success(saasActivityService.queryAgentActivityList()); // return ResponseMsgUtil.success(saasActivityService.queryAgentActivityList());
// 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("8226900723007E8"); externalCustomerNos.add(code);
return ResponseMsgUtil.success(saasActivityService.customerRegisterActivity("73", null, externalCustomerNos)); // externalCustomerNos.add("8226900566100K0");
*//******* 配置活动费率 *******/ // externalCustomerNos.add("82269005714051G");
/* String activityId = "73"; // 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 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) {
@ -487,8 +511,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,9 +146,10 @@ 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("externalCustomerNos", externalCustomerNos); param.put("externalCustomerNos", externalCustomerNos);
@ -170,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

@ -24,7 +24,7 @@ public interface BsBankActivityRosterService {
* @param bankActivityId * @param bankActivityId
* @param merId * @param merId
*/ */
void enrollActivity(Long bankActivityId, Long merId) throws Exception; void enrollActivity(Long bankActivityId, Long merId, String branchBankNo) throws Exception;
/** /**
* 配置费率 * 配置费率

@ -54,7 +54,7 @@ public class BsBankActivityRosterServiceImpl implements BsBankActivityRosterServ
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW) @Transactional(propagation= Propagation.REQUIRES_NEW)
public void enrollActivity(Long bankActivityId, Long merId) throws Exception { public void enrollActivity(Long bankActivityId, Long merId, String branchBankNo) throws Exception {
// 查询报名 // 查询报名
BsBankActivityRoster roster = getActivityRoster(bankActivityId, merId); BsBankActivityRoster roster = getActivityRoster(bankActivityId, merId);
if (roster != null) { if (roster != null) {
@ -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(), null, 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