Merge branch 'release/2.18.2.2412.02' into feature/数据推送
# Conflicts: # src/com/engine/salary/service/impl/SalaryAcctEmployeeServiceImpl.java # src/com/engine/salary/service/impl/SalarySendServiceImpl.java
This commit is contained in:
commit
35aff0431e
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -81,14 +81,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"));
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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,10 +46,17 @@ 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;
|
||||
|
||||
|
||||
/**
|
||||
* 限制
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -15,4 +15,6 @@ import java.util.Map;
|
|||
**/
|
||||
public interface SQLMapper {
|
||||
List<Map> runSQL(@Param("sql") String sql);
|
||||
|
||||
List<Long> listLong(@Param("sql") String sql);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,9 @@
|
|||
<select id="runSQL" resultType="java.util.Map">
|
||||
${sql}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listLong" resultType="long">
|
||||
${sql}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -2,12 +2,15 @@ package com.engine.salary.remote.attend.service.impl;
|
|||
|
||||
import com.alibaba.druid.support.json.JSONUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.kq.cmd.report.GetKQReportCmd;
|
||||
import com.engine.salary.mapper.datacollection.AttendQuoteFieldMapper;
|
||||
import com.engine.salary.remote.attend.cmd.GetSearchListCmd;
|
||||
import com.engine.salary.remote.attend.entity.Attend4Salary;
|
||||
import com.engine.salary.remote.attend.service.RemoteAttend4SalaryService;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
|
|
@ -20,11 +23,14 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.ATTENDANCE_SERIAL_COLLECTION_BTN;
|
||||
|
||||
@Slf4j
|
||||
public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAttend4SalaryService {
|
||||
private final Boolean isLog = "true".equals(new BaseBean().getPropValue("hrmSalary", "log"));
|
||||
|
|
@ -33,12 +39,23 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
return MapperProxyFactory.getProxy(AttendQuoteFieldMapper.class);
|
||||
}
|
||||
|
||||
private SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
//是否采集考勤班次数据
|
||||
boolean isCollectAttendanceSerial = "1".equals(getSalarySysConfService(user).getValueByCode(ATTENDANCE_SERIAL_COLLECTION_BTN));
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getColumns() {
|
||||
|
||||
//兼容获取班次信息字段
|
||||
//是否采集考勤班次数据
|
||||
String attendanceSerial = "";
|
||||
if (isCollectAttendanceSerial) {
|
||||
List<String> attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials();
|
||||
String attendanceSerial = Joiner.on(",").join((Iterable<?>) attendanceSerials);
|
||||
attendanceSerial = Joiner.on(",").join((Iterable<?>) attendanceSerials);
|
||||
}
|
||||
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
paramsMap.put("typeselect", "3");
|
||||
|
|
@ -146,7 +163,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
paramsMap.put("resourceId", String.join(",", resourceIds));
|
||||
paramsMap.put("isNoAccount", "1");
|
||||
//班次
|
||||
paramsMap.put("attendanceSerial", attend4Salary.getAttendanceSerial());
|
||||
paramsMap.put("attendanceSerial", isCollectAttendanceSerial ? attend4Salary.getAttendanceSerial() : "");
|
||||
paramsMap.put("isFromMyAttendance", "1");
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("data", JSONObject.toJSONString(paramsMap));
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
|
|
|
|||
|
|
@ -813,7 +813,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
data.getList().forEach(employee -> {
|
||||
if (employee.getSubcompanyId() != null && employee.getSubcompanyId() != null) {
|
||||
subComIdNameMap.put(employee.getSubcompanyId(), employee.getSubcompanyName());
|
||||
subComIds.add(employee.getDepartmentId());
|
||||
subComIds.add(employee.getSubcompanyId());
|
||||
empIdSubComMap.put(employee.getEmployeeId(), employee.getSubcompanyId());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ public class SalaryStatisticsReportWrapper extends Service {
|
|||
SalaryStatisticsItemPO salaryStatisticsItemPO = salaryStatisticsItemMap.get(salaryItemId);
|
||||
if (salaryStatisticsItemPO != null) {
|
||||
Optional<String> textItemOptional = Arrays.stream(salaryStatisticsItemPO.getItemValue().split(",")).filter(itemId -> !numberItemIds.contains(itemId)).findFirst();
|
||||
row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(Utils.null2String(map.get(k)))) ? new BigDecimal(Utils.null2String(map.get(k))) : map.getOrDefault(k, StringUtils.EMPTY));
|
||||
row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(Utils.null2String(map.get(k)).replaceAll(",", ""))) ? new BigDecimal(Utils.null2String(map.get(k)).replaceAll(",", "")) : map.getOrDefault(k, StringUtils.EMPTY));
|
||||
} else {
|
||||
row.add(map.getOrDefault(k, StringUtils.EMPTY));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3167,6 +3167,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.build();
|
||||
|
||||
String combineErrorMsg = "";
|
||||
log.info("oldSocialInfoListSize:" + oldSocialInfoList.size());
|
||||
//组装新数据
|
||||
if (oldSocialInfoList.size() == 1) {
|
||||
//老数据
|
||||
|
|
@ -3435,6 +3436,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
return null;
|
||||
}
|
||||
|
||||
log.info("自动调整前 基数信息{}", paymentBaseJson);
|
||||
for (Map.Entry<String, String> entry : paymentBaseJson.entrySet()) {
|
||||
|
||||
//判断福利值是否为空/数字
|
||||
|
|
@ -3447,13 +3449,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);
|
||||
|
||||
|
|
@ -3463,18 +3466,18 @@ 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("福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
return null;
|
||||
log.info("自动调整 福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
log.info("自动调整后 基数信息{}", paymentBaseJson);
|
||||
return JSON.toJSONString(paymentBaseJson);
|
||||
}
|
||||
|
||||
|
|
@ -4071,4 +4074,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;
|
||||
|
|
@ -34,6 +33,7 @@ import com.engine.salary.report.entity.param.SalaryStatisticsReportDataQueryPara
|
|||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.auth.AuthService;
|
||||
import com.engine.salary.service.auth.AuthServiceImpl;
|
||||
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;
|
||||
|
|
@ -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
|
||||
|
|
@ -311,12 +311,15 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
return Collections.emptyList();
|
||||
}
|
||||
Set<Long> lastMonthSalaryAcctRecordIds = SalaryEntityUtil.properties(salaryAcctRecordPOS, SalaryAcctRecordPO::getId);
|
||||
// 上个月的核算人员
|
||||
List<SalaryAcctEmployeePO> lastMonthSalaryAcctEmployeePOS = listBySalaryAcctRecordIds(lastMonthSalaryAcctRecordIds);
|
||||
Map<String, SalaryAcctEmployeePO> lastMonthSalaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(lastMonthSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
// 本月的核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listByParam(queryParam);
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployeePOS = listBySalaryAcctRecordId(queryParam.getSalaryAcctRecordId());
|
||||
Set<String> keySet = SalaryEntityUtil.properties(salaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
// 上个月的核算人员
|
||||
queryParam.setSalaryAcctRecordId(null);
|
||||
queryParam.setSalaryAcctRecordIds(lastMonthSalaryAcctRecordIds);
|
||||
List<SalaryAcctEmployeePO> lastMonthSalaryAcctEmployeePOS = listByParam(queryParam);
|
||||
Map<String, SalaryAcctEmployeePO> lastMonthSalaryAcctEmployeePOMap = SalaryEntityUtil.convert2Map(lastMonthSalaryAcctEmployeePOS, salaryAcctEmployeePO -> salaryAcctEmployeePO.getEmployeeId() + "-" + salaryAcctEmployeePO.getTaxAgentId());
|
||||
|
||||
List<SalaryAcctEmployeePO> resultList = Lists.newArrayList();
|
||||
if (CollectionUtils.isNotEmpty(keySet)) {
|
||||
lastMonthSalaryAcctEmployeePOMap.forEach((k, v) -> {
|
||||
|
|
@ -445,7 +448,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 +466,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 +608,7 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
|
||||
// 保存薪资核算人员
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctEmployeePOS)) {
|
||||
batchSave(salaryAcctEmployeePOS);
|
||||
saveAcctEmployeePOS(salaryAcctEmployeePOS, salarySobCycleDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -618,7 +655,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 +813,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 +843,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);
|
||||
|
|
@ -1080,9 +1082,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
|
|||
stopWatch.stop();
|
||||
// 租户下所有的人员
|
||||
stopWatch.start("薪资核算确认的人员");
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listAllForReport();
|
||||
Map<String, Long> salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId);
|
||||
Map<Long, DataCollectionEmployee> emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId);
|
||||
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
|
||||
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
|
||||
stopWatch.stop();
|
||||
// 租户下所有的个税扣缴义务人
|
||||
stopWatch.start("租户下所有的个税扣缴义务人");
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
|
|||
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.SalaryLoggerUtil;
|
||||
|
|
@ -41,6 +42,7 @@ import com.google.common.collect.Lists;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
|
|
@ -706,7 +708,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
String userstatus = queryParam.getUserstatus();
|
||||
r.setUsername(employee.getUsername());
|
||||
r.setDepartmentName(employee.getDepartmentName());
|
||||
r.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(employee.getStatus())));
|
||||
r.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(NumberUtils.isCreatable(employee.getStatus()) ? employee.getStatus() : "-1")));
|
||||
r.setAdjustReason(SalaryArchiveItemAdjustReasonEnum.getDefaultLabelByValue(r.getAdjustReason()));
|
||||
return (StringUtils.isBlank(username) || employee.getUsername().contains(username))
|
||||
&& (CollectionUtils.isEmpty(departmentIds) || departmentIds.contains(employee.getDepartmentId()))
|
||||
|
|
@ -739,7 +741,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
row.add(dto.getAdjustBefore());
|
||||
row.add(dto.getAdjustAfter());
|
||||
row.add(dto.getAdjustReason());
|
||||
row.add(dto.getEffectiveTime() + "");
|
||||
row.add(SalaryDateUtil.getFormatDate(dto.getEffectiveTime()));
|
||||
row.add(dto.getOperator());
|
||||
row.add(format.format(dto.getOperateTime()));
|
||||
row.add(dto.getDescription());
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -49,6 +50,7 @@ import com.engine.salary.enums.salarybill.*;
|
|||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.SQLMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper;
|
||||
|
|
@ -66,6 +68,7 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
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.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
|
|
@ -203,6 +206,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
return ServiceUtil.getService(AuthServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SQLMapper getSQLMapper() {
|
||||
return MapperProxyFactory.getProxy(SQLMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalarySendPO getById(Long salarySendId) {
|
||||
return mapper.getById(salarySendId);
|
||||
|
|
@ -490,10 +497,19 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
if (salarySendInfo == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
|
||||
}
|
||||
Long employeeId = salarySendInfo.getEmployeeId();
|
||||
if (currentEmployeeId.compareTo(employeeId) != 0) {
|
||||
|
||||
if (currentEmployeeId.compareTo(salarySendInfo.getEmployeeId()) != 0) {
|
||||
//主账号可以查看次账号工资单
|
||||
String sql = "select id from Hrmresource a where belongto= " + currentEmployeeId;
|
||||
List<Long> belongtoIds = getSQLMapper().listLong(sql);
|
||||
if (CollUtil.isNotEmpty(belongtoIds) && belongtoIds.contains(employeeId)) {
|
||||
//切换user
|
||||
// this.user = new User(new Integer(employeeId + ""));
|
||||
} else {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单"));
|
||||
}
|
||||
}
|
||||
|
||||
// 获取默认模板信息
|
||||
SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId());
|
||||
|
|
@ -576,7 +592,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
SalaryAcctResultPO build = SalaryAcctResultPO.builder()
|
||||
.salaryAcctRecordId(salaryAcctRecordId)
|
||||
.taxAgentId(salarySendInfo.getTaxAgentId())
|
||||
.employeeId(currentEmployeeId)
|
||||
.employeeId(employeeId)
|
||||
.build();
|
||||
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(build);
|
||||
if (CollUtil.isEmpty(salaryAcctResultPOS)) {
|
||||
|
|
@ -656,7 +672,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
}
|
||||
|
||||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salarySendInfo.getEmployeeId());
|
||||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
|
||||
SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctResultPOS.get(0).getSalaryAcctEmpId());
|
||||
SalaryAcctEmployeeBO.copyAcctEmp(simpleEmployee, acctEmployeePO);
|
||||
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(acctEmployeePO.getTaxAgentId());
|
||||
|
|
@ -664,9 +680,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
map.put("employeeInformation", employeeInformation);
|
||||
map.put("salaryGroups", itemSetListDTOS);
|
||||
|
||||
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, currentEmployeeId));
|
||||
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, employeeId));
|
||||
// 工资单水印文本型动态变量 == 处理
|
||||
handleSalaryWatermark(salaryTemplate, salarySendInfo, currentEmployeeId);
|
||||
handleSalaryWatermark(salaryTemplate, salarySendInfo, employeeId);
|
||||
map.put("salaryTemplate", salaryTemplate);
|
||||
map.put("salaryAcctResult", salaryAcctResultS);
|
||||
|
||||
|
|
@ -736,7 +752,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
* @param salaryTemplate
|
||||
* @param salarySendInfo
|
||||
*/
|
||||
private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long currentEmployeeId) {
|
||||
private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long employeeId) {
|
||||
SalaryBillWatermarkDTO salaryBillWatermark = JsonUtil.parseObject(salaryTemplate.getSalaryWatermark(), SalaryBillWatermarkDTO.class);
|
||||
if (Objects.isNull(salaryBillWatermark) || Boolean.FALSE.equals(salaryBillWatermark.getWatermarkStatus())) {
|
||||
return;
|
||||
|
|
@ -750,7 +766,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
boolean needQueryEmp = (boolean) salaryBillWatermark.getWmSetting().getOrDefault("needQueryEmp", false);
|
||||
DataCollectionEmployee simpleEmployee = null;
|
||||
if (needQueryEmp) {
|
||||
simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(currentEmployeeId);
|
||||
simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
|
||||
}
|
||||
|
||||
String wmText = salaryBillWatermark.getWmSetting().getOrDefault("wmText", StringUtils.EMPTY).toString();
|
||||
|
|
@ -839,7 +855,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);
|
||||
|
|
@ -878,12 +897,12 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
*
|
||||
* @param theme
|
||||
* @param salaryMonth
|
||||
* @param currentEmployeeId
|
||||
* @param employeeId
|
||||
* @return
|
||||
*/
|
||||
private String getBillTitle(String theme, Date salaryMonth, Long currentEmployeeId) {
|
||||
private String getBillTitle(String theme, Date salaryMonth, Long employeeId) {
|
||||
String companyName = "";
|
||||
if (currentEmployeeId != null) {
|
||||
if (employeeId != null) {
|
||||
ResourceComInfo resourceComInfo = null;
|
||||
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
try {
|
||||
|
|
@ -892,7 +911,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
} catch (Exception e) {
|
||||
log.error("资源异常", e);
|
||||
}
|
||||
companyName = subCompanyComInfo.getSubCompanyname(resourceComInfo.getSubCompanyID(currentEmployeeId + ""));
|
||||
companyName = subCompanyComInfo.getSubCompanyname(resourceComInfo.getSubCompanyID(employeeId + ""));
|
||||
}
|
||||
return theme.replace("${companyName}", companyName)
|
||||
.replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth))
|
||||
|
|
@ -970,7 +989,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
.jobtitleName(simpleEmployee.getJobtitleName())
|
||||
.jobtitleId(simpleEmployee.getJobtitleId())
|
||||
.status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus())
|
||||
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(),"1"))).getDefaultLabel())
|
||||
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(), "1"))).getDefaultLabel())
|
||||
.accountTypeName(simpleEmployee.getAccountType() == null ? "" : AccountTypeEnum.parseByValue(simpleEmployee.getAccountType()).getDefaultLabel())
|
||||
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
|
||||
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
|
||||
|
|
@ -1367,64 +1386,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 发送消息
|
||||
// *
|
||||
// * @param salarySend
|
||||
// * @param enableSendList
|
||||
// * @param salaryTemplate
|
||||
// * @param currentTenantKey
|
||||
// */
|
||||
// private void sendMessage(SalarySendPO salarySend, List<Map<String, Object>> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName, Long currentEmployeeId, String currentTenantKey) {
|
||||
// if (StringUtils.isNotBlank(salaryTemplate.getBackground())) {
|
||||
// FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey);
|
||||
// String encode = Base64Encoder.encode(fileByte.getData());
|
||||
// salaryTemplate.setBackground(encode);
|
||||
// }
|
||||
// // 邮箱打开
|
||||
// boolean isEmailOpen = salaryTemplate.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue());
|
||||
//
|
||||
// LocalDate salaryMonth = salarySend.getSalaryMonth();
|
||||
// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "年");
|
||||
// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "月");
|
||||
// String text = salaryMonth.getYear() +
|
||||
// yearI18n +
|
||||
// salaryMonth.getMonth().getValue() +
|
||||
// monthI18n +
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100520, "工资待发明细");
|
||||
//
|
||||
// UserEntity sendUser = null;
|
||||
// // 标题
|
||||
// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName, currentEmployeeId, currentTenantKey);
|
||||
//
|
||||
// // 获取所有人员信息
|
||||
// List<Long> ids = enableSendList.stream().map(e->Long.valueOf(e.get("employeeId").toString())).collect(Collectors.toList());
|
||||
// List<DataCollectionEmployee> allEmployees = hrmCommonEmployeeService.getEmployeeByIds(ids, currentTenantKey);
|
||||
// List<SalaryTemplateSalaryItemSetListDTO> listDTOS = JSONArray.parseArray(salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
// Optional<SalaryTemplateSalaryItemSetListDTO> optionalEmployeeInformation = listDTOS.stream().filter(e -> SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).findFirst();
|
||||
// SalaryTemplateSalaryItemSetListDTO employeeInformation = optionalEmployeeInformation.orElse(null);
|
||||
// Map<String, String> employeeField = SalaryAcctResultBO.buildEmployeeFieldName();
|
||||
// enableSendList.forEach(e -> {
|
||||
// Optional<DataCollectionEmployee> optionalSimpleEmployee = allEmployees.stream().filter(f->f.getEmployeeId().equals(Long.valueOf(e.get("employeeId").toString()))).findFirst();
|
||||
// if (optionalSimpleEmployee.isPresent()) {
|
||||
// buildEmployeeInfo(employeeInformation, optionalSimpleEmployee.get(), e.get("taxAgent").toString(), employeeField);
|
||||
// }
|
||||
//
|
||||
// List<UserEntity> receivers = Collections.singletonList(
|
||||
// SalarySendBO.buildUser(Long.valueOf(e.get("employeeId").toString()), e.get("email") == null ? "" : e.get("email").toString(), currentTenantKey));
|
||||
// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单"));
|
||||
// EmailEntity emailInfo = new EmailEntity();
|
||||
// // 邮箱打开
|
||||
// if (isEmailOpen) {
|
||||
// String emailContent = SalarySendBO.buildEmailContent(e, employeeInformation, title, salaryTemplate);
|
||||
// emailInfo = SalarySendBO.buildEmailInfo(text, emailContent, salaryTemplate.getSendEmailId());
|
||||
// }
|
||||
// SendMessageEntity message = SalarySendBO.buildSendMessageEntity(text, sendUser, receivers, entity, emailInfo);
|
||||
// log.info("开始发送============:{}", JsonUtil.toJsonString(message));
|
||||
// // 开始发送
|
||||
// log.info("发送结果===:{}", JsonUtil.toJsonString(asyncSystemMessageRest.sendMsg(message)));
|
||||
// });
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Map<String, Object> withdraw(SalarySendWithdrawParam param) {
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
PageListTemplateDetailDTO pageListTemplate = getPageListTemplate((PageListTemplateQueryParam.builder().page(page).build()));
|
||||
return pageListTemplate.getChecked();
|
||||
} else {
|
||||
PageListTemplateDTO pageListTemplate = getPageListTemplate(PageListTemplateQueryParam.builder().page(page).build());
|
||||
return pageListTemplate.getSetting();
|
||||
}
|
||||
|
||||
@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,17 @@ 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:关闭 1:开启
|
||||
public static final String ATTENDANCE_SERIAL_COLLECTION_BTN = "ATTENDANCE_SERIAL_COLLECTION_BTN";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -90,6 +90,9 @@ public class SalaryTokenUtil {
|
|||
return heads;
|
||||
}
|
||||
BaseBean baseBean = new BaseBean();
|
||||
// 获取是否是https
|
||||
String isHttps = baseBean.getPropValue("hrmSalaryBillToken", "is_https");
|
||||
String httpKey = (StringUtils.isNotBlank(isHttps) && isHttps.equals("true")) ? "https://" : "http://";
|
||||
RecordSet rs = new RecordSet();
|
||||
Map<String, String> resultMap = new HashMap<>();
|
||||
|
||||
|
|
@ -123,7 +126,7 @@ public class SalaryTokenUtil {
|
|||
heads.put("appid", appid);
|
||||
heads.put("cpk", cpk);
|
||||
// 调用ECOLOGY系统接口进行注册
|
||||
String data = post("http://" + ip + "/api/ec/dev/auth/regist", null, heads);
|
||||
String data = post(httpKey + ip + "/api/ec/dev/auth/regist", null, heads);
|
||||
Map<String, Object> datas = JSONObject.parseObject(data, new TypeReference<Map<String, Object>>() {});
|
||||
// ECOLOGY返回的系统公钥
|
||||
String spk = (String) (datas.get("spk"));
|
||||
|
|
@ -144,7 +147,7 @@ public class SalaryTokenUtil {
|
|||
heads.put("appid", appid);
|
||||
heads.put("secret", secret);
|
||||
//调用ECOLOGY系统接口进行注册
|
||||
String data2 = post("http://" + ip + "/api/ec/dev/auth/applytoken", null, heads);
|
||||
String data2 = post(httpKey + ip + "/api/ec/dev/auth/applytoken", null, heads);
|
||||
// 通过第一步注册许可时返回spk公钥对userid进行加密生成的密文
|
||||
sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SPK'";
|
||||
rs.execute(sql);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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