修改话费定时任务问题

dev-discount
袁野 2 years ago
parent e68774f4e2
commit 654718293c
  1. 35
      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 { 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); HighUser user = highUserService.findByPhone(phone);
@ -270,25 +278,14 @@ public class WechatController {
user.setInfoCompleteStatus(1); user.setInfoCompleteStatus(1);
highUserService.insertUser(user , popularizeUserId , regionId); highUserService.insertUser(user , popularizeUserId , regionId);
} }
// 定义个人所有数据
// 获取手机号验证码 HighUserModel highUserModel = new HighUserModel();
String phoneSmsCode = (String) redisUtil.get("SMS_"+ phone); HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
// 验证码校验 highUserModel.setHighUser(detailData);
if (StringUtils.isNotBlank(phoneSmsCode) && Objects.equals(phoneSmsCode,code)) { SessionObject so = new SessionObject(user.getPhone(), 1, highUserModel);
// 定义个人所有数据 userCenter.save(request, response, so);
HighUserModel highUserModel = new HighUserModel(); return ResponseMsgUtil.success(so);
HighUser detailData = highUserService.getDetailDataByUser(user.getId());
detailData.setPassword(null);
highUserModel.setHighUser(detailData);
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) { } catch (Exception e) {
return ResponseMsgUtil.exception(e); return ResponseMsgUtil.exception(e);

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

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

@ -1608,6 +1608,11 @@ public class HighOrderServiceImpl implements HighOrderService {
if (MapUtils.getString(map, "merchId") != null) { if (MapUtils.getString(map, "merchId") != null) {
criteria.andMerchIdEqualTo(MapUtils.getString(map, "merchId")); 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"); example.setOrderByClause("create_time desc");
List<HighOrder> list = highOrderMapper.selectByExample(example); List<HighOrder> list = highOrderMapper.selectByExample(example);

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

@ -107,7 +107,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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) { if (object.getInteger("count") > 5) {
@ -287,7 +287,7 @@ public class GzSinopecController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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")); JSONObject jsonObject = HuiLianTongConfig.getPayOrderByCouNo(object.getString("couNo"));

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

@ -106,7 +106,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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"))); return ResponseMsgUtil.success(apiMerchantsService.getMerchProduct(apiMerchants.getId() , object.getInteger("rechargeType")));
@ -164,7 +164,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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()); return ResponseMsgUtil.success(apiMerchants.getAmounts());
@ -224,7 +224,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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); ApiOrderRecord apiOrderRecord = apiOrderRecordService.queryOrderResult(map);
@ -322,7 +322,7 @@ public class RechargeProductController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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); apiOpenService.createOrder(object , apiMerchants , apiProductConfig);

@ -100,7 +100,7 @@ public class SelfOilStationController {
if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) { if (!ToolConfig.timetableCheck(15L , object.getLong("timetable"))) {
log.error("getRechargeProduct error!", "请求时间超过15分钟!"); 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")); SecConfig config = secConfigService.findByCodeType(object.getString("merchId"));

Loading…
Cancel
Save