浏览代码

会员试用

zouxuan 3 年之前
父节点
当前提交
f4756d8b86
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentServiceImpl.java

@@ -399,6 +399,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         if(StringUtils.isEmpty(studentIds)){
             throw new BizException("请选择学员");
         }
+        endTime = DateUtil.addSeconds(DateUtil.addDays(endTime,1),-1);
         //学员是否有会员
         List<Integer> studentIdList = Arrays.stream(studentIds.split(",")).map(Integer::parseInt).collect(Collectors.toList());
         List<Student> studentList = studentDao.findByStudentIds(studentIdList);
@@ -417,8 +418,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
         String configValue = sysConfigDao.findConfigValue(SysConfigService.EXPERIENCE_MEMBERSHIP_END_TIME);
         if(StringUtils.isNotEmpty(configValue)){
             Date date = DateUtil.stringToDate(configValue, DateUtil.ISO_EXPANDED_DATE_FORMAT);
-            int i = DateUtil.daysBetween(date, endTime);
-            if(i > 0){
+            if(endTime.after(date)){
                 throw new BizException("操作失败:会员试用期不可超过{}",configValue);
             }
         }