外籍人员更新

This commit is contained in:
钱涛 2024-04-11 18:57:56 +08:00
parent a2a18245bd
commit 4aa66ea587
12 changed files with 207 additions and 70 deletions

View File

@ -2,11 +2,8 @@ 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.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryI18nUtil;
import org.apache.commons.lang3.StringUtils;
/** /**
* @author Harryxzy * @author Harryxzy
@ -23,22 +20,27 @@ public class EmployeeDeclareBO {
EmployeeDeclarePO po = EmployeeDeclarePO.builder() EmployeeDeclarePO po = EmployeeDeclarePO.builder()
.jobNum(dto.getJobNum()) .jobNum(dto.getJobNum())
.employeeName(dto.getEmployeeName()) .employeeName(dto.getEmployeeName())
.cardType(dto.getCardType() == null ? null :CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue()) .cardType(dto.getCardType())
.cardNum(dto.getCardNum()) .cardNum(dto.getCardNum())
.employmentStatus(StringUtils.isBlank(dto.getEmploymentStatus()) ? null : new Integer(dto.getEmploymentStatus())) .nationality(dto.getNationality())
.employmentType(StringUtils.isBlank(dto.getEmploymentType()) ? null : new Integer(dto.getEmploymentType())) .employmentStatus(dto.getEmploymentStatus())
.employmentType(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(dto.getEmploymentDate())
.dismissDate(StringUtils.isBlank(dto.getDismissDate()) ? null : SalaryDateUtil.stringToDate(dto.getDismissDate())) .dismissDate(dto.getDismissDate())
.disability(dto.getDisability()) .disability(dto.getDisability())
.disabilityCardNo(dto.getDisabilityCardNo()) .disabilityCardNo(dto.getDisabilityCardNo())
.martyrDependents(dto.getMartyrDependents()) .martyrDependents(dto.getMartyrDependents())
.martyrDependentsCardNo(dto.getMartyrDependentsCardNo()) .martyrDependentsCardNo(dto.getMartyrDependentsCardNo())
.lonelyOld(dto.getLonelyOld()) .lonelyOld(dto.getLonelyOld())
.deductExpenses(dto.getDeductExpenses()) .deductExpenses(dto.getDeductExpenses())
.gender(StringUtils.isBlank(dto.getGender()) ? null : new Integer(dto.getGender())) .entryDate(dto.getEntryDate())
.birthday(StringUtils.isBlank(dto.getBirthday()) ? null : SalaryDateUtil.stringToDate(dto.getBirthday())) .departureDate(dto.getDepartureDate())
.gender(dto.getGender())
.birthplace(dto.getBirthplace())
.birthday(dto.getBirthday())
.taxReasons(dto.getTaxReasons())
.build(); .build();
return po; return po;
} }

View File

@ -42,7 +42,7 @@ public class EmployeeDeclareRequest {
// *姓名 // *姓名
employeeInfoMap.put("xm", employeeDeclare.getEmployeeName()); employeeInfoMap.put("xm", employeeDeclare.getEmployeeName());
// *证件类型 // *证件类型
CardTypeEnum cardTypeEnum = CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()); CardTypeEnum cardTypeEnum = CardTypeEnum.getByValue(employeeDeclare.getCardType());
employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel()); employeeInfoMap.put("zzlx", cardTypeEnum.getDefaultLabel());
// *证件号码 // *证件号码
employeeInfoMap.put("zzhm", employeeDeclare.getCardNum()); employeeInfoMap.put("zzhm", employeeDeclare.getCardNum());

View File

@ -11,6 +11,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
import java.util.Set; import java.util.Set;
/** /**
@ -67,27 +68,39 @@ public class EmployeeDeclareExcelDTO {
// 证件类型 // 证件类型
@SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType") @SalaryTableColumn(text = "证件类型", width = "10%", column = "cardType")
@TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType") @TableTitle(title = "证件类型", dataIndex = "cardType", key = "cardType")
private String cardType; private Integer cardType;
// 证件号码 // 证件号码
@SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum") @SalaryTableColumn(text = "证件号码", width = "10%", column = "cardNum")
@TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum") @TableTitle(title = "证件号码", dataIndex = "cardNum", key = "cardNum")
private String cardNum; private String cardNum;
// 性别
@SalaryTableColumn(text = "国籍", width = "10%", column = "nationality")
@TableTitle(title = "国籍", dataIndex = "nationality", key = "nationality")
private String nationality;
// 性别 // 性别
@SalaryTableColumn(text = "性别", width = "10%", column = "gender") @SalaryTableColumn(text = "性别", width = "10%", column = "gender")
@TableTitle(title = "性别", dataIndex = "gender", key = "gender") @TableTitle(title = "性别", dataIndex = "gender", key = "gender")
private String gender; private Integer gender;
/**
* 出生地
*/
@SalaryTableColumn(text = "出生地", width = "10%", column = "birthplace")
@TableTitle(title = "出生地", dataIndex = "birthplace", key = "birthplace")
private String birthplace;
// 出生日期 // 出生日期
@SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday") @SalaryTableColumn(text = "出生日期", width = "10%", column = "birthday")
@TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday") @TableTitle(title = "出生日期", dataIndex = "birthday", key = "birthday")
private String birthday; private Date birthday;
// 人员状态 // 人员状态
@SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus") @SalaryTableColumn(text = "人员状态", width = "10%", column = "employmentStatus")
@TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus") @TableTitle(title = "人员状态", dataIndex = "employmentStatus", key = "employmentStatus")
private String employmentStatus; private Integer employmentStatus;
// 手机号码 // 手机号码
@SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile") @SalaryTableColumn(text = "手机号码", width = "10%", column = "mobile")
@ -97,12 +110,12 @@ public class EmployeeDeclareExcelDTO {
// 任职受雇从业类型 // 任职受雇从业类型
@SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType") @SalaryTableColumn(text = "任职受雇从业类型", width = "10%", column = "employmentType")
@TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType") @TableTitle(title = "任职受雇从业类型", dataIndex = "employmentType", key = "employmentType")
private String employmentType; private Integer employmentType;
// 任职受雇从业日期 // 任职受雇从业日期
@SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate") @SalaryTableColumn(text = "任职受雇从业日期", width = "10%", column = "employmentDate")
@TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate") @TableTitle(title = "任职受雇从业日期", dataIndex = "employmentDate", key = "employmentDate")
private String employmentDate; private Date employmentDate;
// 入职年度就业情形 // 入职年度就业情形
private String employmentFirstYear; private String employmentFirstYear;
@ -111,7 +124,33 @@ public class EmployeeDeclareExcelDTO {
// 离职日期 // 离职日期
@SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate") @SalaryTableColumn(text = "离职日期", width = "10%", column = "dismissDate")
@TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate")
private String dismissDate; private Date dismissDate;
/**
* 首次入境时间
*/
@SalaryTableColumn(text = "首次入境时间", width = "10%", column = "entryDate")
@TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate")
private Date entryDate;
/**
* 预计离境时间
*/
@SalaryTableColumn(text = "预计离境时间", width = "10%", column = "departureDate")
@TableTitle(title = "预计离境时间", dataIndex = "departureDate", key = "departureDate")
private Date departureDate;
/**
* 涉税事由
* 任职受雇
* 提供临时劳务
* 转让财产
* 从事投资和经营活动
* 其他
*/
@SalaryTableColumn(text = "涉税事由", width = "10%", column = "taxReasons")
@TableTitle(title = "涉税事由", dataIndex = "taxReasons", key = "taxReasons")
private String taxReasons;
// 是否残疾 // 是否残疾
private Integer disability; private Integer disability;

View File

@ -2,6 +2,8 @@ package com.engine.salary.entity.employeedeclare.po;
import com.engine.hrmelog.annotation.ElogTransform; import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.GenderEnum;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@ -78,6 +80,7 @@ public class EmployeeDeclarePO {
/** /**
* 证件类型 * 证件类型
* @see CardTypeEnum
*/ */
@ElogTransform(name = "证件类型") @ElogTransform(name = "证件类型")
private Integer cardType; private Integer cardType;
@ -102,6 +105,7 @@ public class EmployeeDeclarePO {
/** /**
* 性别 * 性别
* @see GenderEnum
*/ */
@ElogTransform(name = "性别") @ElogTransform(name = "性别")
private Integer gender; private Integer gender;

View File

@ -146,7 +146,7 @@ public class TaxDeclarationRequest {
// 姓名 // 姓名
requestParam.put("xm", employeeDeclare.getEmployeeName()); requestParam.put("xm", employeeDeclare.getEmployeeName());
// 证件类型 // 证件类型
requestParam.put("zzlx", CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()); requestParam.put("zzlx", CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel());
// 证件号码 // 证件号码
requestParam.put("zzhm", employeeDeclare.getCardNum()); requestParam.put("zzhm", employeeDeclare.getCardNum());
// 所得项目 // 所得项目

View File

@ -92,7 +92,7 @@ public class TaxDeclarationValueList {
if (employeeDeclare != null) { if (employeeDeclare != null) {
dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum()); dataMap.put(cnKey ? "工号" : "jobNum", employeeDeclare.getJobNum());
dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName()); dataMap.put(cnKey ? "姓名" : "username", employeeDeclare.getEmployeeName());
dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel() ); dataMap.put(cnKey ? "证件类型" : "cardType",CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel() );
dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum()); dataMap.put(cnKey ? "证件号码" : "cardNum", employeeDeclare.getCardNum());
} else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) { } else if (taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) {
DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId()); DataCollectionEmployee simpleEmployee = simpleEmployeeMap.get(taxDeclarationValue.getEmployeeId());

View File

@ -56,7 +56,7 @@ public class TaxDeclareEmployeeBO {
abnormalEmployeeListDTO abnormalEmployeeListDTO
.setEmployeeName(employeeDeclare.getEmployeeName()) .setEmployeeName(employeeDeclare.getEmployeeName())
.setJobNum(employeeDeclare.getJobNum()) .setJobNum(employeeDeclare.getJobNum())
.setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType()).getDefaultLabel()) .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel())
.setCardNum(employeeDeclare.getCardNum()) .setCardNum(employeeDeclare.getCardNum())
.setDeclareStatus(declareStatusEnum) .setDeclareStatus(declareStatusEnum)
.setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel())); .setDeclareStatusDesc(declareStatusEnum == null ? "" : SalaryI18nUtil.getI18nLabel(declareStatusEnum.getLabelId(), declareStatusEnum.getDefaultLabel()));

