|
@@ -899,9 +899,13 @@ public class ApiController {
|
|
|
}
|
|
|
|
|
|
// 超60周岁是否提醒
|
|
|
- String ageReminderInfo = this.sixtyYearsOldReminder(sysU);
|
|
|
- mapOne.put("ageReminder", Boolean.TRUE.equals(sysU.getAgeReminder()) && StrUtil.isNotBlank(ageReminderInfo));
|
|
|
- mapOne.put("ageReminderInfo", ageReminderInfo);
|
|
|
+ Map<String, String> checkResult = sysUserService.checkSixtyYearsOld(sysU);
|
|
|
+ mapOne.put("ageReminder", Boolean.TRUE.equals(sysU.getAgeReminder()) && CollUtil.isNotEmpty(checkResult));
|
|
|
+ if (CollUtil.isNotEmpty(checkResult)) {
|
|
|
+ mapOne.put("ageReminderInfo", CollUtil.get(checkResult.values(), 0));
|
|
|
+ } else {
|
|
|
+ mapOne.put("ageReminderInfo", null);
|
|
|
+ }
|
|
|
|
|
|
// 获取发起认证的令牌
|
|
|
String randomStr;
|
|
@@ -3811,6 +3815,12 @@ public class ApiController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 校验超过60周岁,不能做任务
|
|
|
+ Map<String, String> checkResult = sysUserService.checkSixtyYearsOld(BeanUtil.copyProperties(sysUser, UserVO.class));
|
|
|
+ if (CollUtil.isNotEmpty(checkResult) && checkResult.containsKey("OVER")) {
|
|
|
+ throw new RuntimeException(checkResult.get("OVER"));
|
|
|
+ }
|
|
|
+
|
|
|
// 查询任务类型启用状态
|
|
|
List<WmTaskSubmissionPercentRule> rules = wmTaskSubmissionPercentRuleService.list(Wrappers.<WmTaskSubmissionPercentRule>lambdaQuery()
|
|
|
.eq(WmTaskSubmissionPercentRule::getDeptId, sysUser.getDeptId())
|
|
@@ -4679,37 +4689,4 @@ public class ApiController {
|
|
|
|
|
|
return R.ok(sysUserService.updateById(user));
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 年龄超60周岁提醒
|
|
|
- *
|
|
|
- * @param userVO
|
|
|
- * @return {@link String}
|
|
|
- */
|
|
|
- private String sixtyYearsOldReminder(UserVO userVO) {
|
|
|
- String idCardNumber = userVO.getIdCardNumber();
|
|
|
- if (IdcardUtil.isValidCard(idCardNumber)) {
|
|
|
- // 当前日期
|
|
|
- Calendar nowCal = Calendar.getInstance();
|
|
|
- // 基于生日的日期,60周岁提前半年的时间
|
|
|
- Calendar halfYearCal = IdcardUtil.getBirthDate(idCardNumber).toCalendar();
|
|
|
- halfYearCal.add(Calendar.YEAR, 59);
|
|
|
- halfYearCal.add(Calendar.MONTH, 6);
|
|
|
- // 基于生日的日期,60周岁的时间
|
|
|
- Calendar sixtyYearsOldYearCal = IdcardUtil.getBirthDate(idCardNumber).toCalendar();
|
|
|
- sixtyYearsOldYearCal.add(Calendar.YEAR, 60);
|
|
|
-
|
|
|
- if (sixtyYearsOldYearCal.compareTo(nowCal) > 0 && halfYearCal.compareTo(nowCal) <= 0) {
|
|
|
- // 提前半年提醒,不满60周岁,但距离60周岁在半年内
|
|
|
- return String.format("平台要求人员年龄在年满18岁未满60岁之间,您的账号将于%s年%s月%s日被停用,停用后将无法做任务或者资金结算,请知悉!",
|
|
|
- sixtyYearsOldYearCal.get(Calendar.YEAR), sixtyYearsOldYearCal.get(Calendar.MONTH) + 1, sixtyYearsOldYearCal.get(Calendar.DAY_OF_MONTH));
|
|
|
- } else if (sixtyYearsOldYearCal.compareTo(nowCal) <= 0) {
|
|
|
- // 已超过60周岁
|
|
|
- return String.format("您的账号已于%s年%s月%s日因年龄超限被停用,请知悉",
|
|
|
- sixtyYearsOldYearCal.get(Calendar.YEAR), sixtyYearsOldYearCal.get(Calendar.MONTH) + 1, sixtyYearsOldYearCal.get(Calendar.DAY_OF_MONTH));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return null;
|
|
|
- }
|
|
|
}
|