From b63e4250beb2624af047d1cd7ddfe113abe7cb92 Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Mon, 9 Oct 2023 14:05:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=89=BE=E5=BF=97--=E8=96=AA=E8=B5=84=E6=A1=A3?= =?UTF-8?q?=E6=A1=88-=E5=BE=80=E6=9C=9F=E7=B4=AF=E8=AE=A1=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/datacollection/AddUpSituation.java | 12 +- .../datacollection/dto/AddUpSituationDTO.java | 32 ++--- .../salary/service/AddUpSituationService.java | 2 + .../impl/AddUpSituationServiceImpl.java | 111 ++++++++++++++++-- .../salary/web/AddUpSituationController.java | 13 ++ .../salary/wrapper/AddUpSituationWrapper.java | 11 ++ 6 files changed, 146 insertions(+), 35 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/AddUpSituation.java b/src/com/engine/salary/entity/datacollection/AddUpSituation.java index 5771dabf0..9adf2d116 100644 --- a/src/com/engine/salary/entity/datacollection/AddUpSituation.java +++ b/src/com/engine/salary/entity/datacollection/AddUpSituation.java @@ -71,16 +71,16 @@ public class AddUpSituation { private String addUpSubtraction; /** - * 累计社保个人合计 + * 累计社保个人合计---> 累计专项扣除 */ - @SalaryFormulaVar(defaultLabel = "累计社保个人合计", labelId = 86710, dataType = "number") + @SalaryFormulaVar(defaultLabel = "累计专项扣除", labelId = 86710, dataType = "number") @Encrypt private String addUpSocialSecurityTotal; /** * 累计公积金个人合计 */ - @SalaryFormulaVar(defaultLabel = "累计公积金个人合计", labelId = 86709, dataType = "number") +// @SalaryFormulaVar(defaultLabel = "累计公积金个人合计", labelId = 86709, dataType = "number") @Encrypt private String addUpAccumulationFundTotal; @@ -158,7 +158,7 @@ public class AddUpSituation { /** * 累计其他免税扣除 */ - @SalaryFormulaVar(defaultLabel = "累计其他免税扣除", labelId = 93902, dataType = "number") + @SalaryFormulaVar(defaultLabel = "累计其他扣除", labelId = 93902, dataType = "number") @Encrypt private String addUpOtherDeduction; @@ -172,7 +172,7 @@ public class AddUpSituation { /** * 累计准予扣除的捐赠额 */ - @SalaryFormulaVar(defaultLabel = "累计准予扣除的捐赠额", labelId = 86703, dataType = "number") + @SalaryFormulaVar(defaultLabel = "累计准予扣除的捐赠", labelId = 86703, dataType = "number") @Encrypt private String addUpAllowedDonation; @@ -186,7 +186,7 @@ public class AddUpSituation { /** * 累计已预扣预缴税额 */ - @SalaryFormulaVar(defaultLabel = "累计已预扣预缴税额", labelId = 86702, dataType = "number") + @SalaryFormulaVar(defaultLabel = "已缴税额", labelId = 86702, dataType = "number") @Encrypt private String addUpAdvanceTax; diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java index 0d31ad308..c241a7cdd 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationDTO.java @@ -90,15 +90,15 @@ public class AddUpSituationDTO { private String addUpSubtraction; //累计社保个人合计 - @TableTitle(title = "累计社保个人合计", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") + @TableTitle(title = "累计专项扣除", dataIndex = "addUpSocialSecurityTotal", key = "addUpSocialSecurityTotal") @ExcelProperty(index = 9) @Encrypt private String addUpSocialSecurityTotal; //累计公积金个人合计 - @TableTitle(title = "累计公积金个人合计", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") - @ExcelProperty(index = 10) - @Encrypt +// @TableTitle(title = "累计公积金个人合计", dataIndex = "addUpAccumulationFundTotal", key = "addUpAccumulationFundTotal") +// @ExcelProperty(index = 10) +// @Encrypt private String addUpAccumulationFundTotal; //累计子女教育 @@ -133,37 +133,37 @@ public class AddUpSituationDTO { //累计企业(职业)年金及其他福利 @TableTitle(title = "累计企业(职业)年金及其他福利", dataIndex = "addUpEnterpriseAndOther", key = "addUpEnterpriseAndOther") - @ExcelProperty(index = 11) + @ExcelProperty(index = 10) @Encrypt private String addUpEnterpriseAndOther; //累计其他扣除 - @TableTitle(title = "累计其他免税扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") - @ExcelProperty(index = 12) + @TableTitle(title = "累计其他扣除", dataIndex = "addUpOtherDeduction", key = "addUpOtherDeduction") + @ExcelProperty(index = 11) @Encrypt private String addUpOtherDeduction; //累计免税收入 @TableTitle(title = "累计免税收入", dataIndex = "addUpTaxExemptIncome", key = "addUpTaxExemptIncome") - @ExcelProperty(index = 13) + @ExcelProperty(index = 12) @Encrypt private String addUpTaxExemptIncome; //累计准予扣除的捐赠额 - @TableTitle(title = "累计准予扣除的捐赠额", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") - @ExcelProperty(index = 14) + @TableTitle(title = "累计准予扣除的捐赠", dataIndex = "addUpAllowedDonation", key = "addUpAllowedDonation") + @ExcelProperty(index = 13) @Encrypt private String addUpAllowedDonation; //累计减免税额 @TableTitle(title = "累计减免税额", dataIndex = "addUpTaxSavings", key = "addUpTaxSavings") - @ExcelProperty(index = 15) + @ExcelProperty(index = 14) @Encrypt private String addUpTaxSavings; //累计已预扣预缴税额 - @TableTitle(title = "累计已预扣预缴税额", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") - @ExcelProperty(index = 16) + @TableTitle(title = "已缴税额", dataIndex = "addUpAdvanceTax", key = "addUpAdvanceTax") + @ExcelProperty(index = 15) @Encrypt private String addUpAdvanceTax; @@ -180,7 +180,7 @@ public class AddUpSituationDTO { /** * 实际累计已预扣预缴税额 */ - @ExcelProperty(index = 17) + @ExcelProperty(index = 16) @TableTitle(title = "实际累计已预扣预缴税额", dataIndex = "actualAddUpAdvanceTax", key = "actualAddUpAdvanceTax") @Encrypt private String actualAddUpAdvanceTax; @@ -188,7 +188,7 @@ public class AddUpSituationDTO { /** * 个税调差 */ - @ExcelProperty(index = 18) + @ExcelProperty(index = 17) @TableTitle(title = "个税调差", dataIndex = "taxAdjustment", key = "taxAdjustment") @Encrypt private String taxAdjustment; @@ -196,7 +196,7 @@ public class AddUpSituationDTO { /** * 累计应纳税所得额 */ - @ExcelProperty(index = 19) + @ExcelProperty(index = 18) @TableTitle(title = "累计应纳税所得额", dataIndex = "addUpTaxableIncome", key = "addUpTaxableIncome") @Encrypt private String addUpTaxableIncome; diff --git a/src/com/engine/salary/service/AddUpSituationService.java b/src/com/engine/salary/service/AddUpSituationService.java index ccfc26231..04acd9e25 100644 --- a/src/com/engine/salary/service/AddUpSituationService.java +++ b/src/com/engine/salary/service/AddUpSituationService.java @@ -120,4 +120,6 @@ public interface AddUpSituationService { * @return */ Map onlineRequest(AddUpDeductionMonthTaxAgentParam param); + + String azChangeAddUpSituationItemName(); } diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 9c360d55c..0ceec9f60 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -22,6 +22,8 @@ import com.engine.salary.entity.datacollection.response.GetCompanyIncomesRespons import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; +import com.engine.salary.entity.salaryformula.po.FormulaPO; +import com.engine.salary.entity.salaryformula.po.FormulaVar; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO; @@ -115,6 +117,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation return MapperProxyFactory.getProxy(EmployeeDeclareMapper.class); } + private SalaryFormulaService getSalaryFormulaService(User user) { + return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user); + } + @Override public Map getSearchCondition() { Map apidatas = new HashMap(); @@ -298,8 +304,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation long employeeId = user.getUID(); // excel标题 final List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "累计收入额", "累计减除费用", - "累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", - "累计已预扣预缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); + "累计专项扣除", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠", "累计减免税额", + "已缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -328,7 +334,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation cellList.add(Util.null2String(dto.getAddUpIncome())); cellList.add(Util.null2String(dto.getAddUpSubtraction())); cellList.add(Util.null2String(dto.getAddUpSocialSecurityTotal())); - cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); +// cellList.add(Util.null2String(dto.getAddUpAccumulationFundTotal())); cellList.add(Util.null2String(dto.getAddUpEnterpriseAndOther())); cellList.add(Util.null2String(dto.getAddUpOtherDeduction())); cellList.add(Util.null2String(dto.getAddUpTaxExemptIncome())); @@ -359,8 +365,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation long employeeId = user.getUID(); //excel标题 List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", - "累计社保个人合计", "累计公积金个人合计", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠额", "累计减免税额", - "累计已预扣预缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); + "累计专项扣除", "累计企业(职业)年金及其他福利", "累计其他扣除", "累计免税收入", "累计准予扣除的捐赠", "累计减免税额", + "已缴税额", "实际累计已预扣预缴税额", "个税调差", "累计应纳税所得额"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -458,14 +464,14 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SalaryI18nUtil.getI18nLabel(86319, "入职日期"), SalaryI18nUtil.getI18nLabel(86712, "累计收入额"), SalaryI18nUtil.getI18nLabel(86711, "累计减除费用"), - SalaryI18nUtil.getI18nLabel(86710, "累计社保个人合计"), - SalaryI18nUtil.getI18nLabel(86709, "累计公积金个人合计"), + SalaryI18nUtil.getI18nLabel(86710, "累计专项扣除"), +// SalaryI18nUtil.getI18nLabel(86709, "累计公积金个人合计"), SalaryI18nUtil.getI18nLabel(90567, "累计企业(职业)年金及其他福利"), - SalaryI18nUtil.getI18nLabel(93902, "累计其他免税扣除"), + SalaryI18nUtil.getI18nLabel(93902, "累计其他扣除"), SalaryI18nUtil.getI18nLabel(86704, "累计免税收入"), - SalaryI18nUtil.getI18nLabel(86703, "累计准予扣除的捐赠额"), + SalaryI18nUtil.getI18nLabel(86703, "累计准予扣除的捐赠"), SalaryI18nUtil.getI18nLabel(105478, "累计减免税额"), - SalaryI18nUtil.getI18nLabel(86702, "累计已预扣预缴税额"), + SalaryI18nUtil.getI18nLabel(86702, "已缴税额"), SalaryI18nUtil.getI18nLabel(86702, "实际累计已预扣预缴税额"), SalaryI18nUtil.getI18nLabel(86702, "个税调差"), SalaryI18nUtil.getI18nLabel(86702, "累计应纳税所得额") @@ -524,7 +530,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation excelComments.add(new ExcelComment(16, 0, 21, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); excelComments.add(new ExcelComment(17, 0, 22, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); excelComments.add(new ExcelComment(18, 0, 23, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); - excelComments.add(new ExcelComment(19, 0, 24, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); +// excelComments.add(new ExcelComment(19, 0, 24, 2, SalaryI18nUtil.getI18nLabel(100344, "输入数字"))); return ExcelUtil.genWorkbookV2(rows, sheetName, excelComments); } @@ -559,7 +565,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.valueOf(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 20, "template.xlsx"); + List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 19, "template.xlsx"); apidatas.put("preview", excelDates); } finally { IOUtils.closeQuietly(fileInputStream); @@ -613,7 +619,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 20, "template.xlsx"); + List excelDates = ExcelParseHelper.parse2Map(fileInputStream, AddUpSituationDTO.class, 0, 1, 19, "template.xlsx"); int total = excelDates.size(); int index = 0; @@ -1338,4 +1344,83 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation private List getEmployeeDeclarePOList(Collection taxAgentIds, Date declareMonth) { return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().declareStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue()).taxCycle(declareMonth).taxAgentIds(taxAgentIds).build()); } + + /** + * ①累计社保个人合计、累计公积金个人合计 2列合并为 累计专项扣除 + * ②累计其他免税扣除 改为 累计其他扣除 + * ③累计准予扣除的捐赠额 改为 累计准予扣除的捐赠 + * ④计已预扣预缴税额 改为 已缴税额 + * @return + */ + @Override + public String azChangeAddUpSituationItemName() { + // ①累计社保个人合计、累计公积金个人合计 2列合并为 累计专项扣除 + String oldName = "累计社保个人合计"; + String newName = "累计专项扣除"; + String fieldNamePrefix = "{往期累计情况.%s}"; + String code = "addUpSituation_addUpSocialSecurityTotal"; + changeItemName(oldName, newName, fieldNamePrefix, code); + + // ②累计其他免税扣除 改为 累计其他扣除 + oldName = "累计其他免税扣除"; + newName = "累计其他扣除"; + fieldNamePrefix = "{往期累计情况.%s}"; + code = "addUpSituation_addUpOtherDeduction"; + changeItemName(oldName, newName, fieldNamePrefix, code); + + + // ③累计准予扣除的捐赠额 改为 累计准予扣除的捐赠 + oldName = "累计准予扣除的捐赠额"; + newName = "累计准予扣除的捐赠"; + fieldNamePrefix = "{往期累计情况.%s}"; + code = "addUpSituation_addUpAllowedDonation"; + changeItemName(oldName, newName, fieldNamePrefix, code); + + + // ④累计已预扣预缴税额 改为 已缴税额 + oldName = "累计已预扣预缴税额"; + newName = "已缴税额"; + fieldNamePrefix = "{往期累计情况.%s}"; + code = "addUpSituation_addUpAdvanceTax"; + changeItemName(oldName, newName, fieldNamePrefix, code); + + + return "true"; + } + + private void changeItemName(String oldName, String newName, String fieldNamePrefix, String code) { +// // 改名后更新公式 +// String oldName = "累计社保个人合计"; +// String newName = "累计专项扣除"; +// +// // 薪资项目 +// String fieldNamePrefix = "{往期累计情况.%s}"; +// +// // 往期累计.累计社保个人合计 +// String code = "addUpSituation_addUpSocialSecurityTotal"; + Date now = new Date(); + List formulaVars = getSalaryFormulaService(user).listByCode(code); + formulaVars.forEach(v -> { + FormulaVar formulaVar = FormulaVar.builder() + .id(v.getId()) + .name(newName) + .fieldName(String.format(fieldNamePrefix, newName)) + .updateTime(now) + .build(); + getSalaryFormulaService(user).updateVar(formulaVar); + }); + + List formulaIds = SalaryEntityUtil.properties(formulaVars, FormulaVar::getFormulaId, Collectors.toList()); + List formulaPOS = getSalaryFormulaService(user).listByIds(formulaIds); + formulaPOS.forEach(f -> { + String formula = f.getFormula(); + formula = formula.replace(String.format(fieldNamePrefix, oldName), String.format(fieldNamePrefix, newName)); + FormulaPO formulaPO = FormulaPO.builder() + .id(f.getId()) + .formula(formula) + .updateTime(now) + .build(); + getSalaryFormulaService(user).update(formulaPO); + }); + } } diff --git a/src/com/engine/salary/web/AddUpSituationController.java b/src/com/engine/salary/web/AddUpSituationController.java index 1823c81b3..6ca707a5c 100644 --- a/src/com/engine/salary/web/AddUpSituationController.java +++ b/src/com/engine/salary/web/AddUpSituationController.java @@ -367,4 +367,17 @@ public class AddUpSituationController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>(user).run(getAddUpSituationWrapper(user)::onlineRequest, param); } + + + /** + * 艾志修改往期累计项目名称 + + */ + @GET + @Path("/azChangeAddUpSituationItemName") + @Produces(MediaType.APPLICATION_JSON) + public String azChangeAddUpItemName(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getAddUpSituationWrapper(user)::azChangeAddUpSituationItemName); + } } diff --git a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java index 015dcb91f..56b14c137 100644 --- a/src/com/engine/salary/wrapper/AddUpSituationWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpSituationWrapper.java @@ -170,4 +170,15 @@ public class AddUpSituationWrapper extends Service { public Map onlineRequest(AddUpDeductionMonthTaxAgentParam param) { return getAddUpSituationService(user).onlineRequest(param); } + + /** + * ①累计社保个人合计、累计公积金个人合计 2列合并为 累计专项扣除 + * ①累计其他免税扣除 改为 累计其他扣除 + * ②累计准予扣除的捐赠额 改为 累计准予扣除的捐赠 + * ③累计已预扣预缴税额 改为 已缴税额 + * @return + */ + public String azChangeAddUpSituationItemName() { + return getAddUpSituationService(user).azChangeAddUpSituationItemName(); + } }