472 lines
11 KiB
Java
472 lines
11 KiB
Java
package com.zcloud.service.system.impl;
|
||
|
||
import java.util.HashMap;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
|
||
import com.zcloud.entity.system.Role;
|
||
import org.springframework.beans.factory.annotation.Autowired;
|
||
import org.springframework.stereotype.Service;
|
||
import org.springframework.transaction.annotation.Transactional;
|
||
|
||
import com.zcloud.entity.Page;
|
||
import com.zcloud.entity.PageData;
|
||
import com.zcloud.entity.system.User;
|
||
import com.zcloud.mapper.datasource.system.UsersMapper;
|
||
import com.zcloud.service.system.UsersService;
|
||
|
||
/**
|
||
* 说明:用户服务接口实现类
|
||
* 作者:luoxiaobao
|
||
* 官网:www.qdkjchina.com
|
||
*/
|
||
@Service
|
||
@Transactional //开启事物
|
||
public class UsersServiceImpl implements UsersService {
|
||
|
||
@Autowired
|
||
private UsersMapper usersMapper;
|
||
|
||
/**通
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> listUserAndDept (PageData pd) throws Exception{
|
||
return usersMapper.listUserAndDept(pd);
|
||
}
|
||
|
||
@Override
|
||
public PageData findLevelByUserId(PageData pd) {
|
||
return usersMapper.findLevelByUserId(pd);
|
||
}
|
||
|
||
/**通过角色ID数组获取角色列表
|
||
* @param arryROLE_ID
|
||
* @throws Exception
|
||
*/
|
||
public List<Role> getRoleByArryROLE_ID(String[] arryROLE_ID)throws Exception{
|
||
return usersMapper.listAllRolesByArryROLE_ID(arryROLE_ID);
|
||
}
|
||
|
||
/**通过组ID获取组下级角色列表
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<Role> listAllRolesByPId(PageData pd) throws Exception {
|
||
return usersMapper.listAllRolesByPId(pd);
|
||
}
|
||
|
||
/**通过用户名获取用户信息
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findByUsername(PageData pd) throws Exception {
|
||
return usersMapper.findByUsername(pd);
|
||
}
|
||
public PageData findByName(PageData pd) throws Exception {
|
||
return usersMapper.findByName(pd);
|
||
}
|
||
|
||
/**通过用户ID获取用户信息
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findById(PageData pd)throws Exception{
|
||
return usersMapper.findById(pd);
|
||
}
|
||
|
||
/**
|
||
* 获取全部用户信息列表
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
@Override
|
||
@Transactional
|
||
public Object getAllUserList() throws Exception {
|
||
Map<String,Object> map = new HashMap<>();
|
||
String errInfo = "success";
|
||
// List<PageData> varList = new ArrayList<>();
|
||
// List<PageData> corpInfoList = corpInfoMapper.getAllCorpInfoList();
|
||
// 所有企业列表
|
||
// Map<String, Object> corpInfoListMap = new HashMap<>();
|
||
// Map<String, Object> corpInfoListMapLived = new HashMap<>();
|
||
// for (PageData pageData : corpInfoList) {
|
||
// corpInfoListMap.put(pageData.getString("CORPINFO_ID"),pageData);
|
||
// }
|
||
|
||
// 所有部门列表
|
||
// List<PageData> departmentList = departmentMapper.getAllDepartmentList();
|
||
// Map<String, Object> departmentListMap = new HashMap<>();
|
||
// for (PageData pageData : departmentList) {
|
||
// departmentListMap.put(pageData.getString("DEPARTMENT_ID"),pageData);
|
||
// }
|
||
|
||
// 所有人员列表
|
||
List<PageData> userList = usersMapper.getAllUserList();
|
||
|
||
map.put("userList", userList);
|
||
map.put("result",errInfo);
|
||
return map;
|
||
}
|
||
|
||
/**通过用户ID获取用户信息
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findPolice(PageData pd)throws Exception{
|
||
return usersMapper.findPolice(pd);
|
||
}
|
||
|
||
/** 获取获取部门账号
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> listUserbyDep(PageData pd)throws Exception{
|
||
return usersMapper.listUserbyDep(pd);
|
||
}
|
||
|
||
/**用户列表
|
||
* @param page
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> userlistPage(Page page) throws Exception {
|
||
return usersMapper.userlistPage(page);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> userConfirmPage(Page page) throws Exception {
|
||
return usersMapper.userConfirmPage(page);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> userExaminePage(Page page) throws Exception {
|
||
return usersMapper.userExaminePage(page);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> userApprovePage(Page page) throws Exception {
|
||
return usersMapper.userApprovePage(page);
|
||
}
|
||
|
||
/**用户列表
|
||
* @param page
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> userSelectlistPage(Page page) throws Exception {
|
||
return usersMapper.userSelectlistPage(page);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> getDepartmentId(String DEPARTMENT_ID) throws Exception {
|
||
return usersMapper.getDepartmentId(DEPARTMENT_ID);
|
||
}
|
||
|
||
@Override
|
||
public User getCorpInfoId(String CORPINFO_ID) throws Exception {
|
||
return usersMapper.getCorpInfoId(CORPINFO_ID);
|
||
}
|
||
|
||
/**通过用户ID获取用户信息和角色信息
|
||
* @param USER_ID
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public User getUserAndRoleById(String USER_ID) throws Exception {
|
||
return usersMapper.getUserAndRoleById(USER_ID);
|
||
}
|
||
|
||
/**保存用户IP
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void saveIP(PageData pd) throws Exception {
|
||
usersMapper.saveIP(pd);
|
||
}
|
||
|
||
/**通过邮箱获取数据
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findByEmail(PageData pd) throws Exception {
|
||
return usersMapper.findByEmail(pd);
|
||
}
|
||
|
||
/**通过编码获取数据
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findByNumbe(PageData pd) throws Exception {
|
||
return usersMapper.findByNumbe(pd);
|
||
}
|
||
|
||
/**列出某角色下的所有用户
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> listAllUserByRoldId(PageData pd) throws Exception{
|
||
return usersMapper.listAllUserByRoldId(pd);
|
||
}
|
||
|
||
/**用户列表(全部)
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> listAllUser(PageData pd)throws Exception{
|
||
return usersMapper.listAllUser(pd);
|
||
}
|
||
|
||
/**用户列表(弹窗选择用)
|
||
* @param page
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> listUsersBystaff(Page page)throws Exception{
|
||
return usersMapper.userBystafflistPage(page);
|
||
}
|
||
|
||
/**保存用户
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void saveUser(PageData pd)throws Exception {
|
||
usersMapper.saveUser(pd);
|
||
}
|
||
|
||
/**保存用户系统皮肤
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void saveSkin(PageData pd)throws Exception{
|
||
usersMapper.saveSkin(pd);
|
||
}
|
||
|
||
/**修改用户
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void editUser(PageData pd)throws Exception{
|
||
usersMapper.editUser(pd);
|
||
}
|
||
public void editPassword(PageData pd)throws Exception{
|
||
usersMapper.editPassword(pd);
|
||
}
|
||
|
||
/**删除用户
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void deleteUser(PageData pd)throws Exception{
|
||
usersMapper.deleteUser(pd);
|
||
}
|
||
|
||
/**批量删除用户
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void deleteAllUser(String[] USER_IDS)throws Exception{
|
||
usersMapper.deleteAllUser(USER_IDS);
|
||
}
|
||
public List<PageData> listUserBYids(String[] USER_IDS)throws Exception{
|
||
return usersMapper.listUserBYids(USER_IDS);
|
||
}
|
||
|
||
/**修改用户小程序权限
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void editUserFuns(PageData pd) {
|
||
usersMapper.editUserFuns(pd);
|
||
}
|
||
|
||
/**查询小程序用户
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public PageData findAppUserById(PageData pd) throws Exception {
|
||
return usersMapper.findAppUserById(pd);
|
||
}
|
||
|
||
/**用户同意协议
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void agreeProtocol(PageData pd) throws Exception {
|
||
usersMapper.agreeProtocol(pd);
|
||
}
|
||
/**
|
||
* 获取该企业下所有用户,用户判断是否重复
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> findUserNameAll(PageData pd) throws Exception {
|
||
// TODO Auto-generated method stub
|
||
return usersMapper.findUserNameAll(pd);
|
||
}
|
||
|
||
/**获取人员Cascader数据(人员ID,姓名,部门ID,部门级别)
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
@Override
|
||
public List<PageData> listCascader(PageData pd) throws Exception {
|
||
return usersMapper.listCascader(pd);
|
||
}
|
||
|
||
/**
|
||
*
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public List<PageData> findAllUser(PageData pd) throws Exception {
|
||
// TODO Auto-generated method stub
|
||
return usersMapper.findAllUser(pd);
|
||
}
|
||
|
||
/**清除在线学习人员分类
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
@Override
|
||
public void clearLearnerCategory(PageData pd) throws Exception {
|
||
usersMapper.clearLearnerCategory(pd);
|
||
}
|
||
|
||
/**
|
||
* 获取账号及部门岗位
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
@Override
|
||
public List<PageData> listUserDepPos(PageData pd) throws Exception {
|
||
return usersMapper.listUserDepPos(pd);
|
||
}
|
||
|
||
/**
|
||
* 查询公司员工总数
|
||
* @param pd
|
||
* @return
|
||
*/
|
||
public int getUserCount(PageData pd) throws Exception{
|
||
return usersMapper.getUserCount(pd);
|
||
}
|
||
|
||
/**
|
||
* 查询公司检查过清单的员工总数
|
||
* @param pd
|
||
* @return
|
||
*/
|
||
public int getWorkedUserCount(PageData pd) throws Exception{
|
||
return usersMapper.getWorkedUserCount(pd);
|
||
}
|
||
|
||
@Override
|
||
public void editUserScheduling(PageData pd) throws Exception {
|
||
usersMapper.editUserScheduling(pd);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> statisticsByCorp(PageData pd) throws Exception {
|
||
return usersMapper.statisticsByCorp(pd);
|
||
}
|
||
|
||
/**通过USERID查部门名称
|
||
* @param USER_ID
|
||
* @throws Exception
|
||
*/
|
||
public PageData findByDeptName(String USER_ID) throws Exception{
|
||
return usersMapper.findByDeptName(USER_ID);
|
||
}
|
||
|
||
/**通过USERID查监管端用户
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
@Override
|
||
public PageData findByRegulatoryId(PageData pd) throws Exception {
|
||
return usersMapper.findByRegulatoryId(pd);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> userlistAll(PageData pd) throws Exception {
|
||
return usersMapper.userlistAll(pd);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> listAllManageAndCorp(PageData pd) throws Exception {
|
||
return usersMapper.listAllManageAndCorp(pd);
|
||
}
|
||
|
||
@Override
|
||
public void lockUser(PageData pd) {
|
||
usersMapper.lockUser(pd);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> findByPostId(PageData pd) throws Exception {
|
||
return usersMapper.findByPostId(pd);
|
||
}
|
||
public PageData findByIdForEmis(PageData pd) throws Exception {
|
||
return usersMapper.findByIdForEmis(pd);
|
||
}
|
||
|
||
/**
|
||
*更新用户pushcid
|
||
* @param pd
|
||
* @throws Exception
|
||
*/
|
||
public void updatePushCid(PageData pd)throws Exception{
|
||
usersMapper.updatePushCid(pd);
|
||
}
|
||
/**
|
||
* 获取用户信息
|
||
* @param pd
|
||
* @return
|
||
* @throws Exception
|
||
*/
|
||
public Map<String,String> getUserMapFroExcel (PageData pd) throws Exception{
|
||
List<PageData> userAll = usersMapper.listAllUser(pd);
|
||
Map<String,String> reMap = new HashMap<>();
|
||
for (PageData pageData :userAll){
|
||
reMap.put(pageData.getString("USERNAME"),pageData.getString("USER_ID"));
|
||
reMap.put(pageData.getString("USER_ID"),pageData.getString("DEPARTMENT_ID"));
|
||
}
|
||
return reMap;
|
||
}
|
||
public List<PageData> userlistAllToExcel(PageData pd) throws Exception {
|
||
return usersMapper.userlistAllToExcel(pd);
|
||
}
|
||
|
||
@Override
|
||
public PageData findByCorpInfoId(PageData pd) {
|
||
return usersMapper.findByCorpInfoId(pd);
|
||
}
|
||
|
||
@Override
|
||
public List<PageData> selectUserListByUserIds(PageData pd) {
|
||
return usersMapper.selectUserListByUserIds(pd);
|
||
}
|
||
|
||
@Override
|
||
public void resetCardNo(PageData pd) {
|
||
usersMapper.resetCardNo(pd);
|
||
}
|
||
}
|