人员信息报送导入

This commit is contained in:
Harryxzy 2023-12-28 16:44:01 +08:00
parent 0f4d92f302
commit 622bd9ceb8
3 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,6 @@ package com.engine.salary.entity.employeedeclare.bo;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO; import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareExcelDTO;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryI18nUtil;
@ -27,7 +26,7 @@ public class EmployeeDeclareBO {
.cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) .cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
.cardNum(dto.getCardNum()) .cardNum(dto.getCardNum())
.employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) .employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus()))
.employmentType(EmploymentTypeEnum.getValueByDefaultLabel(dto.getEmploymentType())) .employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType()))
.employmentFirstYear(dto.getEmploymentFirstYear()) .employmentFirstYear(dto.getEmploymentFirstYear())
.mobile(dto.getMobile()) .mobile(dto.getMobile())
.employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) ) .employmentDate(StringUtils.isBlank(dto.getEmploymentDate()) ? null : SalaryDateUtil.stringToDate(dto.getEmploymentDate()) )

View File

@ -452,8 +452,7 @@
update_time update_time
) )
VALUES VALUES
( <foreach collection="collection" item="item" separator=",">(
<foreach collection="collection" item="item" separator=",">
#{item.birthday}, #{item.birthday},
#{item.cardNum}, #{item.cardNum},
#{item.cardType}, #{item.cardType},
@ -486,8 +485,8 @@
#{item.taxCycle}, #{item.taxCycle},
#{item.tenantKey}, #{item.tenantKey},
#{item.updateTime} #{item.updateTime}
</foreach>
) )
</foreach>
</insert> </insert>

View File

@ -105,7 +105,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
row.add(employeeDeclare.getCardNum()); row.add(employeeDeclare.getCardNum());
row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
row.add(employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel()); row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel());
row.add(employeeDeclare.getEmploymentFirstYear()); row.add(employeeDeclare.getEmploymentFirstYear());
row.add(employeeDeclare.getMobile()); row.add(employeeDeclare.getMobile());
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate()));
@ -327,6 +327,9 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
errorData.add(errorMessageMap); errorData.add(errorMessageMap);
} }
} else { } else {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0,10);
}
if (!SalaryDateUtil.checkDay(dataValue)) { if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true; isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap(); Map<String, String> errorMessageMap = Maps.newHashMap();
@ -440,7 +443,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} else { } else {
EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO(); EmployeeDeclarePO newEmployeeDeclare = new EmployeeDeclarePO();
BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare); BeanUtils.copyProperties(employeeDeclare, newEmployeeDeclare);
BeanUtils.copyProperties(employeeDeclareExcel, newEmployeeDeclare); EmployeeDeclarePO employeeDeclarePO = EmployeeDeclareBO.convert2PO(employeeDeclareExcel);
BeanUtils.copyProperties(employeeDeclarePO, newEmployeeDeclare, getNullPropertyNames(employeeDeclarePO));
newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1); newEmployeeDeclare.setNewEmployeeInfo(StringUtils.equals(employeeDeclare.toCompareString(), newEmployeeDeclare.toCompareString()) ? 0 : 1);
newEmployeeDeclare.setUpdateTime(now); newEmployeeDeclare.setUpdateTime(now);
needUpdateEmployeeDeclares.add(newEmployeeDeclare); needUpdateEmployeeDeclares.add(newEmployeeDeclare);
@ -481,7 +485,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
if (isError) { if (isError) {
failCount++; failCount++;
failRowIndex++; failRowIndex++;
errorData.add(map);
continue; continue;
} }
successCount++; successCount++;
@ -496,7 +499,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
apidatas.put("successCount", successCount); apidatas.put("successCount", successCount);
apidatas.put("errorCount", failCount); apidatas.put("errorCount", failCount);
apidatas.put("errorNotice", errorData); apidatas.put("errorData", errorData);
// 发送导入回调信息 // 发送导入回调信息
// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); // salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets);