领悦 二开

This commit is contained in:
Harryxzy 2025-04-16 14:14:03 +08:00
parent 59cb927806
commit d172cb402e
18 changed files with 547 additions and 25 deletions

View File

@ -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;

View File

@ -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<Long> ids;

View File

@ -52,4 +52,6 @@ public class LySalaryReportQueryParam extends BaseQueryParam {
private List<Integer> ffStatus;
private boolean export;
private List<Long> taxAgentIds;
}

View File

@ -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<SalaryAcctEmployeePO> convert2Employee(Collection<DataCollectionEmployee> employee,
SalaryAcctRecordPO salaryAcctRecord,
List<SalaryArchiveDataDTO> salaryArchiveTaxAgentData,
Map<Long, Map<String, String>> 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<String, String> 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())

View File

@ -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<Long> lockItems;

View File

@ -83,5 +83,16 @@ public interface HrmSnapshotMapper {
*/
List<HrmSnapshotPO> currentEmpData();
/**
* 自定义基本信息
* @return
*/
List<HrmSnapshotPO> currentEmpBaseData();
/**
* 自定义工作信息
* @return
*/
List<HrmSnapshotPO> currentEmpWorkData();
}

View File

@ -70,6 +70,21 @@
<result column="WORKROOM" property="workroom"/>
<result column="workstartdate" property="workstartdate"/>
<result column="workyear" property="workyear"/>
<result column="field136" property="field136"/>
<result column="field137" property="field137"/>
<result column="field128" property="field128"/>
<result column="field1" property="field1"/>
<result column="field7" property="field7"/>
<result column="field121" property="field121"/>
<result column="field152" property="field152"/>
<result column="field124" property="field124"/>
<result column="field141" property="field141"/>
<result column="field142" property="field142"/>
<result column="field125" property="field125"/>
<result column="field31" property="field31"/>
<result column="field46" property="field46"/>
<result column="field145" property="field145"/>
</resultMap>
<!-- 表字段 -->
@ -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
</sql>
<!-- 查询全部 -->
@ -600,6 +629,49 @@
<if test="workyear != null">
workyear,
</if>
<if test="field136 != null">
field136,
</if>
<if test="field137 != null">
field137,
</if>
<if test="field128 != null">
field128,
</if>
<if test="field1 != null">
field1,
</if>
<if test="field7 != null">
field7,
</if>
<if test="field121 != null">
field121,
</if>
<if test="field152 != null">
field152,
</if>
<if test="field124 != null">
field124,
</if>
<if test="field141 != null">
field141,
</if>
<if test="field142 != null">
field142,
</if>
<if test="field125 != null">
field125,
</if>
<if test="field31 != null">
field31,
</if>
<if test="field46 != null">
field46,
</if>
<if test="field145 != null">
field145,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="accountid1 != null">
@ -806,6 +878,49 @@
<if test="workyear != null">
#{workyear},
</if>
<if test="field136 != null">
#{field136},
</if>
<if test="field137 != null">
#{field137},
</if>
<if test="field128 != null">
#{field128},
</if>
<if test="field1 != null">
#{field1},
</if>
<if test="field7 != null">
#{field7},
</if>
<if test="field121 != null">
#{field121},
</if>
<if test="field152 != null">
#{field152},
</if>
<if test="field124 != null">
#{field124},
</if>
<if test="field141 != null">
#{field141},
</if>
<if test="field142 != null">
#{field142},
</if>
<if test="field125 != null">
#{field125},
</if>
<if test="field31 != null">
#{field31},
</if>
<if test="field46 != null">
#{field46},
</if>
<if test="field145 != null">
#{field145},
</if>
</trim>
</insert>
@ -1198,4 +1313,30 @@
left join hrmjobcall job on e.jobcall=job.id
</select>
<select id="currentEmpBaseData" resultType="com.engine.salary.entity.hrm.po.HrmSnapshotPO">
select
id as employeeId,
field136,
field137,
field128,
field1,
field7
from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=-1
</select>
<select id="currentEmpWorkData" resultType="com.engine.salary.entity.hrm.po.HrmSnapshotPO">
select
id as employeeId,
field121,
field152,
field124,
field141,
field142,
field125,
field31,
field46,
field145
from cus_fielddata where scope='HrmCustomFieldByInfoType' and scopeid=3
</select>
</mapper>

