|
@@ -12,6 +12,7 @@ import com.qmth.boot.core.exception.StatusException;
|
|
import com.qmth.boot.tools.excel.ExcelReader;
|
|
import com.qmth.boot.tools.excel.ExcelReader;
|
|
import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
import com.qmth.boot.tools.excel.enums.ExcelType;
|
|
import com.qmth.boot.tools.excel.model.DataMap;
|
|
import com.qmth.boot.tools.excel.model.DataMap;
|
|
|
|
+import com.qmth.exam.reserve.bean.Constants;
|
|
import com.qmth.exam.reserve.bean.category.CategoryCacheBean;
|
|
import com.qmth.exam.reserve.bean.category.CategoryCacheBean;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.category.CategoryInfo;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
import com.qmth.exam.reserve.bean.login.LoginUser;
|
|
@@ -24,9 +25,11 @@ import com.qmth.exam.reserve.cache.impl.ApplyTaskCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.CategoryCacheService;
|
|
import com.qmth.exam.reserve.cache.impl.CategoryCacheService;
|
|
import com.qmth.exam.reserve.dao.CategoryDao;
|
|
import com.qmth.exam.reserve.dao.CategoryDao;
|
|
import com.qmth.exam.reserve.entity.CategoryEntity;
|
|
import com.qmth.exam.reserve.entity.CategoryEntity;
|
|
|
|
+import com.qmth.exam.reserve.entity.SystemPropertyEntity;
|
|
import com.qmth.exam.reserve.enums.CategoryLevel;
|
|
import com.qmth.exam.reserve.enums.CategoryLevel;
|
|
import com.qmth.exam.reserve.enums.Role;
|
|
import com.qmth.exam.reserve.enums.Role;
|
|
import com.qmth.exam.reserve.service.CategoryService;
|
|
import com.qmth.exam.reserve.service.CategoryService;
|
|
|
|
+import com.qmth.exam.reserve.service.SystemPropertyService;
|
|
import com.qmth.exam.reserve.util.PageUtil;
|
|
import com.qmth.exam.reserve.util.PageUtil;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -52,6 +55,9 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
@Autowired
|
|
@Autowired
|
|
private CategoryCacheService categoryCacheService;
|
|
private CategoryCacheService categoryCacheService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private SystemPropertyService systemPropertyService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<CategoryVO> listTeaching(LoginUser user, Boolean flag) {
|
|
public List<CategoryVO> listTeaching(LoginUser user, Boolean flag) {
|
|
flag = flag != null && flag;
|
|
flag = flag != null && flag;
|
|
@@ -259,7 +265,13 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public void selfApplyEnable(Long id, Boolean enable) {
|
|
|
|
|
|
+ public void selfApplyEnable(Long id, Boolean enable, Long orgId) {
|
|
|
|
+ //学校管理员是否关闭自主预约
|
|
|
|
+ SystemPropertyEntity systemProperty = systemPropertyService.findByPropKey(orgId, Constants.APPLY_SWITCH);
|
|
|
|
+ if (systemProperty != null && systemProperty.getPropValue().equals(Constants.APPLY_SWITCH_CLOSE)) {
|
|
|
|
+ throw new StatusException("学校管理员已关闭自主预约,教学点管理员不能设置");
|
|
|
|
+ }
|
|
|
|
+
|
|
LambdaUpdateWrapper<CategoryEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<CategoryEntity> updateWrapper = new LambdaUpdateWrapper<>();
|
|
updateWrapper.set(CategoryEntity::getSelfApplyEnable, enable);
|
|
updateWrapper.set(CategoryEntity::getSelfApplyEnable, enable);
|
|
updateWrapper.set(CategoryEntity::getUpdateTime, System.currentTimeMillis());
|
|
updateWrapper.set(CategoryEntity::getUpdateTime, System.currentTimeMillis());
|