|
@@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
@CrossOrigin
|
|
@@ -368,9 +369,8 @@ public class CompanyMemberController {
|
|
|
String cardType = array[2].toString();
|
|
|
String cardNo = array[3].toString();
|
|
|
String sex = array[4].toString();
|
|
|
- int age = Convert.toInt(array[5]);
|
|
|
- String jobsId = array[6].toString();
|
|
|
- String healthStatus = array[7].toString();
|
|
|
+ String jobsId = array[5].toString();
|
|
|
+ String healthStatus = array[6].toString();
|
|
|
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
searchParams.put("companyId",company.getId());
|
|
@@ -385,15 +385,21 @@ public class CompanyMemberController {
|
|
|
companyMember.setId(UUID.randomUUID().toString());
|
|
|
if (StringUtils.isNotEmpty(company.getId())) companyMember.setCompanyId(company.getId());
|
|
|
if (StringUtils.isNotEmpty(name)) companyMember.setName(name);
|
|
|
- if (StringUtils.isNotEmpty(cardType)) companyMember.setCardType(cardType);
|
|
|
+ if (cardType.contains("身份证")){
|
|
|
+ companyMember.setCardType("1");
|
|
|
+ if (StringUtils.isNotEmpty(cardNo)) companyMember.setAge(getAge(cardNo));
|
|
|
+ }
|
|
|
+ if (cardType.contains("港澳通行证")) companyMember.setCardType("2");
|
|
|
+ if (cardType.contains("护照")) companyMember.setCardType("3");
|
|
|
if (StringUtils.isNotEmpty(cardNo)) companyMember.setCardNo(cardNo);
|
|
|
if (sex.contains("男")) {
|
|
|
companyMember.setSex(true);
|
|
|
} else {
|
|
|
companyMember.setSex(false);
|
|
|
}
|
|
|
- if (age != 0) companyMember.setAge(age);
|
|
|
- if (StringUtils.isNotEmpty(jobsId)) companyMember.setJobsId(jobsId);
|
|
|
+ if (jobsId.contains("一类职业")) companyMember.setJobsId("4e0a6674-a539-45fb-878e-a8dd9db224c5");
|
|
|
+ if (jobsId.contains("二类职业")) companyMember.setJobsId("88ab9059-d0aa-4cef-a623-9beb536e4c10");
|
|
|
+ if (jobsId.contains("三类职业")) companyMember.setJobsId("f0f13d78-54b8-4741-aec9-5e0c07c6bfe4");
|
|
|
if (StringUtils.isNotEmpty(healthStatus)) companyMember.setHealthStatus(healthStatus);
|
|
|
// if(StringUtils.isNotEmpty(cardFiles)) companyMember.setCardFiles(cardFiles);
|
|
|
companyMember.setStatus("0");
|
|
@@ -430,4 +436,21 @@ public class CompanyMemberController {
|
|
|
|
|
|
return msgResult;
|
|
|
}
|
|
|
+
|
|
|
+ private int getAge(String idCard){
|
|
|
+ int leh = idCard.length();
|
|
|
+ String dates="";
|
|
|
+ if (leh == 18) {
|
|
|
+ int se = Integer.valueOf(idCard.substring(leh - 1)) % 2;
|
|
|
+ dates = idCard.substring(6, 10);
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
|
|
|
+ String year = sdf.format(new Date());
|
|
|
+ int u=Integer.parseInt(year)-Integer.parseInt(dates);
|
|
|
+ return u;
|
|
|
+ }else{
|
|
|
+ dates = idCard.substring(6, 8);
|
|
|
+ return Integer.parseInt(dates);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|