diff --git a/resource/sqlupgrade/PG/sql202303130202.sql b/resource/sqlupgrade/PG/sql202303130202.sql index 54a9eae70..c6ed8b220 100644 --- a/resource/sqlupgrade/PG/sql202303130202.sql +++ b/resource/sqlupgrade/PG/sql202303130202.sql @@ -2,9 +2,9 @@ Delete from LeftMenuInfo where id=100186; / Delete from LeftMenuConfig where infoid=100186; / -call LMConfig_U_ByInfoInsert (2,100118,9); +select LMConfig_U_ByInfoInsert (2,100118,9); / -call LMInfo_Insert (100186,541290,'','',2,100118,9,18); +select LMInfo_Insert (100186,541290,'','',2,100118,9,18); / update LeftMenuInfo set mobxrouteurl = '',iconClassName = '',fullrouteurl='/spa/hrmSalary/static/index.html#/main/hrmSalary/externalPersonManage' where id = 100186; / \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202307200603.sql b/resource/sqlupgrade/PG/sql202307200603.sql index e211c560e..522bcacec 100644 --- a/resource/sqlupgrade/PG/sql202307200603.sql +++ b/resource/sqlupgrade/PG/sql202307200603.sql @@ -1,17 +1,14 @@ -select @current_date:= date_format( now(),'%Y-%m-%d'); -select @current_time:= date_format( now(),'%T'); -INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA,SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL,BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER,WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME,onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl,isPhyPage, subcompanyid, unconditionalQuery) VALUES ('salaryExtEmp', '1', '1', '', 'SELECT * FROM hrsa_external_employee where delete_type=0', '', '', '', '', '1','id', '', '', '', '', '', '', 2, '薪酬非系统人员', NULL, '', NULL, NULL, NULL, NULL, '', '', @current_date,@current_time, NULL, NULL, '', '', '0', uuid(), '', '', '', '', '1', 0, 1); +INSERT INTO datashowset(SHOWNAME, SHOWCLASS, DATAFROM, DATASOURCEID, SQLTEXT, WSURL, WSOPERATION, XMLTEXT, INPARA,SHOWTYPE, KEYFIELD, PARENTFIELD, SHOWFIELD, DETAILPAGEURL, TYPENAME, SELECTTYPE, SHOWPAGEURL,BROWSERFROM, NAME, CUSTOMID, CUSTOMHREF, SQLTEXT1, SQLTEXT2, NAMEHEADER, DESCRIPTIONHEADER,WSWORKNAME, SEARCHBYID, CREATEDATE, CREATETIME, MODIFYDATE, MODIFYTIME, SEARCHBYNAME,onlylowestnode, characterset, uuid, isSupportPaging, ESBID, ESBSHOWID, mobiledetailpageurl,isPhyPage, subcompanyid, unconditionalQuery) VALUES ('salaryExtEmp', '1', '1', '', 'SELECT * FROM hrsa_external_employee where delete_type=0', '', '', '', '', '1','id', '', '', '', '', '', '', 2, '薪酬非系统人员', NULL, '', NULL, NULL, NULL, NULL, '', '', '2020-01-01', '19:12:12', NULL, NULL, '', '', '0', uuid(), '', '', '', '', '1', 0, 1); -select @datashowset_id:= max(id)from datashowset; INSERT INTO datashowcacheset(showname, subcompanyid, isopencache, Createdate, createtime, Updatedate, Updatetime) -VALUES ('salaryExtEmp', '0', 0, @current_date, @current_time, NULL, NULL); +VALUES ('salaryExtEmp', '0', 0, '2020-01-01', '19:12:12', NULL, NULL); INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) -VALUES (@datashowset_id, '姓名', 'username', '', 1, 1, uuid(), NULL); +VALUES ((select max(id) from datashowparam), '姓名', 'username', '', 1, 1, uuid(), NULL); INSERT INTO datashowparam(MAINID, FIELDNAME, SEARCHNAME, TRANSQL, ISSHOWNAME, dsporder, uuid, width) -VALUES (@datashowset_id, '手机号', 'mobile', '', 0, 2, uuid(), NULL); +VALUES ((select max(id) from datashowparam), '手机号', 'mobile', '', 0, 2, uuid(), NULL); INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) -VALUES (@datashowset_id, '姓名', 'username', '2', '', 1, uuid(), ''); +VALUES ((select max(id) from datasearchparam), '姓名', 'username', '2', '', 1, uuid(), ''); INSERT INTO datasearchparam(MAINID, FIELDNAME, SEARCHNAME, FIELDTYPE, WOKFLOWFIELDNAME, dsporder, uuid, isshowfield) -VALUES (@datashowset_id, '手机号', 'mobile', '2', '', 2, uuid(), ''); \ No newline at end of file +VALUES ((select max(id) from datasearchparam), '手机号', 'mobile', '2', '', 2, uuid(), ''); \ 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 1042cfef3..f514bb241 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -22,7 +22,10 @@ import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.siaccount.*; +import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.InsuranceBaseInfoMapper; +import com.engine.salary.mapper.siarchives.OtherSchemeMapper; +import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; @@ -109,6 +112,18 @@ public class SIAccountBiz extends Service { return MapperProxyFactory.getProxy(InsuranceBaseInfoMapper.class); } + private SocialSchemeMapper getSocialSchemeMapper() { + return MapperProxyFactory.getProxy(SocialSchemeMapper.class); + } + + private FundSchemeMapper getFundSchemeMapper() { + return MapperProxyFactory.getProxy(FundSchemeMapper.class); + } + + private OtherSchemeMapper getOtherSchemeMapper() { + return MapperProxyFactory.getProxy(OtherSchemeMapper.class); + } + private SalarySysConfService getSalarySysConfService(User user) { return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } @@ -261,7 +276,7 @@ public class SIAccountBiz extends Service { public void accounting(AccountParam param, Long employeeId, String tenantKey, String currentUserName) { //钖祫鏍哥畻杩涘害鏆傛湭瀹炵幇 ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth()); - if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) { + if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) { return; } @@ -310,7 +325,9 @@ public class SIAccountBiz extends Service { .map(InsuranceArchivesBaseInfoPO::getEmployeeId) .collect(Collectors.toList()); - empIds = empIds.stream().filter(f->canAccountIds.contains(f)).collect(Collectors.toList()); + //20231122閫昏緫浼樺寲锛岃繃婊ゅ嚭涓嶅湪璧峰缂寸撼鏈堝拰鏈鍚庣即绾虫湀鍖洪棿鐨勪汉鍛 + List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); + empIds = empIds.stream().filter(f->canAccountIds.contains(f) && empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); //杩囨护涓嶅湪鎵g即涔夊姟浜轰笅鐨勬暟鎹 // Collection employeeIdsInTaxAgent = getTaxAgentService().listEmployeeIdsInTaxAgent(param.getPaymentOrganization()); @@ -400,8 +417,9 @@ public class SIAccountBiz extends Service { log.info("绂忓埄鏍哥畻杩涘害瀹屾垚锛"); } catch (Exception e) { log.error("account run fail", e); + getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(99642, "绂忓埄鏍哥畻鍑洪敊") + ": " + e.getMessage()); + List list = Lists.newArrayList(getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization())); - list = encryptUtil.decryptList(list, InsuranceAccountBatchPO.class, user); if (CollectionUtils.isNotEmpty(list)) { list.stream().forEach(f -> { getInsuranceAccountBatchMapper().deleteById(f.getId()); @@ -411,10 +429,36 @@ public class SIAccountBiz extends Service { //钖祫鏍哥畻杩涘害鏆傛湭瀹炵幇 //salaryAcctProgressService.del(tenantKey + param.getBillMonth(), employeeId, tenantKey); //logger.error("welfare account error:{}", e.getMessage(), e); - getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(user.getLanguage(),543860, "绂忓埄鏍哥畻鍑洪敊") + ": " + e.getMessage()); } } + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜哄拰璐﹀崟鏈堬紝鑾峰彇涓夌被绂忓埄妗f涓鍚堢即绾冲紑濮嬬粨鏉熸湀鍖洪棿鐨勪汉鍛榠d + * @param paymentOrganization + * @param billMonth + * @return + */ + public List listCanPayEmpIds(Long paymentOrganization, String billMonth) { + List listCanPayEmpIds = new ArrayList<>(); + //绀句繚妗f涓彲杩涜缂寸撼鐨勪汉鍛 + List socialCanPayEmpIds = getSocialSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + //鍏Н閲戞。妗堜腑鍙繘琛岀即绾崇殑浜哄憳 + List fundCanPayEmpIds = getFundSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + //鍏朵粬绂忓埄妗f涓彲杩涜缂寸撼鐨勪汉鍛 + List otherCanPayEmpIds = getOtherSchemeMapper().listCanPayEmpIds(paymentOrganization, billMonth); + if (socialCanPayEmpIds != null && socialCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(socialCanPayEmpIds); + } + if (fundCanPayEmpIds != null && fundCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(fundCanPayEmpIds); + } + if (otherCanPayEmpIds != null && otherCanPayEmpIds.size() > 0) { + listCanPayEmpIds.addAll(otherCanPayEmpIds); + } + //鍘婚噸 + listCanPayEmpIds = listCanPayEmpIds.stream().distinct().collect(Collectors.toList()); + return listCanPayEmpIds; + } public void commonAccount(/*CountDownLatch countDownLatch, BlockingDeque results,*/ String billMonth, List ids, Long employeeId, String tenantKey, Long paymentOrganization) { /* try {*/ @@ -1309,6 +1353,9 @@ public class SIAccountBiz extends Service { if (filterList.size() != employeeIds.size()) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(user.getLanguage(),543864, "琛ョ即浜哄憳涓瓨鍦ㄦ湭璁剧疆绂忓埄妗f浜哄憳鎴栫浉鍏充汉鍛樹笉鍦ㄧ鍒╁湪缂翠汉鍛樹腑锛屼笉鍙柊寤鸿ˉ缂翠俊鎭紒")); } + //20231122閫昏緫浼樺寲锛岃繃婊ゅ嚭涓嶅湪璧峰缂寸撼鏈堝拰鏈鍚庣即绾虫湀鍖洪棿鐨勪汉鍛 + List empIdsInPayMonthRange = listCanPayEmpIds(param.getPaymentOrganization(), param.getBillMonth()); + employeeIds = employeeIds.stream().filter(f -> empIdsInPayMonthRange.contains(f)).collect(Collectors.toList()); SalaryAssert.notEmpty(employeeIds, SalaryI18nUtil.getI18nLabel(user.getLanguage(),543862, "鏃犳牳绠椾汉鍛")); List baseList = new ArrayList<>(); diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 4a95d68ef..5a15fb4f0 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1543,7 +1543,14 @@ public class SIArchivesBiz extends Service { Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); if (socialJson != null) { - map.putAll(socialJson); + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); +// map.putAll(socialJson); } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -1555,7 +1562,14 @@ public class SIArchivesBiz extends Service { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); if (fundJson != null) { - map.putAll(fundJson); + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); +// map.putAll(fundJson); } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -1567,7 +1581,14 @@ public class SIArchivesBiz extends Service { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); if (otherJson != null) { - map.putAll(otherJson); + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); +// map.putAll(otherJson); } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -1581,6 +1602,16 @@ public class SIArchivesBiz extends Service { } } + public List payInsuranceIds(Long socialSchemeId) { + //鏌ヨ璇ョ鍒╂柟妗堜笅寮鍚即绾崇殑绂忓埄椤 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //寮鍚即绾崇殑 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } /** * 鑾峰彇淇℃伅鎻愮ず */ diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java index e707a3315..87cc00731 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctRecordBO.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordSaveParam; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -19,6 +20,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -47,6 +49,7 @@ public class SalaryAcctRecordBO { List employeeComInfos, List salaryAcctEmployeeCountDTOS, List salarySendCheckResult, + List taxAgentPOS, User user) { if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) { return Collections.emptyList(); @@ -55,6 +58,7 @@ public class SalaryAcctRecordBO { Map usernameMap = SalaryEntityUtil.convert2Map(employeeComInfos, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); Map empSizeMap = SalaryEntityUtil.convert2Map(salaryAcctEmployeeCountDTOS, SalaryAcctEmployeeCountDTO::getSalaryAcctRecordId, SalaryAcctEmployeeCountDTO::getCountBySalaryAcctRecordId); Map salarySendMap = SalaryEntityUtil.convert2Map(salarySendCheckResult, SalarySendCheckDTO::getSalaryAcctId, SalarySendCheckDTO::isSendFinished); + Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); return salaryAcctRecordPOS.stream() .map(salaryAcctRecordPO -> { SalarySobPO salarySobPO = salarySobMap.get(salaryAcctRecordPO.getSalarySobId()); @@ -80,6 +84,7 @@ public class SalaryAcctRecordBO { return SalaryAcctRecordListDTO.builder() .id(salaryAcctRecordPO.getId()) .salarySobName(Optional.ofNullable(salarySobPO).map(SalarySobPO::getName).orElse(StringUtils.EMPTY)) + .taxAgentName(taxAgentMap.get(Optional.ofNullable(salarySobPO).map(SalarySobPO::getTaxAgentId).orElse(0L))) .salaryMonth(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getSalaryMonth()).toString()) .taxCycle(SalaryDateUtil.localDate2YearMonth(salaryAcctRecordPO.getTaxCycle()).toString()) .status(Optional.ofNullable(salaryAcctRecordStatusEnum) diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java index 72b60ed9c..d8df05ba1 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctResultBO.java @@ -23,7 +23,7 @@ import com.engine.salary.enums.salaryaccounting.LockStatusEnum; import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; -import com.engine.salary.util.page.Column; +import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.apache.commons.collections4.CollectionUtils; @@ -94,30 +94,70 @@ public class SalaryAcctResultBO { * @param salarySobItemAggregateDTO * @return */ - public static List buildTableColumns4ComparisonResult(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Set excludeSalaryItemIds) { - List columns = Lists.newArrayList(); + public static List buildTableColumns4ComparisonResult(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Set excludeSalaryItemIds) { + List columns = Lists.newArrayList(); // 鍛樺伐淇℃伅瀛楁 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new Column(salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup("150", salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId(), salarySobEmpFieldDTO.getFieldId())); } // 钖祫椤圭洰鍒嗙粍涓嬬殑钖祫椤圭洰 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { if (CollectionUtils.isEmpty(salarySobItemGroupDTO.getItems())) { continue; } + List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { continue; } - columns.add(new Column(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); + childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); } + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup("150", salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + columns.add(weaTableColumnWapper); } // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { continue; } - columns.add(new Column(salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); + } + return columns; + } + + /** + * 鏋勫缓钖祫鏍哥畻缁撴灉鍒楄〃鐨勮〃澶达紙绾夸笅瀵规瘮锛 + * + * @param salarySobItemAggregateDTO + * @return + */ + public static List buildTableColumns4ComparisonResultByGroup(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Set excludeSalaryItemIds) { + List columns = Lists.newArrayList(); + // 鍛樺伐淇℃伅瀛楁 + for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { + columns.add(new WeaTableColumnGroup("150", salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId(), salarySobEmpFieldDTO.getFieldId())); + } + // 钖祫椤圭洰鍒嗙粍涓嬬殑钖祫椤圭洰 + for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { + if (CollectionUtils.isEmpty(salarySobItemGroupDTO.getItems())) { + continue; + } + List childrenColumns = Lists.newArrayList(); + for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { + if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { + continue; + } + childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); + } + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup("150", salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + columns.add(weaTableColumnWapper); + } + // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 + for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { + if (excludeSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { + continue; + } + columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), "" + salarySobItemDTO.getSalaryItemId())); } return columns; } @@ -132,7 +172,7 @@ public class SalaryAcctResultBO { List columns = Lists.newArrayList(); // 鍛樺伐淇℃伅瀛楁 for (SalarySobEmpFieldDTO salarySobEmpFieldDTO : salarySobItemAggregateDTO.getEmpFields()) { - columns.add(new WeaTableColumnGroup("150", salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobEmpFieldDTO.getFieldName()), salarySobEmpFieldDTO.getFieldName(), salarySobEmpFieldDTO.getFieldId())); } // 钖祫椤圭洰鍒嗙粍涓嬬殑钖祫椤圭洰 for (SalarySobItemGroupDTO salarySobItemGroupDTO : salarySobItemAggregateDTO.getItemGroups()) { @@ -142,29 +182,29 @@ public class SalaryAcctResultBO { List childrenColumns = Lists.newArrayList(); for (SalarySobItemDTO salarySobItemDTO : salarySobItemGroupDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - childrenColumns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + childrenColumns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } - WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup("150", salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); + WeaTableColumnGroup weaTableColumnWapper = new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemGroupDTO.getName()), salarySobItemGroupDTO.getName(), String.valueOf(salarySobItemGroupDTO.getId()), childrenColumns); columns.add(weaTableColumnWapper); } // 娌℃湁鍒嗙被鐨勮柂璧勯」鐩 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } // 鍥炵畻鐨勮柂璧勯」鐩 for (SalarySobItemDTO salarySobItemDTO : salarySobItemAggregateDTO.getBackCalcItems()) { if (lockSalaryItemIds.contains(salarySobItemDTO.getSalaryItemId())) { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.LOCK.getValue(), salarySobItemDTO.getPattern())); } else { - columns.add(new WeaTableColumnGroup("150", salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); + columns.add(new WeaTableColumnGroup(SalaryPageUtil.selfAdaption(salarySobItemDTO.getName()), salarySobItemDTO.getName(), "" + salarySobItemDTO.getSalaryItemId(), LockStatusEnum.UNLOCK.getValue(), salarySobItemDTO.getPattern())); } } @@ -423,12 +463,12 @@ public class SalaryAcctResultBO { .salarySobItemGroupId(groupPO.getId()) .salarySobItemGroupName(name) .salaryItems(items) - .sortedIndex(groupPO.getSortedIndex()).build() ); + .sortedIndex(groupPO.getSortedIndex()).build()); } } // 鏈垎绫 List noGroupItems = salarySobItemPOMap.getOrDefault(0L, Collections.emptyList()); - if(CollectionUtils.isNotEmpty(noGroupItems)){ + if (CollectionUtils.isNotEmpty(noGroupItems)) { List items = noGroupItems.stream() .map(salarySobItemPO -> convert2SalaryAcctResultDetailItemDTO(salarySobItemPO, salaryItemMap.get(salarySobItemPO.getSalaryItemId()), resultValueMap, formulaContentMap, user)) .collect(Collectors.toList()); @@ -440,7 +480,6 @@ public class SalaryAcctResultBO { } - // // 鍏紡椤圭殑鍊硷紙涓嶆牴鎹畇alaryItemPO鐨剉alueType鍒ゆ柇鏄洜涓鸿柂璧勯」鐩殑valueType灞炴ф敼鍙樺悗骞朵笉浼氬悓姝ユ洿鏂拌柂璧勮处濂椾腑鐨勮柂璧勯」鐩殑formulaId瀛楁锛 // List formulaItems = salarySobItemPOS.stream() // .filter(salarySobItemPO -> salarySobItemPO.getFormulaId() > 0) @@ -471,7 +510,7 @@ public class SalaryAcctResultBO { } public static List sortGroup(List salarySobItemGroupPOS) { - if(CollectionUtils.isEmpty(salarySobItemGroupPOS)){ + if (CollectionUtils.isEmpty(salarySobItemGroupPOS)) { return Collections.emptyList(); } return salarySobItemGroupPOS.stream().sorted(Comparator.comparingInt(SalarySobItemGroupPO::getSortedIndex)).collect(Collectors.toList()); @@ -479,10 +518,9 @@ public class SalaryAcctResultBO { /** * 钖祫璐﹀鐨勮柂璧勯」鐩寜鐓ortedIndex鎺掑簭 - * */ public static void sortItem(Map> salarySobItemPOMap) { - for(Map.Entry> entry : salarySobItemPOMap.entrySet()){ + for (Map.Entry> entry : salarySobItemPOMap.entrySet()) { List items = entry.getValue(); if (CollectionUtils.isNotEmpty(items)) { List sortedValue = items.stream().sorted(Comparator.comparingInt(SalarySobItemPO::getSortedIndex)).collect(Collectors.toList()); @@ -507,7 +545,7 @@ public class SalaryAcctResultBO { SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(Optional.ofNullable(salarySobItemPO).map(SalarySobItemPO::getValueType).orElse(0)); String itemFormulaContent; - if(Objects.equals(salaryValueTypeEnum.getValue(),SalaryValueTypeEnum.FORMULA.getValue())){ + if (Objects.equals(salaryValueTypeEnum.getValue(), SalaryValueTypeEnum.FORMULA.getValue())) { itemFormulaContent = Optional.ofNullable(formulaContentMap.get(salarySobItemPO.getSalaryItemId().toString())).map(SalaryAcctResultListColumnDTO::getFormulaContent).orElse(""); }else{ itemFormulaContent = salaryValueTypeEnum == null ? "" : SalaryI18nUtil.getI18nLabel(user.getLanguage(),salaryValueTypeEnum.getLabelId(),salaryValueTypeEnum.getDefaultLabel()); diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java index a834cddd9..f4e3d757c 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAcctRecordListDTO.java @@ -36,6 +36,9 @@ public class SalaryAcctRecordListDTO { //涓婚敭id private Long id; + @TableTitle(title = "涓◣鎵g即涔夊姟浜", dataIndex = "taxAgentName", key = "taxAgentName", labelId = 537996) + private String taxAgentName; + @TableTitle(title = "钖祫璐﹀", dataIndex = "salarySobName", key = "salarySobName", labelId = 538010) private String salarySobName; diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java index 39fc6b164..2667b00bb 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryComparisonResultListDTO.java @@ -1,6 +1,6 @@ package com.engine.salary.entity.salaryacct.dto; -import com.engine.salary.util.page.Column; +import com.engine.salary.component.WeaTableColumnGroup; import com.engine.salary.util.page.PageInfo; import lombok.AllArgsConstructor; import lombok.Data; @@ -25,7 +25,7 @@ import java.util.Map; public class SalaryComparisonResultListDTO { //鍒楄〃鐨勮〃澶 - private List weaTableColumns; + private List weaTableColumns; //鍒楄〃鏁版嵁 private PageInfo> data; diff --git a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java index bc44d6fae..6da14bd9c 100644 --- a/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java +++ b/src/com/engine/salary/entity/salaryitem/param/SalaryItemSaveParam.java @@ -63,7 +63,7 @@ public class SalaryItemSaveParam { private Integer roundingMode; //淇濈暀灏忔暟浣 - @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 6, message = "灏忔暟浣嶆渶澶氫负6") + @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "灏忔暟浣嶆渶澶氫负8") private Integer pattern; /** diff --git a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java index 914adf9e1..9682888be 100644 --- a/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java +++ b/src/com/engine/salary/entity/salarysob/bo/SalarySobItemAggregateBO.java @@ -15,11 +15,13 @@ import com.engine.salary.util.SalaryI18nUtil; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; import net.sf.cglib.asm.$AnnotationVisitor; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.general.BaseBean; +import weaver.hrm.User; import weaver.general.Util; import weaver.hrm.User; @@ -36,6 +38,7 @@ import java.util.stream.Collectors; * @version 1.0 **/ @AllArgsConstructor +@NoArgsConstructor public class SalarySobItemAggregateBO { /** @@ -366,7 +369,7 @@ public class SalarySobItemAggregateBO { * @param salarySobEmpFields 钖祫璐﹀鐨勫憳宸ヤ俊鎭瓧娈 * @return */ - private List buildEmpField(Collection salarySobEmpFields, User user) { + public List buildEmpField(Collection salarySobEmpFields, User user) { if (CollectionUtils.isEmpty(salarySobEmpFields)) { return Collections.emptyList(); } diff --git a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java index 240625524..f23df1512 100644 --- a/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java +++ b/src/com/engine/salary/entity/salarysob/dto/SalarySobItemFormDTO.java @@ -53,7 +53,7 @@ public class SalarySobItemFormDTO { private Integer roundingMode; //淇濈暀灏忔暟浣") - @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 6, message = "灏忔暟浣嶆渶澶氫负6") + @DataCheck(require = true, type = ValidTypeEnum.NUMBER, max = 8, message = "灏忔暟浣嶆渶澶氫负8") private Integer pattern; //鍙栧兼柟寮") diff --git a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java index 4e9e7af0a..e8811bf3f 100644 --- a/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java +++ b/src/com/engine/salary/entity/salarysob/param/SalarySobListQueryParam.java @@ -17,4 +17,7 @@ public class SalarySobListQueryParam extends BaseQueryParam { //钖祫璐﹀鍚嶇О") private String name; + + // 钖祫璐﹀id + private Long taxAgentId; } diff --git a/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java b/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java new file mode 100644 index 000000000..fb0e402ba --- /dev/null +++ b/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java @@ -0,0 +1,64 @@ +package com.engine.salary.entity.siaccount.param; + +import com.engine.salary.util.valid.DataCheck; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * @Author: sy + * @Description: 缁勮琛ュ樊鍩烘湰鏁版嵁 + * @Date: 2023/11/23 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BalanceAccountBaseParam { + + //鍛樺伐id") + private Long employeeId; + + //璐﹀崟鏈堜唤") + private String billMonth; + + /** + * 涓◣鎵g即涔夊姟浜篿d + */ + @DataCheck(require = true,message = "涓◣鎵g即涔夊姟浜轰笉鑳戒负绌") + private Long paymentOrganization; + + + /** + * 绀句繚琛ョ即閲戦_涓汉 + */ + private String socialPerJson; + + /** + * 绀句繚琛ョ即閲戦_鍗曚綅 + */ + private String socialComJson; + + /** + * 鍏Н閲戣ˉ缂撮噾棰漘涓汉 + */ + private String fundPerJson; + + /** + * 鍏Н閲戣ˉ缂撮噾棰漘鍗曚綅 + */ + private String fundComJson; + + /** + * 鍏朵粬绂忓埄琛ョ即閲戦_涓汉 + */ + private String otherPerJson; + + /** + * 鍏朵粬绂忓埄琛ョ即閲戦_鍗曚綅 + */ + private String otherComJson; + +} diff --git a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountBatchParam.java b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountBatchParam.java index 9e34e0d42..9e3d531aa 100644 --- a/src/com/engine/salary/entity/siaccount/param/InsuranceAccountBatchParam.java +++ b/src/com/engine/salary/entity/siaccount/param/InsuranceAccountBatchParam.java @@ -27,4 +27,6 @@ public class InsuranceAccountBatchParam extends BaseQueryParam { private String endTime; private List taxAgents; + + private Long paymentOrganization; } diff --git a/src/com/engine/salary/enums/common/FilterEnum.java b/src/com/engine/salary/enums/common/FilterEnum.java index bdba1eada..0c8111951 100644 --- a/src/com/engine/salary/enums/common/FilterEnum.java +++ b/src/com/engine/salary/enums/common/FilterEnum.java @@ -13,7 +13,7 @@ public enum FilterEnum implements BaseEnum { BT("BT", "鍖呭惈", 346) { @Override public Predicate filter(List params) { - return a -> a.contains(params.get(0)); + return a -> a != null && a.contains(params.get(0)); } }, EQ("EQ", "绛変簬", 545305) { @@ -23,7 +23,7 @@ public enum FilterEnum implements BaseEnum { if (NumberUtils.isCreatable(a) && NumberUtils.isCreatable(params.get(0))) { return new BigDecimal(a).compareTo(new BigDecimal(params.get(0))) == 0; } else { - return a.equals(params.get(0)); + return a != null && a.equals(params.get(0)); } }; } @@ -35,7 +35,7 @@ public enum FilterEnum implements BaseEnum { if (NumberUtils.isCreatable(a) && NumberUtils.isCreatable(params.get(0))) { return new BigDecimal(a).compareTo(new BigDecimal(params.get(0))) != 0; } else { - return !a.equals(params.get(0)); + return a != null && !a.equals(params.get(0)); } }; } diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml index 784c6e848..61223c9b0 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountBatchMapper.xml @@ -138,6 +138,10 @@ AND t.bill_month between #{param.startTime} and #{param.endTime} + + AND + t.payment_organization = #{param.paymentOrganization} + AND t.payment_organization in diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 6540a705d..2e52ce986 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -1319,7 +1319,8 @@ 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.payment_organization, - t.total, t.social_sum, t.fund_sum, t.other_sum + t.total, t.social_sum, t.fund_sum, t.other_sum, + t.social_scheme_id, t.fund_scheme_id, t.other_scheme_id FROM hrsa_bill_detail t WHERE t.delete_type = 0 diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java index 203509ca1..d6368f8b4 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java @@ -61,6 +61,14 @@ public interface FundSchemeMapper { */ void batchSave(@Param("fundSchemePOS") List singletonList); + /** + * 鏍规嵁涓◣鎵g即涔夊姟浜篿d鑾峰彇鐩爣璐﹀崟鏈堝彲浠ヨ繘琛岀即绾崇殑浜哄憳id + * 绛涢夋潯浠朵负璐﹀崟鏈堟槸鍚﹀湪璧峰缂寸撼鏈堝拰鏈鍚庣即绾虫湀涔嬮棿 + * @param paymentOrganization + * @return + */ + List listCanPayEmpIds(@Param("paymentOrganization")Long paymentOrganization, @Param("billMonth")String billMonth); + List listAll(); int batchUpdate(@Param("collection") List pos); diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index 0b8f650b7..fc91b8885 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -248,6 +248,17 @@ + + + SELECT + t.employee_id + FROM hrsa_other_archives t + WHERE delete_type = 0 + AND payment_organization = #{paymentOrganization} + AND other_scheme_id is not null + AND other_start_time is not null AND other_start_time #{billMonth} + AND (other_end_time is null OR other_end_time = ]]> #{billMonth}) + + + + +