核算时编辑人员组织信息

This commit is contained in:
Harryxzy 2024-07-25 17:51:38 +08:00
parent bdd27bcfc6
commit ec669c1f51
4 changed files with 95 additions and 76 deletions

View File

@ -1,6 +1,7 @@
package com.engine.salary.entity.salaryacct.bo;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
@ -71,7 +72,7 @@ public class SalaryAcctFormulaBO {
* @param simpleEmployee
* @return
*/
public static Map<String, String> convert2FormulaEmployee(DataCollectionEmployee simpleEmployee) {
public static Map<String, String> convert2FormulaEmployee(DataCollectionEmployee simpleEmployee, SalaryAcctEmployeePO salaryAcctEmployeePO, boolean dynamicEmpInfo) {
if (simpleEmployee == null) {
return Collections.emptyMap();
}
@ -79,27 +80,55 @@ public class SalaryAcctFormulaBO {
.map(sex -> StringUtils.equals(sex, "0") ? SalaryI18nUtil.getI18nLabel(102440, "")
: SalaryI18nUtil.getI18nLabel(102442, ""))
.orElse(StringUtils.EMPTY);
SalaryFormulaEmployeeDTO formulaEmployee = SalaryFormulaEmployeeDTO.builder()
.employeeId(simpleEmployee.getEmployeeId())
.username(simpleEmployee.getUsername())
.email(simpleEmployee.getEmail())
.mobile(simpleEmployee.getMobile())
.telephone(simpleEmployee.getTelephone())
.sex(sexName)
.status(simpleEmployee.getStatus())
.statusName(simpleEmployee.getStatusName())
.departmentName(simpleEmployee.getDepartmentName())
.departmentId(simpleEmployee.getDepartmentId())
.subcompanyName(simpleEmployee.getSubcompanyName())
.jobtitleName(simpleEmployee.getJobtitleName())
.jobtitleId(simpleEmployee.getJobtitleId())
.jobcall(simpleEmployee.getJobcall())
.jobcallId(simpleEmployee.getJobcallId())
.companystartdate(simpleEmployee.getCompanystartdate())
.birthday(simpleEmployee.getBirthday())
.workcode(simpleEmployee.getWorkcode())
.idNo(simpleEmployee.getIdNo())
.build();
SalaryFormulaEmployeeDTO formulaEmployee = null;
if (dynamicEmpInfo) {
formulaEmployee = SalaryFormulaEmployeeDTO.builder()
.employeeId(simpleEmployee.getEmployeeId())
.username(simpleEmployee.getUsername())
.email(simpleEmployee.getEmail())
.mobile(simpleEmployee.getMobile())
.telephone(simpleEmployee.getTelephone())
.sex(sexName)
.status(simpleEmployee.getStatus())
.statusName(simpleEmployee.getStatusName())
.departmentName(simpleEmployee.getDepartmentName())
.departmentId(simpleEmployee.getDepartmentId())
.subcompanyName(simpleEmployee.getSubcompanyName())
.subcompanyId(simpleEmployee.getSubcompanyid())
.jobtitleName(simpleEmployee.getJobtitleName())
.jobtitleId(simpleEmployee.getJobtitleId())
.jobcall(simpleEmployee.getJobcall())
.jobcallId(simpleEmployee.getJobcallId())
.companystartdate(simpleEmployee.getCompanystartdate())
.birthday(simpleEmployee.getBirthday())
.workcode(simpleEmployee.getWorkcode())
.idNo(simpleEmployee.getIdNo())
.build();
} else {
formulaEmployee = SalaryFormulaEmployeeDTO.builder()
.employeeId(simpleEmployee.getEmployeeId())
.username(simpleEmployee.getUsername())
.email(simpleEmployee.getEmail())
.mobile(simpleEmployee.getMobile())
.telephone(simpleEmployee.getTelephone())
.sex(sexName)
.status(simpleEmployee.getStatus())
.statusName(simpleEmployee.getStatusName())
.departmentName(salaryAcctEmployeePO.getDepartmentName())
.departmentId(salaryAcctEmployeePO.getDepartmentId())
.subcompanyName(salaryAcctEmployeePO.getSubcompanyName())
.subcompanyId(salaryAcctEmployeePO.getSubcompanyId())
.jobtitleName(salaryAcctEmployeePO.getJobtitleName())
.jobtitleId(salaryAcctEmployeePO.getJobtitleId())
.jobcall(salaryAcctEmployeePO.getJobcall())
.jobcallId(salaryAcctEmployeePO.getJobcallId())
.companystartdate(simpleEmployee.getCompanystartdate())
.birthday(simpleEmployee.getBirthday())
.workcode(simpleEmployee.getWorkcode())
.idNo(simpleEmployee.getIdNo())
.build();
}
return JsonUtil.parseMap(JsonUtil.toJsonString(formulaEmployee), String.class);
}
}

View File

@ -282,7 +282,7 @@ public class SalaryAcctResultBO {
Map<String, String> dataTypeMap = SalaryEntityUtil.convert2Map(salaryItems, salaryItemPO -> salaryItemPO.getId() + DATA_TYPE_SUFFIX, SalaryItemPO::getDataType);
map.putAll(dataTypeMap);
// 人员信息字段的值
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()));
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(e.getEmployeeId()), e, true);
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
// 员工信息字段的字段类型
if (dynamicEmpInfo) {
@ -369,7 +369,7 @@ public class SalaryAcctResultBO {
boolean different = false;
Map<String, Object> map = Maps.newHashMap();
// 员工信息字段的值
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId()));
Map<String, String> fieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(employeeMap.get(salaryAcctEmployee.getEmployeeId()), salaryAcctEmployee, false);
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
// 员工信息字段的字段类型
if (dynamicEmpInfo) {
@ -475,7 +475,7 @@ public class SalaryAcctResultBO {
List<Long> lockItems) {
// 员工信息字段
Map<String, String> employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee);
Map<String, String> employeeFieldValueMap = SalaryAcctFormulaBO.convert2FormulaEmployee(simpleEmployee, salaryAcctEmployee, false);
// 个税扣缴义务人
employeeFieldValueMap.put("taxAgentName", Optional.ofNullable(taxAgentPO).map(TaxAgentPO::getName).orElse(StringUtils.EMPTY));
Map<String, String> employeeFieldNameMap = buildEmployeeFieldName();

View File

@ -41,6 +41,8 @@ public class SalaryFormulaEmployeeDTO {
@SalaryFormulaVar(defaultLabel = "分部", labelId = 82465, dataType = "subcompanyBrowser")
private String subcompanyName;
private Long subcompanyId;
//岗位

View File

@ -1369,77 +1369,65 @@
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO">
UPDATE hrsa_salary_acct_emp
<set>
<if test="salaryAcctRecordId != null" >
salary_acct_record_id=#{salaryAcctRecordId},
<if test="salaryAcctEmployeePO.salaryAcctRecordId != null" >
salary_acct_record_id=#{salaryAcctEmployeePO.salaryAcctRecordId},
</if>
<if test="salarySobId != null" >
salary_sob_id=#{salarySobId},
<if test="salaryAcctEmployeePO.salarySobId != null" >
salary_sob_id=#{salaryAcctEmployeePO.salarySobId},
</if>
<if test="employeeId != null" >
employee_id=#{employeeId},
<if test="salaryAcctEmployeePO.employeeId != null" >
employee_id=#{salaryAcctEmployeePO.employeeId},
</if>
<if test="taxAgentId != null" >
tax_agent_id=#{taxAgentId},
<if test="salaryAcctEmployeePO.taxAgentId != null" >
tax_agent_id=#{salaryAcctEmployeePO.taxAgentId},
</if>
<if test="salaryMonth != null" >
salary_month=#{salaryMonth},
<if test="salaryAcctEmployeePO.salaryMonth != null" >
salary_month=#{salaryAcctEmployeePO.salaryMonth},
</if>
<if test="creator != null" >
creator=#{creator},
<if test="salaryAcctEmployeePO.createTime != null" >
create_time=#{salaryAcctEmployeePO.createTime},
</if>
<if test="createTime != null" >
create_time=#{createTime},
<if test="salaryAcctEmployeePO.updateTime != null" >
update_time=#{salaryAcctEmployeePO.updateTime},
</if>
<if test="updateTime != null" >
update_time=#{updateTime},
<if test="salaryAcctEmployeePO.tenantKey != null" >
tenant_key=#{salaryAcctEmployeePO.tenantKey},
</if>
<if test="deleteType != null" >
delete_type=#{deleteType},
<if test="salaryAcctEmployeePO.employeeType != null" >
employee_type=#{salaryAcctEmployeePO.employeeType},
</if>
<if test="tenantKey != null" >
tenant_key=#{tenantKey},
<if test="salaryAcctEmployeePO.lockStatus != null" >
lock_status=#{salaryAcctEmployeePO.lockStatus},
</if>
<if test="employeeType != null" >
employee_type=#{employeeType},
<if test="salaryAcctEmployeePO.subcompanyName != null" >
subcompany_name=#{salaryAcctEmployeePO.subcompanyName},
</if>
<if test="incomeCategory != null" >
income_category=#{incomeCategory},
<if test="salaryAcctEmployeePO.subcompanyId != null" >
subcompany_id=#{salaryAcctEmployeePO.subcompanyId},
</if>
<if test="lockStatus != null" >
lock_status=#{lockStatus},
<if test="salaryAcctEmployeePO.departmentName != null" >
department_name=#{salaryAcctEmployeePO.departmentName},
</if>
<if test="subcompanyName != null" >
subcompany_name=#{subcompanyName},
<if test="salaryAcctEmployeePO.departmentId != null" >
department_id=#{salaryAcctEmployeePO.departmentId},
</if>
<if test="subcompanyId != null" >
subcompany_id=#{subcompanyId},
<if test="salaryAcctEmployeePO.jobtitleName != null" >
jobtitle_name=#{salaryAcctEmployeePO.jobtitleName},
</if>
<if test="departmentName != null" >
department_name=#{departmentName},
<if test="salaryAcctEmployeePO.jobtitleId != null" >
jobtitle_id=#{salaryAcctEmployeePO.jobtitleId},
</if>
<if test="departmentId != null" >
department_id=#{departmentId},
<if test="salaryAcctEmployeePO.jobcall != null" >
jobcall=#{salaryAcctEmployeePO.jobcall},
</if>
<if test="jobtitleName != null" >
jobtitle_name=#{jobtitleName},
<if test="salaryAcctEmployeePO.jobcallId != null" >
jobcall_id=#{salaryAcctEmployeePO.jobcallId},
</if>
<if test="jobtitleId != null" >
jobtitle_id=#{jobtitleId},
</if>
<if test="jobcall != null" >
jobcall=#{jobcall},
</if>
<if test="jobcallId != null" >
jobcall_id=#{jobcallId},
</if>
<if test="status != null" >
status=#{status},
</if>
<if test="lockTime != null" >
lock_time=#{lockTime},
<if test="salaryAcctEmployeePO.status != null" >
status=#{salaryAcctEmployeePO.status},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
WHERE id = #{salaryAcctEmployeePO.id} AND delete_type = 0
</update>
</mapper>