Commit cb477164 by xuwenhao

10.27修改测试问题

parent b969a69b
...@@ -117,6 +117,12 @@ public class SysUser extends BaseEntity ...@@ -117,6 +117,12 @@ public class SysUser extends BaseEntity
/** 岗位组名称 */ /** 岗位组名称 */
private String postName; private String postName;
/** 部门组 */
private Long[] deptIds;
/** 部门名称 */
private String deptNames;
/** 角色ID */ /** 角色ID */
private Long roleId; private Long roleId;
...@@ -134,6 +140,22 @@ public class SysUser extends BaseEntity ...@@ -134,6 +140,22 @@ public class SysUser extends BaseEntity
} }
public Long[] getDeptIds() {
return deptIds;
}
public void setDeptIds(Long[] deptIds) {
this.deptIds = deptIds;
}
public String getDeptNames() {
return deptNames;
}
public void setDeptNames(String deptNames) {
this.deptNames = deptNames;
}
public String getUnionId() { public String getUnionId() {
return unionId; return unionId;
} }
......
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class SysUserDept {
/** 用户ID */
private Long userId;
/** 岗位ID */
private Long deptId;
public Long getUserId()
{
return userId;
}
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("deptId", getDeptId())
.toString();
}
}
...@@ -125,4 +125,29 @@ public interface SysDeptMapper ...@@ -125,4 +125,29 @@ public interface SysDeptMapper
* 查询部门 * 查询部门
* */ * */
public SysDept selectDeptByDeptName(String deptName); public SysDept selectDeptByDeptName(String deptName);
/**
* 根据用户ID获取单位选择框列表
* @param userId
* @return
*/
List<Long> selectDeptListByUserId(Long userId);
/**
* 根据用户ID获取单位
*/
List<SysDept> getDeptdByUserId(Long userId);
/**
* 查询级部
*
* @param dept 部门信息
* @return 部门信息集合
*/
public List<SysDept> selectGrade(SysDept dept);
/**
* 根据学年查询级部
*/
public SysDept selectDeptGrade(String schoolYear);
} }
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysUserDept;
import java.util.List;
public interface SysUserDeptMapper {
/**
* 通过用户ID删除用户和部门关联
*
* @param userId 用户ID
* @return 结果
*/
public int deleteUserDeptByUserId(Long userId);
/**
* 通过部门ID查询部门使用数量
*
* @param deptId 部门ID
* @return 结果
*/
public int countUserDeptById(Long deptId);
/**
* 批量删除用户和部门关联
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteUserDept(Long[] ids);
/**
* 批量新增用户部门信息
*
* @param userDeptList 用户部门列表
* @return 结果
*/
public int batchUserDept(List<SysUserDept> userDeptList);
int saveUserDept(SysUserDept userDept);
}
...@@ -6,14 +6,14 @@ import com.ruoyi.common.core.domain.entity.SysDept; ...@@ -6,14 +6,14 @@ import com.ruoyi.common.core.domain.entity.SysDept;
/** /**
* 部门管理 服务层 * 部门管理 服务层
* *
* @author ruoyi * @author ruoyi
*/ */
public interface ISysDeptService public interface ISysDeptService
{ {
/** /**
* 查询部门管理数据 * 查询部门管理数据
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 部门信息集合 * @return 部门信息集合
*/ */
...@@ -21,7 +21,7 @@ public interface ISysDeptService ...@@ -21,7 +21,7 @@ public interface ISysDeptService
/** /**
* 查询部门树结构信息 * 查询部门树结构信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 部门树信息集合 * @return 部门树信息集合
*/ */
...@@ -29,7 +29,7 @@ public interface ISysDeptService ...@@ -29,7 +29,7 @@ public interface ISysDeptService
/** /**
* 构建前端所需要树结构 * 构建前端所需要树结构
* *
* @param depts 部门列表 * @param depts 部门列表
* @return 树结构列表 * @return 树结构列表
*/ */
...@@ -37,7 +37,7 @@ public interface ISysDeptService ...@@ -37,7 +37,7 @@ public interface ISysDeptService
/** /**
* 构建前端所需要下拉树结构 * 构建前端所需要下拉树结构
* *
* @param depts 部门列表 * @param depts 部门列表
* @return 下拉树结构列表 * @return 下拉树结构列表
*/ */
...@@ -45,7 +45,7 @@ public interface ISysDeptService ...@@ -45,7 +45,7 @@ public interface ISysDeptService
/** /**
* 根据角色ID查询部门树信息 * 根据角色ID查询部门树信息
* *
* @param roleId 角色ID * @param roleId 角色ID
* @return 选中部门列表 * @return 选中部门列表
*/ */
...@@ -53,7 +53,7 @@ public interface ISysDeptService ...@@ -53,7 +53,7 @@ public interface ISysDeptService
/** /**
* 根据部门ID查询信息 * 根据部门ID查询信息
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 部门信息 * @return 部门信息
*/ */
...@@ -61,7 +61,7 @@ public interface ISysDeptService ...@@ -61,7 +61,7 @@ public interface ISysDeptService
/** /**
* 根据ID查询所有子部门(正常状态) * 根据ID查询所有子部门(正常状态)
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 子部门数 * @return 子部门数
*/ */
...@@ -69,7 +69,7 @@ public interface ISysDeptService ...@@ -69,7 +69,7 @@ public interface ISysDeptService
/** /**
* 是否存在部门子节点 * 是否存在部门子节点
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 * @return 结果
*/ */
...@@ -77,7 +77,7 @@ public interface ISysDeptService ...@@ -77,7 +77,7 @@ public interface ISysDeptService
/** /**
* 查询部门是否存在用户 * 查询部门是否存在用户
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 true 存在 false 不存在 * @return 结果 true 存在 false 不存在
*/ */
...@@ -85,7 +85,7 @@ public interface ISysDeptService ...@@ -85,7 +85,7 @@ public interface ISysDeptService
/** /**
* 校验部门名称是否唯一 * 校验部门名称是否唯一
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -93,14 +93,14 @@ public interface ISysDeptService ...@@ -93,14 +93,14 @@ public interface ISysDeptService
/** /**
* 校验部门是否有数据权限 * 校验部门是否有数据权限
* *
* @param deptId 部门id * @param deptId 部门id
*/ */
public void checkDeptDataScope(Long deptId); public void checkDeptDataScope(Long deptId);
/** /**
* 新增保存部门信息 * 新增保存部门信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -108,7 +108,7 @@ public interface ISysDeptService ...@@ -108,7 +108,7 @@ public interface ISysDeptService
/** /**
* 修改保存部门信息 * 修改保存部门信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -116,9 +116,22 @@ public interface ISysDeptService ...@@ -116,9 +116,22 @@ public interface ISysDeptService
/** /**
* 删除部门管理信息 * 删除部门管理信息
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 * @return 结果
*/ */
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
/**
* 根据用户ID获取单位
*/
List<SysDept> getDeptdByUserId(Long userId);
/**
* 查询级部
*
* @param dept 部门信息
* @return 部门信息集合
*/
public List<SysDept> selectGrade(SysDept dept);
} }
...@@ -23,7 +23,7 @@ import com.ruoyi.system.service.ISysDeptService; ...@@ -23,7 +23,7 @@ import com.ruoyi.system.service.ISysDeptService;
/** /**
* 部门管理 服务实现 * 部门管理 服务实现
* *
* @author ruoyi * @author ruoyi
*/ */
@Service @Service
...@@ -37,7 +37,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -37,7 +37,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 查询部门管理数据 * 查询部门管理数据
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 部门信息集合 * @return 部门信息集合
*/ */
...@@ -50,7 +50,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -50,7 +50,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 查询部门树结构信息 * 查询部门树结构信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 部门树信息集合 * @return 部门树信息集合
*/ */
...@@ -64,7 +64,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -64,7 +64,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 构建前端所需要树结构 * 构建前端所需要树结构
* *
* @param depts 部门列表 * @param depts 部门列表
* @return 树结构列表 * @return 树结构列表
*/ */
...@@ -95,7 +95,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -95,7 +95,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 构建前端所需要下拉树结构 * 构建前端所需要下拉树结构
* *
* @param depts 部门列表 * @param depts 部门列表
* @return 下拉树结构列表 * @return 下拉树结构列表
*/ */
...@@ -108,7 +108,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -108,7 +108,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 根据角色ID查询部门树信息 * 根据角色ID查询部门树信息
* *
* @param roleId 角色ID * @param roleId 角色ID
* @return 选中部门列表 * @return 选中部门列表
*/ */
...@@ -121,7 +121,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -121,7 +121,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 根据部门ID查询信息 * 根据部门ID查询信息
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 部门信息 * @return 部门信息
*/ */
...@@ -133,7 +133,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -133,7 +133,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 根据ID查询所有子部门(正常状态) * 根据ID查询所有子部门(正常状态)
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 子部门数 * @return 子部门数
*/ */
...@@ -145,7 +145,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -145,7 +145,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 是否存在子节点 * 是否存在子节点
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 * @return 结果
*/ */
...@@ -158,7 +158,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -158,7 +158,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 查询部门是否存在用户 * 查询部门是否存在用户
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 true 存在 false 不存在 * @return 结果 true 存在 false 不存在
*/ */
...@@ -171,7 +171,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -171,7 +171,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 校验部门名称是否唯一 * 校验部门名称是否唯一
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -189,7 +189,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -189,7 +189,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 校验部门是否有数据权限 * 校验部门是否有数据权限
* *
* @param deptId 部门id * @param deptId 部门id
*/ */
@Override @Override
...@@ -209,7 +209,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -209,7 +209,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 新增保存部门信息 * 新增保存部门信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -228,7 +228,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -228,7 +228,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 修改保存部门信息 * 修改保存部门信息
* *
* @param dept 部门信息 * @param dept 部门信息
* @return 结果 * @return 结果
*/ */
...@@ -256,7 +256,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -256,7 +256,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 修改该部门的父级部门状态 * 修改该部门的父级部门状态
* *
* @param dept 当前部门 * @param dept 当前部门
*/ */
private void updateParentDeptStatusNormal(SysDept dept) private void updateParentDeptStatusNormal(SysDept dept)
...@@ -268,7 +268,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -268,7 +268,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 修改子元素关系 * 修改子元素关系
* *
* @param deptId 被修改的部门ID * @param deptId 被修改的部门ID
* @param newAncestors 新的父ID集合 * @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合 * @param oldAncestors 旧的父ID集合
...@@ -288,7 +288,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -288,7 +288,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/** /**
* 删除部门管理信息 * 删除部门管理信息
* *
* @param deptId 部门ID * @param deptId 部门ID
* @return 结果 * @return 结果
*/ */
...@@ -298,6 +298,7 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -298,6 +298,7 @@ public class SysDeptServiceImpl implements ISysDeptService
return deptMapper.deleteDeptById(deptId); return deptMapper.deleteDeptById(deptId);
} }
/** /**
* 递归列表 * 递归列表
*/ */
...@@ -340,4 +341,22 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -340,4 +341,22 @@ public class SysDeptServiceImpl implements ISysDeptService
{ {
return getChildList(list, t).size() > 0; return getChildList(list, t).size() > 0;
} }
/**
* 根据用户ID获取单位
*/
@Override
public List<SysDept> getDeptdByUserId(Long userId) {
return deptMapper.getDeptdByUserId(userId);
}
/**
* 查询级部
* @param dept 部门信息
* @return
*/
@Override
public List<SysDept> selectGrade(SysDept dept) {
return deptMapper.selectGrade(dept);
}
} }
...@@ -7,6 +7,8 @@ import java.util.stream.Collectors; ...@@ -7,6 +7,8 @@ import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.system.domain.SysUserDept;
import com.ruoyi.system.mapper.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -25,11 +27,6 @@ import com.ruoyi.common.utils.spring.SpringUtils; ...@@ -25,11 +27,6 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.system.domain.SysPost; import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.domain.SysUserPost;
import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.domain.SysUserRole;
import com.ruoyi.system.mapper.SysPostMapper;
import com.ruoyi.system.mapper.SysRoleMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.mapper.SysUserPostMapper;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysConfigService; import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
...@@ -58,6 +55,9 @@ public class SysUserServiceImpl implements ISysUserService { ...@@ -58,6 +55,9 @@ public class SysUserServiceImpl implements ISysUserService {
private SysUserPostMapper userPostMapper; private SysUserPostMapper userPostMapper;
@Autowired @Autowired
private SysUserDeptMapper userDeptMapper;
@Autowired
private ISysConfigService configService; private ISysConfigService configService;
@Autowired @Autowired
...@@ -249,6 +249,8 @@ public class SysUserServiceImpl implements ISysUserService { ...@@ -249,6 +249,8 @@ public class SysUserServiceImpl implements ISysUserService {
insertUserPost(user); insertUserPost(user);
// 新增用户与角色管理 // 新增用户与角色管理
insertUserRole(user); insertUserRole(user);
//新增用户与部门关联
insertUserDept(user);
return rows; return rows;
} }
...@@ -281,6 +283,10 @@ public class SysUserServiceImpl implements ISysUserService { ...@@ -281,6 +283,10 @@ public class SysUserServiceImpl implements ISysUserService {
userPostMapper.deleteUserPostByUserId(userId); userPostMapper.deleteUserPostByUserId(userId);
// 新增用户与岗位管理 // 新增用户与岗位管理
insertUserPost(user); insertUserPost(user);
// 删除用户与部门关联
userDeptMapper.deleteUserDeptByUserId(userId);
// 新增用户与部门关联
insertUserDept(user);
return userMapper.updateUser(user); return userMapper.updateUser(user);
} }
...@@ -394,6 +400,26 @@ public class SysUserServiceImpl implements ISysUserService { ...@@ -394,6 +400,26 @@ public class SysUserServiceImpl implements ISysUserService {
} }
/** /**
* 新增用户部门信息
*
* @param user 用户对象
*/
public void insertUserDept(SysUser user) {
Long[] depts = user.getDeptIds();
if (StringUtils.isNotEmpty(depts)) {
// 新增用户与部门关联
List<SysUserDept> list = new ArrayList<SysUserDept>(depts.length);
for (Long deptId : depts) {
SysUserDept ud = new SysUserDept();
ud.setUserId(user.getUserId());
ud.setDeptId(deptId);
list.add(ud);
}
userDeptMapper.batchUserDept(list);
}
}
/**
* 新增用户角色信息 * 新增用户角色信息
* *
* @param userId 用户ID * @param userId 用户ID
......
...@@ -165,4 +165,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -165,4 +165,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept set del_flag = '2' where dept_id = #{deptId} update sys_dept set del_flag = '2' where dept_id = #{deptId}
</delete> </delete>
<select id="selectDeptListByUserId" parameterType="Long" resultType="Long">
select d.dept_id
from sys_dept d
left join sys_user_dept ud on ud.dept_id =d.dept_id
left join sys_user u on u.user_id = ud.user_id
where u.user_id = #{userId}
</select>
<select id="getDeptdByUserId" resultMap="SysDeptResult">
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
from sys_dept d
left join sys_user_dept ud on ud.dept_id = d.dept_id
left join sys_user u on u.user_id = ud.user_id
where u.user_id = #{userId}
</select>
<select id="selectGrade" parameterType="SysDept" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
WHERE dept_name like concat('%', "级部", '%') AND parent_id = 100
</select>
<select id="selectDeptGrade" parameterType="String" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
WHERE dept_name like concat('%', #{schoolYear}, '%') AND parent_id = 100
</select>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysUserDeptMapper">
<resultMap type="SysUserDept" id="SysUserDeptResult">
<result property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
</resultMap>
<delete id="deleteUserDeptByUserId" parameterType="Long">
delete from sys_user_dept where user_id=#{userId}
</delete>
<select id="countUserDeptById" resultType="Integer">
select count(1) from sys_user_dept where dept_id=#{deptId}
</select>
<delete id="deleteUserDept" parameterType="Long">
delete from sys_user_dept where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
<insert id="batchUserDept">
insert into sys_user_dept(user_id, dept_id) values
<foreach item="item" index="index" collection="list" separator=",">
(#{item.userId},#{item.deptId})
</foreach>
</insert>
<insert id="saveUserDept">
insert into sys_user_dept(user_id, dept_id) values(#{userId},#{deptId})
</insert>
</mapper>
...@@ -182,38 +182,38 @@ public class SchoolAuditoriumController extends BaseController ...@@ -182,38 +182,38 @@ public class SchoolAuditoriumController extends BaseController
//发送钉钉消息到分管领导 //发送钉钉消息到分管领导
//获取钉钉用户id //获取钉钉用户id
String ddUserId = teacherService.getDdUserIdByUserId(schoolAuditorium.getLeadershipId()); // String ddUserId = teacherService.getDdUserIdByUserId(schoolAuditorium.getLeadershipId());
//发送钉钉消息给分管领导 // //发送钉钉消息给分管领导
DingMessageVo messageVo = new DingMessageVo(); // DingMessageVo messageVo = new DingMessageVo();
OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); // OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA()); // msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA());
msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head()); // msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head());
msg.getOa().getHead().setText("二中校园测试"); // msg.getOa().getHead().setText("二中校园测试");
msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body()); // msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body());
msg.getOa().getBody().setAuthor(schoolAuditorium.getApplyName()); // msg.getOa().getBody().setAuthor(schoolAuditorium.getApplyName());
msg.getOa().getBody().setContent("申请内容:" + schoolAuditorium.getActivityName()); // msg.getOa().getBody().setContent("申请内容:" + schoolAuditorium.getActivityName());
msg.getOa().getBody().setTitle("您好,您有礼堂预约申请等待审批!"); // msg.getOa().getBody().setTitle("您好,您有礼堂预约申请等待审批!");
OapiMessageCorpconversationAsyncsendV2Request.Form form1 = new OapiMessageCorpconversationAsyncsendV2Request.Form(); // OapiMessageCorpconversationAsyncsendV2Request.Form form1 = new OapiMessageCorpconversationAsyncsendV2Request.Form();
form1.setKey("申请时间:"); // form1.setKey("申请时间:");
form1.setValue(applyTime); // form1.setValue(applyTime);
msg.getOa().getBody().setForm(Arrays.asList(form1)); // msg.getOa().getBody().setForm(Arrays.asList(form1));
msg.getOa().setPcMessageUrl("https://open.dingtalk.com/"); // msg.getOa().setPcMessageUrl("https://open.dingtalk.com/");
msg.getOa().setMessageUrl("https://open.dingtalk.com/"); // msg.getOa().setMessageUrl("https://open.dingtalk.com/");
msg.setMsgtype("oa"); // msg.setMsgtype("oa");
OapiMessageCorpconversationAsyncsendV2Request.StatusBar statusBar = new OapiMessageCorpconversationAsyncsendV2Request.StatusBar(); // OapiMessageCorpconversationAsyncsendV2Request.StatusBar statusBar = new OapiMessageCorpconversationAsyncsendV2Request.StatusBar();
statusBar.setStatusBg("0xFFF65E5E"); // statusBar.setStatusBg("0xFFF65E5E");
statusBar.setStatusValue("进行中"); // statusBar.setStatusValue("进行中");
msg.getOa().setStatusBar(statusBar); // msg.getOa().setStatusBar(statusBar);
messageVo.setMsg(msg); // messageVo.setMsg(msg);
messageVo.setToAllUser(false); // messageVo.setToAllUser(false);
messageVo.setUseridList(ddUserId); // messageVo.setUseridList(ddUserId);
Long ddTaskId = dingMessageUtils.sendMessage(messageVo); // Long ddTaskId = dingMessageUtils.sendMessage(messageVo);
//更新消息任务id、钉钉流程实例id // //更新消息任务id、钉钉流程实例id
SchoolAuditorium auditorium = new SchoolAuditorium(); // SchoolAuditorium auditorium = new SchoolAuditorium();
auditorium.setId(id); // auditorium.setId(id);
auditorium.setDdTaskId(ddTaskId); // auditorium.setDdTaskId(ddTaskId);
auditorium.setDdInstanceId(ddInstanceId); // auditorium.setDdInstanceId(ddInstanceId);
schoolAuditoriumService.updateById(auditorium); // schoolAuditoriumService.updateById(auditorium);
/**发送模板消息到分管领导*/ /**发送模板消息到分管领导*/
//获取用户openid //获取用户openid
// String openId = teacherService.getOpenIdByUserId(schoolAuditorium.getLeadershipId()); // String openId = teacherService.getOpenIdByUserId(schoolAuditorium.getLeadershipId());
...@@ -288,25 +288,25 @@ public class SchoolAuditoriumController extends BaseController ...@@ -288,25 +288,25 @@ public class SchoolAuditoriumController extends BaseController
//获取钉钉用户id //获取钉钉用户id
String ddUserId = teacherService.getDdUserIdByUserId(leave.getApplyId()); String ddUserId = teacherService.getDdUserIdByUserId(leave.getApplyId());
//发送钉钉消息给分管领导 //发送钉钉消息给分管领导
DingMessageVo messageVo = new DingMessageVo(); // DingMessageVo messageVo = new DingMessageVo();
OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg(); // OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA()); // msg.setOa(new OapiMessageCorpconversationAsyncsendV2Request.OA());
msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head()); // msg.getOa().setHead(new OapiMessageCorpconversationAsyncsendV2Request.Head());
msg.getOa().getHead().setText("二中校园测试"); // msg.getOa().getHead().setText("二中校园测试");
msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body()); // msg.getOa().setBody(new OapiMessageCorpconversationAsyncsendV2Request.Body());
msg.getOa().getBody().setAuthor(leave.getLeadershipName()); // msg.getOa().getBody().setAuthor(leave.getLeadershipName());
msg.getOa().getBody().setContent(flag ? "已通过" : "已驳回"); // msg.getOa().getBody().setContent(flag ? "已通过" : "已驳回");
msg.getOa().getBody().setTitle("您好,您的礼堂预约申请已回复。"); // msg.getOa().getBody().setTitle("您好,您的礼堂预约申请已回复。");
msg.getOa().setPcMessageUrl("https://open.dingtalk.com/"); // msg.getOa().setPcMessageUrl("https://open.dingtalk.com/");
msg.getOa().setMessageUrl("https://open.dingtalk.com/"); // msg.getOa().setMessageUrl("https://open.dingtalk.com/");
msg.setMsgtype("oa"); // msg.setMsgtype("oa");
messageVo.setMsg(msg); // messageVo.setMsg(msg);
messageVo.setToAllUser(false); // messageVo.setToAllUser(false);
messageVo.setUseridList(ddUserId); // messageVo.setUseridList(ddUserId);
dingMessageUtils.sendMessage(messageVo); // dingMessageUtils.sendMessage(messageVo);
//修改消息任务状态为已完成 //修改消息任务状态为已完成
dingMessageUtils.updateStatusBar(leave.getDdTaskId(), "已完成", "0xFF78C06E"); // dingMessageUtils.updateStatusBar(leave.getDdTaskId(), "已完成", "0xFF78C06E");
/**发送模板消息到申请人,审批结果*/ /**发送模板消息到申请人,审批结果*/
//获取申请人openId //获取申请人openId
......
...@@ -3,6 +3,7 @@ package yangtz.cs.liu.campus.controller.educationalStatistics; ...@@ -3,6 +3,7 @@ package yangtz.cs.liu.campus.controller.educationalStatistics;
import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.hutool.core.io.resource.ClassPathResource; import cn.hutool.core.io.resource.ClassPathResource;
import com.core.utils.StringUtil;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
...@@ -87,9 +88,12 @@ public class StatisticsController extends BaseController { ...@@ -87,9 +88,12 @@ public class StatisticsController extends BaseController {
* 教务-统计-年龄统计 * 教务-统计-年龄统计
*/ */
@GetMapping("/age/{schoolYear}") @GetMapping("/age/{schoolYear}")
public TableDataInfo age(@PathVariable("schoolYear") int schoolYear) public TableDataInfo age(@PathVariable("schoolYear") String schoolYear)
{ {
return getDataTable(statisticsService.getAgeNum(schoolYear)); if (StringUtils.isEmpty(schoolYear)){
throw new ServiceException("请选择学年!");
}
return getDataTable(statisticsService.getAgeNum(Integer.parseInt(schoolYear)));
} }
/**年龄导出*/ /**年龄导出*/
......
...@@ -113,11 +113,18 @@ public class SchoolMessageParentsPushsController extends BaseController ...@@ -113,11 +113,18 @@ public class SchoolMessageParentsPushsController extends BaseController
if(StringUtils.isNull(pList) || pList.size() == 0){ if(StringUtils.isNull(pList) || pList.size() == 0){
return getDataTable(new ArrayList<>()); return getDataTable(new ArrayList<>());
} }
//获取所有家长信息
List<SchoolStudentParent> schoolStudentParents = schoolStudentParentService.list();
//获取家长的用户id //获取家长的用户id
List<Long> pIdList = new ArrayList<>(); List<Long> pIdList = new ArrayList<>();
for(SchoolStudentParentVO vo : pList){ for(SchoolStudentParentVO vo : pList){
SchoolStudentParent p = schoolStudentParentService.getById(vo.getId()); // SchoolStudentParent p = schoolStudentParentService.getById(vo.getId());
pIdList.add(p.getUserId()); for (SchoolStudentParent schoolStudentParent : schoolStudentParents) {
if (vo.getId().equals(schoolStudentParent.getId())){
pIdList.add(schoolStudentParent.getUserId());
}
}
// pIdList.add(p.getUserId());
} }
//获取几张信息推送ID //获取几张信息推送ID
List<Long> pushIds = parentsPushsService.queryDetailsList(pIdList); List<Long> pushIds = parentsPushsService.queryDetailsList(pIdList);
......
...@@ -290,8 +290,9 @@ public class SchoolTeacherExperimentApplyController extends BaseController ...@@ -290,8 +290,9 @@ public class SchoolTeacherExperimentApplyController extends BaseController
default:break; default:break;
} }
} }
if (labSubs.size() > 0 ){
schoolTeacherExperimentApplyVo.setSubs(labSubs); schoolTeacherExperimentApplyVo.setSubs(labSubs);
}
startPage(); startPage();
List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.getTeacherList(schoolTeacherExperimentApplyVo); List<SchoolTeacherExperimentApplyVo> list = schoolTeacherExperimentApplyService.getTeacherList(schoolTeacherExperimentApplyVo);
list.forEach(list1 -> { list.forEach(list1 -> {
......
...@@ -5,7 +5,9 @@ import com.core.utils.HolidayDateUtil; ...@@ -5,7 +5,9 @@ import com.core.utils.HolidayDateUtil;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.TreeSelect;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
...@@ -26,9 +28,8 @@ import yangtz.cs.liu.campus.service.student.ISchoolStudentService; ...@@ -26,9 +28,8 @@ import yangtz.cs.liu.campus.service.student.ISchoolStudentService;
import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect; import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.*;
import java.util.Calendar; import java.util.stream.Collectors;
import java.util.List;
import static com.ruoyi.common.utils.StringUtils.isNull; import static com.ruoyi.common.utils.StringUtils.isNull;
import static yangtz.cs.liu.campus.constant.EmployeeType.EMPLOYEE; import static yangtz.cs.liu.campus.constant.EmployeeType.EMPLOYEE;
...@@ -69,25 +70,53 @@ public class SchoolGradeController extends BaseController { ...@@ -69,25 +70,53 @@ public class SchoolGradeController extends BaseController {
*/ */
@GetMapping("/getList") @GetMapping("/getList")
public AjaxResult getList() { public AjaxResult getList() {
String employeeType = getLoginUser().getUser().getEmployeeType(); //TODO 改造
//是教工 //获取当前登录用户
if (employeeType.equals(TEACH)) { SysUser user = getLoginUser().getUser();
//获取最新学年 List<SysDept> depts = new ArrayList<>();
// int schoolYear = HolidayDateUtil.getSchoolYear(); //获取用户所在部门
// TODO 修改当前最新学年 List<SysDept> deptList = deptService.getDeptdByUserId(user.getUserId());
int schoolYear = schoolGradeService.isNewSchoolYear(); for (SysDept sysDept : deptList) {
SchoolGrade schoolGrade = new SchoolGrade(); String[] split = sysDept.getAncestors().split(",");
//schoolGrade.setSfzxxn(NEWTERM); for (int i = split.length -1; i>0; i--) {
schoolGrade.setSchoolYear(String.valueOf(schoolYear)); SysDept sysDept1 = deptService.selectDeptById(Long.valueOf(split[i]));
List<SchoolGrade> list = schoolGradeService.queryList(schoolGrade); if (!depts.contains(sysDept1)) {
List<GradeTreeSelect> gradeTreeSelectList = new ArrayList<>(); depts.add(sysDept1);
if (StringUtils.isNotNull(list)) { }
gradeTreeSelectList = schoolGradeService.buildGradeTreeList(list); }
if (!depts.contains(sysDept)){
depts.add(sysDept);
} }
return AjaxResult.success(gradeTreeSelectList);
} }
//职工 SysDept sysDept = deptService.selectDeptById(user.getDeptId());
return AjaxResult.success(deptService.selectDeptTreeList(new SysDept())); if (!depts.contains(sysDept)){
depts.add(sysDept);
}
ArrayList<SysDept> sysDepts = depts.stream().collect(Collectors
.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator
.comparing(SysDept::getDeptId))), ArrayList::new));
return AjaxResult.success(deptService.buildDeptTreeSelect(sysDepts));
// //TODO 原方式
// String employeeType = getLoginUser().getUser().getEmployeeType();
// //是教工
// if (employeeType.equals(TEACH)) {
// //获取最新学年
//// int schoolYear = HolidayDateUtil.getSchoolYear();
// // TODO 修改当前最新学年
// int schoolYear = schoolGradeService.isNewSchoolYear();
// SchoolGrade schoolGrade = new SchoolGrade();
// //schoolGrade.setSfzxxn(NEWTERM);
// schoolGrade.setSchoolYear(String.valueOf(schoolYear));
// List<SchoolGrade> list = schoolGradeService.queryList(schoolGrade);
// List<GradeTreeSelect> gradeTreeSelectList = new ArrayList<>();
// if (StringUtils.isNotNull(list)) {
// gradeTreeSelectList = schoolGradeService.buildGradeTreeList(list);
// }
// return AjaxResult.success(gradeTreeSelectList);
// }
// //职工
// return AjaxResult.success(deptService.selectDeptTreeList(new SysDept()));
} }
/** /**
...@@ -147,14 +176,57 @@ public class SchoolGradeController extends BaseController { ...@@ -147,14 +176,57 @@ public class SchoolGradeController extends BaseController {
*/ */
@GetMapping("/getDeptOrGrade") @GetMapping("/getDeptOrGrade")
public AjaxResult getDeptOrGrade() { public AjaxResult getDeptOrGrade() {
String employeeType = getLoginUser().getUser().getEmployeeType();
//是教工 // String employeeType = getLoginUser().getUser().getEmployeeType();
if (employeeType.equals(TEACH)) { // //是教工
//判断所在班级所在级部(存在一个老师跨几个级部教学,比如体育老师,所以获取教授班级所在级部,随便选择某个级部即可) // if (employeeType.equals(TEACH)) {
return AjaxResult.success(schoolGradeService.getGradeId(getUserId())); // //判断所在班级所在级部(存在一个老师跨几个级部教学,比如体育老师,所以获取教授班级所在级部,随便选择某个级部即可)
} // return AjaxResult.success(schoolGradeService.getGradeId(getUserId()));
// }
//职工 //职工
return AjaxResult.success(getDeptId()); AjaxResult ajaxResult = AjaxResult.success();
//当前用户主部门id
Long deptId = getDeptId();
ajaxResult.put("data",deptId);
//判断该部门是属于级部还是科室
SysDept sysDept = deptService.selectDeptById(deptId);
String ancestors = sysDept.getAncestors();
//查询级部
List<SysDept> sysDepts = deptService.selectGrade(new SysDept());
if (sysDepts.size() > 0){
for (SysDept dept : sysDepts) {
if (ancestors.contains(dept.getDeptId().toString())){
ajaxResult.put("employeeType","0");
return ajaxResult;
}
}
}
ajaxResult.put("employeeType","1");
return ajaxResult;
}
/**
* 判断用户所选部门是属于级部还是科室
*/
@GetMapping("/judgeDeptOrGrade/{deptId}")
public AjaxResult judgeDeptOrGrade(@PathVariable("deptId") Long deptId) {
AjaxResult ajaxResult = AjaxResult.success();
ajaxResult.put("data",deptId);
//判断该部门是属于级部还是科室
SysDept sysDept = deptService.selectDeptById(deptId);
String ancestors = sysDept.getAncestors();
//查询级部
List<SysDept> sysDepts = deptService.selectGrade(new SysDept());
if (sysDepts.size() > 0){
for (SysDept dept : sysDepts) {
if (ancestors.contains(dept.getDeptId().toString())){
ajaxResult.put("employeeType","0");
return ajaxResult;
}
}
}
ajaxResult.put("employeeType","1");
return ajaxResult;
} }
/** /**
......
...@@ -6,12 +6,14 @@ import com.ruoyi.common.annotation.Log; ...@@ -6,12 +6,14 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.activiti.engine.RuntimeService; import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; import org.activiti.engine.TaskService;
...@@ -92,6 +94,9 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -92,6 +94,9 @@ public class SchoolTeacherLeaveController extends BaseController {
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired
private ISysDeptService deptService;
//职工 //职工
private static final String TYPE = "1"; private static final String TYPE = "1";
...@@ -143,7 +148,22 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -143,7 +148,22 @@ public class SchoolTeacherLeaveController extends BaseController {
*/ */
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody @Validated SchoolTeacherLeave schoolTeacherLeave) { public AjaxResult add(@RequestBody @Validated SchoolTeacherLeave schoolTeacherLeave) {
schoolTeacherLeave.setApplyType(getLoginUser().getUser().getEmployeeType()); schoolTeacherLeave.setApplyType("1");
//判断部门是科室还是级部
Long applyOrgid = schoolTeacherLeave.getApplyOrgid();
SysDept sysDept = deptService.selectDeptById(applyOrgid);
String ancestors = sysDept.getAncestors();
//查询级部
List<SysDept> sysDepts = deptService.selectGrade(new SysDept());
if (sysDepts.size() > 0){
for (SysDept dept : sysDepts) {
if (ancestors.contains(dept.getDeptId().toString())){
schoolTeacherLeave.setApplyType("0");
break;
}
}
}
// schoolTeacherLeave.setApplyType(getLoginUser().getUser().getEmployeeType());
schoolTeacherLeave.setState(SAVE); schoolTeacherLeave.setState(SAVE);
schoolTeacherLeave.setApplyUserId(getUserId()); schoolTeacherLeave.setApplyUserId(getUserId());
schoolTeacherLeave.setApplyUser(getUsername()); schoolTeacherLeave.setApplyUser(getUsername());
...@@ -170,6 +190,24 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -170,6 +190,24 @@ public class SchoolTeacherLeaveController extends BaseController {
} }
schoolTeacherLeaveService.judgeDate(schoolTeacherLeave); schoolTeacherLeaveService.judgeDate(schoolTeacherLeave);
schoolTeacherLeaveService.judgeHandUser(schoolTeacherLeave); schoolTeacherLeaveService.judgeHandUser(schoolTeacherLeave);
//判断部门属于级部还是科室
schoolTeacherLeave.setApplyType("1");
Long applyOrgid = schoolTeacherLeave.getApplyOrgid();
SysDept sysDept = deptService.selectDeptById(applyOrgid);
schoolTeacherLeave.setApplyOrgname(sysDept.getDeptName());
String ancestors = sysDept.getAncestors();
//查询级部
List<SysDept> sysDepts = deptService.selectGrade(new SysDept());
if (sysDepts.size() > 0){
for (SysDept dept : sysDepts) {
if (ancestors.contains(dept.getDeptId().toString())){
schoolTeacherLeave.setApplyType("0");
break;
}
}
}
//return toAjax(schoolTeacherLeaveService.updateById(schoolTeacherLeave)); //return toAjax(schoolTeacherLeaveService.updateById(schoolTeacherLeave));
return toAjax(schoolTeacherLeaveService.editLeave(schoolTeacherLeave)); return toAjax(schoolTeacherLeaveService.editLeave(schoolTeacherLeave));
} }
...@@ -219,6 +257,9 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -219,6 +257,9 @@ public class SchoolTeacherLeaveController extends BaseController {
if (StringUtils.isNull(schoolTeacherLeave)) { if (StringUtils.isNull(schoolTeacherLeave)) {
throw new ServiceException("提交申请失败,未查询到相关信息"); throw new ServiceException("提交申请失败,未查询到相关信息");
} }
if (StringUtils.isNull(schoolTeacherLeave.getHandUserId1())){
throw new ServiceException("提交申请失败,请选择级部/处室主任后重试");
}
String userName = getUsername(); String userName = getUsername();
schoolTeacherLeave.setApplyTime(DateUtils.getNowDate()); schoolTeacherLeave.setApplyTime(DateUtils.getNowDate());
...@@ -429,7 +470,8 @@ public class SchoolTeacherLeaveController extends BaseController { ...@@ -429,7 +470,8 @@ public class SchoolTeacherLeaveController extends BaseController {
@GetMapping("/getDeptLeader/{applyOrgid}") @GetMapping("/getDeptLeader/{applyOrgid}")
public TableDataInfo getLeader(@PathVariable Long applyOrgid,SchoolTeacherVO teacherVO) { public TableDataInfo getLeader(@PathVariable Long applyOrgid,SchoolTeacherVO teacherVO) {
//判断用户是职工还是教工,来确定传过来的id是级部id还是部门id //判断用户是职工还是教工,来确定传过来的id是级部id还是部门id
String employeeType = getLoginUser().getUser().getEmployeeType(); // String employeeType = getLoginUser().getUser().getEmployeeType();
String employeeType = "1";
startPage(); startPage();
return getDataTable(schoolTeacherLeaveService.getLeader(applyOrgid,employeeType,teacherVO)); return getDataTable(schoolTeacherLeaveService.getLeader(applyOrgid,employeeType,teacherVO));
} }
......
...@@ -193,10 +193,10 @@ public class SchoolTimeTableController extends BaseController { ...@@ -193,10 +193,10 @@ public class SchoolTimeTableController extends BaseController {
Long teacherId = getUserId(); Long teacherId = getUserId();
//获取当前登录用户 //获取当前登录用户
SysUser user = getLoginUser().getUser(); SysUser user = getLoginUser().getUser();
if(user.getEmployeeType().equals(EMPLOYEE)){ // if(user.getEmployeeType().equals(EMPLOYEE)){
//throw new ServiceException("您的用户类型为职工,无法查询个人课表"); // //throw new ServiceException("您的用户类型为职工,无法查询个人课表");
return getDataTable(new ArrayList<>()); // return getDataTable(new ArrayList<>());
} // }
List<TableVO> list = schoolTimeTableService.getTeacherTable(teacherId); List<TableVO> list = schoolTimeTableService.getTeacherTable(teacherId);
return getDataTable(list); return getDataTable(list);
} }
......
...@@ -19,10 +19,10 @@ public class CurriculaVariable extends OurBaseEntity ...@@ -19,10 +19,10 @@ public class CurriculaVariable extends OurBaseEntity
/** 任务名称 */ /** 任务名称 */
private String taskName; private String taskName;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime; private Date startTime;
/** 结束时间 */ /** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime; private Date endTime;
/** 级部 */ /** 级部 */
private String grade; private String grade;
......
package yangtz.cs.liu.campus.domain.introduce; package yangtz.cs.liu.campus.domain.introduce;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.core.domain.OurBaseEntity; import com.core.domain.OurBaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
...@@ -22,6 +24,7 @@ public class SchoolIntroduce extends OurBaseEntity ...@@ -22,6 +24,7 @@ public class SchoolIntroduce extends OurBaseEntity
// 版本号 // 版本号
/** */ /** */
@TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
/** 园所类型 */ /** 园所类型 */
......
...@@ -58,4 +58,11 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> { ...@@ -58,4 +58,11 @@ public interface CurriculaStudentMapper extends BaseMapper<CurriculaStudent> {
* @return * @return
*/ */
List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo); List<CurriculaStudentVo> selectCurriculaStudentListYt(CurriculaStudentVo curriculaStudentVo);
/**
* 批量新增学生和选课关系
* @param list
* @return
*/
int batchInsertCurriculaStudent(List<CurriculaStudent> list);
} }
...@@ -30,6 +30,11 @@ public interface SchoolGradeMentorMapper extends BaseMapper<SchoolGradeMentor> { ...@@ -30,6 +30,11 @@ public interface SchoolGradeMentorMapper extends BaseMapper<SchoolGradeMentor> {
@Param("role") String role, @Param("role") String role,
@Param("entity")SchoolTeacherVO entity); @Param("entity")SchoolTeacherVO entity);
//(改造)获取级部主任
List<SchoolTeacher> getGradeDirector(@Param("deptId") Long deptId,
@Param("role") String role,
@Param("entity")SchoolTeacherVO entity);
/**获取用户所在级部列表,*/ /**获取用户所在级部列表,*/
List<SchoolGrade> getGradeByUserId(@Param("userId") Long userId, List<SchoolGrade> getGradeByUserId(@Param("userId") Long userId,
@Param("schoolYear")int schoolYear); @Param("schoolYear")int schoolYear);
......
...@@ -83,6 +83,13 @@ public interface SchoolTeacherMapper extends BaseMapper<SchoolTeacher>{ ...@@ -83,6 +83,13 @@ public interface SchoolTeacherMapper extends BaseMapper<SchoolTeacher>{
@Param("role") String role, @Param("role") String role,
@Param("entity") SchoolTeacherVO entity); @Param("entity") SchoolTeacherVO entity);
/**
* (改造)获取所在处室处室主任
*/
List<SchoolTeacher> getSectionDirector(@Param("deptId") Long deptId,
@Param("role") String role,
@Param("entity") SchoolTeacherVO entity);
//根据设备号部门姓名,查询当前系统是否有该教职工 //根据设备号部门姓名,查询当前系统是否有该教职工
SchoolTeacherVO judge(String deviceNum); SchoolTeacherVO judge(String deviceNum);
......
...@@ -86,13 +86,16 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM ...@@ -86,13 +86,16 @@ public class CurriculaVariableServiceImpl extends ServiceImpl<CurriculaVariableM
CurriculaVariable variable = curriculaVariableMapper.selectById(curriculaVariable.getId()); CurriculaVariable variable = curriculaVariableMapper.selectById(curriculaVariable.getId());
//新增学生与选课任务关系 //新增学生与选课任务关系
List<Long> studentIds = curriculaVariableMapper.selectByGrade(variable.getGrade()); List<Long> studentIds = curriculaVariableMapper.selectByGrade(variable.getGrade());
if (studentIds.size() > 0){ if (studentIds.size() > 0){
List<CurriculaStudent> curriculaStudents = new ArrayList<>();
for (Long studentId : studentIds) { for (Long studentId : studentIds) {
CurriculaStudent curriculaStudent = new CurriculaStudent(); CurriculaStudent curriculaStudent = new CurriculaStudent();
curriculaStudent.setStudentId(studentId); curriculaStudent.setStudentId(studentId);
curriculaStudent.setCurriculaId(curriculaVariable.getId()); curriculaStudent.setCurriculaId(curriculaVariable.getId());
curriculaStudentMapper.insert(curriculaStudent); curriculaStudents.add(curriculaStudent);
} }
curriculaStudentMapper.batchInsertCurriculaStudent(curriculaStudents);
} }
return i; return i;
} }
......
...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.impl.educationStatistics; ...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.service.impl.educationStatistics;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.core.utils.HolidayDateUtil; import com.core.utils.HolidayDateUtil;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -242,8 +243,11 @@ public class EducationStatisticsServiceImpl implements IEducationStatisticsServi ...@@ -242,8 +243,11 @@ public class EducationStatisticsServiceImpl implements IEducationStatisticsServi
stuLqw.eq(SchoolStudent::getClassId, c.getId()); stuLqw.eq(SchoolStudent::getClassId, c.getId());
List<SchoolStudent> schoolStudents = studentMapper.selectList(stuLqw); List<SchoolStudent> schoolStudents = studentMapper.selectList(stuLqw);
for (SchoolStudent schoolStudent : schoolStudents) { for (SchoolStudent schoolStudent : schoolStudents) {
//计算学生年龄 // TODO 修改 计算学生年龄
int age = getAge(schoolStudent.getBirthday()); int age = 0;
if (StringUtils.isNotNull(schoolStudent.getBirthday())){
age = getAge(schoolStudent.getBirthday());
}
switch (age) { switch (age) {
case 13: case 13:
num13++; num13++;
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
...@@ -98,6 +99,11 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo ...@@ -98,6 +99,11 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
@Override @Override
@Transactional @Transactional
public int insertSchoolCirculation(SchoolCirculation schoolCirculation) { public int insertSchoolCirculation(SchoolCirculation schoolCirculation) {
//判断该设备是否允许借出
SchoolEquipmentLedger schoolEquipmentLedger1 = equipmentLedgerMapper.selectById(schoolCirculation.getEquipmentId());
if (schoolEquipmentLedger1.getIsAllowLend().equals("0")){
throw new ServiceException("该设备不允许借出");
}
if (StringUtils.isNotNull(schoolCirculation.getBorrowById())){ if (StringUtils.isNotNull(schoolCirculation.getBorrowById())){
String userName = sysUserMapper.selectUserById(schoolCirculation.getBorrowById()).getUserName(); String userName = sysUserMapper.selectUserById(schoolCirculation.getBorrowById()).getUserName();
schoolCirculation.setBorrowBy(userName); schoolCirculation.setBorrowBy(userName);
......
...@@ -89,6 +89,11 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe ...@@ -89,6 +89,11 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe
String userName = sysUserMapper.selectUserById(schoolEquipmentRepair.getRepairId()).getUserName(); String userName = sysUserMapper.selectUserById(schoolEquipmentRepair.getRepairId()).getUserName();
schoolEquipmentRepair.setRepairName(userName); schoolEquipmentRepair.setRepairName(userName);
} }
if (StringUtils.isNotEmpty(schoolEquipmentRepair.getDisposeState())){
if (schoolEquipmentRepair.getDisposeState().equals("0")){
schoolEquipmentRepair.setRepairState("");
}
}
schoolEquipmentRepair.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolEquipmentRepair.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolEquipmentRepair.setCreateTime(DateUtils.getNowDate()); schoolEquipmentRepair.setCreateTime(DateUtils.getNowDate());
return equipmentRepairMapper.insert(schoolEquipmentRepair); return equipmentRepairMapper.insert(schoolEquipmentRepair);
...@@ -110,6 +115,11 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe ...@@ -110,6 +115,11 @@ public class EquipmentRepairServiceImpl extends ServiceImpl<EquipmentRepairMappe
String userName = sysUserMapper.selectUserById(schoolEquipmentRepair.getRepairId()).getUserName(); String userName = sysUserMapper.selectUserById(schoolEquipmentRepair.getRepairId()).getUserName();
schoolEquipmentRepair.setRepairName(userName); schoolEquipmentRepair.setRepairName(userName);
} }
if (StringUtils.isNotEmpty(schoolEquipmentRepair.getDisposeState())){
if (schoolEquipmentRepair.getDisposeState().equals("0")){
schoolEquipmentRepair.setRepairState("");
}
}
schoolEquipmentRepair.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName()); schoolEquipmentRepair.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolEquipmentRepair.setUpdateTime(DateUtils.getNowDate()); schoolEquipmentRepair.setUpdateTime(DateUtils.getNowDate());
return equipmentRepairMapper.updateById(schoolEquipmentRepair); return equipmentRepairMapper.updateById(schoolEquipmentRepair);
......
...@@ -111,7 +111,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, SchoolReceive ...@@ -111,7 +111,8 @@ public class ReceiveServiceImpl extends ServiceImpl<ReceiveMapper, SchoolReceive
String userName = sysUserMapper.selectUserById(schoolReceive.getReceivedById()).getUserName(); String userName = sysUserMapper.selectUserById(schoolReceive.getReceivedById()).getUserName();
schoolReceive.setReceivedBy(userName); schoolReceive.setReceivedBy(userName);
} }
if (schoolReceive.getReturnState().equals("1")){ if (StringUtils.isNotNull(schoolReceive.getReturnTime())){
schoolReceive.setReturnState("1");
SchoolEquipmentLedger schoolEquipmentLedger = new SchoolEquipmentLedger(); SchoolEquipmentLedger schoolEquipmentLedger = new SchoolEquipmentLedger();
schoolEquipmentLedger.setId(schoolReceive.getEquipmentId()); schoolEquipmentLedger.setId(schoolReceive.getEquipmentId());
schoolEquipmentLedger.setAffiliationType("2"); schoolEquipmentLedger.setAffiliationType("2");
......
package yangtz.cs.liu.campus.service.impl.schoolInstrument; package yangtz.cs.liu.campus.service.impl.schoolInstrument;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
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 yangtz.cs.liu.campus.domain.schoolInstrument.SchoolInstrument;
import yangtz.cs.liu.campus.domain.schoolInstrument.SchoolInstrumentClassify; import yangtz.cs.liu.campus.domain.schoolInstrument.SchoolInstrumentClassify;
import yangtz.cs.liu.campus.mapper.schoolInstrument.SchoolInstrumentClassifyMapper; import yangtz.cs.liu.campus.mapper.schoolInstrument.SchoolInstrumentClassifyMapper;
import yangtz.cs.liu.campus.mapper.schoolInstrument.SchoolInstrumentMapper;
import yangtz.cs.liu.campus.service.schoolInstrument.ISchoolInstrumentClassifyService; import yangtz.cs.liu.campus.service.schoolInstrument.ISchoolInstrumentClassifyService;
import java.util.List; import java.util.List;
...@@ -24,6 +28,8 @@ public class SchoolInstrumentClassifyServiceImpl extends ServiceImpl<SchoolInstr ...@@ -24,6 +28,8 @@ public class SchoolInstrumentClassifyServiceImpl extends ServiceImpl<SchoolInstr
@Autowired @Autowired
private SchoolInstrumentClassifyMapper schoolInstrumentClassifyMapper; private SchoolInstrumentClassifyMapper schoolInstrumentClassifyMapper;
@Autowired
private SchoolInstrumentMapper schoolInstrumentMapper;
/** /**
* 查询仪器药品分类 * 查询仪器药品分类
...@@ -118,6 +124,13 @@ public class SchoolInstrumentClassifyServiceImpl extends ServiceImpl<SchoolInstr ...@@ -118,6 +124,13 @@ public class SchoolInstrumentClassifyServiceImpl extends ServiceImpl<SchoolInstr
@Override @Override
public int deleteSchoolInstrumentClassifyById(Long id) public int deleteSchoolInstrumentClassifyById(Long id)
{ {
//查询该分类下是否有仪器
LambdaQueryWrapper<SchoolInstrument> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolInstrument::getInstrumentTypeId,id);
List<SchoolInstrument> list = schoolInstrumentMapper.selectList(wrapper);
if (list.size() > 0){
throw new ServiceException("该分类下存在仪器,不可删除");
}
return schoolInstrumentClassifyMapper.deleteSchoolInstrumentClassifyById(id); return schoolInstrumentClassifyMapper.deleteSchoolInstrumentClassifyById(id);
} }
} }
...@@ -322,7 +322,9 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen ...@@ -322,7 +322,9 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
default:break; default:break;
} }
} }
schoolExperimentPlanVo.setSubs(labSubs); if (labSubs.size() > 0){
schoolExperimentPlanVo.setSubs(labSubs);
}
List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.getExperimentList(schoolExperimentPlanVo); List<SchoolExperimentPlanVo> list = schoolExperimentPlanMapper.getExperimentList(schoolExperimentPlanVo);
list.forEach(list1 -> { list.forEach(list1 -> {
String semester = ""; String semester = "";
...@@ -462,7 +464,9 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen ...@@ -462,7 +464,9 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
} }
} }
schoolExperimentPlanVo.setSubs(labSubs); if (labSubs.size() > 0){
schoolExperimentPlanVo.setSubs(labSubs);
}
List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo); List<Map<String, Object>> list = schoolExperimentPlanMapper.countExperiment(schoolExperimentPlanVo);
list.forEach(list1 -> { list.forEach(list1 -> {
//总班级数 //总班级数
......
...@@ -275,7 +275,9 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -275,7 +275,9 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
default:break; default:break;
} }
} }
schoolLabClassYearVo.setSubs(labSubs); if (labSubs.size() > 0){
schoolLabClassYearVo.setSubs(labSubs);
}
List<SchoolLabClassYearVo> labClassYear = schoolLabClassYearMapper.getLabClassYear(schoolLabClassYearVo); List<SchoolLabClassYearVo> labClassYear = schoolLabClassYearMapper.getLabClassYear(schoolLabClassYearVo);
labClassYear.forEach(list1 -> { labClassYear.forEach(list1 -> {
String semester = ""; String semester = "";
......
...@@ -88,7 +88,9 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab> ...@@ -88,7 +88,9 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
default:break; default:break;
} }
} }
schoolLabVo.setLabSubs(labSubs); if (labSubs.size() > 0){
schoolLabVo.setLabSubs(labSubs);
}
return schoolLabMapper.selectSchoolLabList(schoolLabVo); return schoolLabMapper.selectSchoolLabList(schoolLabVo);
} }
......
...@@ -318,7 +318,9 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL ...@@ -318,7 +318,9 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
default:break; default:break;
} }
} }
schoolTeacherLabApplyVo.setSubs(subs); if (subs.size() > 0){
schoolTeacherLabApplyVo.setSubs(subs);
}
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo); List<SchoolTeacherLabApplyVo> schoolTeacherLabApplyVos = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo);
for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) { for (SchoolTeacherLabApplyVo teacherLabApplyVo : schoolTeacherLabApplyVos) {
LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolAccessory> wrapper = new LambdaQueryWrapper<>();
......
...@@ -72,6 +72,18 @@ public class ISchoolGradeMentorImpl extends ServiceImpl<SchoolGradeMentorMapper, ...@@ -72,6 +72,18 @@ public class ISchoolGradeMentorImpl extends ServiceImpl<SchoolGradeMentorMapper,
return schoolGradeMentorMapper.getGradeLeader(gradeId,role,teacherVO); return schoolGradeMentorMapper.getGradeLeader(gradeId,role,teacherVO);
} }
/**
* (改造)获取级部主任
* @param deptId
* @param role
* @param teacherVO
* @return
*/
@Override
public List<SchoolTeacher> getGradeDirector(Long deptId, String role, SchoolTeacherVO teacherVO) {
return schoolGradeMentorMapper.getGradeDirector(deptId,role,teacherVO);
}
@Override @Override
public List<SchoolGrade> selectGradeList(Long userId) { public List<SchoolGrade> selectGradeList(Long userId) {
return schoolGradeMentorMapper.getGrades(userId); return schoolGradeMentorMapper.getGrades(userId);
......
...@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -5,11 +5,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.core.utils.HolidayDateUtil; import com.core.utils.HolidayDateUtil;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysRole; import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import lombok.var; import lombok.var;
import org.activiti.engine.HistoryService; import org.activiti.engine.HistoryService;
...@@ -95,6 +97,9 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav ...@@ -95,6 +97,9 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav
@Autowired @Autowired
private TaskService taskService; private TaskService taskService;
@Autowired
private ISysDeptService deptService;
//请假状态为通过 //请假状态为通过
public static final String PASS = "0"; public static final String PASS = "0";
...@@ -412,13 +417,32 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav ...@@ -412,13 +417,32 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav
*/ */
@Override @Override
public List<SchoolTeacher> getLeader(Long applyOrgid, String employeeType, SchoolTeacherVO teacherVO) { public List<SchoolTeacher> getLeader(Long applyOrgid, String employeeType, SchoolTeacherVO teacherVO) {
//判断用户所有部门是属于级部还是科室
SysDept sysDept = deptService.selectDeptById(applyOrgid);
String ancestors = sysDept.getAncestors();
//查询级部
List<SysDept> sysDepts = deptService.selectGrade(new SysDept());
if (sysDepts.size() > 0){
for (SysDept dept : sysDepts) {
if (ancestors.contains(dept.getDeptId().toString())){
employeeType = "0";
applyOrgid = dept.getDeptId();
break;
}
}
}
//如果是教工,则传过来的是级部id //如果是教工,则传过来的是级部id
if (employeeType.equals(TEACH)) { if (employeeType.equals(TEACH)) {
List<SchoolTeacher> teacherList = gradeMentorService.getGradeLeader(applyOrgid, GRADELEADER, teacherVO); List<SchoolTeacher> teacherList = gradeMentorService.getGradeDirector(applyOrgid, GRADELEADER, teacherVO);
return teacherList; return teacherList;
} }
//职工,所处处室(部门)id //职工,所处处室(部门)id
return schoolTeacherService.getSectionLeader(applyOrgid, SECTIONLEADER, teacherVO); String[] split = ancestors.split(",");
if (split.length >= 4){
//获取第三级部门
applyOrgid = Long.parseLong(split[3]);
}
return schoolTeacherService.getSectionDirector(applyOrgid, SECTIONLEADER, teacherVO);
} }
/** /**
...@@ -542,14 +566,18 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav ...@@ -542,14 +566,18 @@ public class SchoolTeacherLeaveServiceImpl extends ServiceImpl<SchoolTeacherLeav
.set(SchoolTeacherLeave::getHandUserName1,schoolTeacherLeave.getHandUserName1()) .set(SchoolTeacherLeave::getHandUserName1,schoolTeacherLeave.getHandUserName1())
.set(SchoolTeacherLeave::getState,schoolTeacherLeave.getState()) .set(SchoolTeacherLeave::getState,schoolTeacherLeave.getState())
; ;
//判断这种情况,新增时教师类型是教工0,,后来修改为职工1,则课次需要从表里删除 // TODO 修改 判断这种情况,新增时教师类型是教工0,,后来修改为职工1,则课次、级部/处室主任需要从表里删除
if(EMPLOYEE.equals(schoolTeacherLeave.getApplyType())){ if(EMPLOYEE.equals(schoolTeacherLeave.getApplyType())){
luw luw
.set(SchoolTeacherLeave::getStartSort,null) .set(SchoolTeacherLeave::getStartSort,null)
.set(SchoolTeacherLeave::getEndSort,null) .set(SchoolTeacherLeave::getEndSort,null)
.set(SchoolTeacherLeave::getHandUserId1,null)
.set(SchoolTeacherLeave::getHandUserName1,null)
; ;
schoolTeacherLeave.setStartSort(null); schoolTeacherLeave.setStartSort(null);
schoolTeacherLeave.setEndSort(null); schoolTeacherLeave.setEndSort(null);
schoolTeacherLeave.setHandUserId1(null);
schoolTeacherLeave.setHandUserName1(null);
} }
double time = schoolTeacherLeave.getTotalTime(); double time = schoolTeacherLeave.getTotalTime();
//处理请假时长与分管领导、主要领导 //处理请假时长与分管领导、主要领导
......
...@@ -526,6 +526,12 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S ...@@ -526,6 +526,12 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S
List<SysPost> sysPosts = postMapper.getPostsByUserId(userId); List<SysPost> sysPosts = postMapper.getPostsByUserId(userId);
schoolTeacherVO.setPostName(sysPosts.stream().map(SysPost::getPostName).collect(Collectors.joining(","))); schoolTeacherVO.setPostName(sysPosts.stream().map(SysPost::getPostName).collect(Collectors.joining(",")));
//查询任职部门信息
List<Long> deptList = deptMapper.selectDeptListByUserId(userId);
schoolTeacherVO.setDeptIds((Long[]) deptList.toArray(new Long[deptList.size()]));
List<SysDept> sysDepts = deptMapper.getDeptdByUserId(userId);
schoolTeacherVO.setDeptNames(sysDepts.stream().map(SysDept::getDeptName).collect(Collectors.joining(",")));
SysUser user = userService.selectUserById(userId); SysUser user = userService.selectUserById(userId);
schoolTeacherVO.setStatus(user.getStatus()); schoolTeacherVO.setStatus(user.getStatus());
schoolTeacherVO.setDeptId(user.getDeptId()); schoolTeacherVO.setDeptId(user.getDeptId());
...@@ -565,6 +571,12 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S ...@@ -565,6 +571,12 @@ public class SchoolTeacherServiceImpl extends ServiceImpl<SchoolTeacherMapper, S
return schoolTeacherMapper.getSectionLeader(deptId, role,teacher); return schoolTeacherMapper.getSectionLeader(deptId, role,teacher);
} }
//(改造)获取处室主任
@Override
public List<SchoolTeacher> getSectionDirector(Long deptId, String role, SchoolTeacherVO teacher) {
return schoolTeacherMapper.getSectionDirector(deptId, role,teacher);
}
@Override @Override
public List<TeacherNameListVo> selectSchoolTeacherNameList() { public List<TeacherNameListVo> selectSchoolTeacherNameList() {
return schoolTeacherMapper.selectSchoolTeacherNameList(); return schoolTeacherMapper.selectSchoolTeacherNameList();
......
...@@ -24,6 +24,9 @@ public interface ISchoolGradeMentorService extends IService<SchoolGradeMentor> { ...@@ -24,6 +24,9 @@ public interface ISchoolGradeMentorService extends IService<SchoolGradeMentor> {
List<SchoolTeacher> getGradeLeader(Long gradeId, String role, SchoolTeacherVO teacherVO); List<SchoolTeacher> getGradeLeader(Long gradeId, String role, SchoolTeacherVO teacherVO);
//(改造)获取级部主任
List<SchoolTeacher> getGradeDirector(Long deptId, String role, SchoolTeacherVO teacherVO);
//获取用户所在级部列表 //获取用户所在级部列表
List<SchoolGrade> selectGrades(Long userId,int schoolYear); List<SchoolGrade> selectGrades(Long userId,int schoolYear);
List<SchoolGrade> selectGradeList(Long userId); List<SchoolGrade> selectGradeList(Long userId);
......
...@@ -135,6 +135,11 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> { ...@@ -135,6 +135,11 @@ public interface ISchoolTeacherService extends IService<SchoolTeacher> {
*/ */
List<SchoolTeacher> getSectionLeader(Long deptId, String role,SchoolTeacherVO teacher); List<SchoolTeacher> getSectionLeader(Long deptId, String role,SchoolTeacherVO teacher);
/**
* (改造)获取所在处室处室主任
*/
List<SchoolTeacher> getSectionDirector(Long deptId, String role,SchoolTeacherVO teacher);
List<SchoolTeacherVO> getTeachers(Long classId); List<SchoolTeacherVO> getTeachers(Long classId);
public boolean updatePic(Long userId, String avatar); public boolean updatePic(Long userId, String avatar);
......
...@@ -15,10 +15,10 @@ public class CurriculaVariableVo { ...@@ -15,10 +15,10 @@ public class CurriculaVariableVo {
/** 任务名称 */ /** 任务名称 */
private String taskName; private String taskName;
/** 开始时间 */ /** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime; private Date startTime;
/** 结束时间 */ /** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime; private Date endTime;
/** 级部 */ /** 级部 */
private String grade; private String grade;
......
...@@ -25,12 +25,12 @@ public class SchoolStudentVO { ...@@ -25,12 +25,12 @@ public class SchoolStudentVO {
/**身份证号**/ /**身份证号**/
@Excel(name = "*身份证号",width = 25) @Excel(name = "*身份证号",width = 25)
@NotBlank(message = "身份证号不能为空") // @NotBlank(message = "身份证号不能为空")
private String idCard; private String idCard;
/**性别**/ /**性别**/
@Excel(name = "学生性别",combo = {"男","女"},readConverterExp = "0=男,1=女") @Excel(name = "学生性别",combo = {"男","女"},readConverterExp = "0=男,1=女")
@NotBlank(message = "学生性别不能为空") // @NotBlank(message = "学生性别不能为空")
private String sex; private String sex;
/**民族**/ /**民族**/
...@@ -50,7 +50,7 @@ public class SchoolStudentVO { ...@@ -50,7 +50,7 @@ public class SchoolStudentVO {
private String nativePlace; private String nativePlace;
/**出生日期**/ /**出生日期**/
@NotNull(message = "出生日期不能为空") // @NotNull(message = "出生日期不能为空")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出生日期", dateFormat = "yyyy-MM-dd",width = 25) @Excel(name = "出生日期", dateFormat = "yyyy-MM-dd",width = 25)
private Date birthday; private Date birthday;
......
...@@ -29,14 +29,14 @@ public class SchoolTeacherVO extends OurBaseEntity { ...@@ -29,14 +29,14 @@ public class SchoolTeacherVO extends OurBaseEntity {
* 性别 * 性别
*/ */
@Excel(name = "性别") @Excel(name = "性别")
@NotBlank(message = "性别不能为空") // @NotBlank(message = "性别不能为空")
private String sex; private String sex;
/** /**
* 身份证 * 身份证
*/ */
@Excel(name = "身份证") @Excel(name = "身份证")
@NotBlank(message = "身份证不能为空") // @NotBlank(message = "身份证不能为空")
private String idCard; private String idCard;
/** /**
...@@ -58,6 +58,12 @@ public class SchoolTeacherVO extends OurBaseEntity { ...@@ -58,6 +58,12 @@ public class SchoolTeacherVO extends OurBaseEntity {
/**岗位名称**/ /**岗位名称**/
private String postName; private String postName;
/** 部门id */
private Long[] deptIds;
/** 部门名称 */
private String deptNames;
/** /**
* 生日 * 生日
*/ */
......
...@@ -217,4 +217,13 @@ ...@@ -217,4 +217,13 @@
GROUP BY xk.id,xk.student_id,xk.curricula_id,xs.class_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject GROUP BY xk.id,xk.student_id,xk.curricula_id,xs.class_id,bj.class_name,xs.student_name,xs.id_card,xs.school_no,xk.course_type,xk.curricula_time,xk.curricula_state,xk.selected_course,xk.selected_major,xk.selected_subject
</select> </select>
</mapper> <!--批量新增学生和选课关系-->
\ No newline at end of file <insert id="batchInsertCurriculaStudent">
insert into curricula_student(student_id,curricula_id)
values
<foreach collection="list" item="item" separator=",">
(#{item.studentId}, #{item.curriculaId})
</foreach>
</insert>
</mapper>
...@@ -80,6 +80,21 @@ ...@@ -80,6 +80,21 @@
order by st.id order by st.id
</select> </select>
<!--(改造)获取级部主任-->
<select id="getGradeDirector" resultType="SchoolTeacher">
SELECT st.id, st.teacher_name, st.teacher_tel, st.teacher_code, st.sex FROM school_teacher st
LEFT JOIN sys_user u ON u.user_id = st.id
LEFT JOIN sys_user_role sur ON sur.user_id = st.id
LEFT JOIN sys_role sr ON sr.role_id = sur.role_id
WHERE u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set( #{deptId}, ancestors ) ) AND sr.role_name = #{role} AND st.del_flag = '0'
AND sr.del_flag = '0'
<if test="entity.teacherName != null and entity.teacherName != ''">and st.teacher_name like concat('%', #{entity.teacherName},'%')
</if>
<if test="entity.teacherTel != null and entity.teacherTel != ''">and st.teacher_tel like concat('%', #{entity.teacherTel}, '%')
</if>
order by st.id
</select>
<select id="getGradeByUserId" resultType="yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade"> <select id="getGradeByUserId" resultType="yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade">
select sg.id, sg.grade_value, sg.school_year, sg.grade_year, sg.grade_name, sg.sfzxxn, sg.remark from school_grade sg select sg.id, sg.grade_value, sg.school_year, sg.grade_year, sg.grade_name, sg.sfzxxn, sg.remark from school_grade sg
left join school_grade_mentor sgm on sgm.grade_id = sg.id left join school_grade_mentor sgm on sgm.grade_id = sg.id
......
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
<if test="education != null and education != ''">and t.education = #{education}</if> <if test="education != null and education != ''">and t.education = #{education}</if>
<if test="status != null and status != ''">and u.status = #{status}</if> <if test="status != null and status != ''">and u.status = #{status}</if>
<if test="deptId != null and deptId != 0"> <if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set( #{deptId}, ancestors ) )) or #{deptId} in (SELECT ud.dept_id FROM sys_user_dept ud WHERE ud.user_id = t.id)
</if> </if>
</where> </where>
order by t.id order by t.id
...@@ -397,6 +397,25 @@ ...@@ -397,6 +397,25 @@
order by su.dept_id order by su.dept_id
</select> </select>
<!--(改造)获取处室主任-->
<select id="getSectionDirector" resultType="com.ruoyi.common.core.domain.entity.SchoolTeacher">
SELECT st.id, st.teacher_name, st.teacher_tel, st.teacher_code, st.sex, st.dept_Id, st.dept_name, st.avatar FROM
( SELECT t.id, t.device_num, t.teacher_name, t.teacher_tel, t.teacher_code, t.id_card, t.home_address, t.nation, t.pic_url,
t.birthday, t.education, t.sex, u.dept_id, d.dept_name, u.STATUS, u.sign, u.avatar, u.user_id, u.employee_type FROM school_teacher t
LEFT JOIN sys_user u ON t.id = u.user_id
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
WHERE t.del_flag = '0' AND u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set( #{deptId}, ancestors ) ) OR #{deptId} IN ( SELECT ud.dept_id FROM sys_user_dept ud WHERE ud.user_id = t.id )) st
LEFT JOIN sys_user_role ur ON ur.user_id = st.id
LEFT JOIN sys_role r ON r.role_id = ur.role_id
WHERE r.role_name = #{role} AND r.del_flag = '0'
<if test="entity.teacherName != null and entity.teacherName != ''">and st.teacher_name like concat('%', #{entity.teacherName},
'%')
</if>
<if test="entity.teacherTel != null and entity.teacherTel != ''">and st.teacher_tel like concat('%', #{entity.teacherTel}, '%')
</if>
order by st.dept_id
</select>
<select id="judge" resultType="yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO"> <select id="judge" resultType="yangtz.cs.liu.campus.vo.teacher.SchoolTeacherVO">
select t.id, t.teacher_name, t.teacher_code, u.dept_id, d.dept_name, u.employee_type select t.id, t.teacher_name, t.teacher_code, u.dept_id, d.dept_name, u.employee_type
from school_teacher t from school_teacher t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment