ソースを参照

增加发送短信和推送接口

周箭河 4 年 前
コミット
1f9cae81f0

+ 11 - 0
mec-student/src/main/java/com/ym/mec/student/controller/ChildrenDayController.java

@@ -3,6 +3,7 @@ package com.ym.mec.student.controller;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.StudentDao;
+import com.ym.mec.biz.dal.dao.SysConfigDao;
 import com.ym.mec.biz.dal.dto.DegreeFeeDto;
 import com.ym.mec.biz.dal.dto.DegreePayDto;
 import com.ym.mec.biz.dal.entity.ChildrenDayDegreeDetail;
@@ -13,12 +14,14 @@ import com.ym.mec.biz.service.ChildrenDayReserveService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
+import com.ym.mec.util.date.DateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -35,6 +38,8 @@ public class ChildrenDayController extends BaseController {
     private StudentDao studentDao;
     @Autowired
     private ChildrenDayDegreeDetailService childrenDayDegreeDetailService;
+    @Autowired
+    private SysConfigDao sysConfigDao;
 
     @ApiOperation(value = "占位")
     @PostMapping("/reserve")
@@ -74,6 +79,12 @@ public class ChildrenDayController extends BaseController {
         if (sysUser == null) {
             throw new BizException("用户信息获取失败,请重新登陆");
         }
+        Date nowTime = new Date();
+        String endTimeStr = sysConfigDao.findConfigValue("children_day_end_time");
+        Date endTime = DateUtil.stringToDate(endTimeStr);
+        if (endTime.compareTo(nowTime) <= 0) {
+            throw new BizException("活动已结束,谢谢关注");
+        }
         studentDao.lockUser(sysUser.getId());
 
         degreePayDto.setUserId(sysUser.getId());