View File

@ -2,6 +2,7 @@ package com.engine.salary.enums.employeedeclare;
import com.engine.salary.enums.BaseEnum; import com.engine.salary.enums.BaseEnum;
import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
/** /**
@ -44,7 +45,7 @@ public enum CardTypeEnum implements BaseEnum<Integer> {
return labelId; return labelId;
} }
public static CardTypeEnum getDefaultLabelByValue(Integer value) { public static CardTypeEnum getByValue(Integer value) {
for (CardTypeEnum e : CardTypeEnum.values()) { for (CardTypeEnum e : CardTypeEnum.values()) {
if (Objects.equals(e.getValue(), value)) { if (Objects.equals(e.getValue(), value)) {
return e; return e;
@ -52,4 +53,17 @@ public enum CardTypeEnum implements BaseEnum<Integer> {
} }
return RESIDENT_IDENTITY_CARDS; return RESIDENT_IDENTITY_CARDS;
} }
public static CardTypeEnum getByDefaultLabel(String defaultLabel) {
if (defaultLabel == null) {
return null;
}
CardTypeEnum[] enumAry = CardTypeEnum.values();
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
if (enumAry[i].getDefaultLabel().equals(defaultLabel)) {
return enumAry[i];
}
}
return null;
}
} }

View File

@ -3,6 +3,7 @@ package com.engine.salary.enums.employeedeclare;
import com.engine.salary.enums.BaseEnum; import com.engine.salary.enums.BaseEnum;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects;
/** /**
* 性别 * 性别
@ -56,4 +57,13 @@ public enum GenderEnum implements BaseEnum<Integer> {
} }
return null; return null;
} }
public static GenderEnum getDefaultLabelByValue(Integer value) {
for (GenderEnum e : GenderEnum.values()) {
if (Objects.equals(e.getValue(), value)) {
return e;
}
}
return MALE;
}
} }

View File

@ -16,10 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.OperateTypeEnum;
import com.engine.salary.enums.SalaryOnOffEnum; import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.enums.employeedeclare.CardTypeEnum; import com.engine.salary.enums.employeedeclare.*;
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
@ -101,14 +98,20 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
List<Object> row = Lists.newArrayList(); List<Object> row = Lists.newArrayList();
row.add(employeeDeclare.getJobNum()); row.add(employeeDeclare.getJobNum());
row.add(employeeDeclare.getEmployeeName()); row.add(employeeDeclare.getEmployeeName());
row.add(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel()); row.add(CardTypeEnum.getByValue(employeeDeclare.getCardType()).getDefaultLabel());
row.add(employeeDeclare.getCardNum()); row.add(employeeDeclare.getCardNum());
row.add(employeeDeclare.getNationality());
row.add(GenderEnum.getDefaultLabelByValue(employeeDeclare.getGender()).getDefaultLabel());
row.add(employeeDeclare.getBirthplace());
row.add(employeeDeclare.getBirthday());
row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel()); row.add(employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel());
row.add(employeeDeclare.getEmploymentFirstYear());
row.add(employeeDeclare.getMobile()); row.add(employeeDeclare.getMobile());
row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel());
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate()));
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate()));
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEntryDate()));
row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDepartureDate()));
row.add(employeeDeclare.getTaxReasons());
row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18); row.add(Objects.equals(employeeDeclare.getDisability(), 1) ? yesI18 : noI18);
row.add(employeeDeclare.getDisabilityCardNo()); row.add(employeeDeclare.getDisabilityCardNo());
row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18); row.add(Objects.equals(employeeDeclare.getMartyrDependents(), 1) ? yesI18 : noI18);
@ -211,7 +214,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
// 表头 // 表头
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0); List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
// 检查表头 // 检查表头
String isCorrectHeader = checkHeader(headers, headerList); String isCorrectHeader = checkHeader(headers, headerList);
if (isCorrectHeader != null) { if (isCorrectHeader != null) {
@ -235,7 +238,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO(); EmployeeDeclareExcelDTO employeeDeclareExcel = new EmployeeDeclareExcelDTO();
for (String dataKey : headerList) { for (String dataKey : headerList) {
String dataValue = Util.null2String(map.get(dataKey)); String dataValue = Util.null2String(map.get(dataKey));
if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel( 0, "工号"))) { if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "工号"))) {
if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) { if (StringUtils.equals(checkType, "jobNum") && StringUtils.isEmpty(dataValue)) {
isError = true; isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap(); Map<String, String> errorMessageMap = Maps.newHashMap();
@ -253,30 +256,66 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
employeeDeclareExcel.setEmployeeName(dataValue); employeeDeclareExcel.setEmployeeName(dataValue);
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件类型"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件类型"))) {
employeeDeclareExcel.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue().toString()); if (StringUtils.isEmpty(dataValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型不能为空"));
errorData.add(errorMessageMap);
} else {
CardTypeEnum cardTypeEnum = CardTypeEnum.getByDefaultLabel(dataValue);
if (cardTypeEnum == null) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件类型填写错误,只能填写居民身份证、外国护照"));
errorData.add(errorMessageMap);
} else {
employeeDeclareExcel.setCardType(cardTypeEnum.getValue());
}
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件号码"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "证件号码"))) {
if (StringUtils.isEmpty(dataValue)) { if (StringUtils.isEmpty(dataValue)) {
isError = true; isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap(); Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码不能为空")); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码不能为空"));
errorData.add(errorMessageMap); errorData.add(errorMessageMap);
} else if (!SalaryCardUtil.checkIdNum(dataValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "证件号码格式不正确"));
errorData.add(errorMessageMap);
} else { } else {
// 身份证号全部转为大写 // 身份证号全部转为大写
employeeDeclareExcel.setCardNum(dataValue.toUpperCase()); employeeDeclareExcel.setCardNum(dataValue.toUpperCase());
employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString()); // employeeDeclareExcel.setGender(SalaryCardUtil.judgeGender(dataValue).getValue().toString());
employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString()); // employeeDeclareExcel.setBirthday(SalaryCardUtil.judgeBirthday(dataValue).toString());
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "人员状态"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "国籍"))) {
employeeDeclareExcel.setNationality(dataValue);
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "性别"))) {
Integer gender = GenderEnum.getValueByDefaultLabel(dataValue);
if (gender == null) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "性别填写有误!"));
errorData.add(errorMessageMap);
} else {
employeeDeclareExcel.setGender(gender);
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生地"))) {
employeeDeclareExcel.setBirthplace(dataValue);
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "出生日期"))) {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0, 10);
}
if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
errorData.add(errorMessageMap);
} else {
employeeDeclareExcel.setBirthday(SalaryDateUtil.dateStrToLocalDate(dataValue));
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "状态"))) {
boolean legalDataValue = false; boolean legalDataValue = false;
for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) { for (EmploymentStatusEnum employmentStatusEnum : EmploymentStatusEnum.values()) {
if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) { if (StringUtils.equals(dataValue, employmentStatusEnum.getDefaultLabel())) {
legalDataValue = true; legalDataValue = true;
employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue().toString()); employeeDeclareExcel.setEmploymentStatus(employmentStatusEnum.getValue());
break; break;
} }
} }
@ -286,23 +325,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态只能填写正常或非正常")); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "人员状态只能填写正常或非正常"));
errorData.add(errorMessageMap); errorData.add(errorMessageMap);
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) {
boolean legalDataValue = false;
for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) {
if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) {
legalDataValue = true;
employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue().toString());
break;
}
}
if (!legalDataValue) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误"));
errorData.add(errorMessageMap);
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "入职年度就业情形"))) {
employeeDeclareExcel.setEmploymentFirstYear(dataValue);
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "手机号码"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "手机号码"))) {
if (StringUtils.isEmpty(dataValue)) { if (StringUtils.isEmpty(dataValue)) {
isError = true; isError = true;
@ -317,6 +339,21 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} else { } else {
employeeDeclareExcel.setMobile(dataValue); employeeDeclareExcel.setMobile(dataValue);
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型"))) {
boolean legalDataValue = false;
for (EmploymentTypeEnum employmentTypeEnum : EmploymentTypeEnum.values()) {
if (StringUtils.equals(dataValue, employmentTypeEnum.getDefaultLabel())) {
legalDataValue = true;
employeeDeclareExcel.setEmploymentType(employmentTypeEnum.getValue());
break;
}
}
if (!legalDataValue) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "任职受雇从业类型填写错误"));
errorData.add(errorMessageMap);
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "任职受雇从业日期"))) {
if (StringUtils.isEmpty(dataValue)) { if (StringUtils.isEmpty(dataValue)) {
if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) { if (!Objects.equals(employeeDeclareExcel.getEmploymentType(), EmploymentTypeEnum.OTHER.getValue().toString())) {
@ -327,7 +364,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} }
} else { } else {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0,10); dataValue = dataValue.substring(0, 10);
} }
if (!SalaryDateUtil.checkDay(dataValue)) { if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true; isError = true;
@ -335,7 +372,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
errorData.add(errorMessageMap); errorData.add(errorMessageMap);
} else { } else {
employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); employeeDeclareExcel.setEmploymentDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
} }
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "离职日期"))) {
@ -348,7 +385,7 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} }
} else { } else {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0,10); dataValue = dataValue.substring(0, 10);
} }
if (!SalaryDateUtil.checkDay(dataValue)) { if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true; isError = true;
@ -356,9 +393,35 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确")); errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
errorData.add(errorMessageMap); errorData.add(errorMessageMap);
} else { } else {
employeeDeclareExcel.setDismissDate(SalaryDateUtil.getFormatDate(SalaryDateUtil.dateStrToLocalDate(dataValue))); employeeDeclareExcel.setDismissDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
} }
} }
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "首次入境时间"))) {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0, 10);
}
if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
errorData.add(errorMessageMap);
} else {
employeeDeclareExcel.setEntryDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "预计离境时间"))) {
if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) {
dataValue = dataValue.substring(0, 10);
}
if (!SalaryDateUtil.checkDay(dataValue)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "日期格式不正确"));
errorData.add(errorMessageMap);
} else {
employeeDeclareExcel.setDepartureDate(SalaryDateUtil.dateStrToLocalDate(dataValue));
}
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "涉税事由"))) {
employeeDeclareExcel.setTaxReasons(dataValue);
} else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) { } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否残疾"))) {
if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) {
employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue()); employeeDeclareExcel.setDisability(SalaryOnOffEnum.ON.getValue());
@ -528,12 +591,12 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} }
public static String[] getNullPropertyNames (Object source) { public static String[] getNullPropertyNames(Object source) {
final BeanWrapper src = new BeanWrapperImpl(source); final BeanWrapper src = new BeanWrapperImpl(source);
PropertyDescriptor[] pds = src.getPropertyDescriptors(); PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<>(); Set<String> emptyNames = new HashSet<>();
for(PropertyDescriptor pd : pds) { for (PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName()); Object srcValue = src.getPropertyValue(pd.getName());
// 此处判断可根据需求修改 // 此处判断可根据需求修改
if (srcValue == null) { if (srcValue == null) {
@ -545,7 +608,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
} }
private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee, private EmployeeDeclarePO buildEmployeeDeclare(DataCollectionEmployee extEmployee, DataCollectionEmployee simpleEmployee,
EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId, EmployeeDeclareExcelDTO employeeDeclareExcel, Long taxAgentId,
Date taxCycle, Date now) { Date taxCycle, Date now) {
@ -1086,12 +1148,18 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee
headers.add(SalaryI18nUtil.getI18nLabel(111111, "姓名")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "姓名"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件类型")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件类型"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件号码")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "证件号码"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "人员状态")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "国籍"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "性别"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "入职年度就业情形")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生地"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "出生日期"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "状态"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "手机号码")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "手机号码"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业类型"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业日期")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "任职受雇从业日期"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "离职日期")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "离职日期"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "首次入境时间"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "预计离境时间"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "涉税事由"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否残疾")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否残疾"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "残疾证号")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "残疾证号"));
headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否烈属")); headers.add(SalaryI18nUtil.getI18nLabel(111111, "是否烈属"));

View File

@ -141,7 +141,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) { protected TempWrapper checkBeforeGetRequestIdResponse(TaxPaymentQueryParam param) {
TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param); TempWrapper tempWrapper = super.checkBeforeGetRequestIdResponse(param);
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth())); Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
requestParam.put("sblx", 1); requestParam.put("sblx", param.getReportType());
cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam); cancelWithholdingVoucher(tempWrapper.getApiConfigPO(), tempWrapper.getTaxDeclareRecord(), requestParam);
return tempWrapper; return tempWrapper;
} }

View File

@ -284,7 +284,7 @@ public class EmployeeDeclareWrapper extends Service {
.setNationality(employeeDeclare.getNationality()) .setNationality(employeeDeclare.getNationality())
.setEntryDate(employeeDeclare.getEntryDate()) .setEntryDate(employeeDeclare.getEntryDate())
.setDepartureDate(employeeDeclare.getDepartureDate()) .setDepartureDate(employeeDeclare.getDepartureDate())
.setCardType(CardTypeEnum.getDefaultLabelByValue(employeeDeclare.getCardType())) .setCardType(CardTypeEnum.getByValue(employeeDeclare.getCardType()))
.setCardNum(employeeDeclare.getCardNum()) .setCardNum(employeeDeclare.getCardNum())
.setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class)) .setGender(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class))
.setBirthday(employeeDeclare.getBirthday()) .setBirthday(employeeDeclare.getBirthday())