Merge branch 'release/2.18.1.2412.01' into release/个税版本
# Conflicts: # src/com/engine/salary/service/SalaryEmployeeService.java
This commit is contained in:
commit
7243eece3d
|
|
@ -1,5 +1,5 @@
|
|||
log=false
|
||||
defaultCloseNonStandard149=true
|
||||
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
|
||||
version=2.17.1.2411.01
|
||||
version=2.18.1.2412.01
|
||||
openFormulaForcedEditing=false
|
||||
|
|
@ -0,0 +1,434 @@
|
|||
package com.engine.salary.entity.hrm.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class HrmSnapshotPO {
|
||||
|
||||
@ElogTransform(name = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 快照时间
|
||||
*/
|
||||
@ElogTransform(name = "快照时间")
|
||||
private Date snapshotTime;
|
||||
|
||||
|
||||
/**
|
||||
* 人员id
|
||||
*/
|
||||
@ElogTransform(name = "人员id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ElogTransform(name = "姓名")
|
||||
private String lastname;
|
||||
|
||||
|
||||
/**
|
||||
* 工资帐号1
|
||||
*/
|
||||
@ElogTransform(name = "工资帐号1")
|
||||
private String accountid1;
|
||||
|
||||
/**
|
||||
* 工资账号户名
|
||||
*/
|
||||
@ElogTransform(name = "工资账号户名")
|
||||
private String accountname;
|
||||
|
||||
/**
|
||||
* 帐号类型
|
||||
*/
|
||||
@ElogTransform(name = "帐号类型")
|
||||
private Integer accounttype;
|
||||
|
||||
/**
|
||||
* 公积金帐号
|
||||
*/
|
||||
@ElogTransform(name = "公积金帐号")
|
||||
private String accumfundaccount;
|
||||
|
||||
/**
|
||||
* 助理
|
||||
*/
|
||||
@ElogTransform(name = "助理")
|
||||
private Integer assistantid;
|
||||
|
||||
/**
|
||||
* 工资银行1
|
||||
*/
|
||||
@ElogTransform(name = "工资银行1")
|
||||
private Integer bankid1;
|
||||
|
||||
/**
|
||||
* 所属主帐号
|
||||
*/
|
||||
@ElogTransform(name = "所属主帐号")
|
||||
private Integer belongto;
|
||||
|
||||
/**
|
||||
* 入团时间
|
||||
*/
|
||||
@ElogTransform(name = "入团时间")
|
||||
private String bememberdate;
|
||||
|
||||
/**
|
||||
* 入党时间
|
||||
*/
|
||||
@ElogTransform(name = "入党时间")
|
||||
private String bepartydate;
|
||||
|
||||
/**
|
||||
* 生日
|
||||
*/
|
||||
@ElogTransform(name = "生日")
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
* 出生地
|
||||
*/
|
||||
@ElogTransform(name = "出生地")
|
||||
private String birthplace;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@ElogTransform(name = "身份证号码")
|
||||
private String certificatenum;
|
||||
|
||||
/**
|
||||
* 公司开始日期
|
||||
*/
|
||||
@ElogTransform(name = "公司开始日期")
|
||||
private String companystartdate;
|
||||
|
||||
/**
|
||||
* 公司年限
|
||||
*/
|
||||
@ElogTransform(name = "公司年限")
|
||||
private BigDecimal companyworkyear;
|
||||
|
||||
/**
|
||||
* 所属成本中心
|
||||
*/
|
||||
@ElogTransform(name = "所属成本中心")
|
||||
private Integer costcenterid;
|
||||
|
||||
/**
|
||||
* 国家id
|
||||
*/
|
||||
@ElogTransform(name = "国家id")
|
||||
private Integer countryid;
|
||||
|
||||
/**
|
||||
* 学位
|
||||
*/
|
||||
@ElogTransform(name = "学位")
|
||||
private String degree;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ElogTransform(name = "所属部门")
|
||||
private Integer departmentid;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@ElogTransform(name = "部门名称")
|
||||
private String departmentname;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
@ElogTransform(name = "学历")
|
||||
private Integer educationlevel;
|
||||
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
@ElogTransform(name = "电子邮件")
|
||||
private String email;
|
||||
|
||||
|
||||
/**
|
||||
* 合同结束日期
|
||||
*/
|
||||
@ElogTransform(name = "合同结束日期")
|
||||
private String enddate;
|
||||
|
||||
/**
|
||||
* 分机
|
||||
*/
|
||||
@ElogTransform(name = "分机")
|
||||
private String extphone;
|
||||
|
||||
/**
|
||||
* 传真
|
||||
*/
|
||||
@ElogTransform(name = "传真")
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
@ElogTransform(name = "民族")
|
||||
private String folk;
|
||||
|
||||
/**
|
||||
* 健康状况
|
||||
*/
|
||||
@ElogTransform(name = "健康状况")
|
||||
private String healthinfo;
|
||||
|
||||
/**
|
||||
* 家庭住址
|
||||
*/
|
||||
@ElogTransform(name = "家庭住址")
|
||||
private String homeaddress;
|
||||
|
||||
|
||||
/**
|
||||
* 是否为工会会员
|
||||
*/
|
||||
@ElogTransform(name = "是否为工会会员")
|
||||
private String islabouunion;
|
||||
|
||||
/**
|
||||
* 职责描述
|
||||
*/
|
||||
@ElogTransform(name = "职责描述")
|
||||
private String jobactivitydesc;
|
||||
|
||||
/**
|
||||
* 职称
|
||||
*/
|
||||
@ElogTransform(name = "职称")
|
||||
private Integer jobcall;
|
||||
|
||||
/**
|
||||
* 职称名称
|
||||
*/
|
||||
@ElogTransform(name = "职称名称")
|
||||
private String jobcallname;
|
||||
|
||||
/**
|
||||
* 工作级别
|
||||
*/
|
||||
@ElogTransform(name = "工作级别")
|
||||
private Integer joblevel;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
@ElogTransform(name = "岗位")
|
||||
private Integer jobtitle;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
@ElogTransform(name = "岗位名称")
|
||||
private String jobtitlename;
|
||||
|
||||
/**
|
||||
* 最后登陆日期
|
||||
*/
|
||||
@ElogTransform(name = "最后登陆日期")
|
||||
private String lastlogindate;
|
||||
|
||||
/**
|
||||
* 工作地点
|
||||
*/
|
||||
@ElogTransform(name = "工作地点")
|
||||
private Integer locationid;
|
||||
|
||||
/**
|
||||
* 系统登陆帐号
|
||||
*/
|
||||
@ElogTransform(name = "系统登陆帐号")
|
||||
private String loginid;
|
||||
|
||||
/**
|
||||
* 经理
|
||||
*/
|
||||
@ElogTransform(name = "经理")
|
||||
private Integer managerid;
|
||||
|
||||
/**
|
||||
* 所有上级
|
||||
*/
|
||||
@ElogTransform(name = "所有上级")
|
||||
private String managerstr;
|
||||
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
@ElogTransform(name = "婚姻状况")
|
||||
private String maritalstatus;
|
||||
|
||||
/**
|
||||
* 手机
|
||||
*/
|
||||
@ElogTransform(name = "手机")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 其他电话
|
||||
*/
|
||||
@ElogTransform(name = "其他电话")
|
||||
private String mobilecall;
|
||||
|
||||
/**
|
||||
* 国籍
|
||||
*/
|
||||
@ElogTransform(name = "国籍")
|
||||
private Integer nationality;
|
||||
|
||||
/**
|
||||
* 籍贯
|
||||
*/
|
||||
@ElogTransform(name = "籍贯")
|
||||
private String nativeplace;
|
||||
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
@ElogTransform(name = "政治面貌")
|
||||
private String policy;
|
||||
|
||||
/**
|
||||
* 试用期结束日期
|
||||
*/
|
||||
@ElogTransform(name = "试用期结束日期")
|
||||
private String probationenddate;
|
||||
|
||||
/**
|
||||
* 户口
|
||||
*/
|
||||
@ElogTransform(name = "户口")
|
||||
private String regresidentplace;
|
||||
|
||||
/**
|
||||
* 居住地电话
|
||||
*/
|
||||
@ElogTransform(name = "居住地电话")
|
||||
private String residentphone;
|
||||
|
||||
/**
|
||||
* 居住地
|
||||
*/
|
||||
@ElogTransform(name = "居住地")
|
||||
private String residentplace;
|
||||
|
||||
/**
|
||||
* 居住地邮编
|
||||
*/
|
||||
@ElogTransform(name = "居住地邮编")
|
||||
private String residentpostcode;
|
||||
|
||||
/**
|
||||
* 用户类别
|
||||
*/
|
||||
@ElogTransform(name = "用户类别")
|
||||
private String resourcetype;
|
||||
|
||||
/**
|
||||
* 安全级别
|
||||
*/
|
||||
@ElogTransform(name = "安全级别")
|
||||
private Integer seclevel;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@ElogTransform(name = "性别")
|
||||
private String sex;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 合同开始日期
|
||||
*/
|
||||
@ElogTransform(name = "合同开始日期")
|
||||
private String startdate;
|
||||
|
||||
/**
|
||||
* 0:试用<br>1:正式<br>2:临时<br>3:试用延期<br>4:解聘<br>5:离职<br>6:退休<br>7:无效
|
||||
*/
|
||||
@ElogTransform(name = " 0:试用<br>1:正式<br>2:临时<br>3:试用延期<br>4:解聘<br>5:离职<br>6:退休<br>7:无效")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 所属分部1
|
||||
*/
|
||||
@ElogTransform(name = "所属分部1")
|
||||
private Integer subcompanyid1;
|
||||
|
||||
/**
|
||||
* 分部名称
|
||||
*/
|
||||
@ElogTransform(name = "分部名称")
|
||||
private String subcompanyname;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@ElogTransform(name = "电话")
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 暂住证号码
|
||||
*/
|
||||
@ElogTransform(name = "暂住证号码")
|
||||
private String tempresidentnumber;
|
||||
|
||||
/**
|
||||
* 用工性质
|
||||
*/
|
||||
@ElogTransform(name = "用工性质")
|
||||
private Integer usekind;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@ElogTransform(name = "编号")
|
||||
private String workcode;
|
||||
|
||||
/**
|
||||
* 办公室
|
||||
*/
|
||||
@ElogTransform(name = "办公室")
|
||||
private String workroom;
|
||||
|
||||
/**
|
||||
* 工作开始日期
|
||||
*/
|
||||
@ElogTransform(name = "工作开始日期")
|
||||
private String workstartdate;
|
||||
|
||||
/**
|
||||
* 工作年限
|
||||
*/
|
||||
@ElogTransform(name = "工作年限")
|
||||
private BigDecimal workyear;
|
||||
|
||||
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -34,5 +34,7 @@ public class SalaryMySalaryBillListDTO {
|
|||
|
||||
private Long employeeId;
|
||||
|
||||
private String salaryCode;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import com.engine.salary.entity.salaryformula.dto.SalaryFormulaEmployeeDTO;
|
|||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
|
|
@ -115,8 +117,8 @@ public class SalaryAcctFormulaBO {
|
|||
.mobile(simpleEmployee.getMobile())
|
||||
.telephone(simpleEmployee.getTelephone())
|
||||
.sex(sexName)
|
||||
.status(simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatusName())
|
||||
.status(salaryAcctEmployeePO.getStatus())
|
||||
.statusName(UserStatusEnum.getDefaultLabelByValue(new Integer(Util.null2s(salaryAcctEmployeePO.getStatus(), "1"))))
|
||||
.accountType(simpleEmployee.getAccountType())
|
||||
.accountTypeName(simpleEmployee.getAccountTypeName())
|
||||
.departmentName(salaryAcctEmployeePO.getDepartmentName())
|
||||
|
|
|
|||
|
|
@ -77,14 +77,12 @@ public class SalaryAcctRecordPO {
|
|||
* 回算(上次核算的薪资核算记录id)
|
||||
*/
|
||||
@Deprecated
|
||||
// //备用字段1", ignore = true)
|
||||
private Long superId;
|
||||
|
||||
/**
|
||||
* 回算(最原始的那次薪资核算记录id)
|
||||
*/
|
||||
@Deprecated
|
||||
// //备用字段2", ignore = true)
|
||||
private Long rootId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class SalaryArchiveBO {
|
|||
*
|
||||
* @param salaryItems
|
||||
*/
|
||||
public static List<WeaTableColumn> buildSalaryArchiveTable(List<SalaryItemPO> salaryItems) {
|
||||
public static List<WeaTableColumn> buildSalaryArchiveTable(List<SalaryItemPO> salaryItems, boolean openSecondaryAccount) {
|
||||
// 表格表头
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
WeaTableColumn idColumn = new WeaTableColumn("100px", "id", "id");
|
||||
|
|
@ -72,7 +72,9 @@ public class SalaryArchiveBO {
|
|||
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
columns.add(employeeIdColumn);
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "账号类型"), "accountType"));
|
||||
if (openSecondaryAccount) {
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "账号类型"), "accountType"));
|
||||
}
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgentName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "分部"), "subcompanyName"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));
|
||||
|
|
|
|||
|
|
@ -782,6 +782,7 @@ public class SalaryArchiveExcelBO extends Service {
|
|||
// .modifier(importHandleParam.getCurrentEmployeeId())
|
||||
.deleteType(NumberUtils.INTEGER_ZERO)
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.employeeType(importHandleParam.isExtEmp() ? 1 : null)
|
||||
.build();
|
||||
// 定薪action 保持状态为待定薪
|
||||
if (importHandleParam.isInit() && importHandleParam.getKeepStatus() != null && importHandleParam.getKeepStatus().equals(Boolean.TRUE)) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.salary.common.LocalDateRange;
|
|||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.SalaryCycleTypeEnum;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
||||
import java.time.*;
|
||||
import java.util.Date;
|
||||
|
|
@ -30,7 +31,8 @@ public class SalarySobCycleBO {
|
|||
if (salarySob == null) {
|
||||
return null;
|
||||
}
|
||||
return SalarySobCycleDTO.builder()
|
||||
|
||||
SalarySobCycleDTO salarySobCycleDTO = SalarySobCycleDTO.builder()
|
||||
.salarySobId(salarySob.getId())
|
||||
.salaryMonth(salaryMonth)
|
||||
.taxCycle(buildCycle(salaryMonth, salarySob.getTaxCycleType()))
|
||||
|
|
@ -38,6 +40,18 @@ public class SalarySobCycleBO {
|
|||
.salaryCycle(buildCycleDateRange(salaryMonth, salarySob.getSalaryCycleType(), salarySob.getSalaryCycleFromDay()))
|
||||
.attendCycle(buildCycleDateRange(salaryMonth, salarySob.getAttendCycleType(), salarySob.getAttendCycleFromDay()))
|
||||
.build();
|
||||
|
||||
salarySobCycleDTO.setSalaryDate(SalaryDateUtil.toDate(salarySobCycleDTO.getSalaryMonth(), 1));
|
||||
salarySobCycleDTO.setTaxDate(SalaryDateUtil.toDate(salarySobCycleDTO.getTaxCycle(), 1));
|
||||
salarySobCycleDTO.setSocialSecurityDate(SalaryDateUtil.toDate(salarySobCycleDTO.getSocialSecurityCycle(), 1));
|
||||
LocalDateRange salaryCycle = salarySobCycleDTO.getSalaryCycle();
|
||||
salarySobCycleDTO.setSalaryCycleFromDate(salaryCycle.getFromDate());
|
||||
salarySobCycleDTO.setSalaryCycleEndDate(salaryCycle.getEndDate());
|
||||
LocalDateRange attendCycle = salarySobCycleDTO.getAttendCycle();
|
||||
salarySobCycleDTO.setAttendCycleFromDate(attendCycle.getFromDate());
|
||||
salarySobCycleDTO.setAttendCycleEndDate(attendCycle.getEndDate());
|
||||
|
||||
return salarySobCycleDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -441,7 +441,7 @@
|
|||
hrsa_salary_archive t
|
||||
LEFT JOIN hrsa_external_employee e ON e.id = t.employee_id
|
||||
WHERE t.delete_type = 0
|
||||
and t.employee_type is not null
|
||||
and t.employee_type = 1
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
package com.engine.salary.mapper.hrm;
|
||||
|
||||
import com.engine.salary.entity.hrm.po.HrmSnapshotPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public interface HrmSnapshotMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<HrmSnapshotPO> listAll();
|
||||
|
||||
List<HrmSnapshotPO> snapshot(@Param("employeeId")Long employeeId, @Param("snapshotTime")Date snapshotTime);
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<HrmSnapshotPO> listSome(HrmSnapshotPO hrmSnapshot);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
HrmSnapshotPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param hrmSnapshot 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(HrmSnapshotPO hrmSnapshot);
|
||||
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param hrmSnapshot 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(HrmSnapshotPO hrmSnapshot);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param hrmSnapshot 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(HrmSnapshotPO hrmSnapshot);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param hrmSnapshot 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(HrmSnapshotPO hrmSnapshot);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
*
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteBySnapshotTime(Date snapshotTime);
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<HrmSnapshotPO> currentEmpData();
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -282,6 +282,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala
|
|||
map.put("jobTitle", Util.null2String(emp.getJobtitleName()));
|
||||
map.put("status", Util.null2String(NumberUtil.isNumber(emp.getStatus()) ? SalaryEmployeeStatusEnum.parseByValue(Integer.valueOf(emp.getStatus())).getDefaultLabel() : null));
|
||||
map.put("workCode", Util.null2String(emp.getWorkcode()));
|
||||
map.put("idNo", Util.null2String(emp.getIdNo()));
|
||||
map.put("companystartdate", Util.null2String(emp.getCompanystartdate()));
|
||||
|
||||
// IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(Integer.parseInt(se.getIncomeCategory()));
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
|||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -197,4 +198,6 @@ public interface SalaryEmployeeService {
|
|||
* @return
|
||||
*/
|
||||
JobCallInfo getJobCallInfoById(Long jobCallId);
|
||||
|
||||
List<DataCollectionEmployee> snapshot(List<Long> employeeIds, Date snapshotTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -650,6 +650,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
AccountParam accountParam = new AccountParam();
|
||||
accountParam.setBillMonth(param.getBillMonth());
|
||||
accountParam.setIds(collect);
|
||||
|
||||
//福利核算进度
|
||||
ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization());
|
||||
if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
|
||||
return;
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = new ProgressDTO()
|
||||
.setTitle(SalaryI18nUtil.getI18nLabel(0, "核算中"))
|
||||
.setTitleLabelId(97515L)
|
||||
.setTotalQuantity(2000)
|
||||
.setCalculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.setProgress(BigDecimal.ZERO)
|
||||
.setStatus(true)
|
||||
.setMessage(StringUtils.EMPTY);
|
||||
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), initProgress);
|
||||
|
||||
siAccounting(accountParam);
|
||||
}
|
||||
|
||||
|
|
@ -4891,6 +4908,23 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
// AccountParam selectParam = new AccountParam();
|
||||
// selectParam.setBillMonth(param.getBillMonth());
|
||||
// selectParam.setPaymentOrganization(param.getPaymentOrganization());
|
||||
|
||||
//福利核算进度
|
||||
ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization());
|
||||
if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
|
||||
return String.valueOf(user.getUID());
|
||||
}
|
||||
// 初始化进度
|
||||
ProgressDTO initProgress = new ProgressDTO()
|
||||
.setTitle(SalaryI18nUtil.getI18nLabel(0, "核算中"))
|
||||
.setTitleLabelId(97515L)
|
||||
.setTotalQuantity(2000)
|
||||
.setCalculatedQuantity(NumberUtils.INTEGER_ZERO)
|
||||
.setProgress(BigDecimal.ZERO)
|
||||
.setStatus(true)
|
||||
.setMessage(StringUtils.EMPTY);
|
||||
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), initProgress);
|
||||
|
||||
ExecutorService taskExecutor = Executors.newCachedThreadPool();
|
||||
taskExecutor.execute(() -> {
|
||||
siAccounting(param);
|
||||
|
|
@ -4914,11 +4948,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
|
||||
|
||||
public void siAccounting(AccountParam param) {
|
||||
//福利核算进度
|
||||
ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth());
|
||||
if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
|
||||
return;
|
||||
}
|
||||
// //福利核算进度
|
||||
// ProgressDTO salaryAcctProgressDTO = getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization());
|
||||
// if (salaryAcctProgressDTO != null && salaryAcctProgressDTO.isStatus() && salaryAcctProgressDTO.getProgress().compareTo(BigDecimal.ONE) < 0) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
log.info("开始核算,当前操作人为:{}", user.getLastname());
|
||||
log.info("核算时间:{}, 核算月份:{}, 个税扣缴义务人:{}, 是否首次核算:{}", new Date(), param.getBillMonth(), param.getPaymentOrganization(), param.isFlag());
|
||||
|
|
@ -4998,10 +5032,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
.setProgress(BigDecimal.ZERO)
|
||||
.setStatus(true)
|
||||
.setMessage(StringUtils.EMPTY);
|
||||
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), initProgress);
|
||||
getSalaryAcctProgressService(user).initProgress(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), initProgress);
|
||||
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true);
|
||||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -5017,11 +5051,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization());
|
||||
});
|
||||
log.info("更新福利核算进度······");
|
||||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true);
|
||||
getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), true);
|
||||
log.info("福利核算进度完成!");
|
||||
} catch (Exception e) {
|
||||
log.error("account run fail", e);
|
||||
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage());
|
||||
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage());
|
||||
|
||||
List<InsuranceAccountBatchPO> list = Lists.newArrayList(getInsuranceAccountBatchMapper().getByBillMonth(param.getBillMonth(), param.getPaymentOrganization()));
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
|
|
@ -5043,6 +5077,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
if (!isFirstFlag) {
|
||||
// 不是首次核算,需要把社保历史数据取出
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().list(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(ids).build()));
|
||||
historyDetailData.addAll(getInsuranceAccountDetailMapper().extList(InsuranceAccountDetailParam.builder().billMonth(billMonth).paymentOrganization(paymentOrganization.toString()).employeeIds(ids).build()));
|
||||
} else {
|
||||
employeeList = getSalaryEmployeeService(user).listByIds(ids);
|
||||
}
|
||||
|
|
@ -5111,11 +5146,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
|
||||
if (count % 50 == 0 || count >= ids.size()) {
|
||||
if (count >= ids.size()) {
|
||||
getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth, BigDecimal.valueOf(0.99), false);
|
||||
log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth));
|
||||
getSalaryAcctProgressService(user).updateProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, BigDecimal.valueOf(0.99), false);
|
||||
log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization));
|
||||
} else {
|
||||
getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth, count >= ids.size() ? count % 50 : 50);
|
||||
log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth));
|
||||
getSalaryAcctProgressService(user).getAndAddCalculatedQty(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization, count >= ids.size() ? count % 50 : 50);
|
||||
log.info("更新福利核算进度,当前进度为:{}", getSalaryAcctProgressService(user).getProgress(SalaryCacheKey.ACCT_PROGRESS + billMonth + "_" + paymentOrganization));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5738,7 +5773,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
|
|||
}
|
||||
} catch (Exception e) {
|
||||
log.error("福利核算数据处理失败", e);
|
||||
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage());
|
||||
getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth() + "_" + param.getPaymentOrganization(), SalaryI18nUtil.getI18nLabel(0, "福利核算出错") + ": " + e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3276,6 +3276,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.build();
|
||||
|
||||
String combineErrorMsg = "";
|
||||
log.info("oldSocialInfoListSize:" + oldSocialInfoList.size());
|
||||
//组装新数据
|
||||
if (oldSocialInfoList.size() == 1) {
|
||||
//老数据
|
||||
|
|
@ -3544,6 +3545,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
return null;
|
||||
}
|
||||
|
||||
log.info("自动调整前 基数信息{}", paymentBaseJson);
|
||||
for (Map.Entry<String, String> entry : paymentBaseJson.entrySet()) {
|
||||
|
||||
//判断福利值是否为空/数字
|
||||
|
|
@ -3556,13 +3558,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
|
||||
//根据福利方案id、险种id、缴纳对象、缴费状态查询明细
|
||||
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey()));
|
||||
log.info("福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey()));
|
||||
log.info("自动调整 福利方案id: {},, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey()));
|
||||
if (insuranceSchemeDetailPOList.size() == 0) {
|
||||
log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey()));
|
||||
log.info("自动调整 根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey()));
|
||||
throw new SalaryRunTimeException("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: "+primaryId+", 福利明细项id:{}"+ Long.valueOf(entry.getKey()));
|
||||
}
|
||||
List<InsuranceSchemeDetailPO> isPaymentList = insuranceSchemeDetailPOList.stream()
|
||||
.filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList());
|
||||
log.info("自动调整 isPaymentList", isPaymentList.size());
|
||||
if (isPaymentList.size() > 0) {
|
||||
InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0);
|
||||
|
||||
|
|
@ -3572,18 +3575,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) {
|
||||
//数值低于对应福利明细下限
|
||||
entry.setValue(lowerLimit);
|
||||
log.info("自动调整 福利方案id: {},, 福利明细项id:{},数值{}低于对应福利明细下限{} ", primaryId, Long.valueOf(entry.getKey()), entry.getValue(), lowerLimit);
|
||||
}
|
||||
if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) {
|
||||
//数值高于对应福利明细上限
|
||||
entry.setValue(upperLimit);
|
||||
log.info("自动调整 福利方案id: {},, 福利明细项id:{},数值{}数值高于对应福利明细上限{} ", primaryId, Long.valueOf(entry.getKey()), entry.getValue(), upperLimit);
|
||||
}
|
||||
} else {
|
||||
log.info("福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
log.info("自动调整 福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
log.info("自动调整后 基数信息{}", paymentBaseJson);
|
||||
return JSON.toJSONString(paymentBaseJson);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryAcctEmployeeBO;
|
||||
|
|
@ -29,6 +28,7 @@ import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
|||
import com.engine.salary.mapper.sys.SalarySysConfMapper;
|
||||
import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryParam;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
|
|
@ -155,24 +155,24 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
@Override
|
||||
public void addFromReduce(SalaryAcctEmployeeAddParam addParam) {
|
||||
ValidUtil.doValidator(addParam);
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(addParam.getSalaryAcctRecordId());
|
||||
if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
}
|
||||
// 查询环比减少的薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listByIds(addParam.getIds());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98830, "薪资核算人员不存在或已被删除"));
|
||||
}
|
||||
// 添加薪资核算人员
|
||||
Date now = new Date();
|
||||
List<SalaryAcctEmployeePO> newSalaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().map(salaryAcctEmployeePO -> new SalaryAcctEmployeePO()
|
||||
.setSalaryAcctRecordId(salaryAcctRecordPO.getId()).setSalarySobId(salaryAcctRecordPO.getSalarySobId()).setSalaryMonth(salaryAcctRecordPO.getSalaryMonth()).setEmployeeId(salaryAcctEmployeePO.getEmployeeId()).setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setCreateTime(now).setUpdateTime(now).setCreator((long) user.getUID()).setDeleteType(0)).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(newSalaryAcctEmployeePOS)) {
|
||||
batchSave(newSalaryAcctEmployeePOS);
|
||||
}
|
||||
// ValidUtil.doValidator(addParam);
|
||||
// // 查询薪资核算记录
|
||||
// SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(addParam.getSalaryAcctRecordId());
|
||||
// if (Objects.isNull(salaryAcctRecordPO)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98747, "薪资核算记录不存在或已被删除"));
|
||||
// }
|
||||
// // 查询环比减少的薪资核算人员
|
||||
// List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listByIds(addParam.getIds());
|
||||
// if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98830, "薪资核算人员不存在或已被删除"));
|
||||
// }
|
||||
// // 添加薪资核算人员
|
||||
// Date now = new Date();
|
||||
// List<SalaryAcctEmployeePO> newSalaryAcctEmployeePOS = salaryAcctEmployeePOS.stream().map(salaryAcctEmployeePO -> new SalaryAcctEmployeePO()
|
||||
// .setSalaryAcctRecordId(salaryAcctRecordPO.getId()).setSalarySobId(salaryAcctRecordPO.getSalarySobId()).setSalaryMonth(salaryAcctRecordPO.getSalaryMonth()).setEmployeeId(salaryAcctEmployeePO.getEmployeeId()).setTaxAgentId(salaryAcctEmployeePO.getTaxAgentId()).setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY).setCreateTime(now).setUpdateTime(now).setCreator((long) user.getUID()).setDeleteType(0)).collect(Collectors.toList());
|
||||
// if (CollectionUtils.isNotEmpty(newSalaryAcctEmployeePOS)) {
|
||||
// batchSave(newSalaryAcctEmployeePOS);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -437,7 +437,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "个税扣缴义务人下无该人员档案信息或薪资缴纳日期不在薪资周期内"));
|
||||
}
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
|
||||
//保存核算人员
|
||||
saveAcctEmployeePOS(salaryAcctEmployeePOS, salarySobCycleDTO);
|
||||
|
||||
|
||||
// 记录日志
|
||||
|
|
@ -453,6 +455,38 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
SalaryElogConfig.salaryAcctRecordLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
private void saveAcctEmployeePOS(List<SalaryAcctEmployeePO> salaryAcctEmployeePOS, SalarySobCycleDTO sobCycle) {
|
||||
|
||||
boolean shotEmpBtn = "1".equals(getSalarySysConfService(user).getValueByCode(SalarySysConstant.SHOT_EMP_BTN));
|
||||
|
||||
//替换快照数据
|
||||
if (shotEmpBtn) {
|
||||
// String valueByCode = getSalarySysConfService(user).getValueByCode(SalarySysConstant.SHOT_EMP_TIME_TYPE);
|
||||
shotEmpData(salaryAcctEmployeePOS, sobCycle.getSalaryCycleFromDate());
|
||||
}
|
||||
//保存
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
}
|
||||
|
||||
private void shotEmpData(List<SalaryAcctEmployeePO> salaryAcctEmployeePOS, Date shotTime) {
|
||||
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);
|
||||
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.setSubcompanyId(shotEmp.getSubcompanyid());
|
||||
salaryAcctEmployeePO.setSubcompanyName(shotEmp.getSubcompanyName());
|
||||
salaryAcctEmployeePO.setStatus(shotEmp.getStatus());
|
||||
salaryAcctEmployeePO.setAccountType(shotEmp.getAccountType());
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchSave(Collection<SalaryAcctEmployeePO> salaryAcctEmployeePOS) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
|
|
@ -566,7 +600,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
// 保存薪资核算人员
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
saveAcctEmployeePOS(salaryAcctEmployeePOS, salarySobCycleDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -612,7 +646,8 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
List<Long> delIds = oldEmps.stream().filter(po -> !newEmpMap.containsKey(po.getTaxAgentId() + "_" + po.getEmployeeId())).map(SalaryAcctEmployeePO::getId).collect(Collectors.toList());
|
||||
|
||||
deleteByIds(delIds);
|
||||
batchSave(addEmps);
|
||||
|
||||
saveAcctEmployeePOS(addEmps, salarySobCycleDTO);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -768,7 +803,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
list = list.stream().filter(po -> param.getEmployee().contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if(isRealOrg){
|
||||
if (isRealOrg) {
|
||||
Set<Long> empIds = SalaryEntityUtil.properties(employeeList, DataCollectionEmployee::getEmployeeId);
|
||||
list = list.stream().filter(po -> empIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
}
|
||||
|
|
@ -794,16 +829,16 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
throw new SalaryRunTimeException("锁定状态异常!");
|
||||
}
|
||||
|
||||
if (updateParam.getLockStatus() == LockStatusEnum.LOCK){
|
||||
if (updateParam.getLockStatus() == LockStatusEnum.LOCK) {
|
||||
SalaryAcctConfig salaryAcctSobConfig = getSalaryAcctSobConfigService(user).getSalaryAcctConfig(updateParam.getSalaryAcctRecordId());
|
||||
List<SalarySobItemPO> salarySobItems = salaryAcctSobConfig.getSalarySobItems();
|
||||
List<Long> itemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId,Collectors.toList());
|
||||
List<Long> itemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId, Collectors.toList());
|
||||
|
||||
salaryAcctEmployees.forEach(salaryAcctEmployeePO -> {
|
||||
salaryAcctEmployeePO.setLockItems(itemIds);
|
||||
lock(salaryAcctEmployeePO);
|
||||
});
|
||||
}else {
|
||||
} else {
|
||||
salaryAcctEmployees.forEach(salaryAcctEmployeePO -> {
|
||||
salaryAcctEmployeePO.setLockItems(new ArrayList<>());
|
||||
lock(salaryAcctEmployeePO);
|
||||
|
|
|
|||
|
|
@ -521,6 +521,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
// 查询薪资核算记录所用的薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItems = config.getSalarySobItems();
|
||||
salarySobItems = salarySobItems.stream().filter(salarySobItemPO -> salarySobItemPO.getItemHide() == null || salarySobItemPO.getItemHide() == 0).collect(Collectors.toList());
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
|
||||
// 查询薪资项目
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
|
|
@ -615,6 +616,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
|
||||
// 查询薪资核算记录所用的薪资账套的薪资项目副本
|
||||
List<SalarySobItemPO> salarySobItems = salaryAcctConfig.getSalarySobItems();
|
||||
salarySobItems = salarySobItems.stream().filter(salarySobItemPO -> salarySobItemPO.getItemHide() == null || salarySobItemPO.getItemHide() == 0).collect(Collectors.toList());
|
||||
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
|
||||
// 查询薪资项目
|
||||
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
|
|
@ -15,14 +16,17 @@ import com.engine.salary.entity.hrm.SubCompanyInfo;
|
|||
import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
|
||||
import com.engine.salary.entity.hrm.dto.FieldSetting;
|
||||
import com.engine.salary.entity.hrm.po.ExpandFieldSettingsPO;
|
||||
import com.engine.salary.entity.hrm.po.HrmSnapshotPO;
|
||||
import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
|
||||
import com.engine.salary.enums.AccountTypeEnum;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.TargetTypeEnum;
|
||||
import com.engine.salary.mapper.datacollection.EmployMapper;
|
||||
import com.engine.salary.mapper.hrm.ExpandFieldSettingsMapper;
|
||||
import com.engine.salary.mapper.hrm.HrmSnapshotMapper;
|
||||
import com.engine.salary.service.ExtEmpService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.service.SalarySobExtRangeService;
|
||||
|
|
@ -33,6 +37,7 @@ import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -60,6 +65,10 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
|
||||
private HrmSnapshotMapper getHrmSnapshotMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmSnapshotMapper.class);
|
||||
}
|
||||
|
||||
private EmployMapper getEmployMapper() {
|
||||
return SqlProxyHandle.getProxy(EmployMapper.class);
|
||||
}
|
||||
|
|
@ -633,4 +642,50 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
}
|
||||
return SalaryI18nUtil.i18n(getEmployMapper().getJobCallInfoById(jobCallId));
|
||||
}
|
||||
|
||||
public List<DataCollectionEmployee> snapshot(List<Long> employeeIds, Date snapshotTime) {
|
||||
|
||||
List<DataCollectionEmployee> currentEmployees = getEmployeeByIdsAll(employeeIds);
|
||||
Map<Long, DataCollectionEmployee> currentEmployeeMap = SalaryEntityUtil.convert2Map(currentEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
|
||||
List<DataCollectionEmployee> employees = employeeIds.stream()
|
||||
.map(employeeId -> {
|
||||
|
||||
List<HrmSnapshotPO> snapshot = getHrmSnapshotMapper().snapshot(employeeId, snapshotTime);
|
||||
|
||||
return snapshot.stream().findFirst().map(hrmSnapshotPO -> DataCollectionEmployee.
|
||||
builder()
|
||||
.employeeId(employeeId)
|
||||
.username(hrmSnapshotPO.getLastname())
|
||||
.departmentName(hrmSnapshotPO.getDepartmentname())
|
||||
.departmentId(hrmSnapshotPO.getDepartmentid() == null ? null : NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getDepartmentid())))
|
||||
.subcompanyName(hrmSnapshotPO.getSubcompanyname())
|
||||
.subcompanyid(hrmSnapshotPO.getSubcompanyid1() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getSubcompanyid1())))
|
||||
.costcenterId(hrmSnapshotPO.getCostcenterid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getCostcenterid())))
|
||||
.locationId(hrmSnapshotPO.getLocationid() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getLocationid())))
|
||||
.jobtitleName(hrmSnapshotPO.getJobtitlename())
|
||||
.jobtitleId(hrmSnapshotPO.getJobtitle() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobtitle())))
|
||||
.companystartdate(hrmSnapshotPO.getCompanystartdate())
|
||||
.mobile(hrmSnapshotPO.getMobile())
|
||||
// .dismissdate()
|
||||
.status(Util.null2String(hrmSnapshotPO.getStatus()))
|
||||
.statusName(UserStatusEnum.getDefaultLabelByValue(NumberUtils.toInt(Util.null2String(hrmSnapshotPO.getStatus()), 1)))
|
||||
.workcode(hrmSnapshotPO.getWorkcode())
|
||||
.sex(hrmSnapshotPO.getSex())
|
||||
.email(hrmSnapshotPO.getEmail())
|
||||
.telephone(hrmSnapshotPO.getTelephone())
|
||||
.jobcall(hrmSnapshotPO.getJobcallname())
|
||||
.jobcallId(hrmSnapshotPO.getJobcall() == null ? null :NumberUtil.parseLong(Util.null2String(hrmSnapshotPO.getJobcall())))
|
||||
.birthday(hrmSnapshotPO.getBirthday())
|
||||
.workYear(hrmSnapshotPO.getWorkyear() == null ? null : hrmSnapshotPO.getWorkyear().doubleValue())
|
||||
.companyWorkYear(hrmSnapshotPO.getCompanyworkyear() == null ? null : hrmSnapshotPO.getCompanyworkyear().doubleValue())
|
||||
.idNo(hrmSnapshotPO.getCertificatenum())
|
||||
.accountTypeName(AccountTypeEnum.getDefaultLabelByValue(hrmSnapshotPO.getAccounttype()))
|
||||
.accountType(hrmSnapshotPO.getAccounttype())
|
||||
.build())
|
||||
.orElse(currentEmployeeMap.get(employeeId));
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return SalaryI18nUtil.i18nList(employees);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.engine.salary.config.SalaryElogConfig;
|
|||
import com.engine.salary.constant.SalaryArchiveConstant;
|
||||
import com.engine.salary.constant.SalaryItemConstant;
|
||||
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
|
||||
import com.engine.salary.encrypt.AESEncryptUtil;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
|
|
@ -822,7 +823,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
return true;
|
||||
})
|
||||
.peek(dto -> dto.setEmployeeId((long) user.getUID()))
|
||||
.peek(dto -> {
|
||||
dto.setEmployeeId((long) user.getUID());
|
||||
dto.setSalaryCode(AESEncryptUtil.encrypt4SalaryBill(String.valueOf(user.getUID())));
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
PageInfo<SalaryMySalaryBillListDTO> pageInfo = new PageInfo<>(list, SalaryMySalaryBillListDTO.class);
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "岗位"), "jobTitle"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "员工状态"), "status"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "workCode"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "idNo"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "入职日期"), "companystartdate"));
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "次数"), "acctTimes").setDisplay(WeaBoolAttr.FALSE));
|
||||
if (StrUtil.isNotBlank(param.getName())) {
|
||||
|
|
|
|||
|
|
@ -204,4 +204,14 @@ public class SalarySysConstant {
|
|||
* 审批流程发起后允许修改核算数据
|
||||
*/
|
||||
public static final String APPROVAL_CAN_EDIT_RESULT_STATUS = "APPROVAL_CAN_EDIT_RESULT_STATUS";
|
||||
|
||||
/**
|
||||
* 是否采用组织快照,0:关闭 1:开启
|
||||
*/
|
||||
public static final String SHOT_EMP_BTN = "SHOT_EMP_BTN";
|
||||
|
||||
/**
|
||||
* 快照时间点
|
||||
*/
|
||||
public static final String SHOT_EMP_TIME_TYPE = "SHOT_EMP_TIME_TYPE";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
package com.engine.salary.sys.enums;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 快照时间点类型
|
||||
* <p>Copyright: Copyright (c) 2024</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public enum ShotTimeTypeEnum implements BaseEnum<String> {
|
||||
|
||||
salaryFirstDate("salaryFirstDate", "薪资所属月第一天", 1),
|
||||
salaryLastDate("salaryLastDate", "薪资所属月最后一天", 1),
|
||||
salaryCycleFromDate("salaryCycleFromDate", "薪资周期起始日期", 1),
|
||||
salaryCycleEndDate("salaryCycleEndDate", "薪资周期结束日期", 1);
|
||||
|
||||
private String value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
|
||||
ShotTimeTypeEnum(String value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static ShotTimeTypeEnum parseByValue(String value) {
|
||||
for (ShotTimeTypeEnum e : ShotTimeTypeEnum.values()) {
|
||||
if (StringUtils.equals(e.getValue(), value)) {
|
||||
return e;
|
||||
}
|
||||
}
|
||||
return salaryCycleFromDate;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.engine.salary.timer;
|
||||
|
||||
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.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import weaver.hrm.User;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
public class HrmSnapshotJob extends BaseCronJob {
|
||||
|
||||
//指定筷子时间
|
||||
private String appointSnapshotTime;
|
||||
|
||||
private HrmSnapshotMapper getHrmSnapshotMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmSnapshotMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
User user = new User();
|
||||
user.setUid(1);
|
||||
user.setLoginid("sysadmin");
|
||||
|
||||
try {
|
||||
List<HrmSnapshotPO> hrmSnapshotPOS = getHrmSnapshotMapper().currentEmpData();
|
||||
|
||||
Date snapshotTime = StrUtil.isNotBlank(appointSnapshotTime) && SalaryDateUtil.checkDay(appointSnapshotTime) ? SalaryDateUtil.dateStrToLocalDate(appointSnapshotTime) : SalaryDateUtil.localDateToDate(LocalDate.now());
|
||||
|
||||
//先删除当日快照
|
||||
getHrmSnapshotMapper().deleteBySnapshotTime(snapshotTime);
|
||||
|
||||
hrmSnapshotPOS.forEach(hrmSnapshotPO -> {
|
||||
|
||||
hrmSnapshotPO.setId(IdGenerator.generate());
|
||||
hrmSnapshotPO.setSnapshotTime(snapshotTime);
|
||||
|
||||
getHrmSnapshotMapper().insertIgnoreNull(hrmSnapshotPO);
|
||||
|
||||
});
|
||||
}catch (Exception e){
|
||||
log.error("生成快照失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -26,6 +26,8 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.process.salaryArchive.SalaryArchiveProcessQueryParam;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
|
|
@ -38,6 +40,8 @@ import weaver.hrm.User;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.OPEN_SECONDARY_ACCOUNT;
|
||||
|
||||
/**
|
||||
* 薪资档案
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -73,6 +77,12 @@ public class SalaryArchiveWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//主次账号是否开启
|
||||
boolean openSecondaryAccount = "1".equals(getSalarySysConfService(user).getValueByCode(OPEN_SECONDARY_ACCOUNT));
|
||||
|
||||
/**
|
||||
* 薪资档案列表(分页)
|
||||
|
|
@ -101,7 +111,7 @@ public class SalaryArchiveWrapper extends Service {
|
|||
|
||||
|
||||
//动态列组装
|
||||
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
|
||||
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems, openSecondaryAccount);
|
||||
|
||||
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
|
||||
table.setColumns(columns);
|
||||
|
|
@ -153,7 +163,7 @@ public class SalaryArchiveWrapper extends Service {
|
|||
|
||||
|
||||
//动态列组装
|
||||
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
|
||||
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems, openSecondaryAccount);
|
||||
|
||||
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
|
||||
table.setColumns(columns);
|
||||
|
|
|
|||
|
|
@ -77,9 +77,7 @@ public class SalarySobItemWrapper extends Service {
|
|||
Integer searchPageSize = queryParam.getPageSize();
|
||||
Integer searchCurrent = queryParam.getCurrent();
|
||||
|
||||
PageInfo<SalaryItemPO> page = getSalaryItemService(user).listPageByParam(queryParam);
|
||||
|
||||
List<SalaryItemPO> salaryItemList = page.getList();
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByParam(queryParam);
|
||||
|
||||
Set<Long> taxAgentIds = getTaxAgentService(user).listAllTaxAgents((long) user.getUID())
|
||||
.stream().map(TaxAgentPO::getId)
|
||||
|
|
@ -97,22 +95,23 @@ public class SalarySobItemWrapper extends Service {
|
|||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
salaryItemList = SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList).getList();
|
||||
|
||||
|
||||
//最终返回的分页对象
|
||||
PageInfo<SalaryItemSobListDTO> dtoPage = new PageInfo<>(SalaryItemSobListDTO.class);
|
||||
dtoPage.setPageSize(searchPageSize);
|
||||
dtoPage.setPageNum(searchCurrent);
|
||||
dtoPage.setTotal(page.getTotal());
|
||||
if (CollectionUtils.isNotEmpty(salaryItemList)) {
|
||||
dtoPage.setTotal(salaryItemList.size());
|
||||
List<SalaryItemPO> list = SalaryPageUtil.buildPage(searchCurrent, searchPageSize, salaryItemList).getList();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 查询公式
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(salaryItemList, SalaryItemPO::getFormulaId);
|
||||
Set<Long> formulaIds = SalaryEntityUtil.properties(list, SalaryItemPO::getFormulaId);
|
||||
List<ExpressFormula> expressFormulas = getSalaryFormulaService(user).listExpressFormula(formulaIds);
|
||||
// 查询系统薪资项目
|
||||
Set<Long> sysSalaryItemIds = SalaryEntityUtil.properties(salaryItemList, SalaryItemPO::getSysSalaryItemId);
|
||||
Set<Long> sysSalaryItemIds = SalaryEntityUtil.properties(list, SalaryItemPO::getSysSalaryItemId);
|
||||
List<SysSalaryItemPO> sysSalaryItemPOS = getSysSalaryItemService(user).listByIds(sysSalaryItemIds);
|
||||
// 转换成薪资项目列表dto
|
||||
dtoPage.setList(SalaryItemBO.convert2itemSobListDTO(salaryItemList, expressFormulas, sysSalaryItemPOS));
|
||||
dtoPage.setList(SalaryItemBO.convert2itemSobListDTO(list, expressFormulas, sysSalaryItemPOS));
|
||||
}
|
||||
return dtoPage;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue