修改话费定时任务问题

dev-discount
袁野 2 years ago
parent e68774f4e2
commit 654718293c
  1. 19
      hai-cweb/src/main/java/com/cweb/controller/WechatController.java
  2. 2
      hai-service/src/main/java/com/hai/common/utils/WxUtils.java
  3. 10
      hai-service/src/main/java/com/hai/service/impl/BsDistributionUserRelServiceImpl.java
  4. 5
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  5. 2
      hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java
  6. 6
      v1/src/main/java/com/v1/controller/GzSinopecController.java
  7. 13
      v1/src/main/java/com/v1/controller/HighOrderController.java
  8. 8
      v1/src/main/java/com/v1/controller/RechargeProductController.java
  9. 2
      v1/src/main/java/com/v1/controller/SelfOilStationController.java

@ -253,6 +253,14 @@ public class WechatController {
try {
// 获取手机号验证码
String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone);
// 验证码校验
if (!(StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code))) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
}
// 根据手机号查询用户
HighUser user = highUserService.findByPhone(phone);
@ -270,12 +278,6 @@ public class WechatController {
user.setInfoCompleteStatus(1);
highUserService.insertUser(user , popularizeUserId , regionId);
}
// 获取手机号验证码
String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone);
// 验证码校验
if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code)) {
// 定义个人所有数据
HighUserModel highUserModel = new HighUserModel();
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
@ -284,11 +286,6 @@ public class WechatController {
SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
userCenter.save(request, response, so);
return ResponseMsgUtil.success(so);
} else {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "验证码错误");
}
} catch (Exception e) {
return ResponseMsgUtil.exception(e);

@ -484,7 +484,7 @@ public class WxUtils {
Arrays.sort(keyArray);
StringBuilder sb = new StringBuilder();
for (String k : keyArray) {
if (k.equals(WXPayConstants.FIELD_SIGN)) {
if (k.equals(WXPayConstants.FIELD_SIGN) || k.equals("apiKey")) {
continue;
}
if (data.get(k) != null) // 参数值为空,则不参与签名

@ -35,6 +35,7 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
public void insertDistributionRebate(Long userId, Long popularizeUserId , String regionId) {
HighUser user = highUserService.findByUserId(userId);
HighUser pUser = highUserService.findByUserId(popularizeUserId);
// 定义分销关联关系
BsDistributionUserRel distributionUserRel = new BsDistributionUserRel();
@ -45,12 +46,15 @@ public class BsDistributionUserRelServiceImpl implements BsDistributionUserRelSe
BsDistributionUserRel popularizeUser = findDistributionUserRel(map);
distributionUserRel.setUserId(userId);
distributionUserRel.setUserName(user.getName());
if (popularizeUser != null) {
distributionUserRel.setAgentId(popularizeUser.getAgentId());
distributionUserRel.setAgentName(popularizeUser.getAgentName());
}
distributionUserRel.setUserId(userId);
distributionUserRel.setUserName(user.getName());
distributionUserRel.setPopularizeUserId(popularizeUserId);
distributionUserRel.setPopularizeUserName(popularizeUser.getUserName());
distributionUserRel.setPopularizeUserName(pUser.getName());
distributionUserRel.setCreateTime(new Date());
distributionUserRel.setUpdateTime(new Date());
distributionUserRel.setStatus(100);

@ -1608,6 +1608,11 @@ public class HighOrderServiceImpl implements HighOrderService {
if (MapUtils.getString(map, "merchId") != null) {
criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId"));
}
if (StringUtils.isNotBlank(MapUtils.getString(map, "createTimeS")) && StringUtils.isNotBlank(MapUtils.getString(map, "createTimeE"))) {
criteria.andCreateTimeBetween(
DateUtil.format(MapUtils.getString(map, "createTimeS"), "yyyy-MM-dd HH:mm:ss"),
DateUtil.format(MapUtils.getString(map, "createTimeE"), "yyyy-MM-dd HH:mm:ss"));
}
example.setOrderByClause("create_time desc");
List<HighOrder> list = highOrderMapper.selectByExample(example);

@ -228,7 +228,7 @@ public class HighUserServiceImpl implements HighUserService {
new Thread(()-> {
// 绑定推广关联关系
distributionUserRelService.insertDistributionRebate(highUser.getId() , popularizeUserId , regionId);
});
}).start();
}
@Override

@ -107,7 +107,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
// 查询电子卡券类型
@ -186,7 +186,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
if (object.getInteger("count") > 5) {
@ -287,7 +287,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(object.getString("couNo"));

@ -71,6 +71,9 @@ public class HighOrderController {
}
if (StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("createTimeS")) ||
StringUtils.isBlank(object.getString("createTimeE")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("sign"))
@ -90,6 +93,8 @@ public class HighOrderController {
map.put("apiKey" , object.getString("apiKey"));
map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId"));
map.put("createTimeS" , object.getString("createTimeS"));
map.put("createTimeE" , object.getString("createTimeE"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!");
@ -98,7 +103,7 @@ public class HighOrderController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
Map<String, Object> postMap = new HashMap<>();
@ -133,6 +138,8 @@ public class HighOrderController {
if (StringUtils.isBlank(object.getString("apiKey")) ||
StringUtils.isBlank(object.getString("merchId")) ||
StringUtils.isBlank(object.getString("createTimeS")) ||
StringUtils.isBlank(object.getString("createTimeE")) ||
StringUtils.isBlank(object.getString("timetable")) ||
StringUtils.isBlank(object.getString("sign"))
) {
@ -151,6 +158,8 @@ public class HighOrderController {
map.put("apiKey" , object.getString("apiKey"));
map.put("timetable" , object.getString("timetable"));
map.put("merchId" , object.getString("merchId"));
map.put("createTimeS" , object.getString("createTimeS"));
map.put("createTimeE" , object.getString("createTimeE"));
if (!secConfigService.isSignVerify(map , object.getString("sign"))) {
log.error("getRechargeProduct error!", "签名校验失败!");
@ -159,7 +168,7 @@ public class HighOrderController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
Map<String, Object> postMap = new HashMap<>();

@ -106,7 +106,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
return ResponseMsgUtil.success(apiMerchantsService.getMerchProduct(apiMerchants.getId() , object.getInteger("rechargeType")));
@ -164,7 +164,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
return ResponseMsgUtil.success(apiMerchants.getAmounts());
@ -224,7 +224,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(map);
@ -322,7 +322,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
apiOpenService.createOrder(object , apiMerchants , apiProductConfig);

@ -100,7 +100,7 @@ public class SelfOilStationController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.SIGN_VERIFY);
throw ErrorHelp.genException(SysCode.System, ErrorCode.TIME_OUT);
}
SecConfig config = secConfigService.findByCodeType(object.getString("merchId"));

Loading…
Cancel
Save