Merge branch 'release/2.18.1.2412.01' into feature/权限
# Conflicts: # src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java
This commit is contained in:
commit
36de3feeed
|
|
@ -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,8 @@
|
|||
ALTER TABLE hrsa_page_list_template add (
|
||||
system_type number
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_page_list_template add (
|
||||
system_type number
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_page_list_template add (
|
||||
system_type number
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
/
|
||||
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_page_list_template ADD COLUMN system_type int;
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
ALTER TABLE hrsa_page_list_template add (
|
||||
system_type number
|
||||
)
|
||||
/
|
||||
|
||||
update hrsa_page_list_template set system_type=0
|
||||
/
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE hrsa_page_list_template ADD COLUMN system_type int ;
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE hrsa_page_list_template ADD system_type int NULL
|
||||
GO
|
||||
|
||||
update hrsa_page_list_template set system_type=0
|
||||
GO
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
ALTER TABLE hrsa_page_list_template add (
|
||||
system_type number
|
||||
);
|
||||
/
|
||||
|
||||
update hrsa_page_list_template set system_type=0;
|
||||
/
|
||||
|
||||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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 : 0)
|
||||
.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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.setting.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.engine.salary.enums.common.SharedTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -8,13 +9,61 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 薪资帐套表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_page_list_template
|
||||
public class PageListTemplateDTO {
|
||||
private List<WeaTableColumn> setting;
|
||||
private List<WeaTableColumn> checked;
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
@TableTitle(title = "模板名称",dataIndex = "name",key = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 页面
|
||||
*/
|
||||
private String page;
|
||||
|
||||
/**
|
||||
* 设置
|
||||
*/
|
||||
private List<String> setting;
|
||||
|
||||
/**
|
||||
* 是否共享,0否,1是
|
||||
* @see SharedTypeEnum
|
||||
*/
|
||||
private Integer sharedType;
|
||||
|
||||
@TableTitle(title = "可见性",dataIndex = "sharedTypeName",key = "sharedTypeName")
|
||||
private String sharedTypeName;
|
||||
|
||||
/**
|
||||
* 是否系统模板
|
||||
*/
|
||||
private Integer systemType;
|
||||
|
||||
@TableTitle(title = "是否系统模板",dataIndex = "systemTypeName",key = "systemTypeName")
|
||||
private String systemTypeName;
|
||||
|
||||
@TableTitle(title = "范围",dataIndex = "limits",key = "limits")
|
||||
private String limits;
|
||||
|
||||
/**
|
||||
* 限制
|
||||
*/
|
||||
private List<Long> limitIds;
|
||||
|
||||
private Boolean canEdit;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.salary.entity.setting.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplateDetailDTO {
|
||||
private List<WeaTableColumn> setting;
|
||||
private List<WeaTableColumn> checked;
|
||||
}
|
||||
|
|
@ -20,5 +20,4 @@ public class PageListSettingQueryParam {
|
|||
|
||||
private String name;
|
||||
|
||||
private Integer defaultSetting;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplateDeleteParam {
|
||||
private List<Long> ids;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.setting.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -13,7 +14,7 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PageListTemplateQueryParam {
|
||||
public class PageListTemplateQueryParam extends BaseQueryParam {
|
||||
|
||||
private Long id;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.entity.setting.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.engine.salary.enums.common.SharedTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -17,6 +18,7 @@ import java.util.List;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_page_list_template
|
||||
public class PageListTemplatePO {
|
||||
|
||||
|
||||
|
|
@ -44,16 +46,23 @@ public class PageListTemplatePO {
|
|||
|
||||
/**
|
||||
* 是否共享,0否,1是
|
||||
* @see SharedTypeEnum
|
||||
*/
|
||||
@ElogTransform(name = "是否共享,0否,1是")
|
||||
@ElogTransform(name = "可见性:1私有,0共享")
|
||||
private Integer sharedType;
|
||||
|
||||
/**
|
||||
* 是否系统模板
|
||||
*/
|
||||
@ElogTransform(name = "是否系统模板,0否,1是")
|
||||
private Integer systemType;
|
||||
|
||||
/**
|
||||
* 限制
|
||||
*/
|
||||
@ElogTransform(name = "限制")
|
||||
private List<Long> limitIds;
|
||||
|
||||
/**
|
||||
* 限制
|
||||
*/
|
||||
@ElogTransform(name = "限制")
|
||||
private List<Long> limitIds;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
|
|
@ -67,23 +76,23 @@ public class PageListTemplatePO {
|
|||
@ElogTransform(name = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform(name = "创建人")
|
||||
private Long creator;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ElogTransform(name = "创建人")
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已删除。0:未删除、1:已删除")
|
||||
private Integer deleteType;
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
@ElogTransform(name = "是否已删除。0:未删除、1:已删除")
|
||||
private Integer deleteType;
|
||||
|
||||
|
||||
//主键id集合
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.engine.salary.enums.common;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
public enum SharedTypeEnum implements BaseEnum<Integer> {
|
||||
PRIVATE(1, "私有", 86569),
|
||||
PUBLIC(0, "共享", 86568);
|
||||
|
||||
private Integer value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private Integer labelId;
|
||||
|
||||
SharedTypeEnum(Integer value, String defaultLabel, Integer labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return this.labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return this.defaultLabel;
|
||||
}
|
||||
|
||||
public static SharedTypeEnum parseByValue(Integer value) {
|
||||
for (SharedTypeEnum enums : SharedTypeEnum.values()) {
|
||||
if (Objects.equals(enums.getValue(), value)) {
|
||||
return enums;
|
||||
}
|
||||
}
|
||||
return PUBLIC;
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
|
@ -70,5 +70,4 @@ public interface PageLinkMapper {
|
|||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
PageLinkPO getLink(@Param("employeeId")Long employeeId, @Param("page")String page);
|
||||
}
|
||||
|
|
@ -220,13 +220,5 @@
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getLink" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_page_link t
|
||||
WHERE delete_type = 0
|
||||
AND employee_id = #{employeeId}
|
||||
AND page = #{page}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
<result column="page" property="page"/>
|
||||
<result column="setting" property="setting" typeHandler="com.engine.salary.handle.SalaryListTypeHandler" />
|
||||
<result column="shared_type" property="sharedType"/>
|
||||
<result column="system_type" property="systemType"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
|
@ -28,6 +29,7 @@
|
|||
, t.page
|
||||
, t.setting
|
||||
, t.shared_type
|
||||
, t.system_type
|
||||
, t.tenant_key
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
|
@ -78,6 +80,9 @@
|
|||
</if>
|
||||
<if test="sharedType != null">
|
||||
AND shared_type = #{sharedType}
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
AND system_type = #{systemType}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
|
|
@ -127,6 +132,9 @@
|
|||
<if test="sharedType != null">
|
||||
shared_type,
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
|
|
@ -162,6 +170,9 @@
|
|||
<if test="sharedType != null">
|
||||
#{sharedType},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
|
|
@ -183,6 +194,7 @@
|
|||
page=#{page},
|
||||
setting=#{setting, jdbcType=ARRAY, typeHandler=com.engine.salary.handle.SalaryListTypeHandler},
|
||||
shared_type=#{sharedType},
|
||||
system_type=#{systemType},
|
||||
tenant_key=#{tenantKey},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
|
|
@ -218,6 +230,9 @@
|
|||
<if test="sharedType != null">
|
||||
shared_type=#{sharedType},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
system_type=#{systemType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -255,6 +255,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,8 +10,6 @@ import com.engine.salary.component.WeaTableColumnGroup;
|
|||
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.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.param.PageListSettingQueryParam;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.report.common.constant.SalaryConstant;
|
||||
import com.engine.salary.report.entity.bo.SalaryStatisticsReportBO;
|
||||
|
|
@ -184,15 +182,7 @@ public class SalaryStatisticsEmployeeWrapper extends Service {
|
|||
pageInfo.setList(records);
|
||||
pageInfo.setTotal(salaryAcctEmployeePageInfo.getTotal());
|
||||
|
||||
List<WeaTableColumn> weaTableColumns;
|
||||
//显示方案1,显示模板
|
||||
if (templateShow) {
|
||||
weaTableColumns = getSettingService(user).getPageListColumns(SALARY_DETAILS_REPORT.getValue());
|
||||
} else {
|
||||
PageListSettingQueryParam param = PageListSettingQueryParam.builder().page(SALARY_DETAILS_REPORT.getValue()).defaultSetting(0).build();
|
||||
PageListTemplateDTO pageListSetting = getSettingService(user).getPageListSetting(param);
|
||||
weaTableColumns = pageListSetting.getChecked();
|
||||
}
|
||||
List<WeaTableColumn> weaTableColumns = getSettingService(user).getPageListColumns(SALARY_DETAILS_REPORT.getValue());
|
||||
|
||||
// 结果
|
||||
resultMap.put("columns", weaTableColumns);
|
||||
|
|
|
|||
|
|
@ -160,4 +160,6 @@ public interface SIArchivesService {
|
|||
List<InsuranceArchivesFundSchemePO> listInsuranceArchivesFundSchemeByIds(List<Long> ids);
|
||||
|
||||
List<InsuranceArchivesOtherSchemePO> listInsuranceArchivesOtherSchemeByIds(List<Long> ids);
|
||||
|
||||
List<InsuranceArchivesBaseInfoPO> listAll();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.salary.entity.hrm.dto.EmployeeInfoExpandDTO;
|
|||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -190,4 +191,6 @@ public interface SalaryEmployeeService {
|
|||
* @return
|
||||
*/
|
||||
JobCallInfo getJobCallInfoById(Long jobCallId);
|
||||
|
||||
List<DataCollectionEmployee> snapshot(List<Long> employeeIds, Date snapshotTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,26 +2,58 @@ package com.engine.salary.service;
|
|||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SettingService {
|
||||
|
||||
@Deprecated
|
||||
void savePageListSetting(PageListSettingSaveParam pageListSettingSaveParam);
|
||||
|
||||
PageListTemplateDTO getPageListSetting(PageListSettingQueryParam param);
|
||||
/**
|
||||
* 获取原有显示列定制配置
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
PageListTemplateDetailDTO getDefaultPageListSetting(PageListSettingQueryParam param);
|
||||
|
||||
@Deprecated
|
||||
void resetPageListSetting(PageListSettingResetParam param);
|
||||
|
||||
PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param);
|
||||
/**
|
||||
* 获取指定模板配置或者指定页面默认配置
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
PageListTemplateDetailDTO getPageListTemplate(PageListTemplateQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取可选模板列表
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
List<PageListTemplatePO> getPageListTemplates(PageListTemplateQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 保存模板
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param);
|
||||
|
||||
/**
|
||||
* 更换模板
|
||||
* @param param
|
||||
*/
|
||||
void changePageListTemplate(PageListTemplateChangeParam param);
|
||||
|
||||
List<WeaTableColumn> getPageListColumns(String page);
|
||||
|
||||
PageInfo<PageListTemplateDTO> getTemplates(PageListTemplateQueryParam param);
|
||||
|
||||
void deletePageListTemplate(PageListTemplateDeleteParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -602,6 +602,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);
|
||||
}
|
||||
|
||||
|
|
@ -4843,6 +4860,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);
|
||||
|
|
@ -4866,11 +4900,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());
|
||||
|
|
@ -4950,10 +4984,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;
|
||||
}
|
||||
|
||||
|
|
@ -4969,11 +5003,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)) {
|
||||
|
|
@ -4995,6 +5029,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);
|
||||
}
|
||||
|
|
@ -5063,11 +5098,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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5690,7 +5725,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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4071,4 +4071,9 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
partition.forEach(list -> resultList.addAll(getOtherSchemeMapper().getOtherById(list)));
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsuranceArchivesBaseInfoPO> listAll() {
|
||||
return getInsuranceBaseInfoMapper().listAll();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -32,6 +31,7 @@ import com.engine.salary.mapper.salarysob.SobTaxLinkMapper;
|
|||
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.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
import com.engine.salary.sys.entity.vo.OrderRuleVO;
|
||||
|
|
@ -168,24 +168,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
|
||||
|
|
@ -445,7 +445,9 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
if (CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98769, "个税扣缴义务人下无该人员档案信息或薪资缴纳日期不在薪资周期内"));
|
||||
}
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
|
||||
//保存核算人员
|
||||
saveAcctEmployeePOS(salaryAcctEmployeePOS, salarySobCycleDTO);
|
||||
|
||||
|
||||
// 记录日志
|
||||
|
|
@ -461,6 +463,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)) {
|
||||
|
|
@ -571,7 +605,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
// 保存薪资核算人员
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
saveAcctEmployeePOS(salaryAcctEmployeePOS, salarySobCycleDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -618,7 +652,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);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -775,7 +810,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());
|
||||
}
|
||||
|
|
@ -805,16 +840,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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -624,4 +633,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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,14 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageLinkPO;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.SalaryOnOffEnum;
|
||||
import com.engine.salary.enums.common.SharedTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.setting.PageLinkMapper;
|
||||
import com.engine.salary.mapper.setting.PageListSettingMapper;
|
||||
|
|
@ -26,6 +29,8 @@ 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.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -92,7 +97,7 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageListTemplateDTO getPageListSetting(PageListSettingQueryParam param) {
|
||||
public PageListTemplateDetailDTO getDefaultPageListSetting(PageListSettingQueryParam param) {
|
||||
String page = param.getPage();
|
||||
if (SALARY_DETAILS_REPORT.getValue().equals(page)) {
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
|
|
@ -132,32 +137,22 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
|
||||
columns.addAll(collect);
|
||||
|
||||
Integer defaultSetting = param.getDefaultSetting();
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
|
||||
List<WeaTableColumn> checkedList = new ArrayList<>();
|
||||
|
||||
//是否查询默认设置
|
||||
PageListSettingPO pageListSettingPO;
|
||||
if (defaultSetting == 0) {
|
||||
pageListSettingPO = getPageListSettingMapper().getByPage(page, 0, (long) user.getUID());
|
||||
//查不到个人查默认
|
||||
if (pageListSettingPO == null) {
|
||||
pageListSettingPO = getPageListSettingMapper().getByPage(page, 1, null);
|
||||
}
|
||||
} else {
|
||||
pageListSettingPO = getPageListSettingMapper().getByPage(page, 1, null);
|
||||
}
|
||||
//默认设置
|
||||
PageListSettingPO pageListSettingPO = getPageListSettingMapper().getByPage(page, 1, null);
|
||||
|
||||
//查询选中的项目
|
||||
List<WeaTableColumn> checkedList = new ArrayList<>();
|
||||
if (pageListSettingPO != null) {
|
||||
checkedList = Optional.ofNullable(pageListSettingPO.getSetting()).orElse(new ArrayList<>()).stream().map(s -> columnMap.getOrDefault(s, new WeaTableColumn())).collect(Collectors.toList());
|
||||
} else {
|
||||
checkedList = columns;
|
||||
}
|
||||
return PageListTemplateDTO.builder().setting(columns).checked(checkedList).build();
|
||||
return PageListTemplateDetailDTO.builder().setting(columns).checked(checkedList).build();
|
||||
}
|
||||
|
||||
return PageListTemplateDTO.builder().setting(new ArrayList<>()).checked(new ArrayList<>()).build();
|
||||
return PageListTemplateDetailDTO.builder().setting(new ArrayList<>()).checked(new ArrayList<>()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -175,9 +170,8 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
public PageListTemplateDetailDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
String page = param.getPage();
|
||||
Long id = param.getId();
|
||||
if (SALARY_DETAILS_REPORT.getValue().equals(page)) {
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(87614, "薪资所属月"), "salaryMonth"));
|
||||
|
|
@ -189,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())) {
|
||||
|
|
@ -196,7 +191,7 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
}
|
||||
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listAll();
|
||||
List<WeaTableColumn> collect = salaryItemList.stream().filter(po -> {
|
||||
List<WeaTableColumn> salaryItemCols = salaryItemList.stream().filter(po -> {
|
||||
String name = param.getName();
|
||||
if (StrUtil.isNotEmpty(name)) {
|
||||
return po.getName() != null && po.getName().contains(name);
|
||||
|
|
@ -214,21 +209,31 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
}
|
||||
}).map(item -> new WeaTableColumn("100px", item.getName(), item.getId() + SalaryConstant.DYNAMIC_SUFFIX)).collect(Collectors.toList());
|
||||
|
||||
columns.addAll(collect);
|
||||
columns.addAll(salaryItemCols);
|
||||
|
||||
Map<String, WeaTableColumn> columnMap = SalaryEntityUtil.convert2Map(columns, WeaTableColumn::getColumn);
|
||||
List<WeaTableColumn> checkedList = new ArrayList<>();
|
||||
List<WeaTableColumn> checkedList = columns;
|
||||
Long id = param.getId();
|
||||
if (id != null) {
|
||||
//编辑模板,指定模板id
|
||||
PageListTemplatePO po = getPageListTemplateMapper().getById(id);
|
||||
if (po != null) {
|
||||
checkedList = Optional.ofNullable(po.getSetting()).orElse(new ArrayList<>()).stream().map(s -> columnMap.getOrDefault(s, new WeaTableColumn())).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
} else {
|
||||
//打开选中的模板
|
||||
List<PageListTemplatePO> pageListTemplates = getPageListTemplates(PageListTemplateQueryParam.builder().page(page).build());
|
||||
List<WeaTableColumn> columnList = pageListTemplates.stream()
|
||||
.filter(PageListTemplatePO::getChecked).map(PageListTemplatePO::getSetting).findFirst().orElse(new ArrayList<>())
|
||||
.stream().map(s -> columnMap.getOrDefault(s, new WeaTableColumn())).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(columnList)) {
|
||||
checkedList = columnList;
|
||||
}
|
||||
}
|
||||
return PageListTemplateDTO.builder().setting(columns).checked(checkedList).build();
|
||||
return PageListTemplateDetailDTO.builder().setting(columns).checked(checkedList).build();
|
||||
}
|
||||
|
||||
return PageListTemplateDTO.builder().build();
|
||||
return PageListTemplateDetailDTO.builder().build();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -236,24 +241,74 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
Date now = new Date();
|
||||
String page = param.getPage();
|
||||
|
||||
//个人配置模板
|
||||
PageListTemplatePO build = PageListTemplatePO.builder().page(page).build();
|
||||
List<PageListTemplatePO> pos = getPageListTemplateMapper().listSome(build);
|
||||
|
||||
//获取当前选择的模板
|
||||
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), SALARY_DETAILS_REPORT.getValue());
|
||||
//如果查不到不到系统模板,创建系统模板
|
||||
PageListTemplatePO systemTemplate = pos.stream().filter(po -> po.getSystemType() != null && po.getSystemType() == 1).findFirst().orElse(null);
|
||||
if (systemTemplate == null) {
|
||||
//查询系统默认配置
|
||||
PageListTemplateDetailDTO pageListSetting = getDefaultPageListSetting(PageListSettingQueryParam.builder().page(SALARY_DETAILS_REPORT.getValue()).build());
|
||||
|
||||
systemTemplate = PageListTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.page(param.getPage())
|
||||
.name("系统模板")
|
||||
.sharedType(SharedTypeEnum.PUBLIC.getValue())
|
||||
.systemType(SalaryOnOffEnum.ON.getValue())
|
||||
.setting(pageListSetting.getChecked().stream().map(WeaTableColumn::getColumn).collect(Collectors.toList()))
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.tenantKey(DEFAULT_TENANT_KEY).build();
|
||||
getPageListTemplateMapper().insertIgnoreNull(systemTemplate);
|
||||
pos.add(systemTemplate);
|
||||
}
|
||||
|
||||
//获取当前选择的模板
|
||||
PageLinkPO link = getPageLinkMapper().listSome(PageLinkPO.builder().employeeId((long) user.getUID()).page(SALARY_DETAILS_REPORT.getValue()).build()).stream().findFirst().orElse(null);
|
||||
if (link == null) {
|
||||
link = PageLinkPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.employeeId((long) user.getUID())
|
||||
.page(param.getPage())
|
||||
.templateId(systemTemplate.getId())
|
||||
.tenantKey(DEFAULT_TENANT_KEY)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator((long) user.getUID())
|
||||
.deleteType(0).build();
|
||||
getPageLinkMapper().insertIgnoreNull(link);
|
||||
}
|
||||
Long templateId = link.getTemplateId();
|
||||
|
||||
//权限控制
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
|
||||
List<Long> taxIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
||||
Boolean chief = getTaxAgentService().isChief((long) user.getUID());
|
||||
pos = pos.stream().filter(po -> {
|
||||
if (po.getSharedType() == 1) {
|
||||
SharedTypeEnum sharedTypeEnum = SharedTypeEnum.parseByValue(po.getSharedType());
|
||||
//系统模板直接可见
|
||||
if (chief || po.getSystemType() == 1) {
|
||||
return true;
|
||||
}
|
||||
//私有,只能自己看到
|
||||
if (sharedTypeEnum == SharedTypeEnum.PRIVATE) {
|
||||
return Objects.equals((long) user.getUID(), po.getCreator());
|
||||
}
|
||||
//共享
|
||||
if (sharedTypeEnum == SharedTypeEnum.PUBLIC) {
|
||||
List<Long> limitIds = po.getLimitIds();
|
||||
return CollectionUtil.isNotEmpty(limitIds) && CollectionUtil.intersection(limitIds, taxIds).size() != 0;
|
||||
return CollectionUtil.isEmpty(limitIds) || CollectionUtil.intersection(limitIds, taxIds).size() != 0;
|
||||
}
|
||||
return true;
|
||||
}).peek(po -> {
|
||||
po.setChecked(link != null && po.getId().equals(link.getTemplateId()));
|
||||
po.setChecked(po.getId().equals(templateId));
|
||||
}).collect(Collectors.toList());
|
||||
return pos;
|
||||
}
|
||||
|
|
@ -266,7 +321,19 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
|
||||
PageListTemplatePO po;
|
||||
if (id == null) {
|
||||
po = PageListTemplatePO.builder().id(IdGenerator.generate()).page(param.getPage()).name(param.getName()).sharedType(param.getSharedType()).limitIds(param.getLimitIds()).setting(param.getSetting()).creator((long) user.getUID()).createTime(now).updateTime(now).deleteType(0).tenantKey(DEFAULT_TENANT_KEY).build();
|
||||
po = PageListTemplatePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.page(param.getPage())
|
||||
.name(param.getName())
|
||||
.sharedType(param.getSharedType())
|
||||
.systemType(0)
|
||||
.limitIds(param.getLimitIds())
|
||||
.setting(param.getSetting())
|
||||
.creator((long) user.getUID())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.deleteType(0)
|
||||
.tenantKey(DEFAULT_TENANT_KEY).build();
|
||||
getPageListTemplateMapper().insertIgnoreNull(po);
|
||||
} else {
|
||||
po = getPageListTemplateMapper().getById(id);
|
||||
|
|
@ -301,13 +368,81 @@ public class SettingServiceImpl extends Service implements SettingService {
|
|||
|
||||
@Override
|
||||
public List<WeaTableColumn> getPageListColumns(String page) {
|
||||
PageLinkPO link = getPageLinkMapper().getLink((long) user.getUID(), page);
|
||||
if (link != null) {
|
||||
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).id(link.getTemplateId()).build());
|
||||
return pageListTemplate.getChecked();
|
||||
} else {
|
||||
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).build());
|
||||
return pageListTemplate.getSetting();
|
||||
PageListTemplateDetailDTO pageListTemplate = getPageListTemplate((PageListTemplateQueryParam.builder().page(page).build()));
|
||||
return pageListTemplate.getChecked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<PageListTemplateDTO> getTemplates(PageListTemplateQueryParam param) {
|
||||
PageListTemplatePO build = PageListTemplatePO.builder().page(param.getPage()).build();
|
||||
List<PageListTemplatePO> pos = getPageListTemplateMapper().listSome(build);
|
||||
|
||||
//权限控制
|
||||
List<TaxAgentPO> agentPOList = getTaxAgentService().listAll();
|
||||
Map<Long, String> idNameMap = SalaryEntityUtil.convert2Map(agentPOList, TaxAgentPO::getId, TaxAgentPO::getName);
|
||||
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService().listAllTaxAgents((long) user.getUID());
|
||||
Boolean chief = getTaxAgentService().isChief((long) user.getUID());
|
||||
List<Long> taxIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId, Collectors.toList());
|
||||
List<PageListTemplateDTO> templateDTOS = pos.stream()
|
||||
.filter(po -> {
|
||||
SharedTypeEnum sharedTypeEnum = SharedTypeEnum.parseByValue(po.getSharedType());
|
||||
//系统模板直接可见
|
||||
if (chief || po.getSystemType() == 1) {
|
||||
return true;
|
||||
}
|
||||
//私有,只能自己看到
|
||||
if (sharedTypeEnum == SharedTypeEnum.PRIVATE) {
|
||||
return Objects.equals((long) user.getUID(), po.getCreator());
|
||||
}
|
||||
//共享
|
||||
if (sharedTypeEnum == SharedTypeEnum.PUBLIC) {
|
||||
List<Long> limitIds = po.getLimitIds();
|
||||
return CollectionUtil.isEmpty(limitIds) || CollectionUtil.intersection(limitIds, taxIds).size() != 0;
|
||||
}
|
||||
return true;
|
||||
}).map(po -> PageListTemplateDTO.builder()
|
||||
.id(po.getId())
|
||||
.page(po.getPage())
|
||||
.name(po.getName())
|
||||
.sharedType(po.getSharedType())
|
||||
.systemType(po.getSystemType())
|
||||
.sharedTypeName(SharedTypeEnum.parseByValue(po.getSharedType()).getDefaultLabel())
|
||||
.systemTypeName(po.getSystemType() == 1 ? "系统模板" : "自定义")
|
||||
.limits(CollUtil.isEmpty(po.getLimitIds()) ? "所有" : Optional.ofNullable(po.getLimitIds()).orElse(new ArrayList<>()).stream().map(id -> idNameMap.getOrDefault(id, "")).collect(Collectors.joining(",")))
|
||||
.limitIds(CollUtil.isEmpty(po.getLimitIds()) ? new ArrayList<>() : po.getLimitIds())
|
||||
.setting(po.getSetting())
|
||||
.canEdit(chief || (Objects.equals((long) user.getUID(), po.getCreator()) && po.getSystemType() == 0))
|
||||
.build())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), templateDTOS, PageListTemplateDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePageListTemplate(PageListTemplateDeleteParam param) {
|
||||
List<Long> ids = param.getIds();
|
||||
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
throw new SalaryRunTimeException("未选择模板!");
|
||||
}
|
||||
|
||||
ids.forEach(id -> {
|
||||
PageListTemplatePO pageListTemplatePO = getPageListTemplateMapper().getById(id);
|
||||
if (pageListTemplatePO == null) {
|
||||
throw new SalaryRunTimeException("模板不存在!");
|
||||
}
|
||||
if (pageListTemplatePO.getSystemType() == 1) {
|
||||
throw new SalaryRunTimeException("系统模板不允许删除!");
|
||||
}
|
||||
if (!Objects.equals((long) user.getUID(), pageListTemplatePO.getCreator())) {
|
||||
throw new SalaryRunTimeException(pageListTemplatePO.getName() + "模板无权限删除!");
|
||||
}
|
||||
List<PageLinkPO> pageLinkPOS = getPageLinkMapper().listSome(PageLinkPO.builder().templateId(id).build());
|
||||
if (CollUtil.isNotEmpty(pageLinkPOS)) {
|
||||
throw new SalaryRunTimeException(pageListTemplatePO.getName() + "模板正被使用!不允许删除");
|
||||
}
|
||||
});
|
||||
|
||||
getPageListTemplateMapper().deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,12 +3,15 @@ package com.engine.salary.timer;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.biz.SalaryArchiveBiz;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesBaseInfoPO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.enums.siaccount.EmployeeStatusEnum;
|
||||
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
|
||||
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
|
||||
|
|
@ -22,14 +25,12 @@ import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -38,25 +39,28 @@ import java.util.stream.Collectors;
|
|||
* @date 2023/08/14 9:30
|
||||
* @description 自动同步人员社保福利档案、薪资档案为公司开始日期字段(companystartdate)
|
||||
*/
|
||||
@Slf4j
|
||||
public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryEmployeeService getSalaryEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private SIArchivesService getSIArchivesService(User user) {
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private String syncInsuranceArchive;
|
||||
|
||||
private String syncSalaryArchive;
|
||||
|
||||
private String allStayAddToPay;
|
||||
private String allGotoFixed;
|
||||
|
||||
private SalaryArchiveBiz getSalaryArchiveMapper = new SalaryArchiveBiz();
|
||||
|
||||
private SocialSchemeMapper getSocialSchemeMapper() {
|
||||
|
|
@ -72,14 +76,13 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
User user = new User();
|
||||
user.setUid(1);
|
||||
user.setLoginid("sysadmin");
|
||||
|
||||
if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive,"false")) {
|
||||
if (StringUtils.isBlank(syncInsuranceArchive) || !StringUtils.equals(syncInsuranceArchive, "false")) {
|
||||
// 同步社保福利档案
|
||||
// 获取社保、公积金、其他福利中起始缴纳月任意一个为空的社保档案主表po
|
||||
List<InsuranceArchivesBaseInfoPO> needSyncInsuranceBaseInfoList = getSIArchivesService(user).listStartDateIsNull(Collections.emptyList());
|
||||
|
|
@ -125,7 +128,7 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
|||
});
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive,"false")) {
|
||||
if (StringUtils.isBlank(syncSalaryArchive) || !StringUtils.equals(syncSalaryArchive, "false")) {
|
||||
// 同步薪资档案
|
||||
// 获取薪资档案起始发薪日为空且是待定薪资的档案
|
||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listPayStartDateIsNull(SalaryArchiveListTypeEnum.PENDING.getValue());
|
||||
|
|
@ -154,6 +157,27 @@ public class AutoSyncEmpArchiveStartDateJob extends BaseCronJob {
|
|||
getSalaryArchiveMapper.batchUpdate(needUpdateArchiveList);
|
||||
}
|
||||
|
||||
|
||||
//一键定薪
|
||||
if (StringUtils.isNotBlank(allStayAddToPay) && !StringUtils.equals(allStayAddToPay, "false")) {
|
||||
List<InsuranceArchivesBaseInfoPO> allBaseInfoList = getSIArchivesService(user).listAll();
|
||||
List<Long> ids = allBaseInfoList.stream()
|
||||
.filter(f -> f.getRunStatus().equals(EmployeeStatusEnum.STAY_ADD.getValue()))
|
||||
.map(InsuranceArchivesBaseInfoPO::getId)
|
||||
.collect(Collectors.toList());
|
||||
Map<String, Object> map = getSIArchivesService(user).stayAddToPay(ids);
|
||||
log.info("社保一键定薪结果:" + map);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(allGotoFixed) && !StringUtils.equals(allGotoFixed, "false")) {
|
||||
SalaryArchiveQueryParam queryParam = SalaryArchiveQueryParam.builder().build();
|
||||
queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.PENDING.getValue()));
|
||||
List<SalaryArchiveListDTO> salaryArchiveList = getSalaryArchiveService(user).getSalaryArchiveList(queryParam);
|
||||
List<Long> ids = SalaryEntityUtil.properties(salaryArchiveList, SalaryArchiveListDTO::getId, Collectors.toList());
|
||||
Map<String, Object> map = getSalaryArchiveService(user).gotoFixed(ids);
|
||||
log.info("薪资一键定薪结果:" + map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,11 +2,13 @@ package com.engine.salary.web;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListSettingPO;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryEnumUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.SalaryCommonWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -88,7 +90,7 @@ public class SalaryCommonController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPageListSetting(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListSettingQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListSettingQueryParam, PageListTemplateDTO>(user).run(getSalaryCommonWrapper(user)::getPageListSetting, param);
|
||||
return new ResponseResult<PageListSettingQueryParam, PageListTemplateDetailDTO>(user).run(getSalaryCommonWrapper(user)::getPageListSetting, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -103,7 +105,7 @@ public class SalaryCommonController {
|
|||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getPageListTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateQueryParam, PageListTemplateDTO>(user).run(getSalaryCommonWrapper(user)::getPageListTemplate, param);
|
||||
return new ResponseResult<PageListTemplateQueryParam, PageListTemplateDetailDTO>(user).run(getSalaryCommonWrapper(user)::getPageListTemplate, param);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -121,6 +123,14 @@ public class SalaryCommonController {
|
|||
return new ResponseResult<PageListTemplateQueryParam, List<PageListTemplatePO>>(user).run(getSalaryCommonWrapper(user)::getPageListTemplates, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/pageList/template/pageList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getTemplates(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateQueryParam, PageInfo<PageListTemplateDTO>>(user).run(getSalaryCommonWrapper(user)::getTemplates, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面模板列表
|
||||
* @param request
|
||||
|
|
@ -136,6 +146,15 @@ public class SalaryCommonController {
|
|||
return new ResponseResult<PageListTemplateSaveParam, PageListTemplatePO>(user).run(getSalaryCommonWrapper(user)::savePageListTemplate, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/pageList/template/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String savePageListTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody PageListTemplateDeleteParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<PageListTemplateDeleteParam, PageListTemplatePO>(user).run(getSalaryCommonWrapper(user)::deletePageListTemplate, param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 页面模板列表
|
||||
* @param request
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ package com.engine.salary.wrapper;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDTO;
|
||||
import com.engine.salary.entity.setting.dto.PageListTemplateDetailDTO;
|
||||
import com.engine.salary.entity.setting.param.*;
|
||||
import com.engine.salary.entity.setting.po.PageListTemplatePO;
|
||||
import com.engine.salary.service.SalaryCacheService;
|
||||
import com.engine.salary.service.SettingService;
|
||||
import com.engine.salary.service.impl.SalaryCacheServiceImpl;
|
||||
import com.engine.salary.service.impl.SettingServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -41,12 +43,12 @@ public class SalaryCommonWrapper extends Service {
|
|||
}
|
||||
|
||||
|
||||
public PageListTemplateDTO getPageListSetting(PageListSettingQueryParam param) {
|
||||
return getSettingService(user).getPageListSetting(param);
|
||||
public PageListTemplateDetailDTO getPageListSetting(PageListSettingQueryParam param) {
|
||||
return getSettingService(user).getDefaultPageListSetting(param);
|
||||
}
|
||||
|
||||
|
||||
public PageListTemplateDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
public PageListTemplateDetailDTO getPageListTemplate(PageListTemplateQueryParam param) {
|
||||
return getSettingService(user).getPageListTemplate(param);
|
||||
}
|
||||
|
||||
|
|
@ -54,10 +56,18 @@ public class SalaryCommonWrapper extends Service {
|
|||
return getSettingService(user).getPageListTemplates(param);
|
||||
}
|
||||
|
||||
public PageInfo<PageListTemplateDTO> getTemplates(PageListTemplateQueryParam param) {
|
||||
return getSettingService(user).getTemplates(param);
|
||||
}
|
||||
|
||||
public PageListTemplatePO savePageListTemplate(PageListTemplateSaveParam param) {
|
||||
return getSettingService(user).savePageListTemplate(param);
|
||||
}
|
||||
|
||||
public void deletePageListTemplate(PageListTemplateDeleteParam param) {
|
||||
getSettingService(user).deletePageListTemplate(param);
|
||||
}
|
||||
|
||||
public void changePageListTemplate(PageListTemplateChangeParam param) {
|
||||
getSettingService(user).changePageListTemplate(param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,9 +75,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)
|
||||
|
|
@ -95,22 +93,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