Procházet zdrojové kódy

Merge remote-tracking branch 'origin/master'

hecheng před 3 roky
rodič
revize
0b86b81b77

+ 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("该时间段已存在准入申请,请修改申请时间后在提交申请。");
+            }
         }
 
         //申请时校验是否存在

+ 5 - 1
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabMessageContentServiceImpl.java

@@ -86,8 +86,12 @@ public class LabMessageContentServiceImpl implements ILabMessageContentService {
     @Autowired
     private LabContentMachineMsgMapper labContentMachineMsgMapper;
 
+    public Integer phoneMode;
+
     @Value("${phoneMode:0}")
-    public static Integer phoneMode;
+    private void setPhoneMode(Integer phoneMode){
+        this.phoneMode = phoneMode;
+    }
 
     @Autowired
     RemoteStockService remoteStockService;