diff --git a/resource/sql/分权.sql b/resource/sql/分权.sql index 15116bb76..ff55b57c1 100644 --- a/resource/sql/分权.sql +++ b/resource/sql/分权.sql @@ -134,3 +134,9 @@ ALTER TABLE hrsa_salary_sob ADD COLUMN tax_agent_id bigint(0) NULL COMMENT '个 INSERT INTO hrsa_tax_agent_base(id, devolution_status, create_time, update_time, creator, delete_type, tenant_key) VALUES (1653303537239, 1, '2022-05-23 18:58:53', '2022-05-23 19:12:12', 1, 0, 'all_teams'); + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN payment_organization bigint(0) NULL COMMENT '个税扣缴义务人id' AFTER tenant_key; + +ALTER TABLE hrsa_bill_detail ADD COLUMN payment_organization bigint(0) NULL COMMENT '个税扣缴义务人id' AFTER tenant_key; + +ALTER TABLE hrsa_bill_batch ADD COLUMN payment_organization bigint(0) NULL COMMENT '个税扣缴义务人id' AFTER tenant_key; \ No newline at end of file diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 1b1c62705..50ecdb12f 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -1,8 +1,8 @@ package com.engine.salary.biz; -import com.alibaba.druid.support.json.JSONUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; +import com.engine.core.impl.Service; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO; @@ -12,7 +12,10 @@ import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailTempPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; -import com.engine.salary.entity.siarchives.po.*; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; +import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; import com.engine.salary.entity.taxrate.TaxAgent; @@ -25,7 +28,6 @@ import com.engine.salary.mapper.siaccount.InsuranceAccountBatchMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper; import com.engine.salary.mapper.siaccount.SIAccountDetailTempMapper; - import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.util.SalaryAssert; @@ -35,6 +37,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.util.valid.ValidUtil; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import lombok.extern.slf4j.Slf4j; @@ -42,7 +45,6 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.session.SqlSession; import org.springframework.beans.BeanUtils; - import weaver.conn.mybatis.MyBatisFactory; import java.math.BigDecimal; @@ -52,7 +54,6 @@ import java.util.concurrent.Executors; import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; -import com.engine.core.impl.Service; /** * @Author weaver_cl @@ -61,7 +62,7 @@ import com.engine.core.impl.Service; * @Version V1.0 **/ @Slf4j -public class SIAccountBiz extends Service{ +public class SIAccountBiz extends Service { private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); @@ -71,10 +72,10 @@ public class SIAccountBiz extends Service{ try { InsuranceAccountBatchMapper insuranceAccountBatchMapper = sqlSession.getMapper(InsuranceAccountBatchMapper.class); SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); - List list = insuranceAccountBatchMapper.list(queryParam); - PageInfo pageInfo = new PageInfo<>(list,InsuranceAccountBatchPO.class); + List list = insuranceAccountBatchMapper.list(queryParam); + PageInfo pageInfo = new PageInfo<>(list, InsuranceAccountBatchPO.class); return pageInfo; - }finally { + } finally { sqlSession.close(); } @@ -87,19 +88,21 @@ public class SIAccountBiz extends Service{ SalaryPageUtil.start(queryParam.getCurrent(), queryParam.getPageSize()); queryParam.setPaymentStatus(PaymentStatusEnum.COMMON.getValue()); List list = insuranceAccountDetailMapper.list(queryParam); - PageInfo pageInfo = new PageInfo<>(list,InsuranceAccountDetailPO.class); + PageInfo pageInfo = new PageInfo<>(list, InsuranceAccountDetailPO.class); return pageInfo; - }finally { + } finally { sqlSession.close(); } } - public void save(boolean flag, AccountParam param,Long employeeId,String currentUserName) { + public void save(boolean flag, AccountParam param, Long employeeId, String currentUserName) { if (flag) { - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth()); - SalaryAssert.isNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel( 100461, "所属月份存在核算数据")); + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()); + SalaryAssert.isNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(100461, "所属月份存在核算数据")); + InsuranceAccountBatchPO build = InsuranceAccountBatchPO.builder() - //.id(IdGenerator.generate()) + //.id(IdGenerator.generate()) + .paymentOrganization(param.getPaymentOrganization()) .accountant(currentUserName) .billMonth(param.getBillMonth()) .billStatus(BillStatusEnum.NOT_ARCHIVED.getValue()) @@ -120,14 +123,14 @@ public class SIAccountBiz extends Service{ // insuranceSchemeContext.setNewValues(build); // siAccountLoggerTemplate.write(insuranceSchemeContext); } - account(param.getBillMonth(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY,currentUserName); + account(param, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); } - public void account(String billMonth, Long employeeId, String tenantKey,String currentUserName) { - List employeeIds = MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).selectAccountIds(SalaryDateUtil.getMonthBegin(billMonth)); + public void account(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { + List employeeIds = MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).selectAccountIds(SalaryDateUtil.getMonthBegin(param.getBillMonth()), param.getPaymentOrganization()); if (CollectionUtils.isEmpty(employeeIds)) { - List list = Lists.newArrayList(MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth)); + List list = Lists.newArrayList(MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); if (CollectionUtils.isNotEmpty(list)) { list.stream().forEach(f -> { MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).deleteById(f.getId()); @@ -135,35 +138,36 @@ public class SIAccountBiz extends Service{ } } SalaryAssert.notEmpty(employeeIds, "no account data"); - AccountParam param = new AccountParam(); - param.setBillMonth(billMonth); + AccountParam selectParam = new AccountParam(); + selectParam.setBillMonth(param.getBillMonth()); + selectParam.setPaymentOrganization(param.getPaymentOrganization()); ExecutorService taskExecutor = Executors.newCachedThreadPool(); taskExecutor.execute(() -> { try { DSTenantKeyThreadVar.tenantKey.set(tenantKey); - accounting(param, employeeId, tenantKey,currentUserName); + accounting(selectParam, employeeId, tenantKey, currentUserName); } finally { DSTenantKeyThreadVar.tenantKey.remove(); } }); } - public void accounting(AccountParam param, Long employeeId, String tenantKey,String currentUserName) { + public void accounting(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { //薪资核算进度暂未实现 // SalaryAcctProgressDTO salaryAcctProgressDTO = salaryAcctProgressService.getProgress(tenantKey + param.getBillMonth(), employeeId, tenantKey); // if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) { // return; // } - doAccounting(param, employeeId, tenantKey,currentUserName); + doAccounting(param, employeeId, tenantKey, currentUserName); } //@Transactional(propagation = Propagation.NEVER, rollbackFor = Exception.class) - public void doAccounting(AccountParam param, Long employeeId, String tenantKey,String currentUserName) { + public void doAccounting(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { try { List ids; if (CollectionUtils.isEmpty(param.getIds())) { - ids = MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).selectAccountIds(SalaryDateUtil.getMonthBegin(param.getBillMonth())); + ids = MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).selectAccountIds(SalaryDateUtil.getMonthBegin(param.getBillMonth()), param.getPaymentOrganization()); } else { ids = param.getIds(); } @@ -171,7 +175,7 @@ public class SIAccountBiz extends Service{ //salaryAcctProgressService.fail(tenantKey + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员")); return; } - SalaryAcctProgressDTO salaryAcctProgressDTO = new SalaryAcctProgressDTO(SalaryI18nUtil.getI18nLabel( 97515, "核算中"), 97515L, ids.size(), 0, + SalaryAcctProgressDTO salaryAcctProgressDTO = new SalaryAcctProgressDTO(SalaryI18nUtil.getI18nLabel(97515, "核算中"), 97515L, ids.size(), 0, BigDecimal.ZERO, true, "", true); //salaryAcctProgressService.initProgress(tenantKey + param.getBillMonth(), salaryAcctProgressDTO, employeeId, tenantKey); /* List> partition = Lists.partition(ids, 100); @@ -186,12 +190,12 @@ public class SIAccountBiz extends Service{ countDownLatch.await(); boolean allSuccess = results.stream().allMatch(Boolean::booleanValue);*/ /* if (allSuccess) {*/ - handleData(ids, param.getBillMonth(), employeeId, tenantKey,currentUserName); + handleData(ids, param, employeeId, tenantKey, currentUserName); /*}*/ MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelAccountTempDetails(ids, param.getBillMonth()); } catch (Exception e) { log.error("account run fail", e); - List list = Lists.newArrayList(MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth())); + List list = Lists.newArrayList(MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); if (CollectionUtils.isNotEmpty(list)) { list.stream().forEach(f -> { MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).deleteById(f.getId()); @@ -258,28 +262,30 @@ public class SIAccountBiz extends Service{ }*/ } - private List> splitList(List list , int groupSize){ + private List> splitList(List list, int groupSize) { int length = list.size(); // 计算可以分成多少组 - int num = ( length + groupSize - 1 )/groupSize ; + int num = (length + groupSize - 1) / groupSize; List> newList = new ArrayList<>(num); for (int i = 0; i < num; i++) { // 开始位置 int fromIndex = i * groupSize; // 结束位置 - int toIndex = (i+1) * groupSize < length ? ( i+1 ) * groupSize : length ; - newList.add(list.subList(fromIndex,toIndex)) ; + int toIndex = (i + 1) * groupSize < length ? (i + 1) * groupSize : length; + newList.add(list.subList(fromIndex, toIndex)); } - return newList ; + return newList; } - private void handleData(List ids, String billMonth, Long employeeId, String tenantKey,String currentUserName) { + private void handleData(List ids, AccountParam param, Long employeeId, String tenantKey, String currentUserName) { //事务后续处理 //TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); try { - List list = MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).getListByEmployeeIdsAndBillMonth(ids,billMonth); - MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDelAccountDetails(ids, billMonth); + String billMonth = param.getBillMonth(); + Long paymentOrganization = param.getPaymentOrganization(); + List list = MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).getListByEmployeeIdsAndBillMonth(ids, billMonth, paymentOrganization); + MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDelAccountDetails(ids,billMonth,paymentOrganization); List collect = list.stream().map(item -> { InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); BeanUtils.copyProperties(item, insuranceAccountDetailPO); @@ -291,7 +297,7 @@ public class SIAccountBiz extends Service{ lists.forEach(subList -> { MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchSaveAccountDetails(subList); }); - updateBatchAccount(billMonth, employeeId, tenantKey,currentUserName); + updateBatchAccount(param, employeeId, tenantKey, currentUserName); } //transactionManager.commit(status); } catch (Exception e) { @@ -659,10 +665,10 @@ public class SIAccountBiz extends Service{ /** * 跟新台账接口 * - * @param billMonth 账单月份 * @param tenantKey 租户key */ - public void updateBatchAccount(String billMonth, Long employeeId, String tenantKey,String currentUserName) { + public void updateBatchAccount(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { + String billMonth = param.getBillMonth(); List insuranceAccountDetailPOS = MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).selectList(billMonth); Map> map = insuranceAccountDetailPOS.stream().filter(item -> item.getEmployeeId() != null) @@ -699,7 +705,7 @@ public class SIAccountBiz extends Service{ otherAccountPerson += 1; } } - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth); + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth,param.getPaymentOrganization()); DataCollectionEmployee simpleEmployee = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeById(employeeId); insuranceAccountBatchPO.setAccountant(currentUserName); @@ -723,27 +729,31 @@ public class SIAccountBiz extends Service{ } - public void saveCommonAccount(SaveCommonAccountParam param, Long employeeId,String currentUserName) { + public void saveCommonAccount(SaveCommonAccountParam param, Long employeeId, String currentUserName) { List collect; - SalaryAssert.notEmpty(param.getIncludes(), SalaryI18nUtil.getI18nLabel( 100466, "参数为空")); - SalaryAssert.notNull(param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100467, "账单月为空")); + SalaryAssert.notEmpty(param.getIncludes(), SalaryI18nUtil.getI18nLabel(100466, "参数为空")); + SalaryAssert.notNull(param.getBillMonth(), SalaryI18nUtil.getI18nLabel(100467, "账单月为空")); if (CollectionUtils.isNotEmpty(param.getExcludes())) { collect = param.getIncludes().stream().filter(item -> !param.getExcludes().contains(item)).collect(Collectors.toList()); } else { collect = param.getIncludes(); } - SalaryAssert.notEmpty(collect, SalaryI18nUtil.getI18nLabel( 99920, "无核算人员")); + SalaryAssert.notEmpty(collect, SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); AccountParam accountParam = new AccountParam(); accountParam.setBillMonth(param.getBillMonth()); accountParam.setIds(collect); - accounting(accountParam, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY,currentUserName); + accounting(accountParam, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); } public void delete(AccountParam param, Long employeeId) { - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth()); - SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel( 84026, "参数错误")); + if(param.getPaymentOrganization()==null){ + throw new SalaryRunTimeException("个税扣缴义务人为空"); + } + + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(param.getBillMonth(),param.getPaymentOrganization()); + SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(84026, "参数错误")); MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).deleteById(insuranceAccountBatchPO.getId()); - MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDeleteNotFile(param.getBillMonth()); + MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDeleteNotFile(param.getBillMonth(),param.getPaymentOrganization()); // LoggerContext insuranceSchemeContext = new LoggerContext(); // insuranceSchemeContext.setTargetId(String.valueOf(insuranceAccountBatchPO.getId())); // insuranceSchemeContext.setTargetName(insuranceAccountBatchPO.getBillMonth()); @@ -754,21 +764,21 @@ public class SIAccountBiz extends Service{ // siAccountLoggerTemplate.write(insuranceSchemeContext); } - public void saveSupplementaryAccount(SaveSupplementaryAccountParam param, Long employeeId,String currentUserName) { + public void saveSupplementaryAccount(SaveSupplementaryAccountParam param, Long employeeId, String currentUserName) { if (StringUtils.isBlank(param.getBillMonth()) || CollectionUtils.isEmpty(param.getBillMonthList()) || CollectionUtils.isEmpty(param.getProjects()) || CollectionUtils.isEmpty(param.getIncludes())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 84026, "参数错误")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(84026, "参数错误")); } //需要补缴的月份 if (param.getBillMonthList().contains(param.getBillMonth())) { - throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel( 100481, "当前月走正常缴纳")); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100481, "当前月走正常缴纳")); } //需要补缴的员工id List employeeIds = param.getIncludes(); if (CollectionUtils.isNotEmpty(param.getExcludes())) { employeeIds = employeeIds.stream().filter(item -> !param.getExcludes().contains(item)).collect(Collectors.toList()); } - SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel( 99920, "无核算人员")); + SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(99920, "无核算人员")); List baseList = new ArrayList<>(); employeeIds.stream().forEach(id -> { param.getBillMonthList().stream().forEach(month -> { @@ -782,8 +792,9 @@ public class SIAccountBiz extends Service{ }); }); //核算开始 - accountSupplement(baseList, employeeIds, param.getBillMonth(),employeeId); - updateBatchAccount(param.getBillMonth(), employeeId,SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY,currentUserName); + accountSupplement(baseList, employeeIds, param.getBillMonth(), employeeId); + + updateBatchAccount(AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization()).build(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); } /** @@ -791,21 +802,21 @@ public class SIAccountBiz extends Service{ * @param employeeIds 需要补缴的员工id * @return */ - public String accountSupplement(List baseList, List employeeIds, String billMonth,Long employeeId) { + public String accountSupplement(List baseList, List employeeIds, String billMonth, Long employeeId) { //(k,v) k-员工id v-员工对应的福利档案数据 - Map longInsuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds,SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + Map longInsuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); //核算结果集 List pos = new ArrayList<>(); baseList.forEach(baseParam -> { - InsuranceAccountDetailPO insuranceAccountDetailPO = accountSingleEmployeeBill(baseParam, longInsuranceArchivesAccountPOMap.get(baseParam.getEmployeeId()),employeeId); + InsuranceAccountDetailPO insuranceAccountDetailPO = accountSingleEmployeeBill(baseParam, longInsuranceArchivesAccountPOMap.get(baseParam.getEmployeeId()), employeeId); pos.add(insuranceAccountDetailPO); }); - batchSaveSupplementAccount(pos, billMonth,SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + batchSaveSupplementAccount(pos, billMonth, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); return SalaryI18nUtil.getI18nLabel(100492, "核算完成,数据保存成功"); } - public InsuranceAccountDetailPO accountSingleEmployeeBill(SupplementAccountBaseParam baseParam, InsuranceArchivesAccountPO accountPO,Long employeeId) { + public InsuranceAccountDetailPO accountSingleEmployeeBill(SupplementAccountBaseParam baseParam, InsuranceArchivesAccountPO accountPO, Long employeeId) { InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); List projects = baseParam.getProjects(); insuranceAccountDetailPO.setBillMonth(baseParam.getBillMonth()); @@ -1188,19 +1199,19 @@ public class SIAccountBiz extends Service{ } - private List> splitDetailList(List list , int groupSize){ + private List> splitDetailList(List list, int groupSize) { int length = list.size(); // 计算可以分成多少组 - int num = ( length + groupSize - 1 )/groupSize ; // TODO + int num = (length + groupSize - 1) / groupSize; // TODO List> newList = new ArrayList<>(num); for (int i = 0; i < num; i++) { // 开始位置 int fromIndex = i * groupSize; // 结束位置 - int toIndex = (i+1) * groupSize < length ? ( i+1 ) * groupSize : length ; - newList.add(list.subList(fromIndex,toIndex)) ; + int toIndex = (i + 1) * groupSize < length ? (i + 1) * groupSize : length; + newList.add(list.subList(fromIndex, toIndex)); } - return newList ; + return newList; } //@Transactional @@ -1238,11 +1249,12 @@ public class SIAccountBiz extends Service{ // }); } - public void deleteCommonAccount(SaveCommonAccountParam param, Long employeeId,String currentUserName) { - SalaryAssert.notBlank(param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 84026, "参数错误")); - SalaryAssert.notEmpty(param.getIncludes(), SalaryI18nUtil.getI18nLabel( 84026, "参数错误")); - MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDelAccountDetails(param.getIncludes(), param.getBillMonth()); - //记录日志 + public void deleteCommonAccount(SaveCommonAccountParam param, Long employeeId, String currentUserName) { + ValidUtil.doValidator(param); + SalaryAssert.notBlank(param.getBillMonth(), SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + SalaryAssert.notEmpty(param.getIncludes(), SalaryI18nUtil.getI18nLabel(84026, "参数错误")); + MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class).batchDelAccountDetails(param.getIncludes(), param.getBillMonth(),param.getPaymentOrganization()); + //记录日志 // LoggerContext insuranceSchemeContext = new LoggerContext(); // insuranceSchemeContext.setTargetId(String.join(",", param.getIncludes().stream().map(item -> String.valueOf(item)).collect(Collectors.toList()))); // insuranceSchemeContext.setTargetName(param.getBillMonth()); @@ -1251,10 +1263,10 @@ public class SIAccountBiz extends Service{ // insuranceSchemeContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100462, "新增台账")); // insuranceSchemeContext.setNewValues(param); // siAccountLoggerTemplate.write(insuranceSchemeContext); - updateBatchAccount(param.getBillMonth(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY,currentUserName); + updateBatchAccount(AccountParam.builder().billMonth(param.getBillMonth()).paymentOrganization(param.getPaymentOrganization()).build(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); } - public void deleteSupplementaryAccount(List param, Long employeeId,String currentUserName) { + public void deleteSupplementaryAccount(List param, Long employeeId, String currentUserName) { SalaryAssert.notEmpty(param, SalaryI18nUtil.getI18nLabel(84026, "参数错误")); boolean valid = param.stream().anyMatch(item -> item.getEmployeeId() == null || StringUtils.isBlank(item.getSupplementaryMonth()) @@ -1273,7 +1285,7 @@ public class SIAccountBiz extends Service{ // insuranceSchemeContext.setNewValues(item); // siAccountLoggerTemplate.write(insuranceSchemeContext); // }); - updateBatchAccount(param.get(0).getBillMonth(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY,currentUserName); + updateBatchAccount(AccountParam.builder().billMonth(param.get(0).getBillMonth()).paymentOrganization(param.get(0).getPaymentOrganization()).build(), employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, currentUserName); } public void file(String billMonth, Long employeeId) { @@ -1282,13 +1294,13 @@ public class SIAccountBiz extends Service{ // SalaryAssert.isEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel( 100500, "当前核算月存在核算异常数据")); //开始归档数据 - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillStatus(billMonth,BillStatusEnum.NOT_ARCHIVED.getValue()); + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillStatus(billMonth, BillStatusEnum.NOT_ARCHIVED.getValue()); - SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel( 100503, "月份账单不存在")); - SalaryAssert.isFalse(insuranceAccountBatchPO.getBillStatus() == BillStatusEnum.ARCHIVED.getValue(), SalaryI18nUtil.getI18nLabel( 100504, "月份账单已归档")); + SalaryAssert.notNull(insuranceAccountBatchPO, SalaryI18nUtil.getI18nLabel(100503, "月份账单不存在")); + SalaryAssert.isFalse(insuranceAccountBatchPO.getBillStatus() == BillStatusEnum.ARCHIVED.getValue(), SalaryI18nUtil.getI18nLabel(100504, "月份账单已归档")); insuranceAccountBatchPO.setBillStatus(BillStatusEnum.ARCHIVED.getValue()); MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).updateById(insuranceAccountBatchPO); - //日志记录 + //日志记录 // LoggerContext insuranceSchemeContext = new LoggerContext(); // insuranceSchemeContext.setTargetId(String.valueOf(insuranceAccountBatchPO.getId())); // insuranceSchemeContext.setTargetName(insuranceAccountBatchPO.getBillMonth()); @@ -1300,9 +1312,9 @@ public class SIAccountBiz extends Service{ } - public void accountInspect(Collection ids, String billMonth, Long employeeId,String currentUserName) { + public void accountInspect(Collection ids, String billMonth, Long employeeId, String currentUserName) { List insuranceAccountInspectPOS = allInspects(ids, billMonth); - SalaryAssert.notEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel( 100515, "无核算数据")); + SalaryAssert.notEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel(100515, "无核算数据")); List commonInspects = insuranceAccountInspectPOS.stream() .filter(e -> Objects.equals(e.getPaymentStatus(), PaymentStatusEnum.COMMON.getValue())) .collect(Collectors.toList()); @@ -1314,7 +1326,7 @@ public class SIAccountBiz extends Service{ SaveCommonAccountParam param = new SaveCommonAccountParam(); param.setBillMonth(billMonth); param.setIncludes(commonInspects.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList())); - saveCommonAccount(param, employeeId,currentUserName); + saveCommonAccount(param, employeeId, currentUserName); } //核算补缴 if (CollectionUtils.isNotEmpty(supplementInspects)) { @@ -1328,13 +1340,13 @@ public class SIAccountBiz extends Service{ base.setSupplementaryMonth(e.getSupplementaryMonth()); baseList.add(base); }); - accountSupplement(baseList, baseList.stream().map(SupplementAccountBaseParam::getEmployeeId).collect(Collectors.toList()), billMonth,employeeId); + accountSupplement(baseList, baseList.stream().map(SupplementAccountBaseParam::getEmployeeId).collect(Collectors.toList()), billMonth, employeeId); } } public List allInspects(Collection ids, String billMonth) { - List list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getList(billMonth,InspectStatusEnum.IGNORE.getValue(),ids); + List list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids); if (CollectionUtils.isNotEmpty(list)) { return list; @@ -1350,7 +1362,7 @@ public class SIAccountBiz extends Service{ //获取扣缴义务人信息 List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); - SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel( 100341, "该租户无扣缴义务人")); + SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgent::getId, Function.identity())); List insuranceAccountViewListDTOS = buildRecords(insuranceAccountDetailPOS, paymentMap); @@ -1359,7 +1371,7 @@ public class SIAccountBiz extends Service{ // Page insuranceAccountViewListDTOPage = new Page<>(page.getCurrent(), insuranceAccountViewListDTOS.size(), insuranceAccountViewListDTOS.size(), // page.isSearchCount()); - PageInfo insuranceAccountViewListDTOPage = new PageInfo<>(insuranceAccountViewListDTOS,InsuranceAccountViewListDTO.class); + PageInfo insuranceAccountViewListDTOPage = new PageInfo<>(insuranceAccountViewListDTOS, InsuranceAccountViewListDTO.class); insuranceAccountViewListDTOPage.setTotal(insuranceAccountViewListDTOS.size()); return insuranceAccountViewListDTOPage; } diff --git a/src/com/engine/salary/entity/siaccount/param/AccountParam.java b/src/com/engine/salary/entity/siaccount/param/AccountParam.java index 9e67046d7..74cb238cf 100644 --- a/src/com/engine/salary/entity/siaccount/param/AccountParam.java +++ b/src/com/engine/salary/entity/siaccount/param/AccountParam.java @@ -35,4 +35,11 @@ public class AccountParam { // 是否是首次核算 private boolean flag = true; + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "个税扣缴义务人不能为空") + private Long paymentOrganization; + } diff --git a/src/com/engine/salary/entity/siaccount/param/SaveCommonAccountParam.java b/src/com/engine/salary/entity/siaccount/param/SaveCommonAccountParam.java index 14b6eded1..00c33f845 100644 --- a/src/com/engine/salary/entity/siaccount/param/SaveCommonAccountParam.java +++ b/src/com/engine/salary/entity/siaccount/param/SaveCommonAccountParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.siaccount.param; +import com.engine.salary.util.valid.DataCheck; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -27,4 +28,10 @@ public class SaveCommonAccountParam { //账单月份") private String billMonth; + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "个税扣缴义务人不能为空") + private Long paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java b/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java index 2ce919024..9ca1d1688 100644 --- a/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java +++ b/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java @@ -2,6 +2,7 @@ package com.engine.salary.entity.siaccount.param; import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.serializer.ToStringSerializer; +import com.engine.salary.util.valid.DataCheck; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -38,4 +39,10 @@ public class SaveSupplementaryAccountParam { //账单月份") private String billMonth; + + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "个税扣缴义务人不能为空") + private Long paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java b/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java index 09d8c3be2..1d70cabc4 100644 --- a/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java +++ b/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java @@ -1,5 +1,6 @@ package com.engine.salary.entity.siaccount.param; +import com.engine.salary.util.valid.DataCheck; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -25,6 +26,12 @@ public class SupplementAccountBaseParam { //账单月份") private String billMonth; + /** + * 个税扣缴义务人id + */ + @DataCheck(require = true,message = "个税扣缴义务人不能为空") + private Long paymentOrganization; + //补缴月份") private String supplementaryMonth; diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java index e00d9126e..244c1e130 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountBatchPO.java @@ -100,4 +100,9 @@ public class InsuranceAccountBatchPO { */ private String tenantKey; + /** + * 个税扣缴义务人 + */ + private Long paymentOrganization; + } diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index 9b249b0e5..b1ed7db6e 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -2,12 +2,10 @@ package com.engine.salary.entity.siaccount.po; import com.cloudstore.eccom.pc.table.WeaTableType; import com.engine.salary.annotation.SalaryTable; -import com.engine.salary.annotation.SalaryTableOperate; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.util.Date; @@ -239,4 +237,9 @@ public class InsuranceAccountDetailPO { * 租户key */ private String tenantKey; + + /** + * 个税扣缴义务人 + */ + private Long paymentOrganization; } diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 37d376c61..f2090de3a 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.Accessors; import java.util.Date; @@ -235,4 +234,9 @@ public class InsuranceAccountDetailTempPO { * 租户key */ private String tenantKey; + + /** + * 个税扣缴义务人 + */ + private Long paymentOrganization; } diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java index 24262cceb..d4c1ea3ee 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.java @@ -4,7 +4,6 @@ import com.engine.salary.entity.siaccount.param.InsuranceAccountBatchParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import org.apache.ibatis.annotations.Param; -import java.util.Collection; import java.util.List; /** @@ -27,7 +26,7 @@ public interface InsuranceAccountBatchMapper { * @param billMonth * @return */ - InsuranceAccountBatchPO getByBillMonth(@Param("billMonth") String billMonth); + InsuranceAccountBatchPO getByBillMonth(@Param("billMonth") String billMonth,@Param("paymentOrganization") Long paymentOrganization); /** * 插入 diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml index 578d953f6..c3d691530 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml @@ -18,6 +18,7 @@ + @@ -38,6 +39,7 @@ , t.create_time , t.update_time , t.tenant_key + , t.payment_organization #{billMonth}, @@ -77,6 +80,7 @@ #{createTime}, #{updateTime}, #{tenantKey}, + #{paymentOrganization}, @@ -103,6 +107,7 @@ create_time, update_time, tenant_key, + payment_organization, #{billMonth}, @@ -120,6 +125,7 @@ #{createTime}, #{updateTime}, #{tenantKey}, + #{paymentOrganization}, @@ -161,6 +167,9 @@ hrsa_bill_batch t WHERE t.delete_type = 0 AND t.bill_month = #{billMonth} + + AND t.payment_organization = #{paymentOrganization} + diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java index 3c7183a43..92e318e6e 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.java @@ -29,7 +29,7 @@ public interface InsuranceAccountDetailMapper { * @param time * @return */ - List selectAccountIds(@Param("time") String time); + List selectAccountIds(@Param("time") String time,@Param("paymentOrganization") Long paymentOrganization); /** * 根据id删除 @@ -40,7 +40,7 @@ public interface InsuranceAccountDetailMapper { /** * 批量删除 */ - void batchDelAccountDetails(@Param("employeeIds") Collection employeeIds, @Param("billMonth") String billMonth); + void batchDelAccountDetails(@Param("employeeIds") Collection employeeIds, @Param("billMonth") String billMonth,@Param("paymentOrganization") Long paymentOrganization); /** * 批量保存 @@ -63,7 +63,7 @@ public interface InsuranceAccountDetailMapper { * 根据账单月份删除 * @param billMonth */ - void batchDeleteNotFile(@Param("billMonth") String billMonth); + void batchDeleteNotFile(@Param("billMonth") String billMonth,@Param("paymentOrganization") Long paymentOrganization); /** diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index ae917a135..91b22d672 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -45,6 +45,7 @@ + @@ -93,6 +94,7 @@ , t.create_time , t.update_time , t.tenant_key + , t.payment_organization @@ -223,6 +225,8 @@ ) OR ( social.social_start_time IS NOT NULL AND social.social_start_time != '' +-- 个税扣缴义务人 + social.social_pay_org = #{paymentOrganization} AND( social.social_end_time IS NULL OR social.social_end_time = '' @@ -316,6 +320,7 @@ FROM hrsa_bill_detail WHERE delete_type = 0 AND bill_month = #{billMonth} + AND payment_organization = #{paymentOrganization} AND bill_status = 0 @@ -363,6 +368,7 @@ SET delete_type = 1 WHERE delete_type = 0 AND bill_month = #{billMonth} + AND payment_organization = #{paymentOrganization} AND employee_id IN @@ -388,7 +394,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) VALUES ( @@ -432,7 +438,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} ) @@ -441,7 +448,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) select #{item.employeeId}, @@ -484,7 +491,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} from dual @@ -494,7 +502,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) VALUES ( #{item.employeeId}, @@ -537,7 +545,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} ) diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.java b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.java index 0312219e8..2f38c1b0b 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.java +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.java @@ -34,5 +34,5 @@ public interface SIAccountDetailTempMapper { * @param billMonth * @return */ - List getListByEmployeeIdsAndBillMonth(@Param("employeeIds") Collection employeeIds, @Param("billMonth") String billMonth); + List getListByEmployeeIdsAndBillMonth(@Param("employeeIds") Collection employeeIds, @Param("billMonth") String billMonth,@Param("paymentOrganization") Long paymentOrganization); } diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml index c6719b37f..60674d6c3 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml @@ -45,6 +45,7 @@ + @@ -92,6 +93,7 @@ , t.create_time , t.update_time , t.tenant_key + , t.payment_organization @@ -115,7 +117,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) VALUES ( @@ -159,7 +161,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} ) @@ -168,7 +171,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) select @@ -212,7 +215,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} from dual @@ -222,7 +226,7 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) VALUES ( #{item.employeeId}, @@ -265,7 +269,8 @@ #{item.createTime}, #{item.updateTime}, #{item.deleteType}, - #{item.tenantKey} + #{item.tenantKey}, + #{item.paymentOrganization} ) @@ -277,6 +282,7 @@ hrsa_bill_detail_temp t WHERE t.delete_type = 0 AND t.bill_month = #{billMonth} + AND t.payment_organization = #{paymentOrganization} AND t.employee_id IN diff --git a/src/com/engine/salary/service/SIAccountService.java b/src/com/engine/salary/service/SIAccountService.java index 39d96d030..0119aadbc 100644 --- a/src/com/engine/salary/service/SIAccountService.java +++ b/src/com/engine/salary/service/SIAccountService.java @@ -4,9 +4,7 @@ import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.param.*; import com.engine.salary.entity.siaccount.po.InsuranceAccountInspectPO; -import com.engine.salary.entity.siexport.param.InsuranceExportParam; import com.engine.salary.util.page.PageInfo; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import java.util.Collection; import java.util.List; @@ -134,7 +132,7 @@ public interface SIAccountService { * tab信息 * @param billMonth */ - InsuranceAccountTabDTO tabList(String billMonth); + InsuranceAccountTabDTO tabList(AccountParam build); /** * 人员异动 diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index d1ab56944..885d1ccb7 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -35,11 +35,6 @@ import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.service.ColumnBuildService; import com.engine.salary.service.RecordsBuildService; import com.engine.salary.service.SIAccountService; - -import java.math.BigDecimal; -import java.util.*; -import java.util.stream.Collectors; - import com.engine.salary.service.SICategoryService; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -54,6 +49,10 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + /** * @Author weaver_cl @@ -320,6 +319,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void deleteCommonAccount(SaveCommonAccountParam param) { + ValidUtil.doValidator(param); Long employeeId = (long)user.getUID(); String currentUserName = user.getLastname(); siAccountBiz.deleteCommonAccount(param,employeeId,currentUserName); @@ -372,9 +372,9 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } @Override - public InsuranceAccountTabDTO tabList(String billMonth) { + public InsuranceAccountTabDTO tabList(AccountParam build) { InsuranceAccountTabDTO insuranceAccountTabDTO = InsuranceAccountTabDTO.builder().build(); - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth); + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(build.getBillMonth(),build.getPaymentOrganization()); boolean isShow = false; if (insuranceAccountBatchPO == null || insuranceAccountBatchPO.getBillStatus() == BillStatusEnum.NOT_ARCHIVED.getValue()) { isShow = true; @@ -404,7 +404,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { tabList.add(overView); insuranceAccountTabDTO.setTabList(tabList); insuranceAccountTabDTO.setShow(isShow); - insuranceAccountTabDTO.setBillMonth(billMonth); + insuranceAccountTabDTO.setBillMonth(build.getBillMonth()); return insuranceAccountTabDTO; } @@ -594,7 +594,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public List> welfareData(String billMonth, List employeeIds) { - InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth); + InsuranceAccountBatchPO insuranceAccountBatchPO = MapperProxyFactory.getProxy(InsuranceAccountBatchMapper.class).getByBillMonth(billMonth,null); if (insuranceAccountBatchPO == null || Objects.equals(BillStatusEnum.NOT_ARCHIVED.getValue(), insuranceAccountBatchPO.getBillStatus())) { return Lists.newArrayList(); } diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 13f35404d..bf4cf8f4e 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -292,9 +292,10 @@ public class SIAccountController { @Path("/tabList") @Produces(MediaType.APPLICATION_JSON) public String tabList(@Context HttpServletRequest request, @Context HttpServletResponse response, - @QueryParam("billMonth") String billMonth) { + @QueryParam("billMonth") String billMonth,@QueryParam("paymentOrganization") Long paymentOrganization) { User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getService(user)::tabList, billMonth); + AccountParam build = AccountParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization).build(); + return new ResponseResult(user).run(getService(user)::tabList, build); } @POST