瀏覽代碼

fix: 企业,岗位,求职人员,求职意向导入数据字段类型检查

zhangying 1 天之前
父節點
當前提交
93ca3353cf

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/companyService/CompanyController.java

@@ -214,7 +214,7 @@ public class CompanyController {
     }
 
     @PostMapping("/importCompany")
-    public BaseResponse<Object> importCompany(@RequestBody List<CompanyVo> dataList) {
+    public BaseResponse<Object> importCompany(@RequestBody List<Map<String, Object>> dataList) {
         List<CompanyVo> result = companyService.importCompany(dataList, accountService.getLoginUserID());
 
         if (result != null && result.size() > 0) {

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -219,7 +219,7 @@ public class PostController {
     }
 
     @PostMapping("/importPost")
-    public BaseResponse<Object> importPost(@RequestBody List<PostVo> dataList) {
+    public BaseResponse<Object> importPost(@RequestBody List<Map<String, Object>> dataList) {
         List<PostVo> result = postService.importPost(dataList, accountService.getLoginUserID());
         if (result != null && result.size() > 0) {
             return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobHuntController.java

@@ -114,7 +114,7 @@ public class JobHuntController {
     }
 
     @PostMapping("/importJobHunt")
-    public BaseResponse<Object> importJobHunt(@RequestBody List<JobHuntVo> dataList) {
+    public BaseResponse<Object> importJobHunt(@RequestBody List<Map<String, Object>> dataList) {
         List<JobHuntVo> result = jobhuntService.importJobHunt(dataList, accountService.getLoginUserID());
         if (result != null && result.size() > 0) {
             return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);

+ 1 - 1
src/main/java/com/hz/employmentsite/controller/jobUserManager/JobUserController.java

@@ -174,7 +174,7 @@ public class JobUserController {
     }
 
     @PostMapping("/importJobUser")
-    public BaseResponse<Object> importJobUser(@RequestBody List<JobUserVo> dataList) {
+    public BaseResponse<Object> importJobUser(@RequestBody List<Map<String, Object>> dataList) {
         List<JobUserVo> result = jobuserService.importJobUser(dataList, accountService.getLoginUserID());
         if (result != null && result.size() > 0) {
             return RespGenerstor.importFail(BaseErrorEnum.IMPORT_DATA_ERROR, result);

+ 55 - 2
src/main/java/com/hz/employmentsite/services/impl/companyService/CompanyServiceImpl.java

@@ -13,6 +13,7 @@ import com.hz.employmentsite.services.service.companyService.CompanyService;
 import com.hz.employmentsite.services.service.companyService.FirmService;
 import com.hz.employmentsite.services.service.companyService.IndustryService;
 import com.hz.employmentsite.services.service.system.DictionaryService;
+import com.hz.employmentsite.util.DataTypeUtils;
 import com.hz.employmentsite.util.RegexUtils;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.util.ip.IpUtils;
@@ -91,6 +92,8 @@ public class CompanyServiceImpl implements CompanyService {
     private SysLogMapper sysLogMapper;
     @Autowired
     private PcCreditRecordMapper pcCreditRecordMapper;
+    @Autowired
+    private DataTypeUtils dataTypeUtils;
 
     @Override
     public PageInfo<CompanyVo> getList(Integer pageIndex, Integer pageSize,
@@ -402,9 +405,55 @@ public class CompanyServiceImpl implements CompanyService {
     }
 
     @Override
-    public List<CompanyVo> importCompany(List<CompanyVo> dataList, String userID) {
-        if (dataList.size() <= 0)
+    public List<CompanyVo> importCompany(List<Map<String, Object>> mapList, String userID) {
+        if (mapList.size() <= 0)
             throw new BaseException("1004", "请添加导入数据!");
+        List<CompanyVo> dataList = new ArrayList<>();
+        for (Map<String, Object> item : mapList) {
+            String errorInfo = "";
+            CompanyVo vo = new CompanyVo();
+            vo.setCompanyName((String) item.getOrDefault("companyName", ""));
+            vo.setCompanyCode((String) item.getOrDefault("companyCode", ""));
+            vo.setSiteName((String) item.getOrDefault("SiteName", ""));
+            vo.setCompanyAddress((String) item.getOrDefault("companyAddress", ""));
+            vo.setUserName((String) item.getOrDefault("userName", ""));
+            vo.setUserMobile((String) item.getOrDefault("userMobile", ""));
+            vo.setRecordStatusName((String) item.getOrDefault("recordStatusName", ""));
+            vo.setWorkSituation((String) item.getOrDefault("workSituation", ""));
+            vo.setRegionName((String) item.getOrDefault("regionName", ""));
+            vo.setStreetName((String) item.getOrDefault("streetName", ""));
+            vo.setFrName((String) item.getOrDefault("frName", ""));
+            try {
+                vo.setEstablishmentTime(dataTypeUtils.dataForDate(item.getOrDefault("establishmentTime", null)));
+            } catch (Exception e) {
+                errorInfo += "企业成立日期格式错误,请填写 年-月-日 格式的日期!";
+            }
+            vo.setValidDateStr((String) item.getOrDefault("validDateStr", ""));
+            try {
+                vo.setRegisteredCapital(dataTypeUtils.dataForBigDecimal(item.getOrDefault("registeredCapital", "")));
+            } catch (NumberFormatException e) {
+                errorInfo += "企业注册资本格式错误,请填写数字!";
+            }
+            vo.setRegisteredCapitalTypeStr((String) item.getOrDefault("registeredCapitalTypeStr", ""));
+            vo.setSignInPoliticalAreaName((String) item.getOrDefault("signInPoliticalAreaName", ""));
+            vo.setIndustryName((String) item.getOrDefault("industryName", ""));
+            vo.setEstateCategoryName((String) item.getOrDefault("estateCategoryName", ""));
+            vo.setCompanyEmail((String) item.getOrDefault("companyEmail", ""));
+            vo.setCompanyTypeStr((String) item.getOrDefault("companyTypeStr", ""));
+            vo.setCompanyModelStr((String) item.getOrDefault("companyModelStr", ""));
+            vo.setIsShortageName((String) item.getOrDefault("isShortageName", ""));
+            try {
+                vo.setInsuredCount(dataTypeUtils.dataForInteger(item.getOrDefault("insuredCount", null)));
+            } catch (Exception e) {
+                errorInfo += "参保人数格式错误,请输入整数";
+            }
+            vo.setBusinScope((String) item.getOrDefault("businScope", ""));
+            vo.setCompanyDesc((String) item.getOrDefault("companyDesc", ""));
+            vo.setWebsite((String) item.getOrDefault("website", ""));
+            vo.setBonus((String) item.getOrDefault("bonus", ""));
+            vo.setErrorMessage(errorInfo);
+            dataList.add(vo);
+        }
         //所属驿站
         PcSite curLoginUserSiteInfo = null;
         PcSiteUserExample siteUserExp = new PcSiteUserExample();
@@ -477,6 +526,10 @@ public class CompanyServiceImpl implements CompanyService {
             }
         });
         dataList.forEach(item -> {
+            if (!stringUtils.IsNullOrEmpty(item.getErrorMessage())) {
+                return;
+            }
+
             String errorInfo = "";
             item.companyID = UUID.randomUUID().toString();
             if (stringUtils.IsNullOrEmpty(item.companyName)){

+ 64 - 2
src/main/java/com/hz/employmentsite/services/impl/companyService/PostServiceImpl.java

@@ -9,6 +9,7 @@ import com.hz.employmentsite.mapper.cquery.PostCQuery;
 import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.companyService.PostService;
 import com.hz.employmentsite.services.service.system.DictionaryService;
+import com.hz.employmentsite.util.DataTypeUtils;
 import com.hz.employmentsite.util.RegexUtils;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.util.ip.IpUtils;
@@ -66,6 +67,9 @@ public class PostServiceImpl implements PostService {
     @Autowired
     private SysLogMapper sysLogMapper;
 
+    @Autowired
+    private DataTypeUtils dataTypeUtils;
+
 
     @Override
     public PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
@@ -460,9 +464,63 @@ public class PostServiceImpl implements PostService {
     }
 
     @Override
-    public List<PostVo> importPost(List<PostVo> dataList, String userID) {
-        if (dataList.size() <= 0)
+    public List<PostVo> importPost(List<Map<String, Object>> mapList, String userID) {
+        if (mapList.size() <= 0)
             throw new BaseException("", "请添加导入数据!");
+        List<PostVo> dataList = new ArrayList<>();
+        for (Map<String, Object> item : mapList) {
+            String errorInfo = "";
+            PostVo vo = new PostVo();
+            vo.setCompanyName((String) item.getOrDefault("companyName", ""));
+            vo.setProfessionName((String) item.getOrDefault("professionName", ""));
+            vo.setWorkCategoryName((String) item.getOrDefault("workCategoryName", ""));
+            vo.setRecruitCountStr((String) item.getOrDefault("recruitCountStr", ""));
+            try {
+                vo.setStartTime(dataTypeUtils.dataForDate(item.getOrDefault("startTime", null)));
+            } catch (Exception e) {
+                errorInfo += "开始日期格式错误,请填写 年-月-日 格式的日期!";
+            }
+            try {
+                vo.setEndTime(dataTypeUtils.dataForDate(item.getOrDefault("endTime", null)));
+            } catch (Exception e) {
+                errorInfo += "结束日期格式错误,请填写 年-月-日 格式的日期!";
+            }
+            vo.setJobPlace((String) item.getOrDefault("jobPlace", ""));
+            vo.setContactMobile((String) item.getOrDefault("contactMobile", ""));
+            vo.setContactEmail((String) item.getOrDefault("contactEmail", ""));
+            vo.setWorkYearName((String) item.getOrDefault("workYearName", ""));
+            vo.setCultureLevelName((String) item.getOrDefault("cultureLevelName", ""));
+            try {
+                vo.setMinSalary(dataTypeUtils.dataForBigDecimal(item.getOrDefault("minSalary", null)));
+            } catch (Exception e) {
+                errorInfo += "岗位最低月薪格式错误,请输入数字!";
+            }
+            try {
+                vo.setMaxSalary(dataTypeUtils.dataForBigDecimal(item.getOrDefault("maxSalary", null)));
+            } catch (Exception e) {
+                errorInfo += "岗位最低月薪格式错误,请输入数字!";
+            }
+            vo.setIsTrailName((String) item.getOrDefault("isTrailName", ""));
+            try {
+                vo.setTrailMonths(dataTypeUtils.dataForInteger(item.getOrDefault("trailMonths", null)));
+            } catch (Exception e) {
+                errorInfo += "试用期时长格式错误,请输入数字!";
+            }
+            try {
+                vo.setTrailMinSalary(dataTypeUtils.dataForBigDecimal(item.getOrDefault("trailMinSalary", null)));
+            } catch (Exception e) {
+                errorInfo += "试用期最低薪酬格式错误,请输入数字!";
+            }
+            try {
+                vo.setTrailMaxSalary(dataTypeUtils.dataForBigDecimal(item.getOrDefault("trailMaxSalary", null)));
+            } catch (Exception e) {
+                errorInfo += "试用期最高薪酬格式错误,请输入数字!";
+            }
+            vo.setWelfare((String) item.getOrDefault("welfare", ""));
+            vo.setPostDesc((String) item.getOrDefault("postDesc", ""));
+            vo.setErrorMessage(errorInfo);
+            dataList.add(vo);
+        }
         //所属企业
         PcCompanyExample companyExp = new PcCompanyExample();
         companyExp.or().andRecordStatusEqualTo(1);
@@ -534,6 +592,10 @@ public class PostServiceImpl implements PostService {
         List<PcProfession> proOtherSonList = pcProfessionMapper.selectByExample(proEmp);
 
         dataList.forEach(item -> {
+            if (!stringUtils.IsNullOrEmpty(item.getErrorMessage())) {
+                return;
+            }
+
             String errorInfo = "";
             item.setPostID(UUID.randomUUID().toString());
             item.setRecordStatus(1);

+ 46 - 2
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobHuntServiceImpl.java

@@ -9,6 +9,7 @@ import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.AccountService;
 import com.hz.employmentsite.services.service.jobUserManager.JobHuntService;
 import com.hz.employmentsite.services.service.system.DictionaryService;
+import com.hz.employmentsite.util.DataTypeUtils;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.util.ip.IpUtils;
 import com.hz.employmentsite.vo.jobUserManager.JobHuntVo;
@@ -53,6 +54,9 @@ public class JobHuntServiceImpl implements JobHuntService {
     @Autowired
     private SysLogMapper sysLogMapper;
 
+    @Autowired
+    private DataTypeUtils dataTypeUtils;
+
     @Override
     public PageInfo<JobHuntVo> getList(Integer pageIndex, Integer pageSize, List<String> jobHuntIDList, String jobUserID, String jobUserName, String professionName,
                                        BigDecimal minWorkYear, BigDecimal maxWorkYear, Integer jobHuntTypeID, Integer jobUserTypeID,
@@ -269,9 +273,45 @@ public class JobHuntServiceImpl implements JobHuntService {
 
 
     @Override
-    public List<JobHuntVo> importJobHunt(List<JobHuntVo> dataList, String userID) {
-        if (dataList.size() <= 0)
+    public List<JobHuntVo> importJobHunt(List<Map<String, Object>> mapList, String userID) {
+        if (mapList.size() <= 0) {
             throw new BaseException("", "请添加导入数据!");
+        }
+        List<JobHuntVo> dataList = new ArrayList<>();
+        for (Map<String, Object> map : mapList) {
+            String errorInfo = "";
+
+            JobHuntVo vo = new JobHuntVo();
+            vo.setJobUserName((String) map.getOrDefault("jobUserName",""));
+            vo.setJobHuntTypeStr((String) map.getOrDefault("jobHuntTypeStr",""));
+            vo.setJobUserTypeStr((String) map.getOrDefault("jobUserTypeStr",""));
+            try {
+                vo.setMaxSalary(dataTypeUtils.dataForBigDecimal(map.getOrDefault("maxSalary",null)));
+            } catch (Exception e) {
+                errorInfo += "最大薪资数据格式错误,请填写数字!";
+            }
+            try {
+                vo.setMinSalary(dataTypeUtils.dataForBigDecimal(map.getOrDefault("minSalary",null)));
+            } catch (Exception e) {
+                errorInfo += "最小薪资数据格式错误,请填写数字!";
+            }
+            vo.setProfessionName((String) map.getOrDefault("professionName",""));
+            vo.setAreaWork((String) map.getOrDefault("areaWork",""));
+            try {
+                vo.setInDate(dataTypeUtils.dataForDate(map.getOrDefault("inDate", null)));
+            } catch (Exception e) {
+                errorInfo += "可到职日期数据格式错误,请按 年-月-日 格式填写日期!";
+            }
+            try {
+                vo.setWorkYear(dataTypeUtils.dataForBigDecimal(map.getOrDefault("workYear",null)));
+            } catch (Exception e) {
+                errorInfo += "工作年限数据格式错误,请填写数字!";
+            }
+            vo.setOtherDemand((String) map.getOrDefault("otherDemand",""));
+            vo.setErrorMessage(errorInfo);
+            dataList.add(vo);
+        }
+
         //求职人员
         PcSiteUserExample siteUserExp = new PcSiteUserExample();
         siteUserExp.or().andUserIDEqualTo(userID);
@@ -314,6 +354,10 @@ public class JobHuntServiceImpl implements JobHuntService {
 
         List<PcJobuser> finalJobUserList = jobUserList;
         dataList.forEach(item -> {
+            if (!stringUtils.IsNullOrEmpty(item.getErrorMessage())) {
+                return;
+            }
+
             String errorInfo = "";
             item.setJobHuntID(UUID.randomUUID().toString());
             if (stringUtils.IsNullOrEmpty(item.jobUserName))

+ 54 - 2
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobUserServiceImpl.java

@@ -89,6 +89,8 @@ public class JobUserServiceImpl implements JobUserService {
 
     @Autowired
     private PcSigninMapper pcSigninMapper;
+    @Autowired
+    private DataTypeUtils dataTypeUtils;
 
     @Override
     public PageInfo<JobUserVo> getList(Integer pageIndex, Integer pageSize,
@@ -626,9 +628,59 @@ public class JobUserServiceImpl implements JobUserService {
 
 
     @Override
-    public List<JobUserVo> importJobUser(List<JobUserVo> dataList, String userID) {
-        if (dataList.size() <= 0)
+    public List<JobUserVo> importJobUser(List<Map<String, Object>> mapList, String userID) {
+        if (mapList.size() <= 0)
             throw new BaseException("", "请添加导入数据!");
+        List<JobUserVo> dataList = new ArrayList<>();
+        for (Map<String, Object> item : mapList) {
+            String errorInfo = "";
+            JobUserVo vo = new JobUserVo();
+            vo.setName((String) item.getOrDefault("name", ""));
+            vo.setBirthDayStr((String) item.getOrDefault("birthDayStr", ""));
+            vo.setSexName((String) item.getOrDefault("sexName", ""));
+            vo.setKeyPersonTypeName((String) item.getOrDefault("keyPersonTypeName", ""));
+            vo.setOrdinaryPersonTypeName((String) item.getOrDefault("ordinaryPersonTypeName", ""));
+            vo.setJobStatusName((String) item.getOrDefault("jobStatusName", ""));
+            vo.setSiteName((String) item.getOrDefault("siteName", ""));
+            vo.setAddress((String) item.getOrDefault("address", ""));
+            vo.setUserMobile((String) item.getOrDefault("userMobile", ""));
+            vo.setRegionName((String) item.getOrDefault("regionName", ""));
+            vo.setIdentityNumber((String) item.getOrDefault("identityNumber", ""));
+            vo.setStreetName((String) item.getOrDefault("streetName", ""));
+            vo.setProvinceName((String) item.getOrDefault("provinceName", ""));
+            vo.setUserName((String) item.getOrDefault("userName", ""));
+            vo.setFinishDate((String) item.getOrDefault("finishDate", ""));
+            vo.setNativePlace((String) item.getOrDefault("nativePlace", ""));
+            vo.setSocialSecurityCard((String) item.getOrDefault("socialSecurityCard", ""));
+            try {
+                vo.setEducationalSystem(dataTypeUtils.dataForInteger(item.getOrDefault("educationalSystem", null)));
+            } catch (Exception e) {
+                errorInfo += "学制格式错误,请填写数字!";
+            }
+            vo.setFinishSchool((String) item.getOrDefault("finishSchool", ""));
+            vo.setProfession((String) item.getOrDefault("profession", ""));
+            vo.setDifficultSituationName((String) item.getOrDefault("difficultSituationName", ""));
+            vo.setEsHouseholdRegistration((String) item.getOrDefault("esHouseholdRegistration", ""));
+            vo.setIsFullTimeName((String) item.getOrDefault("isFullTimeName", null));
+            vo.setOccupationalCategoryName((String) item.getOrDefault("occupationalCategoryName", ""));
+            vo.setOccupationalLevelName((String) item.getOrDefault("occupationalLevelName", ""));
+            vo.setNationName((String) item.getOrDefault("nationName", ""));
+            vo.setPoliticsStatusName((String) item.getOrDefault("politicsStatusName", ""));
+            vo.setBirthPlace((String) item.getOrDefault("birthPlace", ""));
+            vo.setFamilyNatureName((String) item.getOrDefault("familyNatureName", ""));
+            vo.setCultureRankName((String) item.getOrDefault("cultureRankName", ""));
+            vo.setHealthName((String) item.getOrDefault("healthName", ""));
+            vo.setBloodTypeName((String) item.getOrDefault("bloodTypeName", ""));
+            vo.setEmail((String) item.getOrDefault("email", ""));
+            vo.setHeight((String) item.getOrDefault("height", ""));
+            vo.setWeight((String) item.getOrDefault("weight", ""));
+            vo.setVision((String) item.getOrDefault("vision", ""));
+            vo.setFamilyAddress((String) item.getOrDefault("familyAddress", ""));
+            vo.setHobby((String) item.getOrDefault("hobby", ""));
+            vo.setPersonalSkills((String) item.getOrDefault("personalSkills", ""));
+            vo.setErrorMessage(errorInfo);
+        }
+
         //性别
         List<SysDictionaryItem> dicJobUserGenderList = dictionaryService.getDictionaryItemList("Gender");
         //重点人员类别

+ 2 - 1
src/main/java/com/hz/employmentsite/services/impl/taskAndLog/DoWorkImpl.java

@@ -54,7 +54,8 @@ public class DoWorkImpl implements DoWorkService {
         if (!stringUtils.IsNullOrEmpty(userId)) {
             List<RoleModel> userRole = roleService.getRoleByUserID(userId);
             if (!userRole.isEmpty()) {
-                RoleModel sysRole = userRole.stream().filter(it -> it.getRoleID().equals("f5a36ac2-2aec-4f3e-9d80-cfcb26d44fac")).findFirst().orElse(null);
+                // RoleModel sysRole = userRole.stream().filter(it -> it.getRoleID().equals("f5a36ac2-2aec-4f3e-9d80-cfcb26d44fac")).findFirst().orElse(null); // 本地 站长ID
+                RoleModel sysRole = userRole.stream().filter(it -> it.getRoleID().equals("d989844d-45d7-4b79-8262-7567a93de0af")).findFirst().orElse(null); // 正式平台 站长ID
                 if (sysRole != null) {
                     // 查询用户所属的驿站
                     UserInfoModel userInfo = userService.getUserInfo(userId);

+ 2 - 1
src/main/java/com/hz/employmentsite/services/service/companyService/CompanyService.java

@@ -13,6 +13,7 @@ import com.hz.employmentsite.vo.signin.SigninVo;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface CompanyService {
 
@@ -41,7 +42,7 @@ public interface CompanyService {
 
     PcCompany getCompanyByOracleIDOrCompanyCode(String oracleTableID, String CompanyCode);
 
-    List<CompanyVo> importCompany(List<CompanyVo> dataList, String userID);
+    List<CompanyVo> importCompany(List<Map<String, Object>> dataList, String userID);
 
     List<PcSite> getSiteList();
 

+ 2 - 1
src/main/java/com/hz/employmentsite/services/service/companyService/PostService.java

@@ -7,6 +7,7 @@ import com.hz.employmentsite.vo.companyService.RecommendPostVo;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface PostService {
     PageInfo<PostVo> getList(Integer page, Integer rows, List<String> postIDList,
@@ -33,7 +34,7 @@ public interface PostService {
 
     List<PostVo> getDataListByCompanyID(String companyID);
 
-    List<PostVo> importPost(List<PostVo> dataList, String userID);
+    List<PostVo> importPost(List<Map<String, Object>> dataList, String userID);
 
     int deletePostAndRecommendMgt(HttpServletRequest request, String id, String loginUserID);
 

+ 2 - 1
src/main/java/com/hz/employmentsite/services/service/jobUserManager/JobHuntService.java

@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface JobHuntService {
 
@@ -24,5 +25,5 @@ public interface JobHuntService {
 
     Integer save(JobHuntVo data, String userId);
 
-    List<JobHuntVo> importJobHunt(List<JobHuntVo> dataList, String userID);
+    List<JobHuntVo> importJobHunt(List<Map<String, Object>> dataList, String userID);
 }

+ 2 - 1
src/main/java/com/hz/employmentsite/services/service/jobUserManager/JobUserService.java

@@ -11,6 +11,7 @@ import com.hz.employmentsite.vo.jobUserManager.JobUserVo;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 public interface JobUserService {
     PageInfo<JobUserVo> getList(Integer pageIndex, Integer pageSize,
@@ -41,7 +42,7 @@ public interface JobUserService {
 
     int baseInfoSave(JobUserVo data, String userId);
 
-    List<JobUserVo> importJobUser(List<JobUserVo> dataList, String userID);
+    List<JobUserVo> importJobUser(List<Map<String, Object>> dataList, String userID);
 
     PageInfo<JobUserMapVo> getDataMapList(int pageIndex, int pageSize, Integer keyTypeValue,
                                           String regionCode, String labelID, Integer minAge,

+ 113 - 0
src/main/java/com/hz/employmentsite/util/DataTypeUtils.java

@@ -0,0 +1,113 @@
+package com.hz.employmentsite.util;
+
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Component
+public class DataTypeUtils {
+    public BigDecimal dataForBigDecimal(Object data) {
+        if (data == null) {
+            return null;
+        }
+        try {
+            if (data instanceof Integer && (Integer) data == 0) {
+                return BigDecimal.ZERO; // 明确处理 Integer 0
+            }
+            if (data instanceof Double && (Double) data == 0.0) {
+                return BigDecimal.ZERO; // 明确处理 Double 0.0
+            }
+            if (data instanceof Integer) {
+                return BigDecimal.valueOf((Integer) data);
+            }
+            if (data instanceof Double) {
+                return BigDecimal.valueOf((Double) data);
+            }
+            if (data instanceof String) {
+                String strValue = ((String) data).trim();
+                if (strValue.isEmpty()) {
+                    return BigDecimal.ZERO; // 空字符串 -> null
+                }
+                // 尝试解析数字(兼容 "0"、"3.14" 等)
+                return new BigDecimal(strValue);
+            }
+            throw new IllegalArgumentException();
+        } catch (NumberFormatException e) {
+            throw new NumberFormatException();
+        }
+    }
+
+    public Date dataForDate(Object data) {
+        if (data == null) {
+            return null;
+        }
+        try {
+            if (data instanceof Date) {
+                return (Date) data;
+            }
+            if (data instanceof Long) {
+                return new Date((Long) data);
+            }
+            if (data instanceof Integer) {
+                return new Date(((Integer) data).longValue() * 1000L);
+            }
+            if (data instanceof String) {
+                String dateStr = ((String) data).trim();
+                if (dateStr.isEmpty()) {
+                    return null;
+                }
+                // 常见日期格式
+                SimpleDateFormat[] dateFormats = {
+                        new SimpleDateFormat("yyyy-MM-dd"),
+                        new SimpleDateFormat("yyyy/MM/dd")
+                };
+                for (SimpleDateFormat format : dateFormats) {
+                    try {
+                        return format.parse(dateStr);
+                    } catch (ParseException ignored) { }
+                }
+                // 额外检查是否为时间戳字符串
+                try {
+                    long timestamp = Long.parseLong(dateStr);
+                    return new Date(timestamp);
+                } catch (NumberFormatException e) {
+                    throw new IllegalArgumentException();
+                }
+            }
+            throw new IllegalArgumentException();
+        } catch (Exception e) {
+            throw new RuntimeException();
+        }
+    }
+
+    public Integer dataForInteger(Object data) {
+        if (data == null) {
+            return null;
+        }
+        try {
+            if (data instanceof Integer) {
+                return (Integer) data;
+            }
+            if (data instanceof Number) {
+                return ((Number) data).intValue();
+            }
+            if (data instanceof String) {
+                String str = ((String) data).trim();
+                if (str.isEmpty()) {
+                    return 0;
+                }
+                return Double.valueOf(str).intValue();
+            }
+            if (data instanceof Boolean) {
+                return (Boolean) data ? 1 : 0;
+            }
+            throw new IllegalArgumentException();
+        } catch (Exception e) {
+            throw new RuntimeException();
+        }
+    }
+
+}