Merge branch 'release/2.15.1.2407.01' into release/个税版本

# Conflicts:
#	src/com/engine/salary/mapper/datacollection/EmployMapper.java
#	src/com/engine/salary/mapper/datacollection/EmployMapper.xml
#	src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.java
#	src/com/engine/salary/mapper/salaryacct/SalaryAcctEmployeeMapper.xml
#	src/com/engine/salary/service/SalaryAcctEmployeeService.java
#	src/com/engine/salary/service/SalaryEmployeeService.java
#	src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java
#	src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java
This commit is contained in:
钱涛 2024-07-31 13:27:15 +08:00
commit 1473f72bd0
20 changed files with 436 additions and 45 deletions

View File

@ -118,6 +118,19 @@ public class EmployBiz extends BaseBean {
}
}
public PositionInfo getPositionInfoById(Long positionId) {
if (positionId == null) {
return null;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
return mapper.getPositionInfoById(positionId);
} finally {
sqlSession.close();
}
}
public List<DataCollectionEmployee> listByParams(List<SalarySobRangeEmpQueryParam> includeQueryParams) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
@ -187,6 +200,20 @@ public class EmployBiz extends BaseBean {
}
}
public SubCompanyInfo getSubCompanyInfoById(Long subCompanyId) {
if (subCompanyId == null) {
return null;
}
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
return mapper.getSubCompanyInfoById(subCompanyId);
} finally {
sqlSession.close();
}
}
public List<DataCollectionEmployee> listAllForReport() {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
@ -206,4 +233,15 @@ public class EmployBiz extends BaseBean {
sqlSession.close();
}
}
public DeptInfo getDeptInfoById(Long departmentId) {
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
try {
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
return mapper.getDeptInfoById(departmentId);
} finally {
sqlSession.close();
}
}
}

View File

@ -0,0 +1,32 @@
package com.engine.salary.entity.hrm;
import com.engine.salary.annotation.I18n;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 职称基本信息
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @author qiantao
* @version 1.0
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class JobCallInfo {
private Long id;
/**
* 名称
*/
@I18n
private String name;
}

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,16 +475,49 @@ 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();
List<String> canEditKeys = Arrays.asList("subcompany", "department", "jobtitle", "jobcall");
List<SalaryAcctEmployeeInfoDTO> employeeInfos = salarySobEmpFields.stream()
.map(e -> SalaryAcctEmployeeInfoDTO.builder()
.fieldName(employeeFieldNameMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY))
.fieldValue(employeeFieldValueMap.getOrDefault(e.getFieldCode(), StringUtils.EMPTY))
.build())
.map(e -> {
String fieldCode = e.getFieldCode();
String fieldType = employeeFieldNameMap.getOrDefault(fieldCode + "_type", StringUtils.EMPTY);
SalaryAcctEmployeeInfoDTO dto = SalaryAcctEmployeeInfoDTO.builder()
.fieldCode(fieldCode)
.fieldName(employeeFieldNameMap.getOrDefault(fieldCode, StringUtils.EMPTY))
.fieldValue(employeeFieldValueMap.getOrDefault(fieldCode, StringUtils.EMPTY))
.fieldType(fieldType)
.canEdit(fieldType.contains("Browser") ? true : false)
.build();
String codeKey = fieldCode.replace("Id", "").replace("Name", "");
if (canEditKeys.contains(codeKey)) {
// 前端用于回写浏览框
Map<String, String> fieldValueMap = new HashMap<>();
fieldValueMap.put("id", employeeFieldValueMap.getOrDefault(codeKey + "Id", StringUtils.EMPTY));
fieldValueMap.put("name", employeeFieldValueMap.getOrDefault(codeKey + "Name", StringUtils.EMPTY));
dto.setFieldValue(fieldValueMap);
}
return dto;
})
.collect(Collectors.toList());
List<String> needRemoveFieldNames = new ArrayList<String>();
// 过滤出是浏览框类型的且人员信息中同时存在名称和id的字段
employeeInfos.stream()
.filter(e -> e.getFieldType().contains("Browser"))
.map(e -> SalaryAcctEmployeeInfoDTO.builder().fieldName(e.getFieldName().replace("ID","")).build())
.collect(Collectors.groupingBy(SalaryAcctEmployeeInfoDTO::getFieldName))
.forEach((k,v) -> {
if (v.size() > 1) {
needRemoveFieldNames.add(k+"ID");
}
});
// 移除字段
employeeInfos = employeeInfos.stream().filter(info -> !needRemoveFieldNames.contains(info.getFieldName())).collect(Collectors.toList());
// 薪资项目的值
Map<Long, String> resultValueMap = SalaryEntityUtil.convert2Map(salaryAcctResults, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
Map<Long, SalaryItemPO> salaryItemMap = SalaryEntityUtil.convert2Map(salaryItems, SalaryItemPO::getId);
@ -709,6 +742,7 @@ public class SalaryAcctResultBO {
}
SalaryFormulaVar annotation = declaredField.getAnnotation(SalaryFormulaVar.class);
employeeFieldNameMap.put(declaredField.getName(), SalaryI18nUtil.getI18nLabel(annotation.labelId(), annotation.defaultLabel()));
employeeFieldNameMap.put(declaredField.getName() + "_type", annotation.dataType());
}
return employeeFieldNameMap;
}

