소스 검색

Merge remote-tracking branch 'origin/master'

Joburgess 4 년 전
부모
커밋
566ddc13a5

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentPaymentRouteOrderServiceImpl.java

@@ -370,6 +370,7 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
             if (list != null && list.size() > 0) {
                 throw new BizException("导入数据错误  重复的交易流水号:{}", list.get(0));
             }
+            Date nowDate = new Date();
 
             List<Object> calenderIds = sheet.stream().map(m -> m.get("缴费单号")).collect(Collectors.toList());
             List<MusicGroupPaymentCalender> calenders = musicGroupPaymentCalenderDao.getPaymentCalenderWithCalenderIdsAndPayUserType(calenderIds, MusicGroupPaymentCalender.PayUserType.SCHOOL);
@@ -455,6 +456,9 @@ public class StudentPaymentRouteOrderServiceImpl extends BaseServiceImpl<Long, S
                         if (date == null) {
                             sb.append("第" + rowNum).append("行数据导入失败:交易日期格式错误;");
                             continue valueIsNull;
+                        } else if (date.after(nowDate)) {
+                            sb.append("第" + rowNum).append("行数据导入失败:交易日期不能大于当前日期");
+                            continue valueIsNull;
                         } else {
                             objectMap.put(columnValue, DateUtil.format(date, DateUtil.DEFAULT_PATTERN));
                         }

+ 4 - 0
mec-web/src/main/java/com/ym/mec/web/controller/StudentPaymentRouteOrderController.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
 
 import java.math.BigDecimal;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -134,6 +135,9 @@ public class StudentPaymentRouteOrderController extends BaseController {
         }
         studentPaymentRouteOrder.setCreateBy(sysUser.getId());
         studentPaymentRouteOrder.setUpdateBy(sysUser.getId());
+        if(studentPaymentRouteOrder.getPayTime().after(new Date())){
+            failed("交易日期不能大于当前时间");
+        }
 
         return succeed(studentPaymentRouteOrderService.addOutOrder(studentPaymentRouteOrder));
     }