View File

@ -27,6 +27,20 @@
<result column="status" property="status"/>
<result column="lock_items" property="lockItems" typeHandler="com.engine.salary.handle.SalaryListTypeHandler"/>
<result column="account_type" property="accountType"/>
<result column="field136" property="field136"/>
<result column="field137" property="field137"/>
<result column="field128" property="field128"/>
<result column="field1" property="field1"/>
<result column="field7" property="field7"/>
<result column="field121" property="field121"/>
<result column="field152" property="field152"/>
<result column="field124" property="field124"/>
<result column="field141" property="field141"/>
<result column="field142" property="field142"/>
<result column="field125" property="field125"/>
<result column="field31" property="field31"/>
<result column="field46" property="field46"/>
<result column="field145" property="field145"/>
</resultMap>
<resultMap id="SalaryAccEmployeeCountMap"
@ -62,7 +76,21 @@
t.jobcall_id,
t.status,
t.lock_items,
t.account_type
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
</sql>
<sql id="emp1Column">
@ -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
<foreach collection="collection" item="emp" separator=",">
(
@ -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}
)
</foreach>
</insert>
@ -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
)
<foreach collection="collection" item="emp" separator="union all">
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
</foreach>
</insert>
@ -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}
)
</foreach>
</insert>
@ -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
</sql>

View File

@ -210,4 +210,11 @@ public interface SalaryEmployeeService {
* @return
*/
List<LyFzhsInfo> listFzhsInfoByDeptIds(List<Long> departmentIds);
/**
* 领悦 - 获取自定义岗位信息
* @param employeeIds
* @return
*/
Map<Long, Map<String, String>> listUfJobtitleMap(List<Long> employeeIds);
}

View File

@ -383,7 +383,9 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 转换成薪资核算人员po
Date salaryDate = SalaryDateUtil.dateStrToLocalDate(salaryYearMonth + "-01");
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, SalaryAcctRecordPO.builder().salarySobId(salarySobId).salaryMonth(salaryDate).build(), salaryArchiveDataDTOS, (long) user.getUID());
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
List<SalaryAcctEmployeePO> 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());

View File

@ -938,6 +938,9 @@ public class LySalaryReportServiceImpl extends Service implements LySalaryReport
param.setSalaryMonthDate(salaryMonthDate);
// 查询核算账套
List<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> 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<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> 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<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> 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<SalarySobPO> salarySobList = getSalarySobService(user).listAll();
if (CollectionUtils.isNotEmpty(param.getTaxAgentIds())) {
salarySobList = salarySobList.stream().filter(salarySobPO -> param.getTaxAgentIds().contains(salarySobPO.getTaxAgentId())).collect(Collectors.toList());
}
List<Long> salarySobIds = salarySobList.stream().map(SalarySobPO::getId).collect(Collectors.toList());
LocalDateRange dateRange = LocalDateRange.builder().fromDate(salaryMonthDate).endDate(salaryMonthDate).build();
// 获取核算记录

View File