View File

@ -23,5 +23,14 @@ public class SalaryAcctEmployeeInfoDTO {
private String fieldName;
//字段值
private String fieldValue;
private Object fieldValue;
// code
private String fieldCode;
// 用于编辑时前端渲染对应输入选择框
private String fieldType;
// 是否可编辑
private boolean canEdit;
}

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.salaryacct.param;
import com.engine.salary.entity.salaryacct.dto.SalaryAcctEmployeeInfoDTO;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -30,6 +31,9 @@ public class SalaryAcctResultSaveParam {
@DataCheck(require = true,message = "薪资项目的值的集合不能为空")
private Collection<SalaryAcctResultDetailItemParam> items;
// 员工基础信息
private Collection<SalaryAcctEmployeeInfoDTO> employeeInfos;
@Data
@Builder
@NoArgsConstructor

View File

@ -31,22 +31,24 @@ public class SalaryFormulaEmployeeDTO {
private String username;
//部门
@SalaryFormulaVar(defaultLabel = "部门", labelId = 86185, dataType = "string")
@SalaryFormulaVar(defaultLabel = "部门", labelId = 86185, dataType = "departmentBrowser")
private String departmentName;
@SalaryFormulaVar(defaultLabel = "部门ID", labelId = 86185, dataType = "string")
@SalaryFormulaVar(defaultLabel = "部门ID", labelId = 86185, dataType = "departmentBrowser")
private Long departmentId;
//分部
@SalaryFormulaVar(defaultLabel = "分部", labelId = 82465, dataType = "string")
@SalaryFormulaVar(defaultLabel = "分部", labelId = 82465, dataType = "subcompanyBrowser")
private String subcompanyName;
private Long subcompanyId;
//岗位
@SalaryFormulaVar(defaultLabel = "岗位", labelId = 90633, dataType = "string")
@SalaryFormulaVar(defaultLabel = "岗位", labelId = 90633, dataType = "jobtitleBrowser")
private String jobtitleName;
@SalaryFormulaVar(defaultLabel = "岗位ID", labelId = 90633, dataType = "string")
@SalaryFormulaVar(defaultLabel = "岗位ID", labelId = 90633, dataType = "jobtitleBrowser")
private Long jobtitleId;
@SalaryFormulaVar(defaultLabel = "入职日期", labelId = 86319, dataType = "string")
@ -88,9 +90,9 @@ public class SalaryFormulaEmployeeDTO {
//职称
@SalaryFormulaVar(defaultLabel = "职称", labelId = 98623, dataType = "string")
@SalaryFormulaVar(defaultLabel = "职称", labelId = 98623, dataType = "jobcallBrowser")
private String jobcall;
@SalaryFormulaVar(defaultLabel = "职称ID", labelId = 98623, dataType = "string")
@SalaryFormulaVar(defaultLabel = "职称ID", labelId = 98623, dataType = "jobcallBrowser")
private Long jobcallId;

View File

@ -2,6 +2,7 @@ package com.engine.salary.mapper.datacollection;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
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.hrm.dto.HrmInfoDTO;
@ -81,6 +82,13 @@ public interface EmployMapper {
*/
List<PositionInfo> listPositionInfo(@Param("collection") List<Long> ids);
/**
* 所以岗位id 获取岗位信息
* @param id
* @return
*/
PositionInfo getPositionInfoById(@Param("positionId") Long id);
/**
* 所以部门
* @param departmentIds
@ -104,6 +112,13 @@ public interface EmployMapper {
*/
List<SubCompanyInfo> getSubCompanyInfoList(@Param("subDepartmentIds") List<Long> subDepartmentIds);
/**
* 根据分部id获取分部信息
* @param subDepartmentId
* @return
*/
SubCompanyInfo getSubCompanyInfoById(@Param("subDepartmentId")Long subDepartmentId);
/**
* 虚拟分部
* @param virtualSubCompanyIds
@ -159,6 +174,8 @@ public interface EmployMapper {
*/
List<DataCollectionEmployee> listBySubCompanyOrDepartment(@Param("subCompanyIds") List<Long> subCompanyIds, @Param("departmentIds") List<Long> departmentIds);
JobCallInfo getJobCallInfoById(@Param("jobCallId") Long jobCallId);
/**
* 根据用户名和工号模糊查询
* @param keyword

View File

@ -107,6 +107,13 @@
</if>
</select>
<select id="getPositionInfoById" resultType="com.engine.salary.entity.hrm.PositionInfo">
select t.id,
t.jobtitlename as name
from hrmjobtitles t
where t.id = #{positionId}
</select>
<select id="listByParams" resultType="com.engine.salary.entity.datacollection.DataCollectionEmployee">
select e.id as employeeId,
e.lastname as username,
@ -363,6 +370,13 @@
</if>
</select>
<select id="getSubCompanyInfoById" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
select d.subcompanyname as name,
d.id as id
from hrmsubcompany d
where d.id = #{subDepartmentId}
</select>
<select id="getVirtualSubCompanyInfoList" resultType="com.engine.salary.entity.hrm.SubCompanyInfo">
select d.subcompanyname as name,
d.id as id
@ -643,4 +657,11 @@
</if>
</sql>
<select id="getJobCallInfoById" resultType="com.engine.salary.entity.hrm.JobCallInfo">
select job.id,
job.jobtitlename as name
from hrmjobcall job
where job.id = #{jobCallId}
</select>
</mapper>

View File

@ -128,4 +128,6 @@ public interface SalaryAcctEmployeeMapper {
List<AbnormalEmployeeListDTO> listPage4NotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam);
int countNotDeclareByParam(@Param("param") AbnormalEmployeeListQueryParam queryParam);
void updateIgnoreNull(@Param("salaryAcctEmployeePO")SalaryAcctEmployeePO salaryAcctEmployeePO);
}

View File

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

View File

@ -367,8 +367,23 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds);
// 3.获取薪资项目
List<Long> salaryItemIds = salaryAcctResultValues.stream().map(SalaryAcctResultPO::getSalaryItemId).distinct().collect(Collectors.toList());
List<SalaryItemPO> salaryItemList = CollectionUtils.isEmpty(salaryItemIds) ? Lists.newArrayList() : getSalaryItemService(user).listByIds(salaryItemIds);
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
salaryItemList = salaryItemList.stream()
.sorted(new Comparator<SalaryItemPO>() {
@Override
public int compare(SalaryItemPO o1, SalaryItemPO o2) {
if (o1.getSortedIndex() == null && o2.getSortedIndex() == null) {
Integer systemType1 = o1.getSystemType() == null ? 0 : o1.getSystemType();
Integer systemType2 = o2.getSystemType() == null ? 0 : o2.getSystemType();
return systemType1.compareTo(systemType2);
} else {
Integer sortedIndex1 = o1.getSortedIndex() == null ? 0 : o1.getSortedIndex();
Integer sortedIndex2 = o2.getSortedIndex() == null ? 0 : o2.getSortedIndex();
return sortedIndex2.compareTo(sortedIndex1);
}
}
})
.collect(Collectors.toList());
return SalaryStatisticsEmployeeDetailResultDTO.builder()
.salaryAcctEmployeeList(salaryAcctEmployeeList)

View File

@ -10,6 +10,7 @@ import com.engine.salary.component.SalaryWeaTable;
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.report.common.constant.SalaryConstant;
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
import com.engine.salary.report.entity.dto.SalaryStatisticsEmployeeDetailResultDTO;
@ -232,6 +233,8 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
if (CollectionUtils.isNotEmpty(records)) {
List<SalaryItemPO> salaryItems = salaryStatisticsEmployeeDetailResult.getSalaryItemList();
// 过滤只统计数值型薪资项目
salaryItems = salaryItems.stream().filter(salaryItemPO -> salaryItemPO.getDataType().equals(SalaryDataTypeEnum.NUMBER.getValue())).collect(Collectors.toList());
for (SalaryItemPO item : salaryItems) {
BigDecimal sumBigDecimal = new BigDecimal(SalaryStatisticsReportBO.ZERO);
String itemKey = item.getId() + SalaryConstant.DYNAMIC_SUFFIX;

View File

@ -275,4 +275,9 @@ public interface SalaryAcctEmployeeService {
int countNotDeclareByParam(AbnormalEmployeeListQueryParam queryParam);
/**
* 更新
* @param salaryAcctEmployeePO
*/
void updateIgnoreNull(SalaryAcctEmployeePO salaryAcctEmployeePO);
}

View File

@ -2,6 +2,7 @@ package com.engine.salary.service;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
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.hrm.dto.EmployeeInfoExpandDTO;
@ -103,14 +104,20 @@ public interface SalaryEmployeeService {
List<DeptInfo> getDeptInfoList(List<Long> departmentIds);
DeptInfo getDeptInfoById(Long departmentId);
List<DeptInfo> getVirtualDeptInfoList(List<Long> virtualDepartmentIds);
List<SubCompanyInfo> getSubCompanyInfoList(List<Long> subDepartmentIds);
SubCompanyInfo getSubCompanyInfoById(Long subDepartmentId);
List<SubCompanyInfo> getVirtualSubCompanyInfoList(List<Long> virtualSubDepartmentIds);
List<PositionInfo> listPositionInfo(List<Long> positionIds);
PositionInfo getPositionInfoById(Long positionId);
List<DataCollectionEmployee> listEmployee();
List<DataCollectionEmployee> listByParams(List<SalarySobRangeEmpQueryParam> includeQueryParams);
@ -183,4 +190,11 @@ public interface SalaryEmployeeService {
*/
List<DataCollectionEmployee> listByKeyword(String keyword);
/**
* 根据职称id获取职称信息
* @param jobCallId
* @return
*/
JobCallInfo getJobCallInfoById(Long jobCallId);
}

View File

@ -167,13 +167,18 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
List<Map<String, String>> resultList = new ArrayList<>();
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
if (socialSchemePO != null && (StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString()) || StringUtils.isNotBlank(socialSchemePO.getSocialPaymentComBaseString()) )) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> socialComMap = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> socialIds = new ArrayList<>();
socialIds.addAll(socialMap.keySet());
socialIds.addAll(socialComMap.keySet());
socialIds = socialIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(socialSchemePO.getSocialSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
socialMap.forEach((k, v) -> {
socialIds.forEach(k -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -203,13 +208,18 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
});
}
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
if (fundSchemePO != null && (StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString()) || StringUtils.isNotBlank(fundSchemePO.getFundPaymentComBaseString()))) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> fundComMap = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> fundIds = new ArrayList<>();
fundIds.addAll(fundMap.keySet());
fundIds.addAll(fundComMap.keySet());
fundIds = fundIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(fundSchemePO.getFundSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
fundMap.forEach((k, v) -> {
fundIds.forEach(k -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
@ -239,14 +249,19 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
});
}
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
if (otherSchemePO != null && (StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString()) || StringUtils.isNotBlank(otherSchemePO.getOtherPaymentComBaseString()))) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
Map<String, String> otherComMap = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new HashMap<String, String>().getClass());
List<String> otherIds = new ArrayList<>();
otherIds.addAll(otherMap.keySet());
otherIds.addAll(otherComMap.keySet());
otherIds = otherIds.stream().distinct().collect(Collectors.toList());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().listBySchemeIds(Collections.singletonList(otherSchemePO.getOtherSchemeId()));
Map<String, Integer> schemeValidNumMap = SalaryEntityUtil.convert2Map(insuranceSchemeDetailPOS, po -> po.getInsuranceId() + "-" + po.getPaymentScope(), InsuranceSchemeDetailPO::getValidNum);
otherMap.forEach((k, v) -> {
otherIds.forEach(k -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
String welfareTypeSign = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "social" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "fund" : "other" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {

View File

@ -142,6 +142,18 @@ public class SIImportServiceImpl extends Service implements SIImportService {
int total = (int)pageInfo.getTotal();
param.setPageSize(total);
param.setCurrent(1);
if (CollectionUtils.isNotEmpty(param.getDepartmentIds())) {
param.setDepartmentIdsStr(StringUtils.join(param.getDepartmentIds(), ","));
}
if (CollectionUtils.isNotEmpty(param.getSubcompanyIds())) {
param.setSubcompanyIdsStr(StringUtils.join(param.getSubcompanyIds(), ","));
}
if (CollectionUtils.isNotEmpty(param.getPositions())) {
param.setPositionsStr(StringUtils.join(param.getPositions(), ","));
}
if (CollectionUtils.isNotEmpty(param.getStatuses())) {
param.setStatusesStr(StringUtils.join(param.getStatuses(), ","));
}
Map<String, Object> dataMap = getSIArchivesService(user).listPage(param);
List<Map<String, Object>> records = (List<Map<String, Object>>)dataMap.get("datas");

View File

@ -817,4 +817,8 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
return getSalaryAcctEmployeeMapper().countNotDeclareByParam(queryParam);
}
@Override
public void updateIgnoreNull(SalaryAcctEmployeePO salaryAcctEmployeePO) {
getSalaryAcctEmployeeMapper().updateIgnoreNull(salaryAcctEmployeePO);
}
}

View File

@ -11,6 +11,10 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.datacollection.dto.AttendQuoteFieldListDTO;
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.bo.SalaryAcctResultReportBO;
import com.engine.salary.entity.report.po.SalaryAcctResultReportPO;
@ -604,6 +608,46 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
if (Objects.isNull(salaryAcctEmployeePO)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98831, "薪资核算人员不存在或已被删除"));
}
// 更新员工基本信息值
saveParam.getEmployeeInfos().stream().forEach(info -> {
if (info.getFieldValue() != null && StringUtils.isNotBlank(info.getFieldValue().toString())) {
if (info.getFieldCode().equals("departmentName") || info.getFieldCode().equals("departmentId")) {
// 修改部门信息
DeptInfo deptInfo = getSalaryEmployeeService(user).getDeptInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
? Long.valueOf(info.getFieldValue().toString()) : 0L);
if (Objects.nonNull(deptInfo)) {
salaryAcctEmployeePO.setDepartmentName(deptInfo.getName());
salaryAcctEmployeePO.setDepartmentId(deptInfo.getId());
}
} else if (info.getFieldCode().equals("subcompanyName") || info.getFieldCode().equals("subcompanyId")) {
// 修改分部信息
SubCompanyInfo subCompanyInfo = getSalaryEmployeeService(user).getSubCompanyInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
? Long.valueOf(info.getFieldValue().toString()) : 0L);
if (Objects.nonNull(subCompanyInfo)) {
salaryAcctEmployeePO.setSubcompanyName(subCompanyInfo.getName());
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());
}
} else if (info.getFieldCode().equals("jobcall") || info.getFieldCode().equals("jobcallId")) {
// 修改职称信息
JobCallInfo jobCallInfo = getSalaryEmployeeService(user).getJobCallInfoById(NumberUtils.isCreatable(info.getFieldValue().toString())
? Long.valueOf(info.getFieldValue().toString()) : 0L);
if (Objects.nonNull(jobCallInfo)) {
salaryAcctEmployeePO.setJobcall(jobCallInfo.getName());
salaryAcctEmployeePO.setJobcallId(jobCallInfo.getId());
}
}
}
});
getSalaryAcctEmployeeService(user).updateIgnoreNull(salaryAcctEmployeePO);
// 查询原来的薪资核算结果
List<SalaryAcctResultPO> salaryAcctResultPOSOld = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctEmpId(saveParam.getSalaryAcctEmpId()).build());
// 解密

