|
@@ -3,6 +3,8 @@ package com.jpsoft.employment.modules.base.controller;
|
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
import cn.hutool.core.util.IdcardUtil;
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
import com.jpsoft.employment.config.OSSConfig;
|
|
import com.jpsoft.employment.config.OSSConfig;
|
|
|
|
|
+import com.jpsoft.employment.modules.base.entity.EnterpriseInfo;
|
|
|
|
|
+import com.jpsoft.employment.modules.base.service.EnterpriseInfoService;
|
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
import com.jpsoft.employment.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.employment.modules.common.utils.DES3;
|
|
import com.jpsoft.employment.modules.common.utils.DES3;
|
|
|
import com.jpsoft.employment.modules.common.utils.OSSUtil;
|
|
import com.jpsoft.employment.modules.common.utils.OSSUtil;
|
|
@@ -40,6 +42,9 @@ public class PersonInfoController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private PersonInfoService personInfoService;
|
|
private PersonInfoService personInfoService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private EnterpriseInfoService enterpriseInfoService;
|
|
|
|
|
+
|
|
|
@Value("${jwt.secret}")
|
|
@Value("${jwt.secret}")
|
|
|
private String jwtSecret;
|
|
private String jwtSecret;
|
|
|
|
|
|
|
@@ -290,6 +295,7 @@ public class PersonInfoController {
|
|
|
|
|
|
|
|
String idCard = poiUtils.getCellValue(sheetIndex,rowIndex,3).toString().replace(" ","");
|
|
String idCard = poiUtils.getCellValue(sheetIndex,rowIndex,3).toString().replace(" ","");
|
|
|
|
|
|
|
|
|
|
+ String enterpriseName = poiUtils.getCellValue(sheetIndex,rowIndex,4).toString().replace(" ","");
|
|
|
|
|
|
|
|
if(StringUtils.isEmpty(userName)){
|
|
if(StringUtils.isEmpty(userName)){
|
|
|
sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("未填写用户名!");
|
|
sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("未填写用户名!");
|
|
@@ -324,11 +330,32 @@ public class PersonInfoController {
|
|
|
personInfo.setUserName(userName);
|
|
personInfo.setUserName(userName);
|
|
|
personInfo.setRealName(realName);
|
|
personInfo.setRealName(realName);
|
|
|
personInfo.setIdCard(idCard);
|
|
personInfo.setIdCard(idCard);
|
|
|
- personInfo.setStatus("0");
|
|
|
|
|
|
|
+ personInfo.setStatus("1");
|
|
|
personInfo.setCreateBy(subject);
|
|
personInfo.setCreateBy(subject);
|
|
|
personInfo.setCreateTime(new Date());
|
|
personInfo.setCreateTime(new Date());
|
|
|
personInfo.setDelFlag(false);
|
|
personInfo.setDelFlag(false);
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //是否填写关联企业
|
|
|
|
|
+ if(StringUtils.isNotEmpty(enterpriseName)){
|
|
|
|
|
+ EnterpriseInfo enterpriseInfo = enterpriseInfoService.findByName(enterpriseName);
|
|
|
|
|
+ if(enterpriseInfo!=null){
|
|
|
|
|
+ personInfo.setEnterpriseId(enterpriseInfo.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ sheet1.getRow(rowIndex).createCell(validateColIndex).setCellValue("填写的企业名称在系统中不存在,请检查企业名称!");
|
|
|
|
|
+ failCount++;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ int gender = IdcardUtil.getGenderByIdCard(personInfo.getIdCard());
|
|
|
|
|
+ int age = IdcardUtil.getAgeByIdCard(personInfo.getIdCard());
|
|
|
|
|
+
|
|
|
|
|
+ personInfo.setGender(String.valueOf(gender));
|
|
|
|
|
+ personInfo.setAge(age);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//保存新用户
|
|
//保存新用户
|
|
|
personInfoService.insert(personInfo);
|
|
personInfoService.insert(personInfo);
|
|
|
affectCount++;
|
|
affectCount++;
|