@ -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<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), saveParam.getEmployeeIds(), taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap((List) saveParam.getEmployeeIds());
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(employees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤不是扣缴义务人下的人员
@ -489,18 +494,44 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
List<Long> employees = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
List<DataCollectionEmployee> snapshot = getSalaryEmployeeService(user).snapshot(employees, shotTime);
Map<Long, DataCollectionEmployee> 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<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 50);
List<List<SalaryAcctEmployeePO>> partition = Lists.partition((List) salaryAcctEmployeePOS, 20);
partition.forEach(getSalaryAcctEmployeeMapper()::batchInsert);
}
@ -606,8 +637,10 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
// 查询薪资档案获取人员的个税扣缴义务人
List<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> 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<Long> employeeIds = SalaryEntityUtil.properties(salaryEmployees, DataCollectionEmployee::getEmployeeId, Collectors.toList());
List<SalaryArchiveDataDTO> salaryArchiveDataDTOS = getSalaryArchiveService(user).getSalaryArchiveTaxAgentData(salarySobCycleDTO.getSalaryCycle(), employeeIds, taxAgentIds);
// 查询领悦自定义岗位信息
Map<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(employeeIds);
// 转换成薪资核算人员po
List<SalaryAcctEmployeePO> newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, (long) user.getUID());
List<SalaryAcctEmployeePO> newEmps = SalaryAcctEmployeeBO.convert2Employee(salaryEmployees, salaryAcctRecordPO, salaryArchiveDataDTOS, ufJobtitleMap, (long) user.getUID());
//过滤掉不属于当前账套扣缴义务人的人员
newEmps = newEmps.stream().filter(po -> taxAgentIds.contains(po.getTaxAgentId())).collect(Collectors.toList());
Map<String, SalaryAcctEmployeePO> newEmpMap = SalaryEntityUtil.convert2Map(newEmps, e -> e.getTaxAgentId() + "_" + e.getEmployeeId());

View File

@ -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())

View File

@ -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<Long, Map<String, String>> listUfJobtitleMap(List<Long> employeeIds) {
if (CollectionUtils.isEmpty(employeeIds)) {
return Collections.emptyMap();
}
RecordSet rs = new RecordSet();
List<List<Long>> partition = Lists.partition(employeeIds, 500);
Map<Long, Map<String, String>> resultMap = new HashMap<Long, Map<String, String>>();
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<String, String> jobtitleInfoMap = new HashMap<>();
jobtitleInfoMap.put("jobtitleId", jobtitleId);
jobtitleInfoMap.put("jobtitleName", gwmc);
resultMap.put(id, jobtitleInfoMap);
}
});
return resultMap;
}
}

View File

@ -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<HrmSnapshotPO> hrmSnapshotPOS = getHrmSnapshotMapper().currentEmpData();
// 查询基本信息
List<HrmSnapshotPO> hrmSnapshotBasePOS = getHrmSnapshotMapper().currentEmpBaseData();
Map<Long, HrmSnapshotPO> baseMap = SalaryEntityUtil.convert2Map(hrmSnapshotBasePOS, HrmSnapshotPO::getEmployeeId);
// 查询工作信息
List<HrmSnapshotPO> hrmSnapshotWorkPOS = getHrmSnapshotMapper().currentEmpWorkData();
Map<Long, HrmSnapshotPO> 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);

View File

@ -126,6 +126,14 @@ public class TaxAgentController {
return new ResponseResult<TaxAgentQueryParam, List<TaxAgentPO>>(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<String, List<TaxAgentPO>>(user).run(getTaxAgentWrapper(user)::selectAllList);
}
//查询个税扣缴义务人下面的代缴机构")
@GET
@Path("/paymentAgency/list")

View File

@ -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<Long, Map<String, String>> ufJobtitleMap = getSalaryEmployeeService(user).listUfJobtitleMap(Collections.singletonList(po.getEmployeeId()));
Map<String, String> jobtitleMap = ufJobtitleMap.get(po.getEmployeeId());
if (jobtitleMap != null && jobtitleMap.get("jobtitleName") != null) {
build.setPosition(jobtitleMap.get("jobtitleName"));
}
baseInfo.put("employee", build);
List<Map<String, Object>> salaryItems = Lists.newArrayList();

View File

@ -151,6 +151,10 @@ public class TaxAgentWrapper extends Service {
return getTaxAgentService(user).listAuth(taxAgentQueryParam);
}
public List<TaxAgentPO> selectAllList() {
return getTaxAgentService(user).listAll();
}
public List<Map<String, Object>> paymentAgencyList(TaxAgentQueryParam queryParam) {
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(queryParam.getIds());
// List<PaymentAgencyPO> paymentAgencyPOS = paymentAgencyService.listAll(currentTenantKey);