View File

@ -9,6 +9,7 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.SalarySobExtRangePO;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
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.hrm.dto.EmployeeInfoExpandDTO;
@ -287,6 +288,14 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return SalaryI18nUtil.i18nList(employBiz.getDeptInfoList(departmentIds));
}
@Override
public DeptInfo getDeptInfoById(Long departmentId) {
if (departmentId == null) {
return null;
}
return SalaryI18nUtil.i18n(employBiz.getDeptInfoById(departmentId));
}
@Override
public List<DeptInfo> getVirtualDeptInfoList(List<Long> virtualDepartmentIds) {
if (CollectionUtils.isEmpty(virtualDepartmentIds)) {
@ -301,6 +310,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return SalaryI18nUtil.i18nList(employBiz.getSubCompanyInfoList(subDepartmentIds));
}
@Override
public SubCompanyInfo getSubCompanyInfoById(Long subDepartmentId) {
return SalaryI18nUtil.i18n(employBiz.getSubCompanyInfoById(subDepartmentId));
}
@Override
public List<SubCompanyInfo> getVirtualSubCompanyInfoList(List<Long> virtualSubDepartmentIds) {
if (CollectionUtils.isEmpty(virtualSubDepartmentIds)) {
@ -315,6 +329,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
return SalaryI18nUtil.i18nList(employBiz.listPositionInfo(positionIds));
}
@Override
public PositionInfo getPositionInfoById(Long positionId) {
return SalaryI18nUtil.i18n(employBiz.getPositionInfoById(positionId));
}
@Override
public List<DataCollectionEmployee> listEmployee() {
List<DataCollectionEmployee> result = employBiz.listEmployee();
@ -535,4 +554,12 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
}
return result;
}
@Override
public JobCallInfo getJobCallInfoById(Long jobCallId) {
if (jobCallId == null) {
return null;
}
return SalaryI18nUtil.i18n(getEmployMapper().getJobCallInfoById(jobCallId));
}
}