|
@@ -4,7 +4,14 @@ import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
+import com.ruoyi.common.core.domain.entity.FormalTeacherClass;
|
|
import com.ruoyi.common.core.domain.entity.vo.SysDeptVo;
|
|
import com.ruoyi.common.core.domain.entity.vo.SysDeptVo;
|
|
|
|
+import com.ruoyi.common.utils.DateUtils;
|
|
|
|
+import com.ruoyi.system.domain.XiakeConfig;
|
|
|
|
+import com.ruoyi.system.domain.XiaoyuanNotice;
|
|
|
|
+import com.ruoyi.system.mapper.XiakeConfigMapper;
|
|
|
|
+import com.ruoyi.system.mapper.XiaoyuanNoticeMapper;
|
|
|
|
+import com.ruoyi.system.service.IFormalTeacherClassService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
@@ -36,6 +43,12 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
@Autowired
|
|
@Autowired
|
|
private SysRoleMapper roleMapper;
|
|
private SysRoleMapper roleMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private XiakeConfigMapper configMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IFormalTeacherClassService formalTeacherClassService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 查询部门管理数据
|
|
* 查询部门管理数据
|
|
*
|
|
*
|
|
@@ -43,9 +56,20 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
* @return 部门信息集合
|
|
* @return 部门信息集合
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- @DataScope(deptAlias = "d")
|
|
|
|
|
|
+ //@DataScope(deptAlias = "d")
|
|
public List<SysDept> selectDeptList(SysDept dept)
|
|
public List<SysDept> selectDeptList(SysDept dept)
|
|
{
|
|
{
|
|
|
|
+ SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
|
+ if(!"admin".equals(user.getUserName())){
|
|
|
|
+ dept.setParentId(user.getDeptId());
|
|
|
|
+ dept.setDeptId(user.getDeptId());
|
|
|
|
+ if(user.getDeptId()==null || user.getDeptId() == 0L){
|
|
|
|
+ List<FormalTeacherClass> teacherClass = formalTeacherClassService.getTeacherClass(String.valueOf(user.getUserId()));
|
|
|
|
+ dept.setParentId(teacherClass.get(0).getSchoolId());
|
|
|
|
+ dept.setDeptId(teacherClass.get(0).getSchoolId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
return deptMapper.selectDeptList(dept);
|
|
return deptMapper.selectDeptList(dept);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -58,7 +82,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
@Override
|
|
@Override
|
|
public List<TreeSelect> selectDeptTreeList(SysDept dept)
|
|
public List<TreeSelect> selectDeptTreeList(SysDept dept)
|
|
{
|
|
{
|
|
- List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
|
|
|
|
|
+ List<SysDept> depts = selectDeptList(dept);
|
|
return buildDeptTreeSelect(depts);
|
|
return buildDeptTreeSelect(depts);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -221,6 +245,23 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
throw new ServiceException("部门停用,不允许新增");
|
|
throw new ServiceException("部门停用,不允许新增");
|
|
}
|
|
}
|
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
|
|
+
|
|
|
|
+ //往xiake_config插入数据
|
|
|
|
+ XiakeConfig config = new XiakeConfig();
|
|
|
|
+ config.setConfigName("下课时间");
|
|
|
|
+ config.setConfigKey(info.getDeptId()+":1");
|
|
|
|
+ config.setConfigValue("5");
|
|
|
|
+ config.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ config.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ configMapper.insertConfig(config);
|
|
|
|
+ XiakeConfig config1 = new XiakeConfig();
|
|
|
|
+ config1.setConfigName("延迟下课");
|
|
|
|
+ config1.setConfigKey(info.getDeptId()+":2");
|
|
|
|
+ config1.setConfigValue("5");
|
|
|
|
+ config1.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ config1.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ configMapper.insertConfig(config1);
|
|
|
|
+
|
|
}else{
|
|
}else{
|
|
dept.setAncestors(String.valueOf(dept.getParentId()));
|
|
dept.setAncestors(String.valueOf(dept.getParentId()));
|
|
}
|
|
}
|
|
@@ -320,6 +361,23 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
//新增
|
|
//新增
|
|
sysDept.setOrderNum(num+1);
|
|
sysDept.setOrderNum(num+1);
|
|
deptMapper.insertDept(sysDept);
|
|
deptMapper.insertDept(sysDept);
|
|
|
|
+
|
|
|
|
+ //往xiake_config插入数据
|
|
|
|
+ XiakeConfig config = new XiakeConfig();
|
|
|
|
+ config.setConfigName("下课时间");
|
|
|
|
+ config.setConfigKey(sysDept.getDeptId()+":1");
|
|
|
|
+ config.setConfigValue("5");
|
|
|
|
+ config.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ config.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ configMapper.insertConfig(config);
|
|
|
|
+ XiakeConfig config1 = new XiakeConfig();
|
|
|
|
+ config1.setConfigName("延迟下课");
|
|
|
|
+ config1.setConfigKey(sysDept.getDeptId()+":2");
|
|
|
|
+ config1.setConfigValue("5");
|
|
|
|
+ config1.setCreateTime(DateUtils.getNowDate());
|
|
|
|
+ config1.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
+ configMapper.insertConfig(config1);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Long[] skuIds = deptIds.toArray(new Long[deptIds.size()]);
|
|
Long[] skuIds = deptIds.toArray(new Long[deptIds.size()]);
|