diff --git a/resource/WEB-INF/prop/hrmSalary.properties b/resource/WEB-INF/prop/hrmSalary.properties index 5aa04d438..22617b5cd 100644 --- a/resource/WEB-INF/prop/hrmSalary.properties +++ b/resource/WEB-INF/prop/hrmSalary.properties @@ -1,5 +1,5 @@ log=false defaultCloseNonStandard149=true AESEncryptScrect=990EB004A1C862721C1513AE90038C9E -version=3.0.6.2510.01.ts +version=3.0.7.2510.01.ts openFormulaForcedEditing=false \ No newline at end of file diff --git a/resource/sqlupgrade/DM/sql202601220103.sql b/resource/sqlupgrade/DM/sql202601220103.sql new file mode 100644 index 000000000..a4398f959 --- /dev/null +++ b/resource/sqlupgrade/DM/sql202601220103.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary number; +/ + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle DATE; +/ + diff --git a/resource/sqlupgrade/GS/sql202601220103.sql b/resource/sqlupgrade/GS/sql202601220103.sql new file mode 100644 index 000000000..a4398f959 --- /dev/null +++ b/resource/sqlupgrade/GS/sql202601220103.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary number; +/ + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle DATE; +/ + diff --git a/resource/sqlupgrade/JC/sql202601220103.sql b/resource/sqlupgrade/JC/sql202601220103.sql new file mode 100644 index 000000000..a4398f959 --- /dev/null +++ b/resource/sqlupgrade/JC/sql202601220103.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary number; +/ + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle DATE; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202601220103.sql b/resource/sqlupgrade/Mysql/sql202601220103.sql new file mode 100644 index 000000000..fca7fac22 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202601220103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_employee_declare +ADD COLUMN reissue_salary tinyint(0) NULL, +ADD COLUMN reissue_tax_cycle date NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202601220103.sql b/resource/sqlupgrade/Oracle/sql202601220103.sql new file mode 100644 index 000000000..c02ad090b --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202601220103.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary number +/ + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle DATE +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202601220103.sql b/resource/sqlupgrade/PG/sql202601220103.sql new file mode 100644 index 000000000..33a196a11 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202601220103.sql @@ -0,0 +1,3 @@ +alter table hrsa_employee_declare add reissue_salary int ; + +alter table hrsa_employee_declare add reissue_tax_cycle timestamp ; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202601220103.sql b/resource/sqlupgrade/SQLServer/sql202601220103.sql new file mode 100644 index 000000000..7d487a02f --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202601220103.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary int +GO + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle datetime +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202601220103.sql b/resource/sqlupgrade/ST/sql202601220103.sql new file mode 100644 index 000000000..a4398f959 --- /dev/null +++ b/resource/sqlupgrade/ST/sql202601220103.sql @@ -0,0 +1,6 @@ +ALTER TABLE hrsa_employee_declare ADD reissue_salary number; +/ + +ALTER TABLE hrsa_employee_declare ADD reissue_tax_cycle DATE; +/ + diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java index 1e3b7243c..575d48d78 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareBO.java @@ -29,6 +29,8 @@ public class EmployeeDeclareBO { .mobile(dto.getMobile()) .employmentDate(dto.getEmploymentDate()) .dismissDate(dto.getDismissDate()) + .reissueSalary(dto.getReissueSalary()) + .reissueTaxCycle(dto.getReissueTaxCycle()) .disability(dto.getDisability()) .disabilityCardNo(dto.getDisabilityCardNo()) .martyrDependents(dto.getMartyrDependents()) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java index d45c35b79..60bba2281 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -75,6 +75,11 @@ public class EmployeeDeclareRequest { employeeInfoMap.put("rzsgrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate())); // 离职日期 employeeInfoMap.put("lzrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate())); + //是否离职后补发工资 + SalaryOnOffEnum reissueSalary = employeeDeclare.getReissueSalary() == null ? SalaryOnOffEnum.OFF : SalaryEnumUtil.enumMatchByValue(employeeDeclare.getReissueSalary(), SalaryOnOffEnum.class); + employeeInfoMap.put("sflzhbfgz", (reissueSalary != null && reissueSalary == SalaryOnOffEnum.ON) ? "是" : ""); + //补发税款所属月份 + employeeInfoMap.put("bfskssyf", SalaryDateUtil.getFormatYYYYMM(employeeDeclare.getReissueTaxCycle())); // 是否残疾 SalaryOnOffEnum disability = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class); employeeInfoMap.put("sfcj", disability == null ? "" : disability.getDefaultLabel()); diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java index 0da6dea75..2d247d15c 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareExcelDTO.java @@ -126,6 +126,12 @@ public class EmployeeDeclareExcelDTO { @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") private Date dismissDate; + //是否离职后补发工资 + private Integer reissueSalary; + + //补发税期 + private Date reissueTaxCycle; + /** * 首次入境时间 */ diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java index 3abbb76d7..a1f0dfca5 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareFromDTO.java @@ -111,6 +111,15 @@ public class EmployeeDeclareFromDTO { @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date dismissDate; + // 是否离职后补发工资 + @TableTitle(title = "是否离职后补发工资", dataIndex = "reissueSalary", key = "reissueSalary") + private SalaryOnOffEnum reissueSalary; + + // 补发税款所属月份 + @TableTitle(title = "补发税款所属月份", dataIndex = "reissueTaxCycle", key = "reissueTaxCycle") + @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8") + private Date reissueTaxCycle; + // 首次入境时间 @TableTitle(title = "首次入境时间", dataIndex = "entryDate", key = "entryDate") diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java index 02df109dd..968816ea8 100644 --- a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -94,6 +94,18 @@ public class EmployeeDeclareSaveParam { //离职日期 private LocalDate dismissDate; + /** + * 是否离职后补发工资 + * 1是,0否。默认为0 + */ + private SalaryOnOffEnum reissueSalary; + + /** + * 补发税款所属月份 + * 当“是否离职后补发工资”选“是”时必填(格式YYYY-MM,需≥2019年9月,且不小于离职月份)。 + */ + private LocalDate reissueTaxCycle; + //首次入境时间 private LocalDate entryDate; diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java index b282f68a8..9c9f88001 100644 --- a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclarePO.java @@ -80,6 +80,7 @@ public class EmployeeDeclarePO { /** * 证件类型 + * * @see CardTypeEnum */ @ElogTransform(name = "证件类型") @@ -105,6 +106,7 @@ public class EmployeeDeclarePO { /** * 性别 + * * @see GenderEnum */ @ElogTransform(name = "性别") @@ -170,6 +172,21 @@ public class EmployeeDeclarePO { private Date dismissDate; + /** + * 是否离职后补发工资 + * 1是,0否。默认为0 + */ + private Integer reissueSalary; + + + /** + * 补发税款所属月份 + * 当“是否离职后补发工资”选“是”时必填(格式YYYY-MM,需≥2019年9月,且不小于离职月份)。 + */ + @ElogTransform(name = "补发税款所属月份") + private Date reissueTaxCycle; + + /** * 首次入境时间 */ @@ -298,6 +315,8 @@ public class EmployeeDeclarePO { ", employmentFirstYear='" + employmentFirstYear + '\'' + ", employmentDate=" + employmentDate + ", dismissDate=" + dismissDate + + ", reissueSalary=" + reissueSalary + + ", reissueTaxCycle=" + reissueTaxCycle + ", entryDate=" + entryDate + ", departureDate=" + departureDate + ", disability=" + disability + diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java index cf4d4ee9f..8f095c351 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -29,11 +29,11 @@ public class TaxDeclarationApiFlowStatisticDetailListDTO { private Long taxAgentId; @JsonIgnore - @TableTitle(title = "个税扣缴义务人",key = "taxAgentName",dataIndex = "taxAgentName") +// @TableTitle(title = "个税扣缴义务人",key = "taxAgentName",dataIndex = "taxAgentName") private String taxAgentName; //税款所属期 - @TableTitle(title = "",key = "",dataIndex = "") + @TableTitle(title = "税款所属期",key = "taxMonth",dataIndex = "taxMonth") private String taxMonth; //月使用流量数 diff --git a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml index 17229b2e9..3e8f2a2fc 100644 --- a/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml +++ b/src/com/engine/salary/mapper/archive/SalaryArchiveMapper.xml @@ -620,9 +620,7 @@ - - when id=#{item.id} then #{item.payEndDate} - + when id=#{item.id} then #{item.payEndDate} @@ -650,9 +648,7 @@ pay_start_date=#{item.payStartDate}, - pay_end_date=#{item.payEndDate}, - WHERE id = #{item.id} AND delete_type = 0 diff --git a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml index c5d985ffc..cbd4323bd 100644 --- a/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml +++ b/src/com/engine/salary/mapper/employeedeclare/EmployeeDeclareMapper.xml @@ -20,6 +20,8 @@ + + @@ -63,6 +65,8 @@ , t.employment_first_year , t.employment_date , t.dismiss_date + , t.reissue_salary + , t.reissue_tax_cycle , t.entry_date , t.departure_date , t.disability @@ -161,6 +165,12 @@ AND dismiss_date = #{dismissDate} + + AND reissue_salary = #{reissueSalary} + + + AND reissue_tax_cycle = #{reissueTaxCycle} + AND disability = #{disability} @@ -284,6 +294,12 @@ dismiss_date, + + reissue_salary, + + + reissue_tax_cycle, + entry_date, @@ -397,6 +413,12 @@ #{dismissDate}, + + #{reissueSalary}, + + + #{reissueTaxCycle}, + #{entryDate}, @@ -474,6 +496,8 @@ disability, disability_card_no, dismiss_date, + reissue_salary, + reissue_tax_cycle, entry_date, departure_date, employee_id, @@ -514,6 +538,8 @@ #{item.disability}, #{item.disabilityCardNo}, #{item.dismissDate}, + #{item.reissueSalary}, + #{item.reissueTaxCycle}, #{item.entryDate}, #{item.departureDate}, #{item.employeeId}, @@ -558,6 +584,8 @@ disability, disability_card_no, dismiss_date, + reissue_salary, + reissue_tax_cycle, entry_date, departure_date, employee_id, @@ -599,6 +627,8 @@ #{item.disability,jdbcType=INTEGER}, #{item.disabilityCardNo,jdbcType=VARCHAR}, #{item.dismissDate,jdbcType=DATE}, + #{item.reissueSalary,jdbcType=INTEGER}, + #{item.reissueTaxCycle,jdbcType=DATE}, #{item.entryDate,jdbcType=DATE}, #{item.departureDate,jdbcType=DATE}, #{item.employeeId,jdbcType=DOUBLE}, @@ -644,6 +674,8 @@ disability, disability_card_no, dismiss_date, + reissue_salary, + reissue_tax_cycle, entry_date, departure_date, employee_id, @@ -684,6 +716,8 @@ #{item.disability}, #{item.disabilityCardNo}, #{item.dismissDate}, + #{item.reissueSalary}, + #{item.reissueTaxCycle}, #{item.entryDate}, #{item.departureDate}, #{item.employeeId}, @@ -734,6 +768,8 @@ employment_first_year=#{employmentFirstYear}, employment_date=#{employmentDate}, dismiss_date=#{dismissDate}, + reissue_salary=#{reissueSalary}, + reissue_tax_cycle=#{reissueTaxCycle}, entry_date=#{entryDate}, departure_date=#{departureDate}, disability=#{disability}, @@ -811,6 +847,8 @@ employment_date=#{employmentDate}, dismiss_date=#{dismissDate}, + reissue_salary=#{reissueSalary}, + reissue_tax_cycle=#{reissueTaxCycle}, entry_date=#{entryDate}, departure_date=#{departureDate}, birthplace=#{birthplace}, diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 17377b967..cd6d26811 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -1196,7 +1196,7 @@ AND hed.tax_agent_id = #{param.taxAgentId} AND hed.tax_cycle = #{param.taxCycle} AND hed.successfully_declared = 1 - AND hed.employment_status = 0 + AND (hed.dismiss_date is null OR hed.dismiss_date = ]]> #{param.taxCycle} OR hed.reissue_tax_cycle = #{param.taxCycle}) AND hed.declare_status IN (4) ) @@ -1214,7 +1214,7 @@ AND hed.tax_agent_id = #{param.taxAgentId} AND hed.tax_cycle = #{param.taxCycle} AND hed.successfully_declared = 1 - AND hed.employment_status = 0 + AND (hed.dismiss_date is null OR hed.dismiss_date = ]]> #{param.taxCycle} OR hed.reissue_tax_cycle = #{param.taxCycle}) AND hed.declare_status IN (4) ) diff --git a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml index 5eba618cb..7744bcbad 100644 --- a/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml +++ b/src/com/engine/salary/mapper/taxdeclaration/TaxDeclarationValueMapper.xml @@ -411,7 +411,7 @@ AND hed.tax_agent_id = #{param.taxAgentId} AND hed.tax_cycle = #{param.taxCycle} AND hed.successfully_declared = 1 - AND hed.employment_status = 0 + AND (hed.dismiss_date is null OR hed.dismiss_date = ]]> #{param.taxCycle} OR hed.reissue_tax_cycle = #{param.taxCycle}) AND hed.declare_status IN (4) ) @@ -432,7 +432,7 @@ AND tax_agent_id = #{param.taxAgentId} AND tax_cycle = #{param.taxCycle} AND successfully_declared = 1 - AND employment_status = 0 + AND (dismiss_date is null OR dismiss_date = ]]> #{param.taxCycle} OR reissue_tax_cycle = #{param.taxCycle}) AND employee_id NOT IN ( SELECT employee_id FROM hrsa_tax_declaration_value htdv diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index 715f4d428..60b15cbd0 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -194,4 +194,5 @@ public interface EmployeeDeclareService{ void batchInsert(List insertList); + List listReissueEmp(Long taxAgentId, Date taxCycle); } diff --git a/src/com/engine/salary/service/impl/AttendQuoteFieldSettingServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteFieldSettingServiceImpl.java index dd8eef639..a6b07bbaf 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteFieldSettingServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteFieldSettingServiceImpl.java @@ -57,7 +57,7 @@ public class AttendQuoteFieldSettingServiceImpl extends Service implements Atten @Override public List list(AttendQuoteFieldSettingQueryParam queryParam) { //同步字段 - getAttendQuoteFieldService(user).syncAttendFields(); +// getAttendQuoteFieldService(user).syncAttendFields(); // 获取字段设置 List list = biz.getAttendQuoteFieldSetting(queryParam.getSourceType()); diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java index ae2bb9444..3f851c9ef 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareExcelServiceImpl.java @@ -109,6 +109,8 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee row.add(employmentTypeEnum == null ? EmploymentTypeEnum.EMPLOYEE.getDefaultLabel() : employmentTypeEnum.getDefaultLabel()); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEmploymentDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDismissDate())); + row.add(Objects.equals(employeeDeclare.getReissueSalary(), 1) ? yesI18 : noI18); + row.add(SalaryDateUtil.getFormatYearMonth(employeeDeclare.getReissueTaxCycle())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getEntryDate())); row.add(SalaryDateUtil.getFormatDate(employeeDeclare.getDepartureDate())); row.add(employeeDeclare.getTaxReasons()); @@ -139,7 +141,6 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee InputStream fileInputStream = null; try { - fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); @@ -396,6 +397,38 @@ public class EmployeeDeclareExcelServiceImpl extends Service implements Employee employeeDeclareExcel.setDismissDate(SalaryDateUtil.dateStrToLocalDate(dataValue)); } } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "是否离职后补发工资"))) { + if (StringUtils.equals(dataValue, SalaryOnOffEnum.ON.getDefaultLabel())) { + employeeDeclareExcel.setReissueSalary(SalaryOnOffEnum.ON.getValue()); + } else if (StringUtils.equals(dataValue, SalaryOnOffEnum.OFF.getDefaultLabel())) { + employeeDeclareExcel.setReissueSalary(SalaryOnOffEnum.OFF.getValue()); + } else { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否离职后补发工资只能填写是与否")); + errorData.add(errorMessageMap); + } + } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "补发税款所属月份"))) { + if (StringUtils.isEmpty(dataValue)) { + if (Objects.equals(employeeDeclareExcel.getReissueSalary(), SalaryOnOffEnum.ON.getValue())) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "是否离职后补发工资为是时,补发税款所属月份必填")); + errorData.add(errorMessageMap); + } + } else { + if (StringUtils.isNotBlank(dataValue) && dataValue.length() >= 10) { + dataValue = dataValue.substring(0, 7); + } + if (SalaryDateUtil.parse(dataValue, SalaryDateUtil.MONTH_FORMATTER_PATTERN) == null) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(0, "补发税款所属月份不正确,正确示例:2025-01")); + errorData.add(errorMessageMap); + } else { + employeeDeclareExcel.setReissueTaxCycle(SalaryDateUtil.yyyyMMDateStrToLocalDate(dataValue)); + } + } } else if (StringUtils.equals(dataKey, SalaryI18nUtil.getI18nLabel(0, "首次入境时间"))) { if (StringUtils.isNotBlank(dataValue)) { if (dataValue.length() >= 10) { @@ -1185,6 +1218,8 @@ 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, "涉税事由")); diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 7b05f29e8..e0da1fdfc 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -225,6 +225,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla employeeDeclare.setEmploymentFirstYear(""); employeeDeclare.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate())); employeeDeclare.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate())); + employeeDeclare.setReissueSalary(saveParam.getReissueSalary().getValue()); + employeeDeclare.setReissueTaxCycle(SalaryDateUtil.localDateToDate(saveParam.getReissueTaxCycle())); employeeDeclare.setEntryDate(SalaryDateUtil.localDateToDate(saveParam.getEntryDate())); employeeDeclare.setDepartureDate(SalaryDateUtil.localDateToDate(saveParam.getDepartureDate())); employeeDeclare.setDisability(saveParam.getDisability().getValue()); @@ -666,9 +668,13 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class); if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) { log.error("服务异常:" + res); + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常")); } if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) { + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg()); } DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody(); @@ -766,4 +772,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla List> partition = Lists.partition(insertList, 50); partition.forEach(getEmployeeDeclareMapper()::batchInsert); } + + @Override + public List listReissueEmp(Long taxAgentId, Date taxCycle) { + return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder() + .reissueTaxCycle(taxCycle) + .taxAgentId(taxAgentId) + .build()); + } } diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index bb24354e2..79ae11524 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -387,11 +387,15 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); - socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if(socialMap!=null){ + socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); - socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if(socialComMap!=null){ + socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } List socialIds = new ArrayList<>(); socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet()); socialIds.addAll(socialComMap == null ? Collections.emptyList() : socialMap.keySet()); @@ -434,12 +438,16 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { && (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); - socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if (socialMap != null) { + socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); - socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if (socialComMap != null) { + socialComMap = socialComMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } List socialIds = new ArrayList<>(); socialIds.addAll(socialMap == null ? Collections.emptyList() : socialMap.keySet()); socialIds.addAll(socialComMap == null ? Collections.emptyList() :socialComMap.keySet()); @@ -482,8 +490,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()))) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); - socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if(socialMap!=null){ + socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + } Map socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); if(socialComMap !=null){ socialComMap = socialComMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index fec3890f1..304b2a206 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -130,6 +130,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct return ServiceUtil.getService(SalaryAcctSobConfigServiceImpl.class, user); } + private EmployeeDeclareService getEmployeeDeclareService(User user) { + return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user); + } + private boolean isRealOrg = "1".equals(getSalaryCacheService(user).get(REPORT_ORGANIZATIN_TYPE)); @@ -870,6 +874,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct @Override public PageInfo listPage4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { + List list = listPage4NotDeclare(queryParam); + return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AbnormalEmployeeListDTO.class); + } + + List listPage4NotDeclare(AbnormalEmployeeListQueryParam queryParam) { Long recordId = queryParam.getRecordId(); SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); @@ -878,19 +887,13 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct queryParam.setTaxAgentId(sobPO.getTaxAgentId()); List list = getSalaryAcctEmployeeMapper().listPage4NotDeclareByParam(queryParam); - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AbnormalEmployeeListDTO.class); + return list; } @Override public int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { - - Long recordId = queryParam.getRecordId(); - SalaryAcctRecordPO recordPO = getSalaryAcctRecordService(user).getById(recordId); - SalarySobPO sobPO = getSalarySobService(user).getById(recordPO.getSalarySobId()); - queryParam.setTaxCycle(recordPO.getTaxCycle()); - queryParam.setTaxAgentId(sobPO.getTaxAgentId()); - - return getSalaryAcctEmployeeMapper().countNotDeclareByParam(queryParam); + List list = listPage4NotDeclare(queryParam); + return list.size(); } @Override diff --git a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java index d2ed11f26..3367bc5e1 100644 --- a/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclareEmployeeServiceImpl.java @@ -64,7 +64,9 @@ public class TaxDeclareEmployeeServiceImpl extends Service implements TaxDeclare @Override public List list4NotDeclareByParam(AbnormalEmployeeListQueryParam queryParam) { - return getTaxDeclarationValueMapper().list4NotDeclareByParam(queryParam); + //根据正常/非正常状态和离职日期查询是否有未报送的人员 + List list = getTaxDeclarationValueMapper().list4NotDeclareByParam(queryParam); + return list; } @Override diff --git a/src/com/engine/salary/util/SalaryDateUtil.java b/src/com/engine/salary/util/SalaryDateUtil.java index db5350ac8..a76c5f9ae 100644 --- a/src/com/engine/salary/util/SalaryDateUtil.java +++ b/src/com/engine/salary/util/SalaryDateUtil.java @@ -248,7 +248,7 @@ public class SalaryDateUtil { Calendar c = Calendar.getInstance(); c.setTime(localDate); int year = c.get(Calendar.YEAR); - return year ; + return year; } public static LocalDateRange localDate2Range(Date localDate) { @@ -278,6 +278,7 @@ public class SalaryDateUtil { cal.set(Calendar.DAY_OF_MONTH, last); return cal.getTime(); } + public static Date getFirstDayDateOfMonthWithMinutesAndSeconds(final Date date) { final Calendar cal = Calendar.getInstance(); cal.setTime(date); @@ -315,8 +316,6 @@ public class SalaryDateUtil { } - - public static String getMonthBegin(String specifiedDay) { int year; int month; @@ -545,6 +544,15 @@ public class SalaryDateUtil { return localDate; } + public static Date yyyyMMDateStrToLocalDate(String date) { + if (date.contains("/")) { + date = date + "/01"; + } else if (date.contains("-")) { + date = date + "-01"; + } + return dateStrToLocalDate(date); + } + public static Date dateStrToLocalTime(String date) { Date localDate = null; try { @@ -571,7 +579,7 @@ public class SalaryDateUtil { if (StringUtils.isNotBlank(startMonth)) { startMonth = startMonth + "-01"; Date socialStartDate = SalaryDateUtil.dateStrToLocalDate(startMonth); - if(socialStartDate == null) { + if (socialStartDate == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "年月解析异常,请检查档案中相关数据设置") + ":" + startMonth.substring(0, startMonth.length() - 3)); } else if (billMonthDate.before(socialStartDate)) { inDataRange = false; @@ -580,7 +588,7 @@ public class SalaryDateUtil { if (StringUtils.isNotBlank(endMonth)) { endMonth = endMonth + "-01"; Date socialEndDate = SalaryDateUtil.dateStrToLocalDate(endMonth); - if(socialEndDate == null) { + if (socialEndDate == null) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "年月解析异常,请检查档案中相关数据设置") + ":" + endMonth.substring(0, endMonth.length() - 3)); } else if (billMonthDate.after(socialEndDate)) { inDataRange = false; @@ -591,9 +599,10 @@ public class SalaryDateUtil { /** * 转换时间对象 - * @see SalaryDateUtil#toDate(LocalDateTime, String) + * * @param dateTime LocalDateTime * @return Date + * @see SalaryDateUtil#toDate(LocalDateTime, String) */ public static Date toDate(LocalDateTime dateTime) { return toDate(dateTime, null); @@ -602,8 +611,9 @@ public class SalaryDateUtil { /** * 转换时间对象 + * * @param dateTime LocalDateTime - * @param offset 时区,e.g. +8 + * @param offset 时区,e.g. +8 * @return Date */ public static Date toDate(LocalDateTime dateTime, String offset) { diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 55f7a6414..2385c2bba 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -285,6 +285,8 @@ public class EmployeeDeclareWrapper extends Service { .setEmploymentType(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class)) .setEmploymentDate(employeeDeclare.getEmploymentDate()) .setDismissDate(employeeDeclare.getDismissDate()) + .setReissueSalary(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getReissueSalary(), SalaryOnOffEnum.class)) + .setReissueTaxCycle(employeeDeclare.getReissueTaxCycle()) .setDisability(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class)) .setDisabilityCardNo(employeeDeclare.getDisabilityCardNo()) .setLonelyOld(SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class)) diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java index 4129ea15e..4f5026cd2 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowStatisticWrapper.java @@ -9,8 +9,6 @@ import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowTotalDTO; import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowMonthQueryParam; import com.engine.salary.service.TaxDeclarationApiFlowStatisticService; import com.engine.salary.service.impl.TaxDeclarationApiFlowStatisticServiceImpl; -import com.engine.salary.util.SalaryAssert; -import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -47,13 +45,13 @@ public class TaxDeclarationApiFlowStatisticWrapper extends Service { public XSSFWorkbook exportFlowStatistics() { List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatistic(); - SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatistics(dtoList); } public XSSFWorkbook exportFlowStatisticsDetail(TaxDeclarationApiFlowMonthQueryParam queryParam) { List dtoList = getTaxDeclarationApiFlowStatisticService(user).listFlowStatisticDetail(queryParam); - SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); +// SalaryAssert.notEmpty(dtoList, SalaryI18nUtil.getI18nLabel(95795, "数据不存在")); return getTaxDeclarationApiFlowStatisticService(user).exportFlowStatisticsDetail(dtoList); }