From 647dd80a20f669b1c9960a674e54c175c7110550 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 11 Nov 2022 08:56:05 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/SIArchiveImportActionParam.java | 39 +++++++++++ .../siArchives/SIArchiveActionAPI.java | 64 +++++++++++++++++++ .../salary/service/SISchemeService.java | 5 ++ .../service/impl/SISchemeServiceImpl.java | 30 ++++++++- 4 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 src/com/engine/salary/entity/siarchives/param/SIArchiveImportActionParam.java create mode 100644 src/com/engine/salary/process/siArchives/SIArchiveActionAPI.java diff --git a/src/com/engine/salary/entity/siarchives/param/SIArchiveImportActionParam.java b/src/com/engine/salary/entity/siarchives/param/SIArchiveImportActionParam.java new file mode 100644 index 000000000..33ea12705 --- /dev/null +++ b/src/com/engine/salary/entity/siarchives/param/SIArchiveImportActionParam.java @@ -0,0 +1,39 @@ +package com.engine.salary.entity.siarchives.param; + +import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum; +import com.engine.salary.enums.siaccount.EmployeeStatusEnum; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; +import java.util.Map; + +/** + * @Author: sy + * @Description: 社保福利档案导入处理参数(action使用) + * @Date: 2022/11/10 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class SIArchiveImportActionParam { + + /** + * 导入类型 + * + * @see EmployeeStatusEnum + */ + + String runStatus; + + /** + * 导入数据 + * + */ + List> importDatas; + + private boolean addData; +} diff --git a/src/com/engine/salary/process/siArchives/SIArchiveActionAPI.java b/src/com/engine/salary/process/siArchives/SIArchiveActionAPI.java new file mode 100644 index 000000000..529f47139 --- /dev/null +++ b/src/com/engine/salary/process/siArchives/SIArchiveActionAPI.java @@ -0,0 +1,64 @@ +package com.engine.salary.process.siArchives; + +import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.siarchives.param.SIArchiveImportActionParam; +import com.engine.salary.enums.siaccount.EmployeeStatusEnum; +import com.engine.salary.service.SISchemeService; +import com.engine.salary.service.impl.SISchemeServiceImpl; +import com.engine.salary.util.ResponseResult; +import io.swagger.v3.oas.annotations.parameters.RequestBody; +import lombok.extern.slf4j.Slf4j; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.Map; + +/** + * @Author: sy + * @Description: 社保福利档案流程使用 + * @Date: 2022/11/10 + **/ +@Slf4j +public class SIArchiveActionAPI { + + private SISchemeService getService(User user) { + return ServiceUtil.getService(SISchemeServiceImpl.class,user); + } + + /** + * 前置校验、列表添加接口 + * @param importData + * @return + */ + @POST + @Path("/checkImportSIArchiveListAdd") + @Produces(MediaType.APPLICATION_JSON) + public String checkImportSIArchiveListAdd(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SIArchiveImportActionParam importData) { + User user = HrmUserVarify.getUser(request, response); + importData.setRunStatus(EmployeeStatusEnum.STAY_ADD.getValue()); + importData.setAddData(false); + return new ResponseResult>(user).run(getService(user)::checkSIArchiveAdd, importData); + } + + /** + * 新增社保福利档案 + * @param importData + * @return + */ + @POST + @Path("/addSIArchive") + @Produces(MediaType.APPLICATION_JSON) + public String addSIArchive(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SIArchiveImportActionParam importData) { + User user = HrmUserVarify.getUser(request, response); + importData.setRunStatus(EmployeeStatusEnum.STAY_ADD.getValue()); + importData.setAddData(true); + return new ResponseResult>(user).run(getService(user)::addSIArchive, importData); + } +} diff --git a/src/com/engine/salary/service/SISchemeService.java b/src/com/engine/salary/service/SISchemeService.java index 05c64c7fd..ebcf73858 100644 --- a/src/com/engine/salary/service/SISchemeService.java +++ b/src/com/engine/salary/service/SISchemeService.java @@ -2,6 +2,7 @@ package com.engine.salary.service; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; +import com.engine.salary.entity.siarchives.param.SIArchiveImportActionParam; import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO; import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO; import com.engine.salary.entity.sischeme.param.InsuranceSchemeParam; @@ -69,4 +70,8 @@ public interface SISchemeService { Map batchImportEbatch(SISchemaImportParam param); XSSFWorkbook exportTemplate(InsuranceArchivesListParam param); + + Map checkSIArchiveAdd(SIArchiveImportActionParam siArchiveImportActionParam); + + Map addSIArchive(SIArchiveImportActionParam siArchiveImportActionParam); } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 3875365e0..005422310 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -17,8 +17,8 @@ import com.engine.salary.encrypt.siarchives.InsuranceArchivesOtherSchemePOEncryp import com.engine.salary.encrypt.siarchives.InsuranceArchivesSocialSchemePOEncrypt; import com.engine.salary.encrypt.sischeme.InsuranceSchemeDetailPOEncrypt; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; +import com.engine.salary.entity.siarchives.param.SIArchiveImportActionParam; import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.dto.InsuranceSchemeListDTO; @@ -64,7 +64,6 @@ import org.apache.commons.lang3.math.NumberUtils; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.apache.xpath.operations.Bool; import weaver.file.ImageFileManager; import weaver.hrm.User; @@ -1232,4 +1231,31 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } + /** + * 校验待新增的社保福利档案数据 + * @param siArchiveImportActionParam + * @return + */ + @Override + public Map checkSIArchiveAdd(SIArchiveImportActionParam siArchiveImportActionParam) { + siArchiveImportActionParam.setAddData(false); + return processAddSIArchive(siArchiveImportActionParam); + } + + /** + * 新增社保福利档案 + * @param siArchiveImportActionParam + * @return + */ + @Override + public Map addSIArchive(SIArchiveImportActionParam siArchiveImportActionParam) { + siArchiveImportActionParam.setAddData(true); + return processAddSIArchive(siArchiveImportActionParam); + } + + private Map processAddSIArchive(SIArchiveImportActionParam siArchiveImportActionParam) { + + return null; + } + } From 86dbb87f1b83c8cd3a76757a765aa38cb86b067c Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 11 Nov 2022 09:11:53 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SISchemeServiceImpl.java | 105 +++++++++++++++++- 1 file changed, 103 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 90db8c674..4977ee678 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1279,9 +1279,110 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { return processAddSIArchive(siArchiveImportActionParam); } - private Map processAddSIArchive(SIArchiveImportActionParam siArchiveImportActionParam) { + private Map processAddSIArchive(SIArchiveImportActionParam param) { - return null; + ValidUtil.doValidator(param); + + if (StringUtils.isBlank(param.getRunStatus())) { + throw new SalaryRunTimeException("福利档案执行状态未在导入条件设置中添加!"); + } +// List excelSheets = message.getBatchFile().getExcelSheets(); + // 租户key +// String tenantKey = message.getTenantKey().toLowerCase(); + //操作员id + Long creator = (long) user.getUID(); + //获取所有福利类型的id-name结合 + Map schemeNameIdMap = schemeNameIdMap(); + Map welfareMap = welfareMap(); + // 获取所有个税扣缴义务人的名称和id的map + Map paymentNameIdMap; + //分权 + Boolean openDevolution = getTaxAgentService().isOpenDevolution(); + if (openDevolution) { + paymentNameIdMap = getTaxAgentService().listAllTaxAgentsAsAdmin((long) user.getUID()).stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId)); + } else { + paymentNameIdMap = getTaxAgentService().listAll().stream().collect(Collectors.toMap(TaxAgentPO::getName, TaxAgentPO::getId)); + } + + //获取所以个税扣缴义务人树型 + List taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree(); + + // 获取所有人员信息 + List employeeByIds = employeeBiz.listEmployee(); + int total = 0; + + int index = 0; + int successCount = 0; + int errorCount = 0; + + // 待导入数据 + List insuranceArchivesAccountPOS = new ArrayList<>(); + + // 待导入数据 + InputStream fileInputStream = null; + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); + Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); + // 表头 + List headers = ExcelSupport.getSheetHeader(sheet, 0); + // 错误sheet数据 + List> errorData = new LinkedList<>(); + // 错误提示 + List> excelComments = new LinkedList<>(); + + // 处理数值 + List> data = ExcelParseHelper.parse2Map(sheet, 1); + total = data.size(); + + //当前sheel的单行记录 + Map map; + for (int i = 0; i < data.size(); i++) { + index += 1; + map = data.get(i); + boolean isError; + List> singleAccount = new ArrayList<>(); + for (int j = 0; j < headers.size(); j++) { + //组装单条数据基础数据 + String key = headers.get(j); + if (key == null) { + continue; + } + Map cellData = new HashMap<>(); + cellData.put(key.toString(), Optional.ofNullable(map.get(key.toString())).orElse("").toString()); + cellData.put("index", j); + singleAccount.add(cellData); + } + + isError = singleAccountCheck(singleAccount, welfareMap, insuranceArchivesAccountPOS, employeeByIds, excelComments, errorCount + 1, schemeNameIdMap, paymentNameIdMap, creator, i + 2, openDevolution, taxAgentManageRangeEmployeeTree, param.getRunStatus()); + if (isError) { + errorCount += 1; + // 添加错误数据 + errorData.add(map); + } else { + successCount += 1; + } +// salaryBatchService.sendImportRate(message.getBizId(), total, index); + } + + // 如果sheet包含错误数据 +// if (CollectionUtils.isNotEmpty(errorData)) { +// salaryBatchService.createErrorExcelSheet(headers, errorData, excelSheet.getName(), excelComments, errorExcelSheets); +// } + + // 数据入库处理 + handleImportData(insuranceArchivesAccountPOS); + + // 发送导入回调信息 +// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); + + Map apidatas = new HashMap(); + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", excelComments); + return apidatas; + } finally { + IOUtils.closeQuietly(fileInputStream); + } } } From f3dc63244f983e2d9b295772e7a8d3d344277d78 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 11 Nov 2022 11:15:33 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/SIArchiveActionAPIController.java | 14 ++++ .../service/impl/SISchemeServiceImpl.java | 68 +++++++++++++------ 2 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 src/com/api/salary/web/SIArchiveActionAPIController.java diff --git a/src/com/api/salary/web/SIArchiveActionAPIController.java b/src/com/api/salary/web/SIArchiveActionAPIController.java new file mode 100644 index 000000000..c130f6a8b --- /dev/null +++ b/src/com/api/salary/web/SIArchiveActionAPIController.java @@ -0,0 +1,14 @@ +package com.api.salary.web; + +import com.engine.salary.process.siArchives.SIArchiveActionAPI; + +import javax.ws.rs.Path; + +/** + * @Author: sy + * @Description: + * @Date: 2022/11/11 + **/ +@Path("/bs/hrmsalary/siArchiveAction") +public class SIArchiveActionAPIController extends SIArchiveActionAPI { +} diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 4977ee678..11e7cff72 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -712,26 +712,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public boolean singleAccountCheck(List> singleAccount, Map welfareMap, List insuranceArchivesAccountPOS, List employeeByIds, List> excelComments, int i, Map schemeNameIdMap, Map paymentNameIdMap, Long creator, int index, Boolean openDevolution, List taxAgentManageRangeEmployeeTree, String runStatus) { boolean isError = false; - String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名")); - String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门")); - String mobile = (String) singleAccount.get(2).get(SalaryI18nUtil.getI18nLabel(86186, "手机号")); - String userStatus = (String) singleAccount.get(3).get(SalaryI18nUtil.getI18nLabel(86187, "员工状态")); - String workcode = (String) singleAccount.get(4).get(SalaryI18nUtil.getI18nLabel(86317, "工号")); +// String userName = (String) singleAccount.get(0).get(SalaryI18nUtil.getI18nLabel(85429, "姓名")); +// String deparmentName = (String) singleAccount.get(1).get(SalaryI18nUtil.getI18nLabel(86185, "部门")); +// String mobile = (String) singleAccount.get(2).get(SalaryI18nUtil.getI18nLabel(86186, "手机号")); +// String userStatus = (String) singleAccount.get(3).get(SalaryI18nUtil.getI18nLabel(86187, "员工状态")); +// String workcode = (String) singleAccount.get(4).get(SalaryI18nUtil.getI18nLabel(86317, "工号")); + + Map userNameMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(85429, "姓名")); + Map deparmentNameMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86185, "部门")); + Map mobileMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86186, "手机号")); + Map userStatusMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86187, "员工状态")); + Map workcodeMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86317, "工号")); + Map employeeIdMap = findElement(singleAccount, SalaryI18nUtil.getI18nLabel(86187, "员工id")); + + + String userName = (String) userNameMap.get(SalaryI18nUtil.getI18nLabel(85429, "姓名")); + String deparmentName = (String) deparmentNameMap.get(SalaryI18nUtil.getI18nLabel(86185, "部门")); + String mobile = (String) mobileMap.get(SalaryI18nUtil.getI18nLabel(86186, "手机号")); + String userStatus = (String) userStatusMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工状态")); + String workcode = (String) workcodeMap.get(SalaryI18nUtil.getI18nLabel(86317, "工号")); + Long addEmployeeId = (Long) employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id")); //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; String rowIndex = "第" + index + "行"; - //仅在全局人员筛选配置为“0”时,才对用户名、部门名称、手机号有要求 - if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(confValue)) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + " 用户名、部门名称、手机号" + SalaryI18nUtil.getI18nLabel(100303, "不能同时为空")); - excelComments.add(errorMessageMap); - isError = true; + List employees = new ArrayList<>(); + //当新增数据中包含员工id信息时,直接根据员工id获取员工信息 + if (addEmployeeId == null) { + //仅在全局人员筛选配置为“0”时,才对用户名、部门名称、手机号有要求 + if (StringUtils.isBlank(userName) && StringUtils.isBlank(deparmentName) && StringUtils.isBlank(mobile) && "0".equals(confValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + " 用户名、部门名称、手机号" + SalaryI18nUtil.getI18nLabel(100303, "不能同时为空")); + excelComments.add(errorMessageMap); + isError = true; + } + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null); + } else { + employees = employeeByIds.stream().filter(f -> f.getEmployeeId().equals(addEmployeeId)).collect(Collectors.toList()); } - //筛选导入人员信息可以在人力资源池中匹配到的人员信息 - List employees = getSalaryEmployeeService(user).matchImportEmployee(employeeByIds, userName, deparmentName, mobile, workcode, null); + if (CollectionUtils.isEmpty(employees)) { Map errorMessageMap = Maps.newHashMap(); @@ -1321,17 +1343,24 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // 待导入数据 InputStream fileInputStream = null; try { - fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId())); - Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX); // 表头 - List headers = ExcelSupport.getSheetHeader(sheet, 0); + List headers = new ArrayList<>(); + if (param.getImportDatas().size() > 0) { + Map getHeadersMap = param.getImportDatas().get(0); + for (Map.Entry entry : getHeadersMap.entrySet()){ + headers.add(entry.getKey()); + } + } else { + throw new SalaryRunTimeException("新增福利档案数据为空!"); + } + // 错误sheet数据 List> errorData = new LinkedList<>(); // 错误提示 List> excelComments = new LinkedList<>(); // 处理数值 - List> data = ExcelParseHelper.parse2Map(sheet, 1); + List> data = param.getImportDatas(); total = data.size(); //当前sheel的单行记录 @@ -1370,8 +1399,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { // } // 数据入库处理 - handleImportData(insuranceArchivesAccountPOS); - + if (param.isAddData()) { + handleImportData(insuranceArchivesAccountPOS); + } // 发送导入回调信息 // salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets); From 2e71ee7a35f0edcf38313c769ee0c40a30242603 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 14 Nov 2022 10:22:15 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3v4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/SISchemeServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 11e7cff72..17a5cc116 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -731,7 +731,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String mobile = (String) mobileMap.get(SalaryI18nUtil.getI18nLabel(86186, "手机号")); String userStatus = (String) userStatusMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工状态")); String workcode = (String) workcodeMap.get(SalaryI18nUtil.getI18nLabel(86317, "工号")); - Long addEmployeeId = (Long) employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id")); + String toAddEmployeeId = employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id")).toString(); + Long addEmployeeId = StringUtils.isNotBlank(toAddEmployeeId) ? Long.valueOf(toAddEmployeeId) : null; //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); From 969bc6b4135d53458016bb2789d19c8949f063af Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 15 Nov 2022 11:13:16 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3v5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 10 +++++++++- .../salary/service/impl/SISchemeServiceImpl.java | 8 +++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 9c6791098..84cf1e972 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -230,6 +230,7 @@ public class SIAccountBiz extends Service { public void doAccounting(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { + log.info("核算时间:{}, 核算月份:{}, 个税扣缴义务人:{}, 是否首次核算:{}", new Date(), param.getBillMonth(), param.getPaymentOrganization(), param.isFlag()); try { List ids; List validIds = new ArrayList<>(); @@ -405,13 +406,20 @@ public class SIAccountBiz extends Service { List list = MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); InsuranceAccountDetailTempPOEncrypt.decryptInsuranceAccountDetailTempPOList(list); Integer paymentStatus = 0; - getInsuranceAccountDetailMapper().batchDelAccountDetails(ids, billMonth, param.getPaymentOrganization(), paymentStatus); + log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size()); + List> partitionIds = Lists.partition((List) ids, 100); + log.info("bill_detail入库前删除数据数量:{}", ids.size()); + for (List part : partitionIds) { + getInsuranceAccountDetailMapper().batchDelAccountDetails(part, billMonth, param.getPaymentOrganization(), paymentStatus); + } + List collect = list.stream().map(item -> { InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); BeanUtils.copyProperties(item, insuranceAccountDetailPO); return insuranceAccountDetailPO; }).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(collect)) { + log.info("bill_detail入库数据数量:{}", collect.size()); batchSaveAccountInspectDetail(collect, billMonth, tenantKey); InsuranceAccountDetailPOEncrypt.encryptInsuranceAccountDetailPOList(collect); List> lists = splitDetailList(collect, 20); diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 17a5cc116..31799a577 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -731,7 +731,13 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String mobile = (String) mobileMap.get(SalaryI18nUtil.getI18nLabel(86186, "手机号")); String userStatus = (String) userStatusMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工状态")); String workcode = (String) workcodeMap.get(SalaryI18nUtil.getI18nLabel(86317, "工号")); - String toAddEmployeeId = employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id")).toString(); + String toAddEmployeeId; + if (employeeIdMap.isEmpty()) { + toAddEmployeeId = null; + } else { + toAddEmployeeId = employeeIdMap.get(SalaryI18nUtil.getI18nLabel(86187, "员工id")).toString(); + } + Long addEmployeeId = StringUtils.isNotBlank(toAddEmployeeId) ? Long.valueOf(toAddEmployeeId) : null; //查询对于人员信息导入筛选的全局配置 From e333f2acc2db55fae1c800078d058d9fc881e58f Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 09:36:00 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=A6=8F=E5=88=A9=E5=9F=BA=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 47 ++++++++++++-------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index e51c8d33e..dc4529180 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1069,36 +1069,47 @@ public class SIArchivesBiz { Set socialSet = new HashSet<>(); Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); InsuranceArchivesSocialSchemePOEncrypt.decryptList(socialList); - InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; +// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); InsuranceArchivesFundSchemePOEncrypt.decryptList(fundList); - InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; +// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); InsuranceArchivesOtherSchemePOEncrypt.decryptList(otherList); - InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; - if (socialItem != null) { - Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { - }); - if (socialJson != null) { - socialJson.forEach((k, v) -> socialSet.add(k)); +// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; + if (socialList.size() > 0) { + for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { + + Map socialJson = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new TypeReference>() { + }); + if (socialJson != null) { + socialJson.forEach((k, v) -> socialSet.add(k)); + } } + } - if (fundItem != null) { - Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { - }); - if (fundJson != null) { - fundJson.forEach((k, v) -> fundSet.add(k)); + if (fundList.size() > 0) { + for (InsuranceArchivesFundSchemePO fundSchemePO : fundList) { + Map fundJson = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new TypeReference>() { + }); + if (fundJson != null) { + fundJson.forEach((k, v) -> fundSet.add(k)); + } } + } - if (otherItem != null) { - Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { - }); - if (otherJson != null) { - otherJson.forEach((k, v) -> otherSet.add(k)); + if (otherList.size() > 0) { + for (InsuranceArchivesOtherSchemePO otherSchemePO : otherList) { + Map otherJson = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new TypeReference>() { + }); + if (otherJson != null) { + otherJson.forEach((k, v) -> otherSet.add(k)); + } } + } }); Map socialMap = new HashMap<>(); From 4073907a2c4153def6b599e7583aa0c734cdba44 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 10:09:01 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=8F=B0=E8=B4=A6=E5=AF=BC=E5=85=A5=E5=90=8E=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AEv1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SIAccountServiceImpl.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index bc2a18a49..b47fb424f 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1267,6 +1267,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { getSiAccountBiz(user).updateByEmployeeIdAndBillMonth(po); } + //刷新hrsa_bill_batch中数据统计信息 + if (updateInsuranceAccountDetailList.size() > 0) { + InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam(); + refreshParam.setBillMonth(updateInsuranceAccountDetailList.get(0).getBillMonth()); + refreshParam.setPaymentOrganization(updateInsuranceAccountDetailList.get(0).getPaymentOrganization().toString()); + PageInfo pageInfos = overView(refreshParam); + } + apidatas.put("successCount", successCount); apidatas.put("errorCount", failCount); apidatas.put("errorData", excelComments); From 57300125cda1d5e3772f39aa38fdb6b55bf2f5ce Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 13:39:50 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E7=BC=B4=E7=BA=B3/=E8=A1=A5=E7=BC=B4=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E5=88=B7=E6=96=B0=E5=8F=B0=E8=B4=A6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsuranceAccountDetailMapper.xml | 4 +- .../service/impl/SIAccountServiceImpl.java | 49 ++++++++++++++++--- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index b3ec88e72..ee574bd49 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -265,7 +265,7 @@ t.fund_per_json,t.fund_com_json,t.other_per_json, t.other_com_json,t.social_per_sum,t.social_com_sum, t.fund_per_sum,t.fund_com_sum,t.other_per_sum, - t.other_com_sum,t.per_sum,t.com_sum + t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization FROM hrsa_bill_detail t WHERE t.delete_type = 0 @@ -280,7 +280,7 @@ t.fund_per_json,t.fund_com_json,t.other_per_json, t.other_com_json,t.social_per_sum,t.social_com_sum, t.fund_per_sum,t.fund_com_sum,t.other_per_sum, - t.other_com_sum,t.per_sum,t.com_sum + t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization FROM hrsa_bill_detail t WHERE t.delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index b47fb424f..87094093e 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -74,6 +74,8 @@ import weaver.hrm.User; import java.io.InputStream; import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -1128,10 +1130,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 处理数值 List> data = ExcelParseHelper.parse2Map(sheet, 1); if (CollectionUtils.isEmpty(headers)) { - throw new RuntimeException("表头为空"); + throw new SalaryRunTimeException("表头为空"); } if (CollectionUtils.isEmpty(data)) { - throw new RuntimeException("无数据"); + throw new SalaryRunTimeException("无数据"); } //存储待更新的InsuranceAccountDetailPO数据 List updateInsuranceAccountDetailList = new ArrayList<>(); @@ -1269,10 +1271,41 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //刷新hrsa_bill_batch中数据统计信息 if (updateInsuranceAccountDetailList.size() > 0) { - InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam(); - refreshParam.setBillMonth(updateInsuranceAccountDetailList.get(0).getBillMonth()); - refreshParam.setPaymentOrganization(updateInsuranceAccountDetailList.get(0).getPaymentOrganization().toString()); - PageInfo pageInfos = overView(refreshParam); + ExecutorService taskExecutor = Executors.newCachedThreadPool(); + taskExecutor.execute(() -> { + Long paymentOrganization = updateInsuranceAccountDetailList.get(0).getPaymentOrganization(); + String billMonth = updateInsuranceAccountDetailList.get(0).getBillMonth(); + if (paymentOrganization != null && billMonth != null) { + InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam(); + refreshParam.setBillMonth(billMonth); + refreshParam.setPaymentOrganization(paymentOrganization.toString()); + PageInfo pageInfos = overView(refreshParam); + TaxAgentPO taxAgentPo = getTaxAgentMapper().getById(paymentOrganization); + if (taxAgentPo != null) { + List viewListDTOList = pageInfos.getList(); + viewListDTOList.stream().filter(f -> f.getPayOrg().equals(taxAgentPo.getName())).collect(Collectors.toList()); + InsuranceAccountBatchPO batchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization); + batchPO = SiAccountEncrypt.decryptInsuranceAccountBatch(batchPO); + //更新 + if (viewListDTOList.size() > 0 && batchPO != null) { + InsuranceAccountViewListDTO viewListDTO = viewListDTOList.get(0); + batchPO.setSocialNum(viewListDTO.getSocialNum()); + batchPO.setFundNum(viewListDTO.getFundNum()); + batchPO.setOtherNum(viewListDTO.getOtherNum()); + + batchPO.setSocialPay(viewListDTO.getSocialPaySum()); + batchPO.setFundPay(viewListDTO.getFundPaySum()); + batchPO.setOtherPay(viewListDTO.getOtherPaySum()); + + batchPO.setUpdateTime(new Date()); + batchPO = SiAccountEncrypt.encryptInsuranceAccountBatch(batchPO); + getInsuranceAccountBatchMapper().updateById(batchPO); + } + } + + } + }); + } apidatas.put("successCount", successCount); @@ -1786,10 +1819,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 处理数值 List> data = ExcelParseHelper.parse2Map(sheet, 1); if (CollectionUtils.isEmpty(headers)) { - throw new RuntimeException("表头为空"); + throw new SalaryRunTimeException("表头为空"); } if (CollectionUtils.isEmpty(data)) { - throw new RuntimeException("无数据"); + throw new SalaryRunTimeException("无数据"); } String billMonth = importParam.getBillMonth(); From fee892e17b23fdcd11300be6eb81a6c0cbbf8bd1 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 15:08:30 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=9C=A8=E8=AE=BE=E7=BD=AE=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E6=97=B6=EF=BC=8C=E5=AF=B9=E5=85=B6=E4=B8=8B?= =?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AE=E7=A6=8F=E5=88=A9=E9=A1=B9=E6=95=B0?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E5=AD=97=E6=AE=B5=E9=BB=98=E8=AE=A4=E4=B8=BA?= =?UTF-8?q?0=EF=BC=8C=E5=B9=B6=E5=8F=82=E4=B8=8E=E5=9F=BA=E6=95=B0?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SISchemeServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 31799a577..f4ec1e33d 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1073,7 +1073,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); + socialPaymentBase.put(String.valueOf(insuranceId), StringUtils.isBlank(itemValue) ? "0" : itemValue); } } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); @@ -1124,7 +1125,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); + socialPaymentBase.put(String.valueOf(insuranceId), StringUtils.isBlank(itemValue) ? "0" : itemValue); } } insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); @@ -1171,7 +1173,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { continue; } if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - socialPaymentBase.put(String.valueOf(insuranceId), (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"))); + String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); + socialPaymentBase.put(String.valueOf(insuranceId), StringUtils.isBlank(itemValue) ? "0" : itemValue); } } insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); From e0175f3ae71656c02cb2a608f5064ba4c40e7288 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 15:32:43 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E8=8B=A5=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BA=86=E7=A6=8F=E5=88=A9=E6=96=B9=E6=A1=88=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E8=AF=A5=E7=A6=8F=E5=88=A9=E7=B1=BB=E5=9E=8B=E7=9A=84=E8=B5=B7?= =?UTF-8?q?=E5=A7=8B=E7=BC=B4=E7=BA=B3=E6=9C=88=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SISchemeServiceImpl.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index f4ec1e33d..9383316c6 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -936,7 +936,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { excelComments.add(errorMessageMap); isError = true; - } else { + } else if (StringUtils.isNotBlank((String) socialMap.get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))) && StringUtils.isBlank(socialStartMonth)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "社保方案已设置,但未设置社保起始缴纳时间!")); + excelComments.add(errorMessageMap); + isError = true; + }else { insuranceArchivesSocialSchemePO = buildSocialPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && schemeNameIdMap.get((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) == null) { @@ -953,7 +958,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { excelComments.add(errorMessageMap); isError = true; - }else { + } else if (StringUtils.isNotBlank((String) fundMap.get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))) && StringUtils.isBlank(fundStartMonth)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "公积金方案已设置,但未设置公积金起始缴纳时间!")); + excelComments.add(errorMessageMap); + isError = true; + } else { insuranceArchivesFundSchemePO = buildFundPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } if (StringUtils.isNotBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) && schemeNameIdMap.get((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) == null) { @@ -969,7 +979,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "其他福利方案不属于其他福利类型")); excelComments.add(errorMessageMap); isError = true; - }else { + } else if (StringUtils.isNotBlank((String) otherMap.get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))) && StringUtils.isBlank(otherStartMonth)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100322, "其他福利方案已设置,但未设置其他福利起始缴纳时间!")); + excelComments.add(errorMessageMap); + isError = true; + } else { insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } /**************校验申报基数**************/ From 47406b67c237156e306158375c8967554d3105b7 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 17 Nov 2022 17:07:04 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E5=AF=B9=E4=BA=8E=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C=E5=85=81=E8=AE=B8?= =?UTF-8?q?excel=E9=BB=98=E8=AE=A4=E6=A0=BC=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SISchemeServiceImpl.java | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 9383316c6..e8c454de5 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -68,6 +68,7 @@ import weaver.file.ImageFileManager; import weaver.hrm.User; import java.io.InputStream; +import java.text.SimpleDateFormat; import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -858,67 +859,67 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialStartMonth = (String) socialStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91319, "社保起始缴纳月")); -// if (StringUtils.isNotBlank(socialStartMonth) && socialStartMonth.length() > 7) { -// socialStartMonth = socialStartMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(socialStartMonth) && (!SalaryDateUtil.checkYearMonth(socialStartMonth) || socialStartMonth.length() != 7)) { + if (StringUtils.isNotBlank(socialStartMonth) && socialStartMonth.length() > 7) { + socialStartMonth = socialStartMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(socialStartMonth) && !SalaryDateUtil.checkYearMonth(socialStartMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100315, "社保起始缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100315, "社保起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } String socialEndMonth = (String) socialEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91320, "社保最后缴纳月")); -// if (StringUtils.isNotBlank(socialEndMonth) && socialEndMonth.length() > 7) { -// socialEndMonth = socialEndMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(socialEndMonth) && (!SalaryDateUtil.checkYearMonth(socialEndMonth) || socialEndMonth.length() != 7)) { + if (StringUtils.isNotBlank(socialEndMonth) && socialEndMonth.length() > 7) { + socialEndMonth = socialEndMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(socialEndMonth) && !SalaryDateUtil.checkYearMonth(socialEndMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100316, "社保最后缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100316, "社保最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } String fundStartMonth = (String) fundStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91483, "公积金起始缴纳月")); -// if (StringUtils.isNotBlank(fundStartMonth) && fundStartMonth.length() > 7) { -// fundStartMonth = fundStartMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(fundStartMonth) && (!SalaryDateUtil.checkYearMonth(fundStartMonth) || fundStartMonth.length() != 7)) { + if (StringUtils.isNotBlank(fundStartMonth) && fundStartMonth.length() > 7) { + fundStartMonth = fundStartMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(fundStartMonth) && !SalaryDateUtil.checkYearMonth(fundStartMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100317, "公积金起始缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100317, "公积金起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } String fundEndMonth = (String) fundEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91484, "公积金最后缴纳月")); -// if (StringUtils.isNotBlank(fundEndMonth) && fundEndMonth.length() > 7) { -// fundEndMonth = fundEndMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(fundEndMonth) && (!SalaryDateUtil.checkYearMonth(fundEndMonth) || fundEndMonth.length() != 7)) { + if (StringUtils.isNotBlank(fundEndMonth) && fundEndMonth.length() > 7) { + fundEndMonth = fundEndMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(fundEndMonth) && !SalaryDateUtil.checkYearMonth(fundEndMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100319, "公积金最后缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100319, "公积金最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } String otherStartMonth = (String) otherStartTimeMap.get(SalaryI18nUtil.getI18nLabel(91490, "其他福利起始缴纳月")); -// if (StringUtils.isNotBlank(otherStartMonth) && otherStartMonth.length() > 7) { -// otherStartMonth = otherStartMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(otherStartMonth) && (!SalaryDateUtil.checkYearMonth(otherStartMonth) || otherStartMonth.length() != 7)) { + if (StringUtils.isNotBlank(otherStartMonth) && otherStartMonth.length() > 7) { + otherStartMonth = otherStartMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(otherStartMonth) && !SalaryDateUtil.checkYearMonth(otherStartMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100320, "其他福利起始缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100320, "其他福利起始缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } String otherEndMonth = (String) otherEndTimeMap.get(SalaryI18nUtil.getI18nLabel(91494, "其他福利最后缴纳月")); -// if (StringUtils.isNotBlank(otherEndMonth) && otherEndMonth.length() > 7) { -// otherEndMonth = otherEndMonth.substring(0, 7); -// } - if (StringUtils.isNotBlank(otherEndMonth) && (!SalaryDateUtil.checkYearMonth(otherEndMonth) || otherEndMonth.length() != 7)) { + if (StringUtils.isNotBlank(otherEndMonth) && otherEndMonth.length() > 7) { + otherEndMonth = otherEndMonth.substring(0, 7); + } + if (StringUtils.isNotBlank(otherEndMonth) && !SalaryDateUtil.checkYearMonth(otherEndMonth)) { Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100321, "其他福利最后缴纳时间格式错误,正确格式为YYYY-MM")); + errorMessageMap.put("message", rowIndex + SalaryI18nUtil.getI18nLabel(100321, "其他福利最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); excelComments.add(errorMessageMap); isError = true; } From aa7a3ced01d4c59b436be01b9f08a6db2b15010f Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 21 Nov 2022 16:53:00 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=B7=E6=96=B0=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SIAccountServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 87094093e..2a96f1802 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -1293,9 +1293,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { batchPO.setFundNum(viewListDTO.getFundNum()); batchPO.setOtherNum(viewListDTO.getOtherNum()); - batchPO.setSocialPay(viewListDTO.getSocialPaySum()); - batchPO.setFundPay(viewListDTO.getFundPaySum()); - batchPO.setOtherPay(viewListDTO.getOtherPaySum()); + batchPO.setSocialPay(viewListDTO.getSocialPaySum().replace(",", "")); + batchPO.setFundPay(viewListDTO.getFundPaySum().replace(",", "")); + batchPO.setOtherPay(viewListDTO.getOtherPaySum().replace(",", "")); batchPO.setUpdateTime(new Date()); batchPO = SiAccountEncrypt.encryptInsuranceAccountBatch(batchPO); From 0f50520aa97a1e3f75371573f0d38ff7e27f4ad7 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 24 Nov 2022 09:31:44 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E6=8A=BD=E5=8F=96?= =?UTF-8?q?bill=5Fbatch=E8=A1=A8=E4=B8=AD=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=B7=E6=96=B0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/SIAccountService.java | 5 +++ .../service/impl/SIAccountServiceImpl.java | 39 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/com/engine/salary/service/SIAccountService.java b/src/com/engine/salary/service/SIAccountService.java index e7e61f8e6..611333b8c 100644 --- a/src/com/engine/salary/service/SIAccountService.java +++ b/src/com/engine/salary/service/SIAccountService.java @@ -238,5 +238,10 @@ public interface SIAccountService { */ Map importExcelInsuranceDetail(ExcelInsuranceImportParam excelInsuranceImportParam); + /** + * 刷新_bill_batch表中的统计信息 + */ + void refreshBillBatch(Long paymentOrganization, String billMonth); + } diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 2a96f1802..32f4a1d87 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2125,5 +2125,44 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return excelInsuranceDetailPO; } + /** + * 刷新_bill_batch表中的统计信息 + */ + @Override + public void refreshBillBatch(Long paymentOrganization, String billMonth) { + ExecutorService taskExecutor = Executors.newCachedThreadPool(); + taskExecutor.execute(() -> { + + if (paymentOrganization != null && billMonth != null) { + InsuranceAccountDetailParam refreshParam =new InsuranceAccountDetailParam(); + refreshParam.setBillMonth(billMonth); + refreshParam.setPaymentOrganization(paymentOrganization.toString()); + PageInfo pageInfos = overView(refreshParam); + TaxAgentPO taxAgentPo = getTaxAgentMapper().getById(paymentOrganization); + if (taxAgentPo != null) { + List viewListDTOList = pageInfos.getList(); + viewListDTOList.stream().filter(f -> f.getPayOrg().equals(taxAgentPo.getName())).collect(Collectors.toList()); + InsuranceAccountBatchPO batchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, paymentOrganization); + batchPO = SiAccountEncrypt.decryptInsuranceAccountBatch(batchPO); + //更新 + if (viewListDTOList.size() > 0 && batchPO != null) { + InsuranceAccountViewListDTO viewListDTO = viewListDTOList.get(0); + batchPO.setSocialNum(viewListDTO.getSocialNum()); + batchPO.setFundNum(viewListDTO.getFundNum()); + batchPO.setOtherNum(viewListDTO.getOtherNum()); + + batchPO.setSocialPay(viewListDTO.getSocialPaySum().replace(",", "")); + batchPO.setFundPay(viewListDTO.getFundPaySum().replace(",", "")); + batchPO.setOtherPay(viewListDTO.getOtherPaySum().replace(",", "")); + + batchPO.setUpdateTime(new Date()); + batchPO = SiAccountEncrypt.encryptInsuranceAccountBatch(batchPO); + getInsuranceAccountBatchMapper().updateById(batchPO); + } + } + + } + }); + } }