|
@@ -2,14 +2,19 @@ package com.template.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.template.annotation.DESRespondSecret;
|
|
import com.template.annotation.DESRespondSecret;
|
|
|
import com.template.api.SmartVisitorParentsConfigControllerAPI;
|
|
import com.template.api.SmartVisitorParentsConfigControllerAPI;
|
|
|
import com.template.mapper.SmartVisitorParentsConfigMapper;
|
|
import com.template.mapper.SmartVisitorParentsConfigMapper;
|
|
|
import com.template.model.pojo.SmartAskForLeaveConfig;
|
|
import com.template.model.pojo.SmartAskForLeaveConfig;
|
|
|
|
|
+import com.template.model.pojo.SmartDuties;
|
|
|
|
|
+import com.template.model.pojo.SmartUser;
|
|
|
import com.template.model.pojo.SmartVisitorParentsConfig;
|
|
import com.template.model.pojo.SmartVisitorParentsConfig;
|
|
|
import com.template.model.result.CommonResult;
|
|
import com.template.model.result.CommonResult;
|
|
|
import com.template.model.result.PageUtils;
|
|
import com.template.model.result.PageUtils;
|
|
|
import com.template.model.vo.SmartVisitorParentsConfigVo;
|
|
import com.template.model.vo.SmartVisitorParentsConfigVo;
|
|
|
|
|
+import com.template.services.SmartDutiesService;
|
|
|
|
|
+import com.template.services.SmartUserService;
|
|
|
import com.template.services.SmartVisitorParentsConfigService;
|
|
import com.template.services.SmartVisitorParentsConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -33,6 +38,12 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
|
|
|
@Autowired
|
|
@Autowired
|
|
|
SmartVisitorParentsConfigService smartVisitorParentsConfigService;
|
|
SmartVisitorParentsConfigService smartVisitorParentsConfigService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ SmartUserService smartUserService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ SmartDutiesService smartDutiesService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
@DESRespondSecret(validated = true)
|
|
@DESRespondSecret(validated = true)
|
|
|
public CommonResult getClassId(Integer page,Integer size, Integer classId) {
|
|
public CommonResult getClassId(Integer page,Integer size, Integer classId) {
|
|
@@ -51,5 +62,32 @@ public class SmartVisitorParentsConfigController implements SmartVisitorParentsC
|
|
|
return CommonResult.fail();
|
|
return CommonResult.fail();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ @DESRespondSecret(validated = true)
|
|
|
|
|
+ public CommonResult getUserId(Integer userId) {
|
|
|
|
|
+ SmartUser smartById = smartUserService.getSmartById(userId);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(smartById)) {
|
|
|
|
|
+ return CommonResult.fail("不存在该用户");
|
|
|
|
|
+ }
|
|
|
|
|
+// 职务
|
|
|
|
|
+ Integer duties = smartById.getDuties();
|
|
|
|
|
+
|
|
|
|
|
+ SmartDuties smartDuties = smartDutiesService.getSmartById(duties);
|
|
|
|
|
+ if (ObjectUtils.isEmpty(smartDuties)) {
|
|
|
|
|
+ return CommonResult.fail("无职务");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String name = smartDuties.getName();
|
|
|
|
|
+ if (!"班主任".equals(name)) {
|
|
|
|
|
+ return CommonResult.fail("无配置权限");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ Integer schoolClass = smartById.getSchoolClass();
|
|
|
|
|
+
|
|
|
|
|
+ SmartVisitorParentsConfigVo smartVisitorParentsConfigVo=smartVisitorParentsConfigService.getClassId(schoolClass);
|
|
|
|
|
+
|
|
|
|
|
+ return CommonResult.ok(smartVisitorParentsConfigVo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|