|
@@ -338,7 +338,7 @@ public class PersonInfoController {
|
|
@RequestAttribute String subject){
|
|
@RequestAttribute String subject){
|
|
|
|
|
|
//当前用户ID
|
|
//当前用户ID
|
|
- System.out.println(subject);
|
|
|
|
|
|
+ User user = userService.get(subject);
|
|
|
|
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
MessageResult<Map> msgResult = new MessageResult<>();
|
|
|
|
|
|
@@ -362,7 +362,10 @@ public class PersonInfoController {
|
|
if (StringUtils.isNotEmpty(phone)) {
|
|
if (StringUtils.isNotEmpty(phone)) {
|
|
searchParams.put("phone","%" + phone + "%");
|
|
searchParams.put("phone","%" + phone + "%");
|
|
}
|
|
}
|
|
- if (StringUtils.isNotEmpty(companyId)) {
|
|
|
|
|
|
+ if(userService.hasRole(subject,"ADMIN")){
|
|
|
|
+ searchParams.put("companyId",user.getCompanyId());
|
|
|
|
+ }
|
|
|
|
+ if (userService.hasRole(subject,"SYSADMIN") && StringUtils.isNotEmpty(companyId)) {
|
|
searchParams.put("companyId",companyId);
|
|
searchParams.put("companyId",companyId);
|
|
}
|
|
}
|
|
if (StringUtils.isNotEmpty(position1)) {
|
|
if (StringUtils.isNotEmpty(position1)) {
|
|
@@ -657,13 +660,14 @@ public class PersonInfoController {
|
|
|
|
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
Map<String, Object> searchParams = new HashMap<>();
|
|
searchParams.put("companyId", companyId);
|
|
searchParams.put("companyId", companyId);
|
|
- searchParams.put("idCard", idCard);
|
|
|
|
|
|
+ searchParams.put("name", name);
|
|
|
|
+ searchParams.put("phone", phone);
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
sortList.add(new Sort("id_","asc"));
|
|
sortList.add(new Sort("id_","asc"));
|
|
Page<PersonInfo> page = personInfoService.pageSearch(searchParams, 1, 1,false, sortList);
|
|
Page<PersonInfo> page = personInfoService.pageSearch(searchParams, 1, 1,false, sortList);
|
|
|
|
|
|
if (page.size() > 0) {
|
|
if (page.size() > 0) {
|
|
- sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证已导入!");
|
|
|
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("该人员已存在!");
|
|
failCount++;
|
|
failCount++;
|
|
continue;
|
|
continue;
|
|
} else {
|
|
} else {
|
|
@@ -672,19 +676,19 @@ public class PersonInfoController {
|
|
|
|
|
|
CheckIdCard cic = null;
|
|
CheckIdCard cic = null;
|
|
if(StringUtils.isEmpty(idCard)){
|
|
if(StringUtils.isEmpty(idCard)){
|
|
- sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证不能为空!");
|
|
|
|
- failCount++;
|
|
|
|
- continue;
|
|
|
|
|
|
+// sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证不能为空!");
|
|
|
|
+// failCount++;
|
|
|
|
+// continue;
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
idCard = idCard.trim().toUpperCase();
|
|
idCard = idCard.trim().toUpperCase();
|
|
- }
|
|
|
|
|
|
|
|
- cic = new CheckIdCard(idCard);
|
|
|
|
- if (!cic.validate()){
|
|
|
|
- sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证验证失败!");
|
|
|
|
- failCount++;
|
|
|
|
- continue;
|
|
|
|
|
|
+ cic = new CheckIdCard(idCard);
|
|
|
|
+ if (!cic.validate()){
|
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("身份证验证失败!");
|
|
|
|
+ failCount++;
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
personInfo.setIdCard(idCard);
|
|
personInfo.setIdCard(idCard);
|