diff --git a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java index 9203785c0..034d45b90 100644 --- a/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java +++ b/src/com/engine/salary/entity/datacollection/DataCollectionEmployee.java @@ -125,6 +125,42 @@ public class DataCollectionEmployee { @SalaryFormulaVar(defaultLabel = "账号类型编码", labelId = 98622, dataType = "string") private Integer accountType; + + + // 基本信息 + @SalaryFormulaVar(defaultLabel = "公司", labelId = 0, dataType = "string") + private String field136; + @SalaryFormulaVar(defaultLabel = "片区", labelId = 0, dataType = "string") + private String field137; + @SalaryFormulaVar(defaultLabel = "岗位名称", labelId = 0, dataType = "string") + private String field128; + @SalaryFormulaVar(defaultLabel = "岗位职级", labelId = 0, dataType = "string") + private String field1; + @SalaryFormulaVar(defaultLabel = "人员类型", labelId = 0, dataType = "string") + private String field7; + + // 工作信息 + @SalaryFormulaVar(defaultLabel = "岗级", labelId = 0, dataType = "string") + private String field121; + @SalaryFormulaVar(defaultLabel = "星级评定", labelId = 0, dataType = "string") + private String field152; + @SalaryFormulaVar(defaultLabel = "工资发放主体", labelId = 0, dataType = "string") + private String field124; + @SalaryFormulaVar(defaultLabel = "五险购买主体", labelId = 0, dataType = "string") + private String field141; + @SalaryFormulaVar(defaultLabel = "公积金购买主体", labelId = 0, dataType = "string") + private String field142; + @SalaryFormulaVar(defaultLabel = "成本归属本体", labelId = 0, dataType = "string") + private String field125; + @SalaryFormulaVar(defaultLabel = "开户行名称", labelId = 0, dataType = "string") + private String field31; + @SalaryFormulaVar(defaultLabel = "银行卡号", labelId = 0, dataType = "string") + private String field46; + @SalaryFormulaVar(defaultLabel = "发薪银行", labelId = 0, dataType = "string") + private String field145; + + + //是否是系统管理员 private Boolean isAdmin; diff --git a/src/com/engine/salary/entity/hrm/po/HrmSnapshotPO.java b/src/com/engine/salary/entity/hrm/po/HrmSnapshotPO.java index 48411733a..6bff83110 100644 --- a/src/com/engine/salary/entity/hrm/po/HrmSnapshotPO.java +++ b/src/com/engine/salary/entity/hrm/po/HrmSnapshotPO.java @@ -428,6 +428,25 @@ public class HrmSnapshotPO { private BigDecimal workyear; + // 基本信息 + private String field136; + private String field137; + private String field128; + private String field1; + private String field7; + + // 工作信息 + private String field121; + private String field152; + private String field124; + private String field141; + private String field142; + private String field125; + private String field31; + private String field46; + private String field145; + + //主键id集合 private Collection ids; diff --git a/src/com/engine/salary/entity/ly/param/LySalaryReportQueryParam.java b/src/com/engine/salary/entity/ly/param/LySalaryReportQueryParam.java index b28118a79..edb4bf6cc 100644 --- a/src/com/engine/salary/entity/ly/param/LySalaryReportQueryParam.java +++ b/src/com/engine/salary/entity/ly/param/LySalaryReportQueryParam.java @@ -52,4 +52,6 @@ public class LySalaryReportQueryParam extends BaseQueryParam { private List ffStatus; private boolean export; + + private List taxAgentIds; } diff --git a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java index 34207d581..2303b9dbf 100644 --- a/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java +++ b/src/com/engine/salary/entity/salaryacct/bo/SalaryAcctEmployeeBO.java @@ -17,6 +17,7 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.general.Util; +import weaver.wechat.util.Utils; import java.util.*; import java.util.stream.Collectors; @@ -80,6 +81,7 @@ public class SalaryAcctEmployeeBO { public static List convert2Employee(Collection employee, SalaryAcctRecordPO salaryAcctRecord, List salaryArchiveTaxAgentData, + Map> ufJobtitleMap, Long employeeId) { if (CollectionUtils.isEmpty(employee)) { return Collections.emptyList(); @@ -96,6 +98,7 @@ public class SalaryAcctEmployeeBO { if (CollectionUtils.isEmpty(taxAgentIds)) { taxAgentIds.add(0L); } + Map ufJobtitleInfo = ufJobtitleMap.get(emp.getEmployeeId()) == null ? Collections.emptyMap() : ufJobtitleMap.get(emp.getEmployeeId()); for (Long taxAgentId : taxAgentIds) { SalaryAcctEmployeePO salaryAcctEmployee = SalaryAcctEmployeePO.builder() .salaryAcctRecordId(salaryAcctRecord.getId()) @@ -108,8 +111,10 @@ public class SalaryAcctEmployeeBO { .departmentName(emp.getDepartmentName()) .jobcall(emp.getJobcall()) .jobcallId(emp.getJobcallId()) - .jobtitleId(emp.getJobtitleId()) - .jobtitleName(emp.getJobtitleName()) + // .jobtitleId(emp.getJobtitleId()) + // .jobtitleName(emp.getJobtitleName()) + .jobtitleId(NumberUtils.isCreatable(ufJobtitleInfo.get("jobtitleId")) ? Long.valueOf(ufJobtitleInfo.get("jobtitleId")) : null) + .jobtitleName(Utils.null2String(ufJobtitleInfo.get("jobtitleName"))) .subcompanyId(emp.getSubcompanyid()) .subcompanyName(emp.getSubcompanyName()) .status(emp.getStatus()) diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java index c456e80da..42c3d61e8 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryAcctEmployeePO.java @@ -155,6 +155,40 @@ public class SalaryAcctEmployeePO { @SalaryFormulaVar(defaultLabel = "状态编码", labelId = 86321, dataType = "string") private String status; + + // 基本信息 + @SalaryFormulaVar(defaultLabel = "公司", labelId = 0, dataType = "string") + private String field136; + @SalaryFormulaVar(defaultLabel = "片区", labelId = 0, dataType = "string") + private String field137; + @SalaryFormulaVar(defaultLabel = "岗位名称", labelId = 0, dataType = "string") + private String field128; + @SalaryFormulaVar(defaultLabel = "岗位职级", labelId = 0, dataType = "string") + private String field1; + @SalaryFormulaVar(defaultLabel = "人员类型", labelId = 0, dataType = "string") + private String field7; + + // 工作信息 + @SalaryFormulaVar(defaultLabel = "岗级", labelId = 0, dataType = "string") + private String field121; + @SalaryFormulaVar(defaultLabel = "星级评定", labelId = 0, dataType = "string") + private String field152; + @SalaryFormulaVar(defaultLabel = "工资发放主体", labelId = 0, dataType = "string") + private String field124; + @SalaryFormulaVar(defaultLabel = "五险购买主体", labelId = 0, dataType = "string") + private String field141; + @SalaryFormulaVar(defaultLabel = "公积金购买主体", labelId = 0, dataType = "string") + private String field142; + @SalaryFormulaVar(defaultLabel = "成本归属本体", labelId = 0, dataType = "string") + private String field125; + @SalaryFormulaVar(defaultLabel = "开户行名称", labelId = 0, dataType = "string") + private String field31; + @SalaryFormulaVar(defaultLabel = "银行卡号", labelId = 0, dataType = "string") + private String field46; + @SalaryFormulaVar(defaultLabel = "发薪银行", labelId = 0, dataType = "string") + private String field145; + + //锁定的项目 private List lockItems; diff --git a/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.java b/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.java index 81082b003..e8a45bc30 100644 --- a/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.java +++ b/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.java @@ -83,5 +83,16 @@ public interface HrmSnapshotMapper { */ List currentEmpData(); + /** + * 自定义基本信息 + * @return + */ + List currentEmpBaseData(); + + /** + * 自定义工作信息 + * @return + */ + List currentEmpWorkData(); } \ No newline at end of file diff --git a/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.xml b/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.xml index d56a738ea..22a1ffd13 100644 --- a/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.xml +++ b/src/com/engine/salary/mapper/hrm/HrmSnapshotMapper.xml @@ -70,6 +70,21 @@ + + + + + + + + + + + + + + + @@ -144,6 +159,20 @@ , t.WORKROOM , t.workstartdate , t.workyear + , t.field136 + , t.field137 + , t.field128 + , t.field1 + , t.field7 + , t.field121 + , t.field152 + , t.field124 + , t.field141 + , t.field142 + , t.field125 + , t.field31 + , t.field46 + , t.field145 @@ -600,6 +629,49 @@ workyear, + + + field136, + + + field137, + + + field128, + + + field1, + + + field7, + + + field121, + + + field152, + + + field124, + + + field141, + + + field142, + + + field125, + + + field31, + + + field46, + + + field145, + @@ -806,6 +878,49 @@ #{workyear}, + + + #{field136}, + + + #{field137}, + + + #{field128}, + + + #{field1}, + + + #{field7}, + + + #{field121}, + + + #{field152}, + + + #{field124}, + + + #{field141}, + + + #{field142}, + + + #{field125}, + + + #{field31}, + + + #{field46}, + + + #{field145}, + @@ -1198,4 +1313,30 @@ left join hrmjobcall job on e.jobcall=job.id + + + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml index 9aeca4df9..af6c0b4c1 100644 --- a/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml +++ b/src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml @@ -27,6 +27,20 @@ + + + + + + + + + + + + + + @@ -86,7 +114,21 @@ jobcall, jobcall_id, status, - account_type) + account_type, + field136, + field137, + field128, + field1, + field7, + field121, + field152, + field124, + field141, + field142, + field125, + field31, + field46, + field145) VALUES ( @@ -111,7 +153,21 @@ #{emp.jobcall}, #{emp.jobcallId}, #{emp.status}, - #{emp.accountType} + #{emp.accountType}, + #{emp.field136}, + #{emp.field137}, + #{emp.field128}, + #{emp.field1}, + #{emp.field7}, + #{emp.field121}, + #{emp.field152}, + #{emp.field124}, + #{emp.field141}, + #{emp.field142}, + #{emp.field125}, + #{emp.field31}, + #{emp.field46}, + #{emp.field145} ) @@ -128,7 +184,21 @@ jobcall, jobcall_id, status, - account_type + account_type, + field136, + field137, + field128, + field1, + field7, + field121, + field152, + field124, + field141, + field142, + field125, + field31, + field46, + field145 ) select @@ -153,7 +223,21 @@ #{emp.jobcall,jdbcType=VARCHAR}, #{emp.jobcallId,jdbcType=DOUBLE}, #{emp.status,jdbcType=VARCHAR}, - #{emp.accountType,jdbcType=INTEGER} + #{emp.accountType,jdbcType=INTEGER}, + #{emp.field136,jdbcType=VARCHAR}, + #{emp.field137,jdbcType=VARCHAR}, + #{emp.field128,jdbcType=VARCHAR}, + #{emp.field1,jdbcType=VARCHAR}, + #{emp.field7,jdbcType=VARCHAR}, + #{emp.field121,jdbcType=VARCHAR}, + #{emp.field152,jdbcType=VARCHAR}, + #{emp.field124,jdbcType=VARCHAR}, + #{emp.field141,jdbcType=VARCHAR}, + #{emp.field142,jdbcType=VARCHAR}, + #{emp.field125,jdbcType=VARCHAR}, + #{emp.field31,jdbcType=VARCHAR}, + #{emp.field46,jdbcType=VARCHAR}, + #{emp.field145,jdbcType=VARCHAR} from dual @@ -171,7 +255,21 @@ jobcall, jobcall_id, status, - account_type + account_type, + field136, + field137, + field128, + field1, + field7, + field121, + field152, + field124, + field141, + field142, + field125, + field31, + field46, + field145 ) VALUES ( @@ -196,7 +294,21 @@ #{emp.jobcall}, #{emp.jobcallId}, #{emp.status}, - #{emp.accountType} + #{emp.accountType}, + #{emp.field136}, + #{emp.field137}, + #{emp.field128}, + #{emp.field1}, + #{emp.field7}, + #{emp.field121}, + #{emp.field152}, + #{emp.field124}, + #{emp.field141}, + #{emp.field142}, + #{emp.field125}, + #{emp.field31}, + #{emp.field46}, + #{emp.field145} ) @@ -1063,6 +1175,20 @@ , t.status , t.lock_items , t.account_type + , t.field136 + , t.field137 + , t.field128 + , t.field1 + , t.field7 + , t.field121 + , t.field152 + , t.field124 + , t.field141 + , t.field142 + , t.field125 + , t.field31 + , t.field46 + , t.field145 diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index 6379e567f..21803c6af 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -210,4 +210,11 @@ public interface SalaryEmployeeService { * @return */ List listFzhsInfoByDeptIds(List departmentIds); + + /** + * 领悦 - 获取自定义岗位信息 + * @param employeeIds + * @return + */ + Map> listUfJobtitleMap(List employeeIds); } diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index 0ff7b6674..79451855e 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -383,7 +383,9 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds); // 转换成薪资核算人员po Date salaryDate = SalaryDateUtil.dateStrToLocalDate(salaryYearMonth + "-01"); - List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, (long) user.getUID()); + // 查询领悦自定义岗位信息 + Map> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds); + List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID()); //过滤掉不属于当前账套扣缴义务人的人员 employeeIds = salaryAcctEmployeePOS.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/LySalaryReportServiceImpl.java b/src/com/engine/salary/service/impl/LySalaryReportServiceImpl.java index 4186aaff1..5ae92c8bb 100644 --- a/src/com/engine/salary/service/impl/LySalaryReportServiceImpl.java +++ b/src/com/engine/salary/service/impl/LySalaryReportServiceImpl.java @@ -938,6 +938,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport param.setSalaryMonthDate(salaryMonthDate); // 查询核算账套 List salarySobList = getSalarySobService(user).listAll(); + if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) { + salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList()); + } List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList()); LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build(); // 获取核算记录 @@ -1092,6 +1095,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport param.setSalaryMonthDate(salaryMonthDate); // 查询核算账套 List salarySobList = getSalarySobService(user).listAll(); + if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) { + salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList()); + } List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList()); LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build(); // 获取核算记录 @@ -1214,6 +1220,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport param.setSalaryMonthDate(salaryMonthDate); // 查询核算账套 List salarySobList = getSalarySobService(user).listAll(); + if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) { + salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList()); + } List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList()); LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build(); // 获取核算记录 @@ -1376,6 +1385,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport param.setSalaryMonthDate(salaryMonthDate); // 查询核算账套 List salarySobList = getSalarySobService(user).listAll(); + if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) { + salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList()); + } List salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList()); LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build(); // 获取核算记录 diff --git a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java index 35d5f2353..c7eaea0b2 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java @@ -49,7 +49,9 @@ import com.google.common.collect.Sets; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.BeanUtils; +import weaver.conn.RecordSet; import weaver.hrm.User; import java.util.*; @@ -444,8 +446,11 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // 查询薪资档案 List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), saveParam.getEmployeeIds(), taxAgentIds); + + // 查询领悦自定义岗位信息 + Map> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap((List) saveParam.getEmployeeIds()); // 转换成薪资核算人员po - List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); + List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID()); //过滤不是扣缴义务人下的人员 @@ -489,18 +494,44 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct List employees = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); List snapshot = getSalaryEmployeeService(user).snapshot(employees, shotTime); Map shotEmpMap = SalaryEntityUtil.convert2Map(snapshot, DataCollectionEmployee::getEmployeeId); + RecordSet rs = new RecordSet(); salaryAcctEmployeePOS.forEach(salaryAcctEmployeePO -> { DataCollectionEmployee shotEmp = shotEmpMap.getOrDefault(salaryAcctEmployeePO.getEmployeeId(), new DataCollectionEmployee()); salaryAcctEmployeePO.setDepartmentId(shotEmp.getDepartmentId()); salaryAcctEmployeePO.setDepartmentName(shotEmp.getDepartmentName()); salaryAcctEmployeePO.setJobcall(shotEmp.getJobcall()); salaryAcctEmployeePO.setJobcallId(shotEmp.getJobcallId()); - salaryAcctEmployeePO.setJobtitleId(shotEmp.getJobtitleId()); - salaryAcctEmployeePO.setJobtitleName(shotEmp.getJobtitleName()); + // salaryAcctEmployeePO.setJobtitleId(shotEmp.getJobtitleId()); + // salaryAcctEmployeePO.setJobtitleName(shotEmp.getJobtitleName()); + // 领悦 - 取自定义的岗位信息 + Long jobtitleId = NumberUtils.isCreatable(shotEmp.getField128()) ? Long.valueOf(shotEmp.getField128()) : null; + salaryAcctEmployeePO.setJobtitleId(jobtitleId); + rs.executeQuery("select gwmc from uf_xcbz where id= ?", new Object[]{jobtitleId}); + if (rs.next()) { + salaryAcctEmployeePO.setJobtitleName(rs.getString("gwmc")); + } else { + salaryAcctEmployeePO.setJobtitleName(""); + } + salaryAcctEmployeePO.setSubcompanyId(shotEmp.getSubcompanyid()); salaryAcctEmployeePO.setSubcompanyName(shotEmp.getSubcompanyName()); salaryAcctEmployeePO.setStatus(shotEmp.getStatus()); salaryAcctEmployeePO.setAccountType(shotEmp.getAccountType()); + + salaryAcctEmployeePO.setField136(shotEmp.getField136()); + salaryAcctEmployeePO.setField137(shotEmp.getField137()); + salaryAcctEmployeePO.setField128(shotEmp.getField128()); + salaryAcctEmployeePO.setField1(shotEmp.getField1()); + salaryAcctEmployeePO.setField7(shotEmp.getField7()); + salaryAcctEmployeePO.setField121(shotEmp.getField121()); + salaryAcctEmployeePO.setField152(shotEmp.getField152()); + salaryAcctEmployeePO.setField124(shotEmp.getField124()); + salaryAcctEmployeePO.setField141(shotEmp.getField141()); + salaryAcctEmployeePO.setField142(shotEmp.getField142()); + salaryAcctEmployeePO.setField125(shotEmp.getField125()); + salaryAcctEmployeePO.setField31(shotEmp.getField31()); + salaryAcctEmployeePO.setField46(shotEmp.getField46()); + salaryAcctEmployeePO.setField145(shotEmp.getField145()); }); } @@ -509,7 +540,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) { return; } - List> partition = Lists.partition((List) salaryAcctEmployeePOS, 50); + List> partition = Lists.partition((List) salaryAcctEmployeePOS, 20); partition.forEach(getSalaryAcctEmployeeMapper()::batchInsert); } @@ -606,8 +637,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // 查询薪资档案,获取人员的个税扣缴义务人 List employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList()); List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds); + // 查询领悦自定义岗位信息 + Map> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds); // 转换成薪资核算人员po - List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); + List salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID()); //过滤掉不属于当前账套扣缴义务人的人员 salaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList()); @@ -642,8 +675,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct // 查询薪资档案,获取人员的个税扣缴义务人 List employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList()); List salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds); + // 查询领悦自定义岗位信息 + Map> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds); // 转换成薪资核算人员po - List newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID()); + List newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID()); //过滤掉不属于当前账套扣缴义务人的人员 newEmps = newEmps.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList()); Map newEmpMap = SalaryEntityUtil.convert2Map(newEmps, e -> e.getTaxAgentId() + "_" + e.getEmployeeId()); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 74594533e..8a28081d2 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -14,7 +14,6 @@ import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO; import com.engine.salary.entity.datacollection.po.VariableItemPO; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.JobCallInfo; -import com.engine.salary.entity.hrm.PositionInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.progress.ProgressDTO; import com.engine.salary.entity.report.po.SalaryAcctResultReportPO; @@ -63,6 +62,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.util.StopWatch; +import weaver.conn.RecordSet; import weaver.general.BaseBean; import weaver.hrm.User; @@ -603,6 +603,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除")); } // 更新员工基本信息值 + RecordSet rs = new RecordSet(); saveParam.getEmployeeInfos().stream().forEach(info -> { if (info.getFieldValue() != null && StringUtils.isNotBlank(info.getFieldValue().toString())) { if (info.getFieldCode().equals("departmentName") || info.getFieldCode().equals("departmentId")) { @@ -622,13 +623,19 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe salaryAcctEmployeePO.setSubcompanyId(subCompanyInfo.getId()); } } else if (info.getFieldCode().equals("jobtitleName") || info.getFieldCode().equals("jobtitleId")) { - // 修改岗位信息 - PositionInfo positionInfo = getSalaryEmployeeService(user).getPositionInfoById(NumberUtils.isCreatable(info.getFieldValue().toString()) - ? Long.valueOf(info.getFieldValue().toString()) : 0L); - if (Objects.nonNull(positionInfo)) { - salaryAcctEmployeePO.setJobtitleName(positionInfo.getName()); - salaryAcctEmployeePO.setJobtitleId(positionInfo.getId()); + if (info.getFieldValue() != null && StringUtils.isNotBlank(info.getFieldValue().toString())) { + // 领悦 - 取自定义的岗位信息 + rs.executeQuery("select gwmc from uf_xcbz where id= ?", new Object[]{info.getFieldValue()}); + if (rs.next()) { + salaryAcctEmployeePO.setJobtitleName(rs.getString("gwmc")); + salaryAcctEmployeePO.setJobtitleId(NumberUtils.isCreatable(info.getFieldValue().toString()) ? Long.valueOf(info.getFieldValue().toString()) : 0L); + } } + // salaryAcctEmployeePO.setJobtitleName(positionInfo.getName()); + // salaryAcctEmployeePO.setJobtitleId(positionInfo.getId()); + // 修改岗位信息 + // PositionInfo positionInfo = getSalaryEmployeeService(user).getPositionInfoById(NumberUtils.isCreatable(info.getFieldValue().toString()) + // ? Long.valueOf(info.getFieldValue().toString()) : 0L); } else if (info.getFieldCode().equals("jobcall") || info.getFieldCode().equals("jobcallId")) { // 修改职称信息 JobCallInfo jobCallInfo = getSalaryEmployeeService(user).getJobCallInfoById(NumberUtils.isCreatable(info.getFieldValue().toString()) diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 0d9f88e3a..fbe4724b3 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -681,6 +681,20 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee .idNo(hrmSnapshotPO.getCertificatenum()) .accountTypeName(AccountTypeEnum.getDefaultLabelByValue(hrmSnapshotPO.getAccounttype())) .accountType(hrmSnapshotPO.getAccounttype()) + .field136(hrmSnapshotPO.getField136()) + .field137(hrmSnapshotPO.getField137()) + .field128(hrmSnapshotPO.getField128()) + .field1(hrmSnapshotPO.getField1()) + .field7(hrmSnapshotPO.getField7()) + .field121(hrmSnapshotPO.getField121()) + .field152(hrmSnapshotPO.getField152()) + .field124(hrmSnapshotPO.getField124()) + .field141(hrmSnapshotPO.getField141()) + .field142(hrmSnapshotPO.getField142()) + .field125(hrmSnapshotPO.getField125()) + .field31(hrmSnapshotPO.getField31()) + .field46(hrmSnapshotPO.getField46()) + .field145(hrmSnapshotPO.getField145()) .build()) .orElse(currentEmployeeMap.get(employeeId)); }).collect(Collectors.toList()); @@ -700,4 +714,30 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } return getEmployMapper().listFzhsInfoByDeptIds(departmentIds); } + + @Override + public Map> listUfJobtitleMap(List employeeIds) { + if (CollectionUtils.isEmpty(employeeIds)) { + return Collections.emptyMap(); + } + RecordSet rs = new RecordSet(); + List> partition = Lists.partition(employeeIds, 500); + Map> resultMap = new HashMap>(); + + partition.forEach(part -> { + String empIdStr = StringUtils.join(part, ","); + String sql = "select a.id,a.field128,b.gwmc FROM cus_fielddata a left join uf_xcbz b on a.field128 = b.id where a.SCOPEID = -1 and a.id in (" +empIdStr + ")"; + rs.execute(sql); + while (rs.next()) { + Long id = Long.valueOf(rs.getInt("id")); + String jobtitleId = Util.null2String(rs.getString("field128")); + String gwmc = Util.null2String(rs.getString("gwmc")); + Map jobtitleInfoMap = new HashMap<>(); + jobtitleInfoMap.put("jobtitleId", jobtitleId); + jobtitleInfoMap.put("jobtitleName", gwmc); + resultMap.put(id, jobtitleInfoMap); + } + }); + return resultMap; + } } diff --git a/src/com/engine/salary/timer/HrmSnapshotJob.java b/src/com/engine/salary/timer/HrmSnapshotJob.java index ac0a7a091..5d8f9e36e 100644 --- a/src/com/engine/salary/timer/HrmSnapshotJob.java +++ b/src/com/engine/salary/timer/HrmSnapshotJob.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.StrUtil; import com.engine.salary.entity.hrm.po.HrmSnapshotPO; import com.engine.salary.mapper.hrm.HrmSnapshotMapper; import com.engine.salary.util.SalaryDateUtil; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.IdGenerator; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; @@ -13,6 +14,7 @@ import weaver.interfaces.schedule.BaseCronJob; import java.time.LocalDate; import java.util.Date; import java.util.List; +import java.util.Map; @Slf4j public class HrmSnapshotJob extends BaseCronJob { @@ -32,6 +34,12 @@ public class HrmSnapshotJob extends BaseCronJob { try { List hrmSnapshotPOS = getHrmSnapshotMapper().currentEmpData(); + // 查询基本信息 + List hrmSnapshotBasePOS = getHrmSnapshotMapper().currentEmpBaseData(); + Map baseMap = SalaryEntityUtil.convert2Map(hrmSnapshotBasePOS, HrmSnapshotPO::getEmployeeId); + // 查询工作信息 + List hrmSnapshotWorkPOS = getHrmSnapshotMapper().currentEmpWorkData(); + Map workMap = SalaryEntityUtil.convert2Map(hrmSnapshotWorkPOS, HrmSnapshotPO::getEmployeeId); Date snapshotTime = StrUtil.isNotBlank(appointSnapshotTime) && SalaryDateUtil.checkDay(appointSnapshotTime) ? SalaryDateUtil.dateStrToLocalDate(appointSnapshotTime) : SalaryDateUtil.localDateToDate(LocalDate.now()); @@ -39,7 +47,26 @@ public class HrmSnapshotJob extends BaseCronJob { getHrmSnapshotMapper().deleteBySnapshotTime(snapshotTime); hrmSnapshotPOS.forEach(hrmSnapshotPO -> { - + HrmSnapshotPO baseInfo = baseMap.get(hrmSnapshotPO.getEmployeeId()); + if (baseInfo != null) { + hrmSnapshotPO.setField136(baseInfo.getField136()); + hrmSnapshotPO.setField137(baseInfo.getField137()); + hrmSnapshotPO.setField128(baseInfo.getField128()); + hrmSnapshotPO.setField1(baseInfo.getField1()); + hrmSnapshotPO.setField7(baseInfo.getField7()); + } + HrmSnapshotPO workInfo = workMap.get(hrmSnapshotPO.getEmployeeId()); + if (workInfo != null) { + hrmSnapshotPO.setField121(workInfo.getField121()); + hrmSnapshotPO.setField152(workInfo.getField152()); + hrmSnapshotPO.setField124(workInfo.getField124()); + hrmSnapshotPO.setField141(workInfo.getField141()); + hrmSnapshotPO.setField142(workInfo.getField142()); + hrmSnapshotPO.setField125(workInfo.getField125()); + hrmSnapshotPO.setField31(workInfo.getField31()); + hrmSnapshotPO.setField46(workInfo.getField46()); + hrmSnapshotPO.setField145(workInfo.getField145()); + } hrmSnapshotPO.setId(IdGenerator.generate()); hrmSnapshotPO.setSnapshotTime(snapshotTime); diff --git a/src/com/engine/salary/web/TaxAgentController.java b/src/com/engine/salary/web/TaxAgentController.java index 5d06ab13f..9613462cb 100644 --- a/src/com/engine/salary/web/TaxAgentController.java +++ b/src/com/engine/salary/web/TaxAgentController.java @@ -126,6 +126,14 @@ public class TaxAgentController { return new ResponseResult>(user).run(getTaxAgentWrapper(user)::listAuth, queryParam); } + @POST + @Path("/listAll") + @Produces(MediaType.APPLICATION_JSON) + public String selectAllList(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getTaxAgentWrapper(user)::selectAllList); + } + //查询个税扣缴义务人下面的代缴机构") @GET @Path("/paymentAgency/list") diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 8a8b87e51..0050b5848 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -364,11 +364,17 @@ public class SalaryArchiveWrapper extends Service { SalaryArchiveBaseInfoFormDTO build = SalaryArchiveBaseInfoFormDTO.builder() .username(employee.getUsername()) .department(employee.getDepartmentName()) - .position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName()) + // .position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName()) .hiredate(employee.getCompanystartdate()) .mobile(employee.getMobile()) .taxAgent(taxAgent.getName()) .build(); + // 获取领悦自定义岗位 + Map> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(Collections.singletonList(po.getEmployeeId())); + Map jobtitleMap = ufJobtitleMap.get(po.getEmployeeId()); + if (jobtitleMap != null && jobtitleMap.get("jobtitleName") != null) { + build.setPosition(jobtitleMap.get("jobtitleName")); + } baseInfo.put("employee", build); List> salaryItems = Lists.newArrayList(); diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 2ea504ee9..c56cc7f76 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -151,6 +151,10 @@ public class TaxAgentWrapper extends Service { return getTaxAgentService(user).listAuth(taxAgentQueryParam); } + public List selectAllList() { + return getTaxAgentService(user).listAll(); + } + public List> paymentAgencyList(TaxAgentQueryParam queryParam) { // List taxAgentPOS = getTaxAgentService(user).listByIds(queryParam.getIds()); // List paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);