Merge branch 'release/2.6.3.2303.01' into feature/外部人员
This commit is contained in:
commit
ca20ed8ca2
|
|
@ -1,4 +1,4 @@
|
|||
update hrsa_tax_agent_emp set delete_type = 1
|
||||
update hrsa_tax_agent_emp set delete_type = 3
|
||||
where id in(
|
||||
|
||||
select id from hrsa_tax_agent_emp
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
ALTER TABLE hrsa_salary_item MODIFY COLUMN shared_type int(0) NULL ;
|
||||
ALTER TABLE hrsa_salary_sob_item MODIFY COLUMN tenant_key varchar(10) null ;
|
||||
|
||||
|
||||
ALTER TABLE hrsa_salary_item ALTER COLUMN [shared_type] int NULL
|
||||
GO
|
||||
|
||||
ALTER TABLE hrsa_salary_sob_item ALTER COLUMN [tenant_key] varchar NULL
|
||||
GO
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -30,7 +32,7 @@ public class SalarySendBaseInfoDTO {
|
|||
private String template;
|
||||
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private YearMonth salaryMonth;
|
||||
|
||||
// @ApiModelProperty("薪资账套的周期")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -21,10 +22,10 @@ import java.util.List;
|
|||
//@ApiModel("工资单发放参数")
|
||||
public class SalarySendGrantParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
// 主键id
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
// 工资单发放Id
|
||||
private Long salarySendId;
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +33,9 @@ public class SalarySendGrantParam {
|
|||
*/
|
||||
private List<Long> salarySendRangeIds;
|
||||
|
||||
//模板,发消息用
|
||||
private SalaryTemplatePO template;
|
||||
|
||||
public static String checkParam(SalarySendGrantParam param, Long employeeId, String tenantKey) {
|
||||
if (param.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
|
|
|
|||
|
|
@ -17,59 +17,51 @@ import java.util.Date;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@TableName("hrsa_salary_send_info")
|
||||
//@ElogTransform(name = "工资单发放信息表")
|
||||
//工资单发放信息表")
|
||||
public class SalarySendInfoPO {
|
||||
|
||||
public Object get;
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
// @ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
// @ElogTransform(name = "工资单发放id")
|
||||
// 工资单发放id
|
||||
private Long salarySendId;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
// @ElogTransform(name = "薪资所属月")
|
||||
private Date salaryMonth;
|
||||
|
||||
/**
|
||||
* 薪资核算表的主键id
|
||||
*/
|
||||
// @ElogTransform(name = "薪资核算表的主键id")
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
/**
|
||||
* 人员信息表的主键id
|
||||
*/
|
||||
// @ElogTransform(name = "人员信息表的主键id")
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 人员信息表的主键id
|
||||
*/
|
||||
// @ElogTransform(name = "个税扣缴义务人表的主键id")
|
||||
private Long taxAgentId;
|
||||
|
||||
/**
|
||||
* 发送状态。0:未发送、1:已发送、2:已撤回
|
||||
*/
|
||||
// @ElogTransform(name = "发送状态。0:未发送、1:已发送、2:已撤回")
|
||||
private Integer sendStatus;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
// @ElogTransform(name = "发送时间")
|
||||
private Date sendTime;
|
||||
|
||||
/**
|
||||
* 核算类型。0:正常,1:补发
|
||||
*/
|
||||
// @ElogTransform(name = "核算类型。0:正常,1:补发")
|
||||
private Integer salaryAcctType;
|
||||
|
||||
/**
|
||||
|
|
@ -80,30 +72,25 @@ public class SalarySendInfoPO {
|
|||
/**
|
||||
* 创建人
|
||||
*/
|
||||
// @ElogTransform(name = "创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
// @ElogTransform(name = "创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
// @ElogTransform(name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
// @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,86 +21,72 @@ public class SalarySendPO {
|
|||
/**
|
||||
* 主键id
|
||||
*/
|
||||
// @ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
// @ElogTransform(name = "薪资所属月")
|
||||
private Date salaryMonth;
|
||||
|
||||
/**
|
||||
* 薪资核算id
|
||||
*/
|
||||
// @ElogTransform(name = "薪资核算id")
|
||||
private Long salaryAccountingId;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
// @ElogTransform(name = "薪资账套id")
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 已发送数量
|
||||
*/
|
||||
// @ElogTransform(name = "已发送数量")
|
||||
private Integer sendNum;
|
||||
|
||||
/**
|
||||
* 发送总数
|
||||
*/
|
||||
// @ElogTransform(name = "发送总数")
|
||||
private Integer sendTotal;
|
||||
|
||||
/**
|
||||
* 最后发送时间
|
||||
*/
|
||||
// @ElogTransform(name = "最后发送时间")
|
||||
private Date lastSendTime;
|
||||
|
||||
|
||||
/**
|
||||
* 发放状态。0:未冻结、1:已冻结
|
||||
*/
|
||||
// @ElogTransform(name = "发放状态。0:未冻结、1:已冻结")
|
||||
private Integer sendStatus;
|
||||
|
||||
/**
|
||||
* 核算类型。0:正常,1:补发
|
||||
*/
|
||||
// @ElogTransform(name = "核算类型。0:正常,1:补发")
|
||||
private Integer salaryAcctType;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
// @ElogTransform(name = "创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
// @ElogTransform(name = "创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
// @ElogTransform(name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
// @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,139 +23,116 @@ public class SalaryTemplatePO {
|
|||
/**
|
||||
* 主键
|
||||
*/
|
||||
// @ElogTransform(name = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
// @ElogTransform(name = "模板名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 薪资账套表的主键id
|
||||
*/
|
||||
// @ElogTransform(name = "薪资账套表的主键id")
|
||||
private Long salarySobId;
|
||||
|
||||
/**
|
||||
* 使用类型。0:普通、1:默认
|
||||
*/
|
||||
// @ElogTransform(name = "使用类型。0:普通、1:默认")
|
||||
private Integer useType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
// @ElogTransform(name = "备注")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 邮箱开启状态。0:关、1:开
|
||||
*/
|
||||
// @ElogTransform(name = "邮箱开启状态。0:关、1:开")
|
||||
private Integer emailStatus;
|
||||
|
||||
/**
|
||||
* 发送地址:公共邮箱账号id
|
||||
*/
|
||||
// @ElogTransform(name = "发送地址")
|
||||
private Long sendEmailId;
|
||||
|
||||
/**
|
||||
* 消息中心开启状态。0:关、1:开
|
||||
*/
|
||||
// @ElogTransform(name = "消息中心开启状态。0:关、1:开")
|
||||
private Integer msgStatus;
|
||||
|
||||
/**
|
||||
* 主题
|
||||
*/
|
||||
// @ElogTransform(name = "主题")
|
||||
private String theme;
|
||||
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
// @ElogTransform(name = "背景图")
|
||||
private String background;
|
||||
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
// @ElogTransform(name = "文本内容")
|
||||
private String textContent;
|
||||
|
||||
/**
|
||||
* 文本内容显示位置。1:薪资项目前、2:薪资项目后
|
||||
*/
|
||||
// @ElogTransform(name = "文本内容显示位置。1:薪资项目前、2:薪资项目后")
|
||||
private Integer textContentPosition;
|
||||
|
||||
/**
|
||||
* 薪资项为空时不显示开启状态。0:关、1:开
|
||||
*/
|
||||
// @ElogTransform(name = "薪资项为空时不显示开启状态。0:关、1:开")
|
||||
private Integer salaryItemNullStatus;
|
||||
|
||||
/**
|
||||
* 薪资项为0时不显示开启状态。0:关、1:开
|
||||
*/
|
||||
// @ElogTransform(name = "薪资项为0时不显示开启状态。0:关、1:开")
|
||||
private Integer salaryItemZeroStatus;
|
||||
|
||||
/**
|
||||
* 薪资项目设置
|
||||
*/
|
||||
// @ElogTransform(name = "薪资项目设置")
|
||||
private String salaryItemSetting;
|
||||
|
||||
//=====================补发===================
|
||||
/**
|
||||
* 补发工资单模板名称
|
||||
*/
|
||||
// @ElogTransform(name = "补发工资单模板名称")
|
||||
private String replenishName;
|
||||
|
||||
/**
|
||||
* 补发工资单名单生成规则
|
||||
*/
|
||||
// @ElogTransform(name = "补发工资单名单生成规则")
|
||||
private String replenishRule;
|
||||
|
||||
/**
|
||||
* 补发薪资项目设置
|
||||
*/
|
||||
// @ElogTransform(name = "补发薪资项目设置")
|
||||
private String replenishSalaryItemSetting;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
// @ElogTransform(name = "创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
// @ElogTransform(name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
// @ElogTransform(name = "创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
// @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -322,9 +322,9 @@
|
|||
<include refid="addUpSituationColumn"/>
|
||||
FROM
|
||||
hrsa_add_up_situation t1
|
||||
INNER JOIN
|
||||
(SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
-- INNER JOIN
|
||||
-- (SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
-- t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
||||
|
|
@ -346,9 +346,9 @@
|
|||
<include refid="addUpSituationColumn"/>
|
||||
FROM
|
||||
hrsa_add_up_situation t1
|
||||
INNER JOIN
|
||||
(SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
-- INNER JOIN
|
||||
-- (SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
-- t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
||||
|
|
@ -370,9 +370,9 @@
|
|||
<include refid="addUpSituationColumn"/>
|
||||
FROM
|
||||
hrsa_add_up_situation t1
|
||||
INNER JOIN
|
||||
(SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
-- INNER JOIN
|
||||
-- (SELECT employee_id, MAX(tax_year_month) tax_year_month FROM hrsa_add_up_situation WHERE delete_type = 0 GROUP BY employee_id) t ON
|
||||
-- t.employee_id = t1.employee_id AND t.tax_year_month = t1.tax_year_month
|
||||
LEFT JOIN hrmresource e ON e.id = t1.employee_id
|
||||
LEFT JOIN hrmdepartment d ON d.id = e.departmentid
|
||||
LEFT JOIN hrsa_tax_agent t2 ON t1.tax_agent_id = t2.id
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ import java.util.Set;
|
|||
**/
|
||||
public interface SalarySendInfoMapper {
|
||||
|
||||
SalarySendInfoPO getById(@Param("id") Long id);
|
||||
|
||||
List<Long> listSalaryAccRecordIds(@Param("param") SalarySendDetailQueryParam param);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@
|
|||
, t.salary_acct_type
|
||||
</sql>
|
||||
|
||||
<select id="getById" resultType="com.engine.salary.entity.salaryBill.po.SalarySendInfoPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_send_info
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_salary_send_info (
|
||||
id,
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
</if>
|
||||
<if test="salarySobItemGroupIds != null and salarySobItemGroupIds.size()>0">
|
||||
AND salary_sob_item_group_id IN
|
||||
<foreach collection="salarySobItemGroupIds" open="(" item="id" separator="," close=",0)">
|
||||
<foreach collection="salarySobItemGroupIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -90,4 +90,9 @@ public interface SIArchivesService {
|
|||
* 待减员页面的删除待办
|
||||
*/
|
||||
void cancelStayDel(InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO);
|
||||
|
||||
/**
|
||||
* 处理福利档案增量数据
|
||||
*/
|
||||
void handleChangeData(long currentEmployeeId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.util.ConditionFactory;
|
||||
|
|
@ -59,7 +58,6 @@ import weaver.general.Util;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.*;
|
||||
import java.util.*;
|
||||
|
|
@ -771,14 +769,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction
|
|||
}
|
||||
|
||||
private String plus(String var0, String var1) {
|
||||
if (StrUtil.isEmpty(var0)) {
|
||||
var0 = "0";
|
||||
}
|
||||
if (StrUtil.isEmpty(var1)) {
|
||||
var1 = "0";
|
||||
}
|
||||
return new BigDecimal(var0)
|
||||
.add(new BigDecimal(var1))
|
||||
return SalaryEntityUtil.string2BigDecimalDefault0(var0)
|
||||
.add(SalaryEntityUtil.string2BigDecimalDefault0(var1))
|
||||
.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,13 +149,13 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
handleStayDelData(currentEmployeeId);
|
||||
sw.stop();
|
||||
|
||||
sw.start("福利档案-增量数据处理");
|
||||
// 3.增量数据处理
|
||||
String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
if (welSign == null || "0".equals(welSign)) {
|
||||
handleChangeData(currentEmployeeId);
|
||||
}
|
||||
sw.stop();
|
||||
// sw.start("福利档案-增量数据处理");
|
||||
// // 3.增量数据处理
|
||||
// String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
// if (welSign == null || "0".equals(welSign)) {
|
||||
// handleChangeData(currentEmployeeId);
|
||||
// }
|
||||
// sw.stop();
|
||||
|
||||
//排序配置
|
||||
OrderRuleVO orderRule = getSalarySysConfService(user).orderRule();
|
||||
|
|
@ -240,7 +240,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
* @param currentEmployeeId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
private void handleChangeData(long currentEmployeeId) {
|
||||
@Override
|
||||
public void handleChangeData(long currentEmployeeId) {
|
||||
Util_DataCache.setObjVal("welfareChangeSign", "1");
|
||||
log.info("福利档案中增量数据处理逻辑开始:");
|
||||
// 所有增量人员列表
|
||||
|
|
@ -251,13 +252,23 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
return;
|
||||
}
|
||||
// 当前可以管辖的人员
|
||||
Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId);
|
||||
log.info("当前可以管辖的个税扣缴义务人数量 {}:", taxAgentList.size());
|
||||
taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> taxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
||||
Util_DataCache.setObjVal("welfareChangeSign", "0");
|
||||
return;
|
||||
Collection<TaxAgentPO> taxAgentList = new ArrayList<>();
|
||||
if (currentEmployeeId != 1L) {
|
||||
taxAgentList = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId);
|
||||
Collection<TaxAgentPO> finalTaxAgentList = taxAgentList;
|
||||
taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> finalTaxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList());
|
||||
if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
||||
Util_DataCache.setObjVal("welfareChangeSign", "0");
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Collection<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAllTaxAgents(currentEmployeeId);
|
||||
// log.info("当前可以管辖的个税扣缴义务人数量 {}:", taxAgentList.size());
|
||||
// taxAgentEmpChangeList = taxAgentEmpChangeList.stream().filter(f -> taxAgentList.stream().anyMatch(e -> e.getId().equals(f.getTaxAgentId()))).collect(Collectors.toList());
|
||||
// if (CollectionUtils.isEmpty(taxAgentEmpChangeList)) {
|
||||
// Util_DataCache.setObjVal("welfareChangeSign", "0");
|
||||
// return;
|
||||
// }
|
||||
log.info("根据当前可以管辖的个税扣缴义务人筛选出的可处理增量数据数量 {}:", taxAgentEmpChangeList.size());
|
||||
// 所有福利档案基础信息数据
|
||||
List<InsuranceArchivesBaseInfoPO> baseInfoPOList = getInsuranceBaseInfoMapper().listAll();
|
||||
|
|
|
|||
|
|
@ -219,6 +219,8 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
salarySobItemGroupPOS = salarySobItemGroupPOS.stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList());
|
||||
// 获取薪资项目分类ID
|
||||
List<Long> salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList());
|
||||
//加上未分类
|
||||
salarySobItemGroupIds.add(0L);
|
||||
|
||||
// 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目)
|
||||
List<SalarySobItemPO> salarySobItemPOS = getSalarySobItemService(user).listBySalarySobIdAndGroupId(salaryAcctEmployeePO.getSalarySobId(), salarySobItemGroupIds);
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "薪资档案");
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86176, "工号"),SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(91075, "状态"), SalaryI18nUtil.getI18nLabel(91075, "起始发薪日期"), SalaryI18nUtil.getI18nLabel(91075, "最后发薪日期")};
|
||||
// 2.表头
|
||||
List<Object> headerList = new ArrayList<>(Arrays.asList(header));
|
||||
for (SalaryItemPO salaryItem : salaryItems) {
|
||||
|
|
@ -502,6 +502,7 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
row.add(Util.null2String(e.get("username")));
|
||||
row.add(Util.null2String(e.get("taxAgentName")));
|
||||
row.add(Util.null2String(e.get("departmentName")));
|
||||
row.add(Util.null2String(e.get("workcode")));
|
||||
row.add(Util.null2String(e.get("mobile")));
|
||||
row.add(Util.null2String(e.get("employeeStatus")));
|
||||
row.add(Util.null2String(e.get("payStartDate")));
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.dev.api.bean.MessageBean;
|
||||
import com.cloudstore.dev.api.bean.MessageType;
|
||||
import com.cloudstore.dev.api.service.ServiceMessageCustom;
|
||||
import com.cloudstore.dev.api.service.ServiceMessageCustomImpl;
|
||||
import com.cloudstore.dev.api.util.Util_Message;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
|
|
@ -61,8 +62,9 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import weaver.hrm.User;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
import weaver.hrm.resource.ResourceComInfo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -426,7 +428,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
}
|
||||
return SalarySendBaseInfoDTO.builder()
|
||||
.salaryMonth(salarySobCycleDTO == null ? null : salarySobCycleDTO.getSalaryMonth())
|
||||
.salaryMonth(salarySobCycleDTO.getSalaryMonth())
|
||||
.template(template)
|
||||
.salarySobCycle(salarySobCycleDTO)
|
||||
.sendNum(salarySend.getSendNum())
|
||||
|
|
@ -627,9 +629,20 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
private String getBillTitle(String theme, Date salaryMonth, Long currentEmployeeId) {
|
||||
String yearI18n = SalaryI18nUtil.getI18nLabel(100325, "年");
|
||||
String monthI18n = SalaryI18nUtil.getI18nLabel(100326, "月");
|
||||
String companyName = "";
|
||||
if (currentEmployeeId != null) {
|
||||
ResourceComInfo resourceComInfo = null;
|
||||
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
||||
try {
|
||||
resourceComInfo = new ResourceComInfo();
|
||||
subCompanyComInfo = new SubCompanyComInfo();
|
||||
} catch (Exception e) {
|
||||
log.error("资源异常", e);
|
||||
}
|
||||
companyName = subCompanyComInfo.getSubCompanyname(resourceComInfo.getSubCompanyID(currentEmployeeId + ""));
|
||||
}
|
||||
return theme
|
||||
// TODO 设置租户名称
|
||||
.replace("${companyName}", "")
|
||||
.replace("${companyName}", companyName)
|
||||
.replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth));
|
||||
}
|
||||
|
||||
|
|
@ -821,25 +834,20 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
if (CollectionUtils.isEmpty(salaryTemplates)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100518, "没有默认模板,无法发送"));
|
||||
}
|
||||
SalaryTemplatePO templatePO = salaryTemplates.get(0);
|
||||
Date sendTime = new Date();
|
||||
// 获取可发送的列表
|
||||
List<Map<String, Object>> enableSendList = getEnableSendList(salarySend, ids, salaryTemplates.get(0));
|
||||
List<Map<String, Object>> enableSendList = getEnableSendList(salarySend, ids, templatePO);
|
||||
// 1.发放
|
||||
|
||||
SalarySendInfoPO po = new SalarySendInfoPO();
|
||||
po.setSendStatus(SalarySendStatusEnum.ALREADYSEND.getValue());
|
||||
po.setSendTime(sendTime);
|
||||
po.setSalaryTemplate(JsonUtil.toJsonString(salaryTemplates.get(0)));
|
||||
|
||||
po.setSalaryTemplate(JsonUtil.toJsonString(templatePO));
|
||||
salarySendInfoMapper.updateGrantWithdraw(po, salarySendId, Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()), ids);
|
||||
|
||||
|
||||
// 2.更新数量
|
||||
po = new SalarySendInfoPO();
|
||||
po.setDeleteType(0);
|
||||
po.setSalarySendId(salarySendId);
|
||||
|
||||
List<SalarySendInfoPO> list = salarySendInfoMapper.listSome(po);
|
||||
List<SalarySendInfoPO> list = salarySendInfoMapper.listSome(SalarySendInfoPO.builder().salarySendId(salarySendId).build());
|
||||
//需要发送工资的人
|
||||
|
||||
List<SalarySendInfoPO> sendList = list.stream().filter(e -> e.getSendStatus().equals(SalarySendStatusEnum.ALREADYSEND.getValue())).collect(Collectors.toList());
|
||||
|
|
@ -859,37 +867,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
|
||||
mapper.updateById(salarySendNew);
|
||||
|
||||
// List<SalarySobPO> salarySobs = new LambdaQueryChainWrapper<>(salarySobMapper)
|
||||
// .eq(SalarySobPO::getTenantKey, TenantContext.getCurrentTenantKey())
|
||||
// .eq(SalarySobPO::getDeleteType, 0)
|
||||
// .eq(SalarySobPO::getId, salarySend.getSalarySobId())
|
||||
// .list();
|
||||
|
||||
SalarySobPO salarySobPO = new SalarySobPO();
|
||||
salarySobPO.setDeleteType(0);
|
||||
salarySobPO.setId(salarySend.getSalarySobId());
|
||||
// List<SalarySobPO> salarySobs = salarySobMapper.listSome(salarySobPO);
|
||||
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(salarySendLoggerTemplate,
|
||||
// salarySend.getId(),
|
||||
// salarySend.getSalaryMonth() + "-" + (CollectionUtils.isNotEmpty(salarySobs) ? salarySobs.get(0).getName() : ""),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 93215, "工资单发放"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 93215, "工资单发放"),
|
||||
// salarySend,
|
||||
// salarySendNew);
|
||||
|
||||
// 3.异步发送消息:先修改数据再发消息,避免出错后无法撤回
|
||||
// TODO 异步发送消息
|
||||
// String tenantName = TenantContext.getCurrentTenant().getTenantName();
|
||||
// taskExecutor.execute(() -> {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(currentTenantKey);
|
||||
// sendMessage(salarySend, enableSendList, salaryTemplates.get(0), tenantName, currentEmployeeId, currentTenantKey);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// });
|
||||
List<SalarySendInfoPO> needSendList = Lists.newArrayList();
|
||||
enableSendList.forEach(map -> {
|
||||
sendList.forEach(item -> {
|
||||
|
|
@ -900,6 +877,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
});
|
||||
|
||||
// 发送消息
|
||||
param.setTemplate(templatePO);
|
||||
sendMessage(true, needSendList, param, salarySend);
|
||||
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
|
|
@ -918,27 +896,18 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
* @param salarySend
|
||||
*/
|
||||
private void sendMessage(boolean sendFlag, List<SalarySendInfoPO> list, SalarySendGrantParam param, SalarySendPO salarySend) {
|
||||
Date salaryMonth = salarySend.getSalaryMonth();
|
||||
String month = DateUtil.format(salaryMonth, "yyyy-MM");
|
||||
new Thread() {
|
||||
public void run() {
|
||||
List<Long> collect = new ArrayList<>();
|
||||
List<SalarySendInfoPO> pos = list;
|
||||
if (CollectionUtils.isNotEmpty(param.getIds())) {
|
||||
collect = new ArrayList<>(param.getIds());
|
||||
} else {
|
||||
collect = list.stream().map(item -> item.getId()).collect(Collectors.toList());
|
||||
pos = list.stream().filter(f -> param.getIds().contains(f.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
collect.forEach(item -> {
|
||||
SalarySendInfoPO po = SalarySendInfoPO.builder().id(item).build();
|
||||
List<SalarySendInfoPO> salarySendInfoPOS = salarySendInfoMapper.listSome(po);
|
||||
if (CollectionUtils.isNotEmpty(salarySendInfoPOS)) {
|
||||
Long employeeId = salarySendInfoPOS.get(0).getEmployeeId();
|
||||
if (sendFlag) {
|
||||
sendPayRollEMMessage(item, employeeId, month);
|
||||
} else {
|
||||
withdrawPayrollEMMessage(item, employeeId);
|
||||
}
|
||||
pos.forEach(po -> {
|
||||
Long employeeId = po.getEmployeeId();
|
||||
if (sendFlag) {
|
||||
sendPayRollEMMessage(po, param.getTemplate(), employeeId);
|
||||
} else {
|
||||
withdrawPayrollEMMessage(po, employeeId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -948,36 +917,57 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
/**
|
||||
* 发送Em消息
|
||||
*/
|
||||
private void sendPayRollEMMessage(Long id, Long employeeId, String month) {
|
||||
MessageType messageType = MessageType.newInstance(499); // 消息来源(见文档第四点补充 必填)
|
||||
private void sendPayRollEMMessage(SalarySendInfoPO po, SalaryTemplatePO template, Long employeeId) {
|
||||
Long id = po.getId();
|
||||
|
||||
String billTitle = getBillTitle(template.getTheme(), po.getSalaryMonth(), employeeId);
|
||||
String background = template.getBackground();
|
||||
|
||||
Set<String> userIdList = new HashSet<>(); // 接收人id 必填
|
||||
userIdList.add(employeeId.toString());
|
||||
String title = month + " 工资单"; // 标题
|
||||
String title = billTitle; // 标题
|
||||
String context = "点击查看详情"; // 内容
|
||||
String linkUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?id=" + id; // PC端链接
|
||||
String linkMobileUrl = weaver.general.GCONST.getContextPath() + "/spa/hrmSalary/static/index.html#/main/hrmSalary/mobilepayroll?type=phone&id=" + id; // 移动端链接
|
||||
try {
|
||||
MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl);
|
||||
messageBean.setCreater(user.getUID());// 创建人id
|
||||
messageBean.setBizState("0");// 需要修改消息为已处理等状态时传入,表示消息最初状态为待处理
|
||||
messageBean.setTargetId("499|" + id); //消息来源code +“|”+业务id需要修改消息为已处理等状态时传入
|
||||
Util_Message.store(messageBean);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("code", "499");
|
||||
map.put("title", title);
|
||||
map.put("context", context);
|
||||
map.put("linkUrl", linkUrl);
|
||||
map.put("linkMobileUrl", linkMobileUrl);
|
||||
map.put("bizState", "0"); //在消息需要修改状态时传入,表示消息初始的状态是待处理
|
||||
map.put("targetId", "499|" + id);// 消息来源code +“|”+业务id 消息需要打上已处理标记
|
||||
map.put("userIdList", userIdList); //接收人OA系统id 第一种形式 参数是userIdList
|
||||
map.put("creater", user.getUID()); //创建人OA系统id 第一种形式 参数是creater
|
||||
|
||||
Map extraMap = new HashMap<>();
|
||||
extraMap.put("linkurl", linkUrl);
|
||||
if (StringUtils.isNotBlank(background)) {
|
||||
extraMap.put("showimage", background);//图片地址
|
||||
} else {
|
||||
extraMap.put("showimage", "/hrm/hrm_e9/images/payroll.jpg?pictype=jpg");//图片地址
|
||||
}
|
||||
Map shareMap = new HashMap<>();
|
||||
shareMap.put("extra", extraMap);
|
||||
Map emParams = new HashMap<>();
|
||||
emParams.put("share", shareMap);
|
||||
|
||||
map.put("emParams", emParams);
|
||||
ServiceMessageCustom factory = new ServiceMessageCustomImpl();
|
||||
factory.sendCustomMessageSingle(JSON.toJSONString(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回EM消息
|
||||
*
|
||||
* @param id
|
||||
* @param po
|
||||
*/
|
||||
private void withdrawPayrollEMMessage(Long id, Long employeeId) {
|
||||
private void withdrawPayrollEMMessage(SalarySendInfoPO po, Long employeeId) {
|
||||
try {
|
||||
MessageBean messageBean = Util_Message.createMessage();
|
||||
messageBean.setUserList(new HashSet<>());//接收人id
|
||||
messageBean.setUserId(employeeId.intValue());
|
||||
messageBean.setTargetId("499|" + id); //code + “|” + 业务id
|
||||
messageBean.setTargetId("499|" + po.getId()); //code + “|” + 业务id
|
||||
//messageBean.setMessageType(MessageType.newInstance(121));//消息来源code(传了代表code也做为删除时的条件,默认不传)
|
||||
Util_Message.delMessageTargetid(messageBean);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
salarySobItemGroupPOS = salarySobItemGroupPOS.stream().filter(group -> !(hideGroupIDs.contains(group.getId()))).collect(Collectors.toList());
|
||||
// 获取薪资项目分类ID
|
||||
List<Long> salarySobItemGroupIds = salarySobItemGroupPOS.stream().map(SalarySobItemGroupPO::getId).collect(Collectors.toList());
|
||||
salarySobItemGroupIds.add(0L);
|
||||
|
||||
// 查询薪资账套的薪资项目副本(已经过滤关闭分类显示按钮的薪资项目)
|
||||
List<SalarySobItemPO> salarySobItemPOS = listBySalarySobIdAndGroupId(salarySobId, salarySobItemGroupIds);
|
||||
|
|
@ -536,6 +537,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
salarySobItemMapper.deleteByGroupIds(needDeleteGroupIds);
|
||||
|
||||
|
||||
//未分类
|
||||
List<SalarySobItemSaveParam.SalarySobItemParam> items = saveParam.getItems();
|
||||
List<Long> itemIds = SalaryEntityUtil.properties(items, SalarySobItemSaveParam.SalarySobItemParam::getId, Collectors.toList());
|
||||
List<SalarySobItemPO> oldItems = salarySobItemMapper.listBySalarySobIdAndGroupId(salarySobId, Collections.singleton(0L));
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public SIArchivesService getSIArchivesService(User user) {
|
||||
return ServiceUtil.getService(SIArchivesServiceImpl.class,user);
|
||||
}
|
||||
|
||||
private EmployBiz employBiz = new EmployBiz();
|
||||
|
||||
private List<TaxAgentManageRangePO> listByTaxAgentIds(List<Long> taxAgentIds) {
|
||||
|
|
@ -339,6 +343,11 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
syncLocalEmp(taxAgentId, allSalaryEmployees, allSubAdminRanges, (long) user.getUID());
|
||||
//生成档案
|
||||
getSalaryArchiveService(user).handleChangeData(1L);
|
||||
//生成社保福利档案
|
||||
String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
if (welSign == null || "0".equals(welSign)) {
|
||||
getSIArchivesService(user).handleChangeData(1L);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -454,8 +463,14 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM
|
|||
// 同步分管理员的人员
|
||||
// taxAgentSubAdminEmployeeService.syncTaxAgentSubAdminEmployee(subAdminEmpSaveParamList, employeeId, tenantKey);
|
||||
|
||||
//生成档案
|
||||
//生成薪资档案
|
||||
getSalaryArchiveService(user).handleChangeData(1L);
|
||||
|
||||
//生成社保福利档案
|
||||
String welSign = (String) Util_DataCache.getObjVal("welfareChangeSign");
|
||||
if (welSign == null || "0".equals(welSign)) {
|
||||
getSIArchivesService(user).handleChangeData(1L);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -114,17 +114,11 @@ public class ResponseResult<T, R> {
|
|||
}
|
||||
|
||||
|
||||
private static String getJsonString(Object apidatas) {
|
||||
private static String getJsonString(Object apidatas) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
return mapper.writeValueAsString(apidatas);
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
return mapper.writeValueAsString(apidatas);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
|
|
@ -138,7 +132,7 @@ public class ResponseResult<T, R> {
|
|||
/**
|
||||
* 成功返回
|
||||
*/
|
||||
private String Ok(R r) {
|
||||
private String Ok(R r) throws JsonProcessingException {
|
||||
Map<String, Object> apidatas = new HashMap<>();
|
||||
apidatas.put("status", true);
|
||||
apidatas.put("data", r);
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.DBType;
|
||||
import com.mzlion.core.json.fastjson.JsonUtil;
|
||||
import com.mzlion.core.utils.BeanUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -55,6 +55,10 @@ public class SalaryTemplateWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobItemGroupService getSalarySobItemGroupService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemGroupServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -213,27 +217,32 @@ public class SalaryTemplateWrapper extends Service {
|
|||
salaryTemplateShowSetDTO.setSalaryItemZeroStatus(po.getSalaryItemZeroStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
}
|
||||
|
||||
// 主题及其他设置
|
||||
// WeaForm salaryTemplateShowSet = SalaryFormatUtil.<SalaryTemplateShowSetDTO>getInstance().buildForm(SalaryTemplateShowSetDTO.class, new SalaryTemplateShowSetDTO());
|
||||
//
|
||||
// WeaFormItem textContentItem = salaryTemplateShowSet.getItems().get("textContent");
|
||||
// Map<String, Object> otherParams = Maps.newHashMap();
|
||||
// otherParams.put("showCount", true);
|
||||
// otherParams.put("placeholder", SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 85987, "请输入"));
|
||||
// textContentItem.setOtherParams(otherParams);
|
||||
// salaryTemplateShowSet.getItems().put("textContent", textContentItem);
|
||||
//
|
||||
// salaryTemplateShowSet.setData(JsonUtil.parseMap(salaryTemplateShowSetDTO, Object.class));
|
||||
|
||||
Map<String, Object> salaryTemplateShowSet = new HashMap<>();
|
||||
salaryTemplateShowSet.put("data", salaryTemplateShowSetDTO);
|
||||
|
||||
// 薪资项目设置
|
||||
List<SalaryTemplateSalaryItemSetListDTO> salaryTemplateShowSetData = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(po.getSalaryItemSetting())) {
|
||||
salaryTemplateShowSetData = JsonUtil.fromJson(po.getSalaryItemSetting(), List.class);
|
||||
salaryTemplateShowSetData = JsonUtil.parseList(po.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
}
|
||||
|
||||
//同步项目名称
|
||||
List<SalaryItemPO> itemPOS = getSalaryItemService(user).listAll();
|
||||
Map<Long, String> itemIdNameMap = SalaryEntityUtil.convert2Map(itemPOS, SalaryItemPO::getId, SalaryItemPO::getName);
|
||||
|
||||
// List<SalarySobItemGroupPO> groupPOS = getSalarySobItemGroupService(user).listBySalarySobId(po.getSalarySobId());
|
||||
// Map<Long, String> groupIdNameMap = SalaryEntityUtil.convert2Map(groupPOS, SalarySobItemGroupPO::getId, SalarySobItemGroupPO::getName);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(salaryTemplateShowSetData)) {
|
||||
salaryTemplateShowSetData.stream()
|
||||
//排除人员消息
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111"))
|
||||
.forEach(data -> {
|
||||
data.getItems().forEach(item -> item.setName(itemIdNameMap.getOrDefault(Long.valueOf(item.getSalaryItemId()), item.getName())));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return SalaryTemplateShowFormDTO.builder()
|
||||
.id(id)
|
||||
.vars(Arrays.stream(SalaryTemplateVarEnum.values()).map(SalaryTemplateVarEnum::getValue).collect(Collectors.toList()))
|
||||
|
|
@ -372,7 +381,18 @@ public class SalaryTemplateWrapper extends Service {
|
|||
}
|
||||
BeanUtils.copyProperties(po, salaryTemplateReplenishSetDTO);
|
||||
if (StringUtils.isNotEmpty(po.getReplenishSalaryItemSetting())) {
|
||||
replenishSalaryItemSetting = JsonUtil.fromJson(po.getReplenishSalaryItemSetting(), List.class);
|
||||
replenishSalaryItemSetting = JsonUtil.parseList(po.getReplenishSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
// 同步补发薪资项目名称
|
||||
List<SalaryItemPO> itemPOS = getSalaryItemService(user).listAll();
|
||||
Map<Long, String> itemIdNameMap = SalaryEntityUtil.convert2Map(itemPOS, SalaryItemPO::getId, SalaryItemPO::getName);
|
||||
if (CollectionUtils.isNotEmpty(replenishSalaryItemSetting)) {
|
||||
replenishSalaryItemSetting.stream()
|
||||
//排除人员消息
|
||||
.filter(data -> !StringUtils.equals(data.getGroupId(), "111111111111111111"))
|
||||
.forEach(data -> {
|
||||
data.getItems().forEach(item -> item.setName(itemIdNameMap.getOrDefault(Long.valueOf(item.getSalaryItemId()), item.getName())));
|
||||
});
|
||||
}
|
||||
} else {
|
||||
replenishSalaryItemSetting = getReplenishSalaryItemSet(replenishFormQueryParam.getSalarySobId());
|
||||
}
|
||||
|
|
@ -388,6 +408,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取单个分组下,没有被加入到模板的薪资项目
|
||||
*
|
||||
* @param param 入参
|
||||
* @return 单个分组下剩余的薪资项目
|
||||
*/
|
||||
|
|
@ -410,6 +431,7 @@ public class SalaryTemplateWrapper extends Service {
|
|||
|
||||
/**
|
||||
* 获取账套下没有被加入的分组
|
||||
*
|
||||
* @param param 入参
|
||||
* @return 分组与下属
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue