diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java index d73bf6637..926faa3cb 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java @@ -4,9 +4,12 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; +import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.report.entity.bo.SalaryStatisticsEmployeeBO; @@ -62,6 +65,14 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala return ServiceUtil.getService(SalaryItemServiceImpl.class, user); } + private SalarySobService getSalarySobService(User user) { + return ServiceUtil.getService(SalarySobServiceImpl.class, user); + } + + private SalaryAcctRecordService getSalaryAcctRecordService(User user) { + return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user); + } + // private ExtEmployeeMapper extEmployeeMapper; @@ -76,7 +87,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala @Override public PageInfo listPage(SalaryStatisticsEmployeeQueryParam queryParam) { List list = Collections.emptyList(); - PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, SalaryStatisticsEmployeeListDTO.class); // 1.分权处理, 首先获取个税扣缴义务人参数 Collection taxAgentViews = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); @@ -165,7 +176,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala // .in(ExtEmployeePO::getId, extEmployeeIdList) // .list(); // Map extEmployeeMap = extEmployeeList.stream().collect(Collectors.toMap(ExtEmployeePO::getId, v -> v)); - List simpleEmployeeList = getSalaryEmployeeService(user).getEmployeeByIds(employeeIds); + List simpleEmployeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); Map innerEmployeeMap = simpleEmployeeList.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, v -> v)); salaryStatisticsEmployeeListDTOs.forEach(e -> { DataCollectionEmployee simpleEmployee = innerEmployeeMap.get(e.getId()); @@ -173,7 +184,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala e.setSubCompany(simpleEmployee.getSubcompanyName()); e.setDepartment(simpleEmployee.getDepartmentName()); e.setPosition(simpleEmployee.getJobtitleName()); - e.setStatus(simpleEmployee.getStatus()); + e.setStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(simpleEmployee.getStatus()))); e.setJobNum(simpleEmployee.getWorkcode()); e.setIdNo(simpleEmployee.getIdNo()); }); @@ -229,6 +240,12 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala List taxAgentList = getTaxAgentService(user).listAll(); Map taxAgentMap = SalaryEntityUtil.convert2Map(taxAgentList, TaxAgentPO::getId, TaxAgentPO::getName); + List salarySobPOS = getSalarySobService(user).listAll(); + Map SalarySobMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getId, SalarySobPO::getName); + + List salaryAcctRecordPOS = getSalaryAcctRecordService(user).listAll(); + Map salaryAcctRecordMap = SalaryEntityUtil.convert2Map(salaryAcctRecordPOS, SalaryAcctRecordPO::getId, SalaryAcctRecordPO::getAcctTimes); + Map> acctResultValueList = SalaryEntityUtil.group2Map(salaryStatisticsEmployeeDetailResult.getSalaryAcctResultValueList(), SalaryAcctResultPO::getSalaryAcctEmpId); Map> acctResultValueMap = new HashMap<>(); acctResultValueList.forEach((k, v) -> { @@ -250,8 +267,10 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala finalMap.put(k + SalaryConstant.DYNAMIC_SUFFIX, v); }); map.put("id", se.getId().toString()); - map.put("salaryMonth", se.getSalaryMonth()); + map.put("salaryMonth", SalaryDateUtil.getFormatYearMonth(se.getSalaryMonth())); map.put("taxAgent", taxAgentMap.get(se.getTaxAgentId())); + map.put("salarySob",SalarySobMap.get(se.getSalarySobId())); + map.put("acctTimes", salaryAcctRecordMap.get(se.getSalaryAcctRecordId())); // IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory())); // map.put("incomeCategory", Objects.isNull(incomeCategoryEnum) ? "" : SalaryI18nUtil.getI18nLabel(incomeCategoryEnum.getLabelId(), incomeCategoryEnum.getDefaultLabel())); list.add(map); diff --git a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java index 588637ddc..435ad5ac2 100644 --- a/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java +++ b/src/com/engine/salary/report/wrapper/SalaryStatisticsEmployeeWrapper.java @@ -1,6 +1,9 @@ package com.engine.salary.report.wrapper; +import com.cloudstore.eccom.constant.WeaBoolAttr; +import com.cloudstore.eccom.pc.table.WeaTable; import com.cloudstore.eccom.pc.table.WeaTableColumn; +import com.cloudstore.eccom.result.WeaResultMsg; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; @@ -23,10 +26,7 @@ import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; /** * 薪酬统计员工明细 @@ -41,6 +41,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { private SalaryStatisticsEmployeeService getSalaryStatisticsEmployeeService(User user) { return ServiceUtil.getService(SalaryStatisticsEmployeeServiceImpl.class, user); } + /** * 员工列表 * @@ -48,8 +49,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { * @return */ public PageInfo list(SalaryStatisticsEmployeeQueryParam queryParam) { - PageInfo page = getSalaryStatisticsEmployeeService(user).listPage(queryParam); - return page; + return getSalaryStatisticsEmployeeService(user).listPage(queryParam); } /** @@ -64,10 +64,6 @@ public class SalaryStatisticsEmployeeWrapper extends Service { List> records = getSalaryStatisticsEmployeeService(user).listDetailPage(salaryStatisticsEmployeeDetailResult, queryParam); Map countResultMap = Maps.newHashMap(); - countResultMap.put("id", "1000000"); - countResultMap.put("salaryMonth", "-"); - countResultMap.put("taxAgent", "-"); - countResultMap.put("incomeCategory", "-"); if (CollectionUtils.isNotEmpty(records)) { List salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList(); for (SalaryItemPO item : salaryItems) { @@ -75,7 +71,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service { String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX; for (Map record : records) { if (record.containsKey(itemKey)) { - if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString())&& NumberUtils.isCreatable(record.get(itemKey).toString())) { + if (Objects.nonNull(record.get(itemKey)) && StringUtils.isNotEmpty(record.get(itemKey).toString()) && NumberUtils.isCreatable(record.get(itemKey).toString())) { sumBigDecimal = sumBigDecimal.add(new BigDecimal(record.get(itemKey).toString())); record.put(itemKey, ReportDataUtil.thousandthConvert(record.get(itemKey).toString())); } @@ -89,21 +85,33 @@ public class SalaryStatisticsEmployeeWrapper extends Service { // 列表columns List weaTableColumns = buildDetailTableColumns(salaryStatisticsEmployeeDetailResult); + WeaTable table = new WeaTable(); + table.setPageUID(UUID.randomUUID().toString()); + table.setColumns(weaTableColumns); + + WeaResultMsg result = new WeaResultMsg(false); + result.putAll(table.makeDataResult()); + result.success(); + // 结果 Map resultMap = Maps.newHashMap(); - resultMap.put("columns", weaTableColumns); +// resultMap.put("columns", weaTableColumns); + resultMap.put("dataKey", result.getResultMap()); resultMap.put("pageInfo", pageInfo); + resultMap.put("countResult", countResultMap); return resultMap; } private List buildDetailTableColumns(SalaryStatisticsEmployeeDetailResultDTO salaryStatisticsEmployeeDetailResult) { // 表格表头 List columns = new ArrayList<>(); - columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 87614, "薪资所属月"), "salaryMonth", "100")); - columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"), "taxAgent", "150")); - columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 121908, "收入所得项目"), "incomeCategory", "150")); + columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(87614, "薪资所属月"), "salaryMonth")); + columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgent")); + columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "账套"), "salarySob")); + columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "次数"), "acctTimes").setDisplay(WeaBoolAttr.FALSE)); +// columns.add(new WeaTableColumn("100px",SalaryI18nUtil.getI18nLabel( 121908, "收入所得项目"), "incomeCategory")); salaryStatisticsEmployeeDetailResult.getSalaryItemList().forEach(item -> { - columns.add(new WeaTableColumn(item.getName(), item.getId() + SalaryConstant.DYNAMIC_SUFFIX, "100")); + columns.add(new WeaTableColumn("100px", item.getName(), item.getId() + SalaryConstant.DYNAMIC_SUFFIX)); }); return columns; } diff --git a/src/com/engine/salary/service/SalaryAcctRecordService.java b/src/com/engine/salary/service/SalaryAcctRecordService.java index c4adc2860..5e1f16cbf 100644 --- a/src/com/engine/salary/service/SalaryAcctRecordService.java +++ b/src/com/engine/salary/service/SalaryAcctRecordService.java @@ -31,6 +31,8 @@ public interface SalaryAcctRecordService { */ SalaryAcctRecordPO getById(Long id); + List listAll(); + /** * 根据主键id查询薪资核算记录 * @@ -202,4 +204,7 @@ public interface SalaryAcctRecordService { List getBackCalcRecordByIds(Set salaryAcctIds); List listBySalaryAcctEmpId(Long salaryAcctEmpId); + + + } diff --git a/src/com/engine/salary/service/SalarySobService.java b/src/com/engine/salary/service/SalarySobService.java index 49846bbfc..dd39fc5ee 100644 --- a/src/com/engine/salary/service/SalarySobService.java +++ b/src/com/engine/salary/service/SalarySobService.java @@ -63,6 +63,8 @@ public interface SalarySobService { */ List listByDisable(Integer disable); + List listAll(); + /** * 获取拥有管理权限的账套 * @return diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index 40387d1d2..434b74638 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -102,6 +102,11 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe return getSalaryAcctRecordMapper().getById(id); } + @Override + public List listAll() { + return getSalaryAcctRecordMapper().listAll(); + } + @Override public List listByIds(Collection ids) { if (CollectionUtils.isEmpty(ids)) { diff --git a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java index da2075bd6..f10e53149 100644 --- a/src/com/engine/salary/service/impl/SalarySobServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobServiceImpl.java @@ -156,6 +156,11 @@ public class SalarySobServiceImpl extends Service implements SalarySobService { return filterByAuthority(salarySobPOS); } + @Override + public List listAll() { + return salarySobMapper.listSome(SalarySobPO.builder().build()); + } + @Override public List listByAdmin() { List salarySobPOS = salarySobMapper.listSome(SalarySobPO.builder().build());