|
|
|
@ -1,8 +1,10 @@
|
|
|
|
|
package com.zcloud.controller.system;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.mchange.v2.codegen.bean.BeangenUtils;
|
|
|
|
|
import com.zcloud.controller.base.BaseController;
|
|
|
|
|
import com.zcloud.entity.EmployeeData;
|
|
|
|
|
import com.zcloud.entity.Page;
|
|
|
|
@ -23,6 +25,7 @@ import org.apache.commons.lang.ObjectUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
|
|
import org.apache.shiro.crypto.hash.SimpleHash;
|
|
|
|
|
import org.apache.shiro.util.CollectionUtils;
|
|
|
|
|
import org.checkerframework.checker.units.qual.C;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
@ -95,7 +98,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 根据卡号找人信息
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
@ -110,7 +113,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 根据USERID找人
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
@ -121,7 +124,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
String errInfo = "success";
|
|
|
|
|
PageData pd = this.getPageData();
|
|
|
|
|
pd = usersService.getUserByUserId(pd);
|
|
|
|
|
map.put("pd",pd);
|
|
|
|
|
map.put("pd", pd);
|
|
|
|
|
map.put("result", errInfo);
|
|
|
|
|
return map;
|
|
|
|
|
// PageData pageData = getPageData();
|
|
|
|
@ -160,7 +163,6 @@ public class UsersController extends BaseController {
|
|
|
|
|
List<PageData> userList = usersService.userlistPage(page); //列出用户列表
|
|
|
|
|
pd.put("ROLE_ID", Jurisdiction.getVIPLEVEL());
|
|
|
|
|
List<Role> roleList = roleService.listAllRolesByPId(pd); //列出所有系统用户角色
|
|
|
|
|
|
|
|
|
|
map.put("userList", userList);
|
|
|
|
|
map.put("roleList", roleList);
|
|
|
|
|
map.put("ROLE_ID", ROLE_ID);
|
|
|
|
@ -256,7 +258,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
pd.put("VIPLEVEL", Jurisdiction.getVIPLEVEL());
|
|
|
|
|
List<PageData> userList = usersService.userSelectPersonTypelist(pd);//列出用户列表
|
|
|
|
|
userList = userList.stream().parallel()
|
|
|
|
|
.filter(data -> data.getString("PERSONNEL_TYPE").contains("5ae743c76dbf496eb1b5101075b073d5")) // 列出所有驾驶员
|
|
|
|
|
.filter(data -> data.getString("PERSONNEL_TYPE").contains("5ae743c76dbf496eb1b5101075b073d5")) // 列出所有驾驶员
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
map.put("userList", userList);
|
|
|
|
|
//map.put("page", page);
|
|
|
|
@ -727,6 +729,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
map.put("result", errInfo); //返回结果
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断用户名是否存在
|
|
|
|
|
*
|
|
|
|
@ -1696,7 +1699,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
for (PageData pageData : editUserList) {
|
|
|
|
|
// if (PLSUtil.editUser(pageData)) {
|
|
|
|
|
usersService.editUser(pageData);
|
|
|
|
|
usersService.editUser(pageData);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
errorStr.append("成功导入" + addUserList.size() + "条数据!");
|
|
|
|
@ -2215,7 +2218,6 @@ public class UsersController extends BaseController {
|
|
|
|
|
*
|
|
|
|
|
* @param parentId 部门父节点id
|
|
|
|
|
* @param departMap 全部部门信息
|
|
|
|
|
* @param valName 部门名称
|
|
|
|
|
* @return 从子节点开始往上循序
|
|
|
|
|
*/
|
|
|
|
|
public String getParentName(String parentId, Map<String, Object> departMap) {
|
|
|
|
@ -2253,7 +2255,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 查询公司所有用户
|
|
|
|
|
*
|
|
|
|
|
* @param page
|
|
|
|
|
* @param
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "/listUserByCorp")
|
|
|
|
@ -2537,7 +2539,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c.put("ALLOW_QUALIFICATION", (ALLOW_QUALIFICATION.length() < 1 ? "" : ALLOW_QUALIFICATION.substring(0, ALLOW_QUALIFICATION.length()-1)));
|
|
|
|
|
c.put("ALLOW_QUALIFICATION", (ALLOW_QUALIFICATION.length() < 1 ? "" : ALLOW_QUALIFICATION.substring(0, ALLOW_QUALIFICATION.length() - 1)));
|
|
|
|
|
}
|
|
|
|
|
if (Tools.notEmpty(pd.getString("CORPINFO_ID"))) {
|
|
|
|
|
PageData dept = new PageData();
|
|
|
|
@ -2556,7 +2558,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
data.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
List<PageData> dataInfoList = userCorpService.findByUserId(data);
|
|
|
|
|
dataInfoList = dataInfoList.stream()
|
|
|
|
|
.filter(userCorpData -> StringUtils.equals(userCorpData.getString("ISDELETE"), "0"))
|
|
|
|
|
.filter(userCorpData -> StringUtils.equals(userCorpData.getString("ISDELETE"), "0"))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
/*dataInfoList.sort((t1,t2) -> t2.getString("OPERATTIME").compareTo(t1.getString("OPERATTIME")));
|
|
|
|
|
dataInfoList.forEach(info -> {
|
|
|
|
@ -2613,7 +2615,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
@Transactional
|
|
|
|
|
@LogAnno(menuType = "企业信息", menuServer = "从业人员", instructionsOperate = "从业人员", instructionsType = "新增")
|
|
|
|
|
public Object setPractitionerAdd(
|
|
|
|
|
@RequestParam(value="imgFiles",required=false) MultipartFile[] imgFiles) throws Exception {
|
|
|
|
|
@RequestParam(value = "imgFiles", required = false) MultipartFile[] imgFiles) throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
PageData pd = this.getPageData();
|
|
|
|
|
try {
|
|
|
|
@ -2629,6 +2631,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
/**
|
|
|
|
|
* 去修改用户页面(从系统用户页面修改)
|
|
|
|
|
* // goEditUser
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
@ -2716,7 +2719,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
c.put("ALLOW_QUALIFICATION", ALLOW_QUALIFICATION.length() < 1 ? "" : ALLOW_QUALIFICATION.substring(0, ALLOW_QUALIFICATION.length()-1));
|
|
|
|
|
c.put("ALLOW_QUALIFICATION", ALLOW_QUALIFICATION.length() < 1 ? "" : ALLOW_QUALIFICATION.substring(0, ALLOW_QUALIFICATION.length() - 1));
|
|
|
|
|
}
|
|
|
|
|
//获取岗位下拉
|
|
|
|
|
PageData post = new PageData();
|
|
|
|
@ -2743,10 +2746,10 @@ public class UsersController extends BaseController {
|
|
|
|
|
@ResponseBody
|
|
|
|
|
@LogAnno(menuType = "企业信息", menuServer = "从业人员", instructionsOperate = "从业人员", instructionsType = "修改用户(系统用户列表修改)")
|
|
|
|
|
public Object setPractitionerEdit(
|
|
|
|
|
@RequestParam(value="idCardFrontFiles",required=false) MultipartFile idCardFrontFiles,
|
|
|
|
|
@RequestParam(value="idCardBackFiles",required=false) MultipartFile idCardBackFiles,
|
|
|
|
|
@RequestParam(value="driverLicenseFiles",required=false) MultipartFile driverLicenseFiles,
|
|
|
|
|
@RequestParam(value="qualificationCertificateFiles",required=false) MultipartFile qualificationCertificateFiles
|
|
|
|
|
@RequestParam(value = "idCardFrontFiles", required = false) MultipartFile idCardFrontFiles,
|
|
|
|
|
@RequestParam(value = "idCardBackFiles", required = false) MultipartFile idCardBackFiles,
|
|
|
|
|
@RequestParam(value = "driverLicenseFiles", required = false) MultipartFile driverLicenseFiles,
|
|
|
|
|
@RequestParam(value = "qualificationCertificateFiles", required = false) MultipartFile qualificationCertificateFiles
|
|
|
|
|
) throws Exception {
|
|
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
String errInfo = "success";
|
|
|
|
@ -2771,7 +2774,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
if (pd.getString("PASSWORD") != null && !"".equals(pd.getString("PASSWORD"))) {
|
|
|
|
|
pd.put("PASSWORD", new SimpleHash("SHA-1", pd.getString("USERNAME"), pd.getString("PASSWORD")).toString());
|
|
|
|
|
}
|
|
|
|
|
if(!StringUtils.isEmpty(pd.getString("periodStr"))) {
|
|
|
|
|
if (!StringUtils.isEmpty(pd.getString("periodStr"))) {
|
|
|
|
|
String[] periodStrs = pd.getString("periodStr").split(",");
|
|
|
|
|
pd.put("DURATION", periodStrs[0]);
|
|
|
|
|
pd.put("WORKSTATUS", periodStrs[1]);
|
|
|
|
@ -2933,18 +2936,18 @@ public class UsersController extends BaseController {
|
|
|
|
|
PageData qualificationCertificate = new PageData();
|
|
|
|
|
Warden.initData(qualificationCertificate, "pc", pd);
|
|
|
|
|
qualificationCertificate.put("ID_PHOTO_FRONT", pd.getString("QUALIFICATION_CERTIFICATE"));
|
|
|
|
|
if (null != idCardFrontFiles && !idCardFrontFiles.isEmpty()){
|
|
|
|
|
if (null != idCardFrontFiles && !idCardFrontFiles.isEmpty()) {
|
|
|
|
|
//保存签名文件
|
|
|
|
|
String ffile = "practitioner"+ "/" +DateUtil.getYear()+ "/" +DateUtil.getMonth()+ "/" +DateUtil.getOnlyDay();
|
|
|
|
|
String ffile = "practitioner" + "/" + DateUtil.getYear() + "/" + DateUtil.getMonth() + "/" + DateUtil.getOnlyDay();
|
|
|
|
|
String fileName = UuidUtil.get32UUID() + idCardFrontFiles.getOriginalFilename().substring(idCardFrontFiles.getOriginalFilename().lastIndexOf("."));
|
|
|
|
|
smb.sshSftp(idCardFrontFiles, fileName, Const.FILEPATHFILE + ffile);
|
|
|
|
|
idCard.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
|
|
|
|
|
}
|
|
|
|
|
pd.put("ID_PHOTO", idCard.getString("ID_PHOTO_FRONT"));
|
|
|
|
|
userInfoService.editPractitioner(pd);
|
|
|
|
|
if (null != idCardBackFiles && !idCardBackFiles.isEmpty()){
|
|
|
|
|
if (null != idCardBackFiles && !idCardBackFiles.isEmpty()) {
|
|
|
|
|
//保存签名文件
|
|
|
|
|
String ffile = "practitioner"+ "/" +DateUtil.getYear()+ "/" +DateUtil.getMonth()+ "/" +DateUtil.getOnlyDay();
|
|
|
|
|
String ffile = "practitioner" + "/" + DateUtil.getYear() + "/" + DateUtil.getMonth() + "/" + DateUtil.getOnlyDay();
|
|
|
|
|
String fileName = UuidUtil.get32UUID() + idCardBackFiles.getOriginalFilename().substring(idCardBackFiles.getOriginalFilename().lastIndexOf("."));
|
|
|
|
|
smb.sshSftp(idCardBackFiles, fileName, Const.FILEPATHFILE + ffile);
|
|
|
|
|
idCard.put("ID_PHOTO_BACK", Const.FILEPATHFILE + ffile + "/" + fileName);
|
|
|
|
@ -2961,9 +2964,9 @@ public class UsersController extends BaseController {
|
|
|
|
|
userCertificateService.editByUserId(idCard);
|
|
|
|
|
|
|
|
|
|
// 驾驶证
|
|
|
|
|
if (null != driverLicenseFiles && !driverLicenseFiles.isEmpty()){
|
|
|
|
|
if (null != driverLicenseFiles && !driverLicenseFiles.isEmpty()) {
|
|
|
|
|
//保存签名文件
|
|
|
|
|
String ffile = "practitioner"+ "/" +DateUtil.getYear()+ "/" +DateUtil.getMonth()+ "/" +DateUtil.getOnlyDay();
|
|
|
|
|
String ffile = "practitioner" + "/" + DateUtil.getYear() + "/" + DateUtil.getMonth() + "/" + DateUtil.getOnlyDay();
|
|
|
|
|
String fileName = UuidUtil.get32UUID() + driverLicenseFiles.getOriginalFilename().substring(driverLicenseFiles.getOriginalFilename().lastIndexOf("."));
|
|
|
|
|
smb.sshSftp(driverLicenseFiles, fileName, Const.FILEPATHFILE + ffile);
|
|
|
|
|
driverLicense.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
|
|
|
|
@ -2994,8 +2997,8 @@ public class UsersController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 道路运输从业资格证
|
|
|
|
|
if (null != qualificationCertificateFiles && !qualificationCertificateFiles.isEmpty()){
|
|
|
|
|
String ffile = "practitioner"+ "/" +DateUtil.getYear()+ "/" +DateUtil.getMonth()+ "/" +DateUtil.getOnlyDay();
|
|
|
|
|
if (null != qualificationCertificateFiles && !qualificationCertificateFiles.isEmpty()) {
|
|
|
|
|
String ffile = "practitioner" + "/" + DateUtil.getYear() + "/" + DateUtil.getMonth() + "/" + DateUtil.getOnlyDay();
|
|
|
|
|
String fileName = UuidUtil.get32UUID() + qualificationCertificateFiles.getOriginalFilename().substring(qualificationCertificateFiles.getOriginalFilename().lastIndexOf("."));
|
|
|
|
|
smb.sshSftp(qualificationCertificateFiles, fileName, Const.FILEPATHFILE + ffile);
|
|
|
|
|
qualificationCertificate.put("ID_PHOTO_FRONT", Const.FILEPATHFILE + ffile + "/" + fileName);
|
|
|
|
@ -3028,8 +3031,8 @@ public class UsersController extends BaseController {
|
|
|
|
|
data.put("USER_ID", pd.getString("USER_ID"));
|
|
|
|
|
data.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
|
|
|
|
List<PageData> userCorpList = userCorpService.listAll(data);
|
|
|
|
|
if(!CollectionUtil.isEmpty(userCorpList)) {
|
|
|
|
|
if(StringUtils.equals(userCorpList.get(0).getString("APPLY_STATUS"), "-1")) {
|
|
|
|
|
if (!CollectionUtil.isEmpty(userCorpList)) {
|
|
|
|
|
if (StringUtils.equals(userCorpList.get(0).getString("APPLY_STATUS"), "-1")) {
|
|
|
|
|
userCorpList.get(0).put("APPLY_STATUS", "0");
|
|
|
|
|
userCorpList.get(0).put("TITLE", pd.getString("TITLE"));
|
|
|
|
|
userCorpList.get(0).put("DUTIES", pd.getString("DUTIES"));
|
|
|
|
@ -3038,7 +3041,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
userCorpList.get(0).put("ENTRY_DATE", pd.getString("ENTRY_DATE"));
|
|
|
|
|
userCorpList.get(0).put("SHIFTDUTYONE", pd.getString("SHIFTDUTYONE"));
|
|
|
|
|
userCorpList.get(0).put("SHIFTDUTYTWO", pd.getString("SHIFTDUTYTWO"));
|
|
|
|
|
if(!StringUtils.isEmpty(pd.getString("periodStr"))) {
|
|
|
|
|
if (!StringUtils.isEmpty(pd.getString("periodStr"))) {
|
|
|
|
|
String[] periodStrs = pd.getString("periodStr").split(",");
|
|
|
|
|
userCorpList.get(0).put("DURATION", periodStrs[0]);
|
|
|
|
|
userCorpList.get(0).put("WORKSTATUS", periodStrs[1]);
|
|
|
|
@ -3052,7 +3055,6 @@ public class UsersController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping("/getTrafficPenaltyUserList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public Object getTrafficPenaltyUserList(Page page) throws Exception {
|
|
|
|
@ -3357,7 +3359,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
FileUtils.deleteQuietly(tempFile);//删除临时文件
|
|
|
|
|
} else {
|
|
|
|
|
map.put("result", "error"); //返回结果
|
|
|
|
|
if(listPd.size() > 1000){
|
|
|
|
|
if (listPd.size() > 1000) {
|
|
|
|
|
map.put("msg", "Excel数据大于1000条不支持上传,请检查数据后,重新上传!");
|
|
|
|
|
} else {
|
|
|
|
|
map.put("msg", "Excel数据为空,请检查数据后,重新上传!");
|
|
|
|
@ -3416,7 +3418,7 @@ public class UsersController extends BaseController {
|
|
|
|
|
List<PageData> resultList = new ArrayList<>();
|
|
|
|
|
List<PageData> userList = usersService.getUserNoCorpinfoListAll(page); // 所有无企业信息的所有用户
|
|
|
|
|
Map<String, List<PageData>> dataList = userList.stream().collect(Collectors.groupingBy(data -> data.getString("USER_ID")));
|
|
|
|
|
dataList.forEach((key,value) -> {
|
|
|
|
|
dataList.forEach((key, value) -> {
|
|
|
|
|
resultList.add(value.get(0));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|