parent
827d195ef3
commit
49ba6ddacb
|
|
@ -166,4 +166,16 @@ public class SysUser extends BaseEntity {
|
|||
* 采集时间
|
||||
*/
|
||||
private String collectionTime;
|
||||
|
||||
|
||||
/**
|
||||
* 是否参加考勤 1是 0不是
|
||||
*/
|
||||
private String isAttend;
|
||||
|
||||
/**
|
||||
* 角色类型 1:人资专员和管理员;2:考勤员
|
||||
*/
|
||||
private String roleType;
|
||||
private String orgListId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
import com.bonus.common.log.annotation.Log;
|
||||
import com.bonus.common.log.enums.BusinessType;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.entity.AttDataDetailsBean;
|
||||
import com.bonus.system.att.entity.AttDayReportBean;
|
||||
import com.bonus.system.att.entity.AttMonthReportBean;
|
||||
|
|
@ -13,6 +14,7 @@ import com.bonus.system.att.service.AttendanceDetailsService;
|
|||
import com.bonus.system.basic.domain.SysOrg;
|
||||
import com.bonus.system.basic.service.SysOrgService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -211,5 +213,13 @@ public class AttendanceDetailsController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户新增
|
||||
*/
|
||||
@PostMapping("/synchronous")
|
||||
@Log(title = "考勤报表-> 考勤明细->数据同步", businessType = BusinessType.INSERT)
|
||||
public AjaxResult synchronous(@Validated @RequestBody AttDataDetailsBean bean) {
|
||||
return attendanceDetailsService.synchronous(bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.system.att.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.att.entity.AttDataDetailsBean;
|
||||
import com.bonus.system.att.entity.AttDayReportBean;
|
||||
import com.bonus.system.att.entity.AttMonthReportBean;
|
||||
|
|
@ -96,4 +97,6 @@ public interface AttendanceDetailsService {
|
|||
List<AttDataDetailsBean> getAttDayReportDetailsList(AttDataDetailsBean bean);
|
||||
|
||||
List<AttDataDetailsBean> getOutCountList(AttDataDetailsBean bean);
|
||||
|
||||
AjaxResult synchronous(AttDataDetailsBean bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,18 @@ package com.bonus.system.att.service;
|
|||
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.att.dao.AttendanceDetailsDao;
|
||||
import com.bonus.system.att.entity.AttDataDetailsBean;
|
||||
import com.bonus.system.att.entity.AttDayReportBean;
|
||||
import com.bonus.system.att.entity.AttMonthReportBean;
|
||||
import com.bonus.system.att.tasks.AttTasks;
|
||||
import com.bonus.system.basic.domain.SysNotice;
|
||||
import com.bonus.system.basic.service.SysNoticeService;
|
||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -24,6 +27,7 @@ import java.util.stream.Collectors;
|
|||
* @author zys
|
||||
*/
|
||||
@Service("attendanceDetailsService")
|
||||
@Log4j2
|
||||
public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
||||
|
||||
@Resource(name = "attendanceDetailsDao")
|
||||
|
|
@ -32,6 +36,9 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
|||
@Resource(name = "ProDeptRoleDao")
|
||||
private ProDeptRoleDao proDeptRoleDao;
|
||||
|
||||
@Resource
|
||||
private AttTasks attTasks;
|
||||
|
||||
/**
|
||||
* 消息推送库表
|
||||
*/
|
||||
|
|
@ -164,6 +171,18 @@ public class AttendanceDetailsServiceImpl implements AttendanceDetailsService {
|
|||
return attendanceDetailsDao.getOutCountList(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult synchronous(AttDataDetailsBean bean) {
|
||||
try {
|
||||
List<String> dateList = attTasks.getStrDateListBetween(bean.getStartDate(), bean.getEndDate());
|
||||
attTasks.hisAttPush(dateList);
|
||||
return AjaxResult.success("数据同步成功");
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
return AjaxResult.error("数据同步失败");
|
||||
}
|
||||
}
|
||||
|
||||
public List<AttDayReportBean> getAttDayReportListAll(List<AttDayReportBean> list) {
|
||||
List<AttDayReportBean> allList = new ArrayList<>();
|
||||
Map<String, AttDayReportBean> map = list.stream()
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public class AttTasks {
|
|||
log.info("--------考勤定时器完毕------");
|
||||
}
|
||||
|
||||
private void hisAttPush(List<String> dateList) {
|
||||
public void hisAttPush(List<String> dateList) {
|
||||
// 创建固定大小的线程池
|
||||
ExecutorService executorService = Executors.newFixedThreadPool(THREAD_POOL_SIZE);
|
||||
// 分批处理日期列表
|
||||
|
|
|
|||
|
|
@ -178,4 +178,20 @@ public class SysOrgController extends BaseController
|
|||
return error("系统异常");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取组织列表下拉树
|
||||
*/
|
||||
|
||||
@GetMapping("/listTree")
|
||||
@Log(title = "系统管理->组织管理->下拉树", businessType = BusinessType.QUERY)
|
||||
public AjaxResult listTree(SysOrg sysOrg) {
|
||||
try{
|
||||
List<SysOrg> org = sysOrgService.selectOrgList(sysOrg);
|
||||
return success(org);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return error("系统异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -9,11 +9,14 @@ import com.bonus.common.log.enums.BusinessType;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.tasks.WechatTasks;
|
||||
import com.bonus.system.basic.dao.SysUserMapper;
|
||||
import com.bonus.system.basic.service.SysMenuService;
|
||||
import com.bonus.system.basic.service.SysUserService;
|
||||
import com.bonus.system.dept.entity.ProDeptRoleDo;
|
||||
import com.bonus.system.holiday.dao.WorkReportDao;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -53,6 +56,12 @@ public class SysUserController extends BaseController {
|
|||
@Autowired
|
||||
private WechatTasks wechatTasks;
|
||||
|
||||
@Resource(name = "WorkReportDao")
|
||||
private WorkReportDao dao;
|
||||
|
||||
@Resource
|
||||
private SysUserMapper userMapper;
|
||||
|
||||
|
||||
@RequiresPermissions("system:user:list")
|
||||
@GetMapping("/list")
|
||||
|
|
@ -61,6 +70,30 @@ public class SysUserController extends BaseController {
|
|||
try{
|
||||
// List<SysUser> list = userService.selectUserList(bean);
|
||||
// return endPage(list);
|
||||
//根据登录账号获取角色
|
||||
//不是管理员,只能查自己
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<SysRole> sysRoleList = dao.getRoleListByUserId(userId);
|
||||
int roleCount = 0;
|
||||
if(!sysRoleList.isEmpty()){
|
||||
for (SysRole sysRole : sysRoleList) {
|
||||
if(sysRole.getRoleName().contains("管理员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("人资专员")){
|
||||
roleCount = 1;
|
||||
break;
|
||||
}else if(sysRole.getRoleName().contains("考勤员")){
|
||||
roleCount = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(roleCount==2){
|
||||
String ids = userMapper.getOrg(userId);
|
||||
bean.setRoleType("2");
|
||||
bean.setOrgListId(ids);
|
||||
}
|
||||
startPage();
|
||||
List<SysUser> list = userService.selectUserList(bean);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -228,4 +228,6 @@ public interface SysUserMapper
|
|||
void updateAttOrgByUserId(OrgChangeBean item);
|
||||
|
||||
List<String> getRoleListById(SysUser user);
|
||||
|
||||
String getOrg(Long userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,6 +148,16 @@ public class EvectionBean extends BaseBean {
|
|||
*/
|
||||
private String isAgree;
|
||||
|
||||
/**
|
||||
* 是否省外 1 是 0 否
|
||||
*/
|
||||
private String isOutside;
|
||||
|
||||
/**
|
||||
* 是否西藏 1 是 0 否
|
||||
*/
|
||||
private String isXizang;
|
||||
|
||||
/**
|
||||
* 代理主持工作人员(多个自动隔开)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -134,6 +134,16 @@ public class WechatEvectionBean extends BaseBean {
|
|||
*/
|
||||
private String isAgree;
|
||||
|
||||
/**
|
||||
* 是否省外 1 是 0 否
|
||||
*/
|
||||
private String isOutside;
|
||||
|
||||
/**
|
||||
* 是否西藏 1 是 0 否
|
||||
*/
|
||||
private String isXizang;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,307 +1,309 @@
|
|||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.system.basic.dao.SysUserMapper">
|
||||
<insert id="insertUser" keyColumn="user_id" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="idNumber != null and idNumber != ''">id_number,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="createBy != null and createBy != ''">create_user_id,</if>
|
||||
<if test="isCadre != null and isCadre != ''">is_cadre,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="idNumber != null and idNumber != ''">#{idNumber},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="isCadre != null and isCadre != ''">#{isCadre},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertUser" keyColumn="user_id" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="idNumber != null and idNumber != ''">id_number,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="createBy != null and createBy != ''">create_user_id,</if>
|
||||
<if test="isCadre != null and isCadre != ''">is_cadre,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="idNumber != null and idNumber != ''">#{idNumber},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="isCadre != null and isCadre != ''">#{isCadre},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertUserOrg">
|
||||
insert into sys_user_org(user_id, org_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.orgId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteUserOrgByUserId">
|
||||
delete from sys_user_org where user_id = #{userId}
|
||||
</delete>
|
||||
<delete id="deleteUserPostByUserId">
|
||||
delete from sys_user_post where user_id = #{userId}
|
||||
</delete>
|
||||
<delete id="deleteUserRoleByUserId">
|
||||
delete from sys_user_role where user_id = #{userId}
|
||||
</delete>
|
||||
<update id="deleteUserById">
|
||||
update sys_user
|
||||
set is_active = 0
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="updateUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_user_id = #{updateBy},</if>
|
||||
<if test="isCadre != null and isCadre != ''">is_cadre = #{isCadre},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<insert id="insertUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="insertUserOrg">
|
||||
insert into sys_user_org(user_id, org_id) values
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.userId},#{item.orgId})
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteUserOrgByUserId">
|
||||
delete
|
||||
from sys_user_org
|
||||
where user_id = #{userId}
|
||||
</delete>
|
||||
<delete id="deleteUserPostByUserId">
|
||||
delete
|
||||
from sys_user_post
|
||||
where user_id = #{userId}
|
||||
</delete>
|
||||
<delete id="deleteUserRoleByUserId">
|
||||
delete
|
||||
from sys_user_role
|
||||
where user_id = #{userId}
|
||||
</delete>
|
||||
<update id="deleteUserById">
|
||||
update sys_user
|
||||
set is_active = 0
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
<update id="updateUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="phone != null and phone != ''">phone = #{phone},</if>
|
||||
<if test="idNumber != null and idNumber != ''">id_number = #{idNumber},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_user_id = #{updateBy},</if>
|
||||
<if test="isCadre != null and isCadre != ''">is_cadre = #{isCadre},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateIsFace">
|
||||
update sys_user set is_face = #{isFace} where user_id = #{userId}
|
||||
</update>
|
||||
<update id="updateIsFace">
|
||||
update sys_user
|
||||
set is_face = #{isFace}
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 改两次sys_user是为了第一次录入人脸时多次录入需要审核但又未更新时间的问题-->
|
||||
<update id="checkPersonAssignment">
|
||||
UPDATE sys_user_face SET
|
||||
`is_check` = #{isCheck},
|
||||
`examine_opinion` = #{examineOpinion}
|
||||
WHERE `user_id` = #{userId};
|
||||
<if test='isCheck == 1'>
|
||||
update sys_user set is_face = 1 where user_id = #{userId};
|
||||
update sys_user set is_face = 0 where user_id = #{userId};
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateAttOrgByUserId">
|
||||
update att_group_person_relation set org_id = #{newOrgId} where user_id = #{userId} and org_id = #{oldOrgId};
|
||||
</update>
|
||||
<!-- 改两次sys_user是为了第一次录入人脸时多次录入需要审核但又未更新时间的问题-->
|
||||
<update id="checkPersonAssignment">
|
||||
UPDATE sys_user_face SET
|
||||
`is_check` = #{isCheck},
|
||||
`examine_opinion` = #{examineOpinion}
|
||||
WHERE `user_id` = #{userId};
|
||||
<if test='isCheck == 1'>
|
||||
update sys_user set is_face = 1 where user_id = #{userId};
|
||||
update sys_user set is_face = 0 where user_id = #{userId};
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateAttOrgByUserId">
|
||||
update att_group_person_relation
|
||||
set org_id = #{newOrgId}
|
||||
where user_id = #{userId}
|
||||
and org_id = #{oldOrgId};
|
||||
</update>
|
||||
|
||||
<select id="selectUserByUserName" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select * from sys_user su
|
||||
where su.is_active = 1 and su.phone = #{userName}
|
||||
</select>
|
||||
<select id="selectUserByUserName" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select *
|
||||
from sys_user su
|
||||
where su.is_active = 1
|
||||
and su.phone = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select * from sys_user su
|
||||
where su.user_id = #{userId}
|
||||
</select>
|
||||
<select id="getOrgByUserId" resultType="com.bonus.system.api.domain.MapVo">
|
||||
SELECT
|
||||
id,
|
||||
`org_name` AS `name`
|
||||
FROM
|
||||
sys_organization
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
org_id
|
||||
FROM
|
||||
sys_user_org
|
||||
WHERE
|
||||
user_id = #{userId})
|
||||
</select>
|
||||
<select id="selectUserList" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT
|
||||
su.user_id AS userId,
|
||||
su.user_name as userName,
|
||||
su.id_number as idNumber,
|
||||
GROUP_CONCAT(DISTINCT so.org_name ORDER BY so.id SEPARATOR ', ') as orgName,
|
||||
GROUP_CONCAT(DISTINCT sdd.dict_label ORDER BY sdd.dict_code SEPARATOR ', ') as postName,
|
||||
GROUP_CONCAT(DISTINCT sr.role_name ORDER BY sr.role_id SEPARATOR ', ') as roleName,
|
||||
su.phone,su.is_cadre as isCadre,
|
||||
su.is_face as isFace,
|
||||
case when suf.new_face is not null then suf.new_face else suf.applied_face end new_face,
|
||||
suf.is_check,
|
||||
suf.examine_opinion as examineOpinion,
|
||||
suf.collection_time
|
||||
FROM
|
||||
sys_user su
|
||||
LEFT JOIN sys_user_post sup on sup.user_id=su.user_id and sup.is_active=1
|
||||
LEFT JOIN sys_dict_data sdd on sdd.dict_code=sup.post_id and sdd.`status`=0
|
||||
LEFT JOIN sys_user_role sur on sur.user_id=su.user_id and sur.is_active=1
|
||||
LEFT JOIN sys_role sr on sr.role_id=sur.role_id and sr.del_flag=0
|
||||
LEFT JOIN sys_user_org suo on suo.user_id=su.user_id and suo.is_active=1
|
||||
LEFT JOIN sys_organization so on so.id=suo.org_id and so.is_active=1
|
||||
LEFT JOIN sys_user_face suf ON suf.user_id = su.user_id
|
||||
WHERE
|
||||
su.is_active =1
|
||||
<if test="userName != null and userName != ''">
|
||||
AND su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="orgId != null and orgId != ''">
|
||||
AND suo.org_id = #{orgId}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
AND su.phone = #{phone}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
AND su.user_id = #{userId}
|
||||
</if>
|
||||
GROUP BY su.user_id
|
||||
order by su.update_time desc
|
||||
</select>
|
||||
<select id="getSelectRole" resultType="com.bonus.system.api.domain.SysRole">
|
||||
SELECT role_id,
|
||||
role_name
|
||||
FROM sys_role
|
||||
WHERE del_flag = '0'
|
||||
and status = '0'
|
||||
</select>
|
||||
<select id="getSelectPost" resultType="com.bonus.system.api.domain.SysDictData">
|
||||
SELECT dict_code,
|
||||
dict_label
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'post_list'
|
||||
and status = '0'
|
||||
</select>
|
||||
<select id="getRoleIdsByUserId">
|
||||
SELECT
|
||||
role_id as roleId
|
||||
FROM
|
||||
sys_user_role
|
||||
WHERE
|
||||
user_id = #{userId}
|
||||
and is_active=1
|
||||
</select>
|
||||
<select id="getOrgIdsByUserId">
|
||||
SELECT
|
||||
org_id as orgId
|
||||
FROM
|
||||
sys_user_org
|
||||
WHERE
|
||||
user_id = #{userId}
|
||||
and is_active=1
|
||||
</select>
|
||||
<select id="getPostIdsByUserId">
|
||||
SELECT
|
||||
sdd.dict_value as postId
|
||||
FROM
|
||||
sys_dict_data sdd
|
||||
LEFT JOIN sys_user_post sup on sup.post_id=sdd.dict_code and sup.is_active=1
|
||||
WHERE
|
||||
sup.user_id=#{userId}
|
||||
and sdd.`status`=0
|
||||
</select>
|
||||
<select id="checkPhoneUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, phone
|
||||
from sys_user
|
||||
where phone = #{phone}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
<select id="selectPostIdById" resultType="java.lang.String">
|
||||
select dict_code as postId from sys_dict_data where dict_value = #{postId} and dict_type = 'post_list' and status = '0' limit 1
|
||||
</select>
|
||||
<select id="getOrgList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT
|
||||
id,
|
||||
org_name as `name`
|
||||
FROM
|
||||
`sys_organization`
|
||||
WHERE
|
||||
is_active=1
|
||||
and org_name is not null
|
||||
GROUP BY org_name
|
||||
</select>
|
||||
<select id="getRoleList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT
|
||||
role_id as id,
|
||||
role_name as `name`
|
||||
FROM
|
||||
sys_role
|
||||
WHERE
|
||||
del_flag = '0'
|
||||
and status = '0'
|
||||
and role_name is not null
|
||||
GROUP BY role_name
|
||||
</select>
|
||||
<select id="getPostList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT
|
||||
dict_code as id,
|
||||
dict_label as `name`
|
||||
FROM
|
||||
sys_dict_data
|
||||
WHERE
|
||||
dict_type = 'post_list'
|
||||
and status = '0'
|
||||
and dict_label is not null
|
||||
GROUP BY dict_label
|
||||
</select>
|
||||
<select id="getSelectUser" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT
|
||||
user_id AS userIds,
|
||||
user_name AS userName,
|
||||
id_number AS idNumber,
|
||||
phone
|
||||
FROM
|
||||
sys_user
|
||||
WHERE
|
||||
is_active = 1
|
||||
AND user_name IS NOT NULL
|
||||
</select>
|
||||
<select id="checkIdNumberUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, id_number as idNumber
|
||||
from sys_user
|
||||
where id_number = #{idNumber}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
<select id="selectUserByUserNames" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT suo.org_id AS orgId
|
||||
FROM sys_user su
|
||||
LEFT JOIN sys_user_org suo ON suo.user_id = su.user_id
|
||||
AND suo.is_active = 1
|
||||
WHERE su.is_active = 1
|
||||
AND su.user_name = #{userName}
|
||||
</select>
|
||||
<select id="selectUserById" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select *
|
||||
from sys_user su
|
||||
where su.user_id = #{userId}
|
||||
</select>
|
||||
<select id="getOrgByUserId" resultType="com.bonus.system.api.domain.MapVo">
|
||||
SELECT id,
|
||||
`org_name` AS `name`
|
||||
FROM sys_organization
|
||||
WHERE id IN (SELECT org_id
|
||||
FROM sys_user_org
|
||||
WHERE user_id = #{userId})
|
||||
</select>
|
||||
<select id="selectUserList" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT
|
||||
su.user_id AS userId,
|
||||
su.user_name as userName,
|
||||
su.id_number as idNumber,
|
||||
GROUP_CONCAT(DISTINCT so.org_name ORDER BY so.id SEPARATOR ', ') as orgName,
|
||||
GROUP_CONCAT(DISTINCT sdd.dict_label ORDER BY sdd.dict_code SEPARATOR ', ') as postName,
|
||||
GROUP_CONCAT(DISTINCT sr.role_name ORDER BY sr.role_id SEPARATOR ', ') as roleName,
|
||||
su.phone,su.is_cadre as isCadre,
|
||||
su.is_face as isFace,
|
||||
case when suf.new_face is not null then suf.new_face else suf.applied_face end new_face,
|
||||
suf.is_check,
|
||||
suf.examine_opinion as examineOpinion,
|
||||
suf.collection_time,
|
||||
if(agpr.user_id is null, false, true) as isAttend
|
||||
FROM
|
||||
sys_user su
|
||||
LEFT JOIN sys_user_post sup on sup.user_id=su.user_id and sup.is_active=1
|
||||
LEFT JOIN sys_dict_data sdd on sdd.dict_code=sup.post_id and sdd.`status`=0
|
||||
LEFT JOIN sys_user_role sur on sur.user_id=su.user_id and sur.is_active=1
|
||||
LEFT JOIN sys_role sr on sr.role_id=sur.role_id and sr.del_flag=0
|
||||
LEFT JOIN sys_user_org suo on suo.user_id=su.user_id and suo.is_active=1
|
||||
LEFT JOIN sys_organization so on so.id=suo.org_id and so.is_active=1
|
||||
LEFT JOIN sys_user_face suf ON suf.user_id = su.user_id
|
||||
LEFT JOIN att_group_person_relation agpr on agpr.user_id = su.user_id and agpr.is_active = 1
|
||||
WHERE
|
||||
su.is_active =1
|
||||
<if test="userName != null and userName != ''">
|
||||
AND su.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="orgId != null and orgId != ''">
|
||||
AND suo.org_id = #{orgId}
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
AND su.phone = #{phone}
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
AND su.user_id = #{userId}
|
||||
</if>
|
||||
<if test="roleType =='2' || roleType == 2 ">
|
||||
and suo.org_id in (#{orgListId})
|
||||
</if>
|
||||
GROUP BY su.user_id
|
||||
order by su.update_time desc
|
||||
</select>
|
||||
<select id="getSelectRole" resultType="com.bonus.system.api.domain.SysRole">
|
||||
SELECT role_id,
|
||||
role_name
|
||||
FROM sys_role
|
||||
WHERE del_flag = '0'
|
||||
and status = '0'
|
||||
</select>
|
||||
<select id="getSelectPost" resultType="com.bonus.system.api.domain.SysDictData">
|
||||
SELECT dict_code,
|
||||
dict_label
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'post_list'
|
||||
and status = '0'
|
||||
</select>
|
||||
<select id="getRoleIdsByUserId">
|
||||
SELECT role_id as roleId
|
||||
FROM sys_user_role
|
||||
WHERE user_id = #{userId}
|
||||
and is_active = 1
|
||||
</select>
|
||||
<select id="getOrgIdsByUserId">
|
||||
SELECT org_id as orgId
|
||||
FROM sys_user_org
|
||||
WHERE user_id = #{userId}
|
||||
and is_active = 1
|
||||
</select>
|
||||
<select id="getPostIdsByUserId">
|
||||
SELECT sdd.dict_value as postId
|
||||
FROM sys_dict_data sdd
|
||||
LEFT JOIN sys_user_post sup on sup.post_id = sdd.dict_code and sup.is_active = 1
|
||||
WHERE sup.user_id = #{userId}
|
||||
and sdd.`status` = 0
|
||||
</select>
|
||||
<select id="checkPhoneUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, phone
|
||||
from sys_user
|
||||
where phone = #{phone}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
<select id="selectPostIdById" resultType="java.lang.String">
|
||||
select dict_code as postId
|
||||
from sys_dict_data
|
||||
where dict_value = #{postId}
|
||||
and dict_type = 'post_list'
|
||||
and status = '0' limit 1
|
||||
</select>
|
||||
<select id="getOrgList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT id,
|
||||
org_name as `name`
|
||||
FROM `sys_organization`
|
||||
WHERE is_active = 1
|
||||
and org_name is not null
|
||||
GROUP BY org_name
|
||||
</select>
|
||||
<select id="getRoleList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT role_id as id,
|
||||
role_name as `name`
|
||||
FROM sys_role
|
||||
WHERE del_flag = '0'
|
||||
and status = '0'
|
||||
and role_name is not null
|
||||
GROUP BY role_name
|
||||
</select>
|
||||
<select id="getPostList" resultType="com.bonus.system.holiday.entity.HolidayKeyBean">
|
||||
SELECT dict_code as id,
|
||||
dict_label as `name`
|
||||
FROM sys_dict_data
|
||||
WHERE dict_type = 'post_list'
|
||||
and status = '0'
|
||||
and dict_label is not null
|
||||
GROUP BY dict_label
|
||||
</select>
|
||||
<select id="getSelectUser" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT user_id AS userIds,
|
||||
user_name AS userName,
|
||||
id_number AS idNumber,
|
||||
phone
|
||||
FROM sys_user
|
||||
WHERE is_active = 1
|
||||
AND user_name IS NOT NULL
|
||||
</select>
|
||||
<select id="checkIdNumberUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, id_number as idNumber
|
||||
from sys_user
|
||||
where id_number = #{idNumber}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
<select id="selectUserByUserNames" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT suo.org_id AS orgId
|
||||
FROM sys_user su
|
||||
LEFT JOIN sys_user_org suo ON suo.user_id = su.user_id
|
||||
AND suo.is_active = 1
|
||||
WHERE su.is_active = 1
|
||||
AND su.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="getSelectUserCurrent" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT
|
||||
user_id AS userIds,
|
||||
user_name AS userName,
|
||||
id_number AS idNumber,
|
||||
phone
|
||||
FROM
|
||||
sys_user
|
||||
WHERE
|
||||
is_active = 1
|
||||
AND user_name IS NOT NULL
|
||||
</select>
|
||||
<select id="checkUserNameUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, id_number as idNumber
|
||||
from sys_user
|
||||
where user_name = #{userName}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
<select id="getSelectUserCurrent" resultType="com.bonus.system.api.domain.SysUser">
|
||||
SELECT user_id AS userIds,
|
||||
user_name AS userName,
|
||||
id_number AS idNumber,
|
||||
phone
|
||||
FROM sys_user
|
||||
WHERE is_active = 1
|
||||
AND user_name IS NOT NULL
|
||||
</select>
|
||||
<select id="checkUserNameUnique" resultType="com.bonus.system.api.domain.SysUser">
|
||||
select user_id as userId, id_number as idNumber
|
||||
from sys_user
|
||||
where user_name = #{userName}
|
||||
and is_active = '1' limit 1
|
||||
</select>
|
||||
|
||||
<select id="getAttGroupByUserId" resultType="com.bonus.system.api.domain.MapVo">
|
||||
SELECT
|
||||
ag.id,
|
||||
ag.group_name AS `name`
|
||||
FROM
|
||||
att_group_person_relation agpr
|
||||
LEFT JOIN att_group ag ON agpr.group_id = ag.id
|
||||
AND ag.is_active = '1'
|
||||
WHERE
|
||||
agpr.user_id = #{userId} and agpr.is_active = '1' and ag.id is not null
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getUserAttGroupByUserId" resultType="java.lang.Long">
|
||||
select org_id from att_group_person_relation where user_id=#{userId} and is_active = 1 limit 1
|
||||
<select id="getAttGroupByUserId" resultType="com.bonus.system.api.domain.MapVo">
|
||||
SELECT ag.id,
|
||||
ag.group_name AS `name`
|
||||
FROM att_group_person_relation agpr
|
||||
LEFT JOIN att_group ag ON agpr.group_id = ag.id
|
||||
AND ag.is_active = '1'
|
||||
WHERE agpr.user_id = #{userId}
|
||||
and agpr.is_active = '1'
|
||||
and ag.id is not null LIMIT 1
|
||||
</select>
|
||||
<select id="getUserAttGroupByUserId" resultType="java.lang.Long">
|
||||
select org_id
|
||||
from att_group_person_relation
|
||||
where user_id = #{userId}
|
||||
and is_active = 1 limit 1
|
||||
|
||||
</select>
|
||||
</select>
|
||||
<select id="getRoleListById" resultType="java.lang.String">
|
||||
select role_id from sys_user_role
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
select role_id
|
||||
from sys_user_role
|
||||
where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getOrg" resultType="java.lang.String">
|
||||
SELECT GROUP_CONCAT(suo.org_id SEPARATOR ', ') AS orgName
|
||||
FROM `sys_user` su
|
||||
LEFT JOIN sys_user_org suo on suo.user_id = su.user_id and suo.is_active = 1
|
||||
WHERE su.is_active = 1
|
||||
AND su.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -8,11 +8,11 @@
|
|||
INSERT INTO leave_apply(user_id, user_name, org_id, org_name, leave_type, leave_reason,
|
||||
leave_start_date, leave_start_interval, leave_end_date, leave_end_interval,
|
||||
leave_duration, source, create_user_id, is_agree, location, host_user_id,host_user_name, remark
|
||||
, leave_form_id, submit_id,examine_status)
|
||||
, leave_form_id, submit_id,examine_status,is_outside,is_xizang)
|
||||
VALUES (#{userId}, #{userName}, #{orgId}, #{orgName}, '出差报备', #{leaveReason},
|
||||
#{leaveStartDate}, #{leaveStartInterval}, #{leaveEndDate}, #{leaveEndInterval},
|
||||
#{leaveDuration}, #{source}, #{createUserId}, #{isAgree}, #{location}, #{hostUserId},#{hostUserName}, #{remark},
|
||||
#{uuid}, #{createUserId},'1')
|
||||
#{uuid}, #{createUserId},'1',#{isOutside},#{isXizang})
|
||||
</insert>
|
||||
|
||||
<update id="updateEvection">
|
||||
|
|
@ -156,7 +156,9 @@
|
|||
l.host_user_name,
|
||||
l.is_agree,
|
||||
l.location,
|
||||
l.remark
|
||||
l.remark,
|
||||
l.is_outside,
|
||||
l.is_xizang
|
||||
FROM leave_apply l
|
||||
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
|
||||
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
|
||||
|
|
@ -181,7 +183,9 @@
|
|||
l.host_user_id,
|
||||
l.is_agree,
|
||||
l.location,
|
||||
l.remark
|
||||
l.remark,
|
||||
l.is_outside,
|
||||
l.is_xizang
|
||||
ORDER BY l.update_time DESC) a
|
||||
LEFT JOIN sys_user su ON su.user_id = a.submit_id
|
||||
GROUP BY uuid
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@
|
|||
sys_user_role sur
|
||||
LEFT JOIN sys_role sr on sr.role_id=sur.role_id and sr.del_flag=0
|
||||
WHERE
|
||||
sur.is_active=1
|
||||
sur.is_active=1 and sr.del_flag=0
|
||||
and sur.user_id=#{userId}
|
||||
</select>
|
||||
<select id="selectEvectionById" resultType="com.bonus.system.holiday.entity.WorkReportBean">
|
||||
|
|
|
|||
|
|
@ -97,7 +97,9 @@
|
|||
l.host_user_name,
|
||||
l.is_agree,
|
||||
l.location,
|
||||
l.remark
|
||||
l.remark,
|
||||
l.is_outside,
|
||||
l.is_xizang
|
||||
FROM leave_apply l
|
||||
LEFT JOIN sys_user_post p ON p.user_id = l.user_id
|
||||
LEFT JOIN sys_dict_data d on d.dict_code = p.post_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue