Переглянути джерело

安全准入申请,增加身份验证,避免用非学生账号申请引起的其他问题,小程序端由于操作流程原因,移除校验。

liujh 3 роки тому
батько
коміт
da11cf5090

+ 15 - 8
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/LabSecurityApplyController.java

@@ -381,18 +381,25 @@ public class LabSecurityApplyController extends BaseController
         //获取当前登录用户信息
         SysUser tokensysUser = tokenService.getLoginUser().getSysUser();
 
+        if(!"22".equals(tokensysUser.getUserType())){
+            throw new ServiceException("非学生,不允许申请准入。");
+        }
+
         //根据id查询用户信息
         R<SysUser> rDate =remoteUserService.getUserInfoByUserId(tokensysUser.getUserId(), SecurityConstants.INNER);
         SysUser  sysUser = rDate.getData();
 
-        LabSecurityApplyVO labapplyVo=new LabSecurityApplyVO();
-        labapplyVo.setBeginTime(beginTime);
-        labapplyVo.setEndTime(endTime);
-        labapplyVo.setSubjectId(subjectId);
-        labapplyVo.setUserId(sysUser.getUserId());
-        List<LabSecurityApplyVO> listapplyuser = labSecurityApplyService.selectLabSecurityApplyListByTime(labapplyVo);
-        if(listapplyuser.size()>0){
-            throw new ServiceException("该时间段已存在准入申请,请修改申请时间后在提交申请!");
+        //PC端根据条件校验,小程序端不做校验(操作流程不同)
+        if(StringUtils.isNotBlank(remark)) {
+            LabSecurityApplyVO labapplyVo = new LabSecurityApplyVO();
+            labapplyVo.setBeginTime(beginTime);
+            labapplyVo.setEndTime(endTime);
+            labapplyVo.setSubjectId(subjectId);
+            labapplyVo.setUserId(sysUser.getUserId());
+            List<LabSecurityApplyVO> listapplyuser = labSecurityApplyService.selectLabSecurityApplyListByTime(labapplyVo);
+            if (listapplyuser.size() > 0) {
+                throw new ServiceException("该时间段已存在准入申请,请修改申请时间后在提交申请。");
+            }
         }
 
         //申请时校验是否存在