Merge branch 'feature/230701-工资单反馈' into release/2.9.2.2307.02
This commit is contained in:
commit
3a1765b562
|
|
@ -77,6 +77,9 @@ public class SalaryTemplateBO {
|
|||
.autoSendStatus(saveParam.getAutoSendStatus()?1:0)
|
||||
.autoSendDayOfMonth(saveParam.getAutoSendDayOfMonth())
|
||||
.autoSendTimeOfDay(saveParam.getAutoSendTimeOfDay())
|
||||
.ackFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0)
|
||||
.autoAckDays(saveParam.getAutoAckDays())
|
||||
.feedbackUrl(saveParam.getFeedbackUrl())
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.creator(employeeId)
|
||||
|
|
|
|||
|
|
@ -29,10 +29,7 @@ public class SalaryBaseSetFormDTO {
|
|||
// 水印设置
|
||||
private Object watermarkSetting;
|
||||
|
||||
// 签名确认
|
||||
private Boolean ackStatus;
|
||||
|
||||
// 员工反馈
|
||||
private Boolean feedbackStatus;
|
||||
// 工资单反馈设置
|
||||
private SalaryBillAckFeedbackDTO ackFeedbackSetting;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName SalaryBillAckFeedbackDTO
|
||||
* @date 2023/07/12 13:46
|
||||
* @description 工资单确认和反馈DTO
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryBillAckFeedbackDTO {
|
||||
|
||||
/**
|
||||
* 工资单确认反馈是否开启。0:否,1:是
|
||||
*/
|
||||
private String ackStatus;
|
||||
|
||||
/**
|
||||
* 反馈地址
|
||||
*/
|
||||
private String feedBackUrl;
|
||||
|
||||
/**
|
||||
* 超时自动确认天数
|
||||
*/
|
||||
private Integer autoAckDays;
|
||||
|
||||
}
|
||||
|
|
@ -48,6 +48,12 @@ public class SalarySendInfoListDTO {
|
|||
@TableTitle(title = "发送状态", dataIndex = "sendStatus", key = "sendStatus")
|
||||
private String sendStatus;
|
||||
|
||||
@TableTitle(title = "查看状态", dataIndex = "billReadStatus", key = "billReadStatus")
|
||||
private String billReadStatus;
|
||||
|
||||
@TableTitle(title = "确认状态", dataIndex = "billConfirmStatus", key = "billConfirmStatus")
|
||||
private String billConfirmStatus;
|
||||
|
||||
private String email;
|
||||
private Long salaryAcctRecordId;
|
||||
/**
|
||||
|
|
@ -55,5 +61,10 @@ public class SalarySendInfoListDTO {
|
|||
*/
|
||||
private Integer salaryAcctType;
|
||||
|
||||
/**
|
||||
* 该模板是否开启了工资单反馈确认
|
||||
*/
|
||||
private boolean needAck;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,5 +141,10 @@ public class SalarySendListDTO {
|
|||
*/
|
||||
// private Integer haveBackCalc;
|
||||
|
||||
/**
|
||||
* 工资单确认反馈状态
|
||||
*/
|
||||
private Integer ackFeedbackStatus;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,4 +66,20 @@ public class SalaryTemplateBaseSetDTO {
|
|||
|
||||
// 发送时间
|
||||
private String autoSendTimeOfDay;
|
||||
|
||||
/**
|
||||
* 工资单确认反馈状态
|
||||
*/
|
||||
private Boolean ackFeedbackStatus;
|
||||
|
||||
/**
|
||||
* 自动确认超时天数
|
||||
*/
|
||||
private Integer autoAckDays;
|
||||
|
||||
/**
|
||||
* 反馈流程地址
|
||||
*
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,5 @@ public class SalaryTemplateShowSetDTO {
|
|||
|
||||
// 薪资项为0时不显示")
|
||||
private Boolean salaryItemZeroStatus;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -7,6 +8,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
|
@ -32,11 +34,8 @@ public class SalaryBaseSetSaveParam {
|
|||
// 自定义设置内容")
|
||||
private Map<String, Object> wmSetting;
|
||||
|
||||
// 是否启用确认")
|
||||
private Boolean ackStatus;
|
||||
|
||||
// 是否启用反馈")
|
||||
private Boolean feedbackStatus;
|
||||
// 工资单确认反馈设置
|
||||
private SalaryBillAckFeedbackDTO ackFeedbackSetting;
|
||||
|
||||
public static void checkParam(SalaryBaseSetSaveParam saveParam) {
|
||||
if (Objects.isNull(saveParam.getWatermarkStatus())) {
|
||||
|
|
@ -51,14 +50,10 @@ public class SalaryBaseSetSaveParam {
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(220419, "自定义水印的设置内容必传"));
|
||||
}
|
||||
}
|
||||
if (Objects.isNull(saveParam.getAckFeedbackSetting()) || StringUtils.isBlank(saveParam.getAckFeedbackSetting().getAckStatus())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(220418, "工资单确认反馈信息必传"));
|
||||
}
|
||||
|
||||
// if (Objects.isNull(saveParam.getAckStatus())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 222645, "是否启用确认必传"));
|
||||
// }
|
||||
//
|
||||
// if (Objects.isNull(saveParam.getFeedbackStatus())) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 222646, "是否启用反馈必传"));
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,22 @@ public class SalaryTemplateSaveParam {
|
|||
// 补发薪资项目设置
|
||||
private List<SalaryTemplateSalaryItemSetListDTO> replenishSalaryItemSetting;
|
||||
|
||||
/**
|
||||
* 工资单确认反馈状态
|
||||
*/
|
||||
private Boolean ackFeedbackStatus;
|
||||
|
||||
/**
|
||||
* 自动确认超时天数
|
||||
*/
|
||||
private Integer autoAckDays;
|
||||
|
||||
/**
|
||||
* 反馈流程地址
|
||||
*
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
|
||||
public static void checkParam(SalaryTemplateSaveParam saveParam) {
|
||||
if (saveParam.getSalarySobId() == null) {
|
||||
throw new SalaryRunTimeException("薪资账套表的主键id必传;");
|
||||
|
|
|
|||
|
|
@ -52,6 +52,21 @@ public class SalarySendInfoPO {
|
|||
*/
|
||||
private Integer sendStatus;
|
||||
|
||||
/**
|
||||
* 查看状态。0:未查看、1:已查看
|
||||
*/
|
||||
private Integer billReadStatus;
|
||||
|
||||
/**
|
||||
* 确认状态 0:未确认、1:已确认
|
||||
*/
|
||||
private Integer billConfirmStatus;
|
||||
|
||||
/**
|
||||
* 操作发送工资单人员id
|
||||
*/
|
||||
private Long sendEmployeeId;
|
||||
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -170,5 +170,23 @@ public class SalaryTemplatePO {
|
|||
*/
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 工资单确认反馈状态
|
||||
*/
|
||||
private Integer ackFeedbackStatus;
|
||||
|
||||
/**
|
||||
* 自动确认超时天数
|
||||
*/
|
||||
private Integer autoAckDays;
|
||||
|
||||
/**
|
||||
* 反馈流程地址
|
||||
*
|
||||
*/
|
||||
private String feedbackUrl;
|
||||
|
||||
|
||||
|
||||
private Collection<Long> salarySobIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @ClassName BillConfimStatusEnum
|
||||
* @author Harryxzy
|
||||
* @date 2023/7/10 17:03
|
||||
* @description 工资单确认
|
||||
*/
|
||||
public enum BillConfimStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
UNCONFIRMED(0, "未确认", 93286),
|
||||
CONFIRMED(1, "已确认", 93212),
|
||||
FEEDBACK(2, "已反馈", 0);
|
||||
|
||||
private final int value;
|
||||
|
||||
private final String defaultLabel;
|
||||
|
||||
private final int labelId;
|
||||
|
||||
BillConfimStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
BillConfimStatusEnum[] enumAry = BillConfimStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (enumAry[i].getValue().equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
BillConfimStatusEnum[] enumAry = BillConfimStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (enumAry[i].getValue().equals(value)) {
|
||||
return enumAry[i].name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.engine.salary.enums.salarybill;
|
||||
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @ClassName BillReadStatusEnum
|
||||
* @author Harryxzy
|
||||
* @date 2023/7/10 17:13
|
||||
* @description 工资单查看
|
||||
*/
|
||||
public enum BillReadStatusEnum implements BaseEnum<Integer> {
|
||||
|
||||
UNREAD(0, "未查看", 93286),
|
||||
READED(1, "已查看", 93212);
|
||||
|
||||
private int value;
|
||||
|
||||
private String defaultLabel;
|
||||
|
||||
private int labelId;
|
||||
|
||||
BillReadStatusEnum(int value, String defaultLabel, int labelId) {
|
||||
this.value = value;
|
||||
this.defaultLabel = defaultLabel;
|
||||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultLabel() {
|
||||
return defaultLabel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getLabelId() {
|
||||
return labelId;
|
||||
}
|
||||
|
||||
public static String getDefaultLabelByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
BillReadStatusEnum[] enumAry = BillReadStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].getDefaultLabel();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getNameByValue(Integer value) {
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
BillReadStatusEnum[] enumAry = BillReadStatusEnum.values();
|
||||
for(int i = 0; i < Arrays.asList(enumAry).size(); i++){
|
||||
if (Integer.valueOf(enumAry[i].getValue()).equals(value)) {
|
||||
return enumAry[i].name();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -101,4 +101,17 @@ public interface SalarySendInfoMapper {
|
|||
void deleteBySalaryAcctRecordIds(@Param("salaryAcctRecordId") Collection<Long> ids);
|
||||
|
||||
List<SalarySendInfoPO> getNeedSendInfoList(@Param("salarySendIds") List<Long> salarySendIds);
|
||||
|
||||
/**
|
||||
* 自动确认工资单
|
||||
* @param needAutoIds
|
||||
*/
|
||||
void autoConfirmSalaryBill(@Param("ids") List<Long> needAutoIds);
|
||||
|
||||
/**
|
||||
* 根据薪资账套id获取已发送,确认状态为未确认的工资单
|
||||
* @param salarySobIds
|
||||
* @return
|
||||
*/
|
||||
List<SalarySendInfoPO> listUnConfirmedSendInfo(@Param("salarySobIds") List<Long> salarySobIds);
|
||||
}
|
||||
|
|
@ -36,6 +36,9 @@
|
|||
, t.delete_type
|
||||
, t.tenant_key
|
||||
, t.salary_acct_type
|
||||
, t.bill_read_status
|
||||
, t.bill_confirm_status
|
||||
, t.send_employee_id
|
||||
</sql>
|
||||
<update id="deleteBySalaryAcctRecordIds">
|
||||
update hrsa_salary_send_info
|
||||
|
|
@ -168,6 +171,8 @@
|
|||
t1.send_status,
|
||||
t1.employee_id,
|
||||
t1.salary_month,
|
||||
t1.bill_read_status as billReadStatus,
|
||||
t1.bill_confirm_status as billConfirmStatus,
|
||||
e.email
|
||||
</sql>
|
||||
|
||||
|
|
@ -609,7 +614,16 @@
|
|||
delete_type = #{po.deleteType},
|
||||
</if>
|
||||
<if test="po.salaryTemplate != null">
|
||||
salary_template = #{po.salaryTemplate}
|
||||
salary_template = #{po.salaryTemplate},
|
||||
</if>
|
||||
<if test="po.billReadStatus != null">
|
||||
bill_read_status = #{po.billReadStatus},
|
||||
</if>
|
||||
<if test="po.billConfirmStatus != null">
|
||||
bill_confirm_status = #{po.billConfirmStatus},
|
||||
</if>
|
||||
<if test="po.sendEmployeeId != null">
|
||||
send_employee_id = #{po.sendEmployeeId}
|
||||
</if>
|
||||
</set>
|
||||
|
||||
|
|
@ -682,6 +696,12 @@
|
|||
<if test="tenantKey != null and tenantKey != ''">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="billConfirmStatus != null and billConfirmStatus != ''">
|
||||
AND bill_confirm_status = #{billConfirmStatus}
|
||||
</if>
|
||||
<if test="billReadStatus != null and billReadStatus != ''">
|
||||
AND bill_read_status = #{billReadStatus}
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
<select id="getNeedSendInfoList" resultType="com.engine.salary.entity.salaryBill.po.SalarySendInfoPO">
|
||||
|
|
@ -697,6 +717,20 @@
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="listUnConfirmedSendInfo" resultType="com.engine.salary.entity.salaryBill.po.SalarySendInfoPO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_send_info t
|
||||
LEFT JOIN hrsa_salary_send s
|
||||
ON t.salary_send_id = s.id
|
||||
WHERE t.delete_type = 0
|
||||
AND t.send_status = 1
|
||||
AND s.salary_sob_id IN
|
||||
<foreach collection="salarySobIds" separator="," item="salarySobId" open="(" close=")">
|
||||
#{salarySobId}
|
||||
</foreach>
|
||||
AND (t.bill_confirm_status = 0 or bill_confirm_status is null)
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
|
|
@ -709,9 +743,6 @@
|
|||
<if test="salaryMonth != null">
|
||||
salary_month=#{salaryMonth},
|
||||
</if>
|
||||
<if test="useType != null">
|
||||
use_type=#{useType},
|
||||
</if>
|
||||
<if test="salaryAcctRecordId != null">
|
||||
salary_acct_record_id=#{salaryAcctRecordId},
|
||||
</if>
|
||||
|
|
@ -745,8 +776,27 @@
|
|||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="billReadStatus != null">
|
||||
bill_read_status=#{billReadStatus},
|
||||
</if>
|
||||
<if test="billConfirmStatus != null">
|
||||
bill_confirm_status=#{billConfirmStatus},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
<update id="autoConfirmSalaryBill">
|
||||
UPDATE hrsa_salary_send_info
|
||||
set
|
||||
bill_confirm_status = 1
|
||||
where
|
||||
delete_type = 0
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -65,4 +65,6 @@ public interface SalarySendMapper {
|
|||
void deleteBySalaryAcctRecordIds(@Param("salaryAcctRecordId") Collection<Long> ids);
|
||||
|
||||
List<SalarySendPO> getNeedSendListBySalarySobIds(@Param("salarySobIds")List<Long> salarySobIds);
|
||||
|
||||
List<SalarySendPO> getByIds(@Param("ids") List<Long> salarySendId);
|
||||
}
|
||||
|
|
@ -252,6 +252,18 @@
|
|||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
<select id="getByIds" resultType="com.engine.salary.entity.salaryBill.po.SalarySendPO">
|
||||
SELECT
|
||||
<include refid="salarySendPOColumn" />
|
||||
FROM hrsa_salary_send t
|
||||
WHERE delete_type = 0
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
|
|
|
|||
|
|
@ -48,13 +48,16 @@
|
|||
, t.salary_item_null_status
|
||||
, t.salary_item_zero_status
|
||||
, t.salary_item_setting
|
||||
, replenish_name
|
||||
, replenish_rule
|
||||
, replenish_salary_item_setting
|
||||
, auto_send_status
|
||||
, auto_send_cycle_type
|
||||
, auto_send_day_of_month
|
||||
, auto_send_time_of_day
|
||||
, t.replenish_name
|
||||
, t.replenish_rule
|
||||
, t.replenish_salary_item_setting
|
||||
, t.auto_send_status
|
||||
, t.auto_send_cycle_type
|
||||
, t.auto_send_day_of_month
|
||||
, t.auto_send_time_of_day
|
||||
, t.ack_feedback_status
|
||||
, t.auto_ack_days
|
||||
, t.feedback_url
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
|
|
@ -84,6 +87,9 @@
|
|||
auto_send_cycle_type,
|
||||
auto_send_day_of_month,
|
||||
auto_send_time_of_day,
|
||||
ack_feedback_status,
|
||||
auto_ack_days,
|
||||
feedback_url,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
|
|
@ -321,6 +327,9 @@
|
|||
<if test="autoSendStatus != null and autoSendStatus != ''">
|
||||
AND auto_send_status = #{autoSendStatus}
|
||||
</if>
|
||||
<if test="ackFeedbackStatus != null and ackFeedbackStatus != ''">
|
||||
AND ack_feedback_status = #{ackFeedbackStatus}
|
||||
</if>
|
||||
<if test="salarySobIds != null and salarySobIds.size() > 0">
|
||||
AND salary_sob_id IN
|
||||
<foreach collection="salarySobIds" open="(" item="id" separator="," close=")">
|
||||
|
|
@ -513,6 +522,15 @@
|
|||
<if test="autoSendTimeOfDay != null">
|
||||
auto_send_time_of_day=#{autoSendTimeOfDay},
|
||||
</if>
|
||||
<if test="ackFeedbackStatus!= null">
|
||||
ack_feedback_status=#{ackFeedbackStatus},
|
||||
</if>
|
||||
<if test="autoAckDays != null">
|
||||
auto_ack_days=#{autoAckDays},
|
||||
</if>
|
||||
<if test="feedbackUrl != null">
|
||||
feedback_url=#{feedbackUrl},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
|
|
@ -603,6 +621,15 @@
|
|||
<if test="autoSendTimeOfDay != null">
|
||||
auto_send_time_of_day,
|
||||
</if>
|
||||
<if test="ackFeedbackStatus != null">
|
||||
ack_feedback_status,
|
||||
</if>
|
||||
<if test="autoAckDays != null">
|
||||
auto_ack_days,
|
||||
</if>
|
||||
<if test="feedbackUrl != null">
|
||||
feedback_url,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
|
|
@ -689,6 +716,15 @@
|
|||
<if test="autoSendTimeOfDay != null">
|
||||
#{autoSendTimeOfDay},
|
||||
</if>
|
||||
<if test="ackFeedbackStatus != null">
|
||||
#{ackFeedbackStatus},
|
||||
</if>
|
||||
<if test="autoAckDays != null">
|
||||
#{autoAckDays},
|
||||
</if>
|
||||
<if test="feedbackUrl != null">
|
||||
#{feedbackUrl},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
|
|
@ -785,6 +821,15 @@
|
|||
<if test="autoSendTimeOfDay != null">
|
||||
auto_send_time_of_day,
|
||||
</if>
|
||||
<if test="ackFeedbackStatus != null">
|
||||
ack_feedback_status,
|
||||
</if>
|
||||
<if test="autoAckDays != null">
|
||||
auto_ack_days,
|
||||
</if>
|
||||
<if test="feedbackUrl != null">
|
||||
feedback_url,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
|
|
@ -871,6 +916,15 @@
|
|||
<if test="autoSendTimeOfDay != null">
|
||||
#{autoSendTimeOfDay},
|
||||
</if>
|
||||
<if test="ackFeedbackStatus != null">
|
||||
#{ackFeedbackStatus},
|
||||
</if>
|
||||
<if test="autoAckDays != null">
|
||||
#{autoAckDays},
|
||||
</if>
|
||||
<if test="feedbackUrl != null">
|
||||
#{feedbackUrl},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.mapper.sys;
|
||||
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -73,4 +74,6 @@ public interface SalarySysConfMapper {
|
|||
* @date 2022/11/9 21:09
|
||||
*/
|
||||
Date getTaxDeclarationRebootDate();
|
||||
|
||||
List<SalarySysConfPO> getListByCodes(@Param("codes") List<String> codes);
|
||||
}
|
||||
|
|
@ -237,4 +237,17 @@
|
|||
select update_time from HRSA_SALARY_SYS_CONF WHERE conf_key = 'taxDeclarationFunction'
|
||||
</select>
|
||||
|
||||
<select id="getListByCodes" resultType="com.engine.salary.sys.entity.po.SalarySysConfPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_sys_conf t
|
||||
WHERE delete_type = 0
|
||||
<if test="codes != null and codes.size()>0">
|
||||
and conf_key IN
|
||||
<foreach collection="codes" open="(" close=")" item="code" separator=",">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam;
|
||||
|
||||
|
|
@ -28,7 +29,7 @@ public interface SalaryBillBaseSetService {
|
|||
// SalaryBillAckFeedbackDTO getAckFeedbackSetting();
|
||||
|
||||
/**
|
||||
* 保存工资单水印设置
|
||||
* 保存工资单模板基础设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
|
|
@ -41,4 +42,10 @@ public interface SalaryBillBaseSetService {
|
|||
* @return
|
||||
*/
|
||||
String previewWaterMark(Map<String, Object> wmSetting);
|
||||
|
||||
/**
|
||||
* 获取默认工资单确认反馈设置
|
||||
* @return
|
||||
*/
|
||||
SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,18 @@ public interface SalaryBillService {
|
|||
*/
|
||||
List<Map<String, Object>> getSendInfoList(Long sendId, List<Long> ids);
|
||||
|
||||
/**
|
||||
* 确认工资单
|
||||
* @param salaryInfoId
|
||||
*/
|
||||
void confirmSalaryBill(Long salaryInfoId);
|
||||
|
||||
/**
|
||||
* 工资单反馈
|
||||
* @param salaryInfoId
|
||||
*/
|
||||
void feedBackSalaryBill(Long salaryInfoId);
|
||||
|
||||
/**
|
||||
* 工资单撤回
|
||||
*
|
||||
|
|
|
|||
|
|
@ -201,4 +201,19 @@ public interface SalarySendService {
|
|||
* @return
|
||||
*/
|
||||
List<SalarySendPO> getNeedSendListBySalarySobIds(List<Long> salarySobIds);
|
||||
|
||||
/**
|
||||
* 获取所有为确认的工资单
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
List<SalarySendInfoPO> listUnConfirmedSendInfo(List<Long> salarySobIds);
|
||||
|
||||
/**
|
||||
* 自动确认工资单
|
||||
* @param needAutoIds
|
||||
*/
|
||||
void autoConfirmSalaryBill(List<Long> needAutoIds);
|
||||
|
||||
List<SalarySendPO> getByIds(List<Long> salarySendId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,4 +125,10 @@ public interface SalaryTemplateService {
|
|||
* 获取所有设置了定时发送的默认工资单模板
|
||||
*/
|
||||
List<SalaryTemplatePO> getAutoSendTemplate();
|
||||
|
||||
/**
|
||||
* 获取所有开启了工资单确认反馈的默认工资单模板
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplatePO> listNeedAckDefaultTemplate();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryBill.bo.SalaryBillBO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryBillWatermarkPO;
|
||||
|
|
@ -13,7 +14,12 @@ import com.engine.salary.enums.salarybill.SalaryTemplateWatermarkTypeEnum;
|
|||
import com.engine.salary.service.SalaryBillBaseSetService;
|
||||
import com.engine.salary.service.SalaryBillWatermarkService;
|
||||
import com.engine.salary.service.SalaryEmployeeService;
|
||||
import com.engine.salary.sys.constant.SalarySysConstant;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
|
@ -21,10 +27,9 @@ import org.apache.commons.lang.math.NumberUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.*;
|
||||
|
||||
/**
|
||||
* @Description: 工资单水印
|
||||
|
|
@ -42,6 +47,10 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB
|
|||
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public SalarySysConfService getSalarySysConfService(User user) {
|
||||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryBillWatermarkDTO getWatermarkSetting() {
|
||||
List<SalaryBillWatermarkPO> list = getSalaryBillWatermarkService(user).listAll();
|
||||
|
|
@ -96,23 +105,16 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB
|
|||
.build());
|
||||
|
||||
|
||||
// // 工资单确认和反馈 ===========================================================
|
||||
// new LambdaUpdateChainWrapper<>(salaryBillAckFeedbackMapper)
|
||||
// .eq(SalaryBillAckFeedbackPO::getDeleteType, 0)
|
||||
// .eq(SalaryBillAckFeedbackPO::getTenantKey, tenantKey)
|
||||
// .set(SalaryBillAckFeedbackPO::getDeleteType, 3)
|
||||
// .update();
|
||||
// salaryBillAckFeedbackMapper.insert(SalaryBillAckFeedbackPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .ackStatus(saveParam.getAckStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)
|
||||
// .feedbackStatus(saveParam.getFeedbackStatus() ? NumberUtils.INTEGER_ONE : NumberUtils.INTEGER_ZERO)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .creator(employeeId)
|
||||
// .deleteType(NumberUtils.INTEGER_ZERO)
|
||||
// .tenantKey(tenantKey)
|
||||
// .build());
|
||||
|
||||
// 工资单确认和反馈 ===========================================================
|
||||
SalaryBillAckFeedbackDTO ackFeedbackSetting = saveParam.getAckFeedbackSetting();
|
||||
// 1.保存确认反馈开关状态
|
||||
getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAckStatus(), SALARY_SEND_FEEDBACK, "工资单确认反馈状态", "billSend");
|
||||
if(StringUtils.equals(ackFeedbackSetting.getAckStatus(),"1")){
|
||||
// 2.保存反馈地址
|
||||
getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getFeedBackUrl(), SALARY_FEEDBACK_URL, "工资单反馈地址", "billSend");
|
||||
// 3.保存自动确认时间
|
||||
getSalarySysConfService(user).saveSettingByType(ackFeedbackSetting.getAutoAckDays().toString(), SALARY_AUTO_ACK_DAYS, "工资单反馈自动确认", "billSend");
|
||||
}
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
|
|
@ -126,4 +128,30 @@ public class SalaryBillBaseSetServiceImpl extends Service implements SalaryBillB
|
|||
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(Long.valueOf(user.getUID()));
|
||||
return SalaryBillBO.handleWmText(wmText, wmTextFieldIds, simpleEmployee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalaryBillAckFeedbackDTO getDefaultAckFeedbackSetting() {
|
||||
// 获取反馈开启状态、自动确认时长、反馈地址
|
||||
List<String> codes = Arrays.asList(SalarySysConstant.SALARY_SEND_FEEDBACK, SalarySysConstant.SALARY_AUTO_ACK_DAYS, SalarySysConstant.SALARY_FEEDBACK_URL);
|
||||
List<SalarySysConfPO> sysConfList= getSalarySysConfService(user).getListByCodes(codes);
|
||||
Map<String, String> sysConfMap = SalaryEntityUtil.convert2Map(sysConfList, SalarySysConfPO::getConfKey, SalarySysConfPO::getConfValue);
|
||||
|
||||
SalaryBillAckFeedbackDTO defaultAckFeedBackDTO = SalaryBillAckFeedbackDTO.builder().build();
|
||||
String ackStatus = sysConfMap.getOrDefault(SalarySysConstant.SALARY_SEND_FEEDBACK, "0");
|
||||
if (StringUtils.equals(ackStatus,"0")) {
|
||||
// 未开启工资单确认
|
||||
defaultAckFeedBackDTO.setAckStatus("0");
|
||||
defaultAckFeedBackDTO.setAutoAckDays(0);
|
||||
defaultAckFeedBackDTO.setFeedBackUrl("/");
|
||||
return defaultAckFeedBackDTO;
|
||||
}
|
||||
defaultAckFeedBackDTO.setAckStatus(ackStatus);
|
||||
// 获取超时自动确认时间
|
||||
Integer autoAckDays = Integer.valueOf(sysConfMap.getOrDefault(SalarySysConstant.SALARY_AUTO_ACK_DAYS, "7"));
|
||||
defaultAckFeedBackDTO.setAutoAckDays(autoAckDays);
|
||||
// 反馈地址
|
||||
String feedbackUrl = sysConfMap.getOrDefault(SalarySysConstant.SALARY_FEEDBACK_URL, "");
|
||||
defaultAckFeedBackDTO.setFeedBackUrl(feedbackUrl);
|
||||
return defaultAckFeedBackDTO;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
|||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salarybill.MessageChannelEnum;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum;
|
||||
import com.engine.salary.enums.salarybill.*;
|
||||
import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarybill.SalarySendInfoMapper;
|
||||
|
|
@ -42,6 +40,7 @@ import com.weaver.util.threadPool.entity.LocalRunnable;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -426,6 +425,28 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
.buildDetailList(list, salaryAcctEmployees, salaryAcctResultValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void confirmSalaryBill(Long salaryInfoId) {
|
||||
SalarySendInfoPO sendInfoPO = getSalarySendInfoMapper().getById(salaryInfoId);
|
||||
if(ObjectUtils.isEmpty(sendInfoPO)){
|
||||
throw new SalaryRunTimeException("工资单不存在或已被删除!");
|
||||
}
|
||||
sendInfoPO.setBillConfirmStatus(BillConfimStatusEnum.CONFIRMED.getValue());
|
||||
sendInfoPO.setUpdateTime(new Date());
|
||||
getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void feedBackSalaryBill(Long salaryInfoId) {
|
||||
SalarySendInfoPO sendInfoPO = getSalarySendInfoMapper().getById(salaryInfoId);
|
||||
if(ObjectUtils.isEmpty(sendInfoPO)){
|
||||
throw new SalaryRunTimeException("工资单不存在或已被删除!");
|
||||
}
|
||||
sendInfoPO.setBillConfirmStatus(BillConfimStatusEnum.FEEDBACK.getValue());
|
||||
sendInfoPO.setUpdateTime(new Date());
|
||||
getSalarySendInfoMapper().updateIgnoreNull(sendInfoPO);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getSendInfoList(Long sendId, List<Long> ids) {
|
||||
|
||||
SalarySendPO salarySend = getSalarySendMapper().getById(sendId);
|
||||
|
|
@ -631,6 +652,9 @@ public class SalaryBillServiceImpl extends Service implements SalaryBillService
|
|||
po.setSendStatus(SalarySendStatusEnum.ALREADYSEND.getValue());
|
||||
po.setSendTime(sendTime);
|
||||
po.setSalaryTemplate(JsonUtil.toJsonString(salaryTemplate));
|
||||
po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue());
|
||||
po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue());
|
||||
po.setSendEmployeeId(Long.valueOf(user.getUID()));
|
||||
partition.forEach(idsp -> {
|
||||
salarySendInfoMapper.updateGrantWithdraw(po, salarySend.getId(), Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()), idsp);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.cloudstore.dev.api.bean.MessageBean;
|
||||
|
|
@ -37,6 +37,8 @@ import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
|||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveFieldTypeEnum;
|
||||
import com.engine.salary.enums.salarybill.BillConfimStatusEnum;
|
||||
import com.engine.salary.enums.salarybill.BillReadStatusEnum;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateReplenishRuleEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
|
|
@ -63,6 +65,7 @@ import com.google.common.collect.Lists;
|
|||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
|
@ -417,11 +420,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
Long salaryAcctId = salarySend.getSalaryAccountingId();
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctId);
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
// List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).listBySalarySobIds(Collections.singletonList(salarySobCycleDTO.getSalarySobId()));
|
||||
// // 是否有回算记录
|
||||
// boolean haveBackCalc = salaryAcctRecordPOS.stream().filter(PO -> Objects.equals(PO.getBackCalcStatus(), NumberUtils.INTEGER_ONE) &&
|
||||
// Objects.equals(sdf.format(PO.getSalaryMonth()), SalaryDateUtil.MONTH_FORMATTER.format(salarySobCycleDTO.getSalaryMonth()))).collect(Collectors.toList()).size() > 0;
|
||||
String template = "";
|
||||
// 获取默认模板
|
||||
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()));
|
||||
|
|
@ -475,6 +473,16 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单"));
|
||||
}
|
||||
SalarySendInfoPO salarySendInfo = salarySendInfos.get(0);
|
||||
// 获取默认模板信息
|
||||
SalarySendPO salarySendPO = getSalarySendMapper().getById(salarySendInfo.getSalarySendId());
|
||||
if(ObjectUtils.isEmpty(salarySendPO))
|
||||
throw new SalaryRunTimeException("工资单不存在");
|
||||
// 更新查看状态
|
||||
if (salarySendInfo.getBillReadStatus() == null || NumberUtils.compare(salarySendInfo.getBillReadStatus(),BillReadStatusEnum.UNREAD.getValue()) == 0) {
|
||||
salarySendInfo.setBillReadStatus(BillReadStatusEnum.READED.getValue());
|
||||
salarySendInfo.setUpdateTime(new Date());
|
||||
getSalarySendInfoMapper().updateIgnoreNull(salarySendInfo);
|
||||
}
|
||||
// List<SalarySendPO> salarySends = new LambdaQueryChainWrapper<>(mapper)
|
||||
// .eq(SalarySendPO::getDeleteType, 0)
|
||||
// .eq(SalarySendPO::getTenantKey, currentTenantKey)
|
||||
|
|
@ -598,6 +606,13 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
handleSalaryWatermark(salaryTemplate, salarySendInfo, currentEmployeeId);
|
||||
map.put("salaryTemplate", salaryTemplate);
|
||||
map.put("salaryAcctResult", salaryAcctResultS);
|
||||
// 工资单发送人、是否已确认
|
||||
if (NumberUtils.compare(salaryTemplate.getAckFeedbackStatus(),1) == 0) {
|
||||
map.put("confirmStatus", salarySendInfo.getBillConfirmStatus() == null ? "0" : salarySendInfo.getBillConfirmStatus().toString());
|
||||
map.put("sendEmployeeId", salarySendInfo.getSendEmployeeId());
|
||||
}else{
|
||||
map.put("confirmStatus", "1");
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
|
@ -611,7 +626,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
*/
|
||||
private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long currentEmployeeId) {
|
||||
SalaryBillWatermarkDTO salaryBillWatermark = JsonUtil.parseObject(salaryTemplate.getSalaryWatermark(), SalaryBillWatermarkDTO.class);
|
||||
if (Objects.isNull(salaryBillWatermark) || !salaryBillWatermark.getWatermarkStatus() ) {
|
||||
if (Objects.isNull(salaryBillWatermark) || Boolean.FALSE.equals(salaryBillWatermark.getWatermarkStatus()) ) {
|
||||
return;
|
||||
}
|
||||
// 发送时已经处理好变量字段,可直接获取判断
|
||||
|
|
@ -643,8 +658,30 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
queryParam.setOrderRule(orderRule);
|
||||
|
||||
List<SalarySendInfoListDTO> page = salarySendInfoMapper.list(queryParam);
|
||||
return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||
PageInfo<SalarySendInfoListDTO> pageInfo = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(),
|
||||
page, SalarySendInfoListDTO.class);
|
||||
SalarySendPO salarySendPO = getSalarySendMapper().getById(queryParam.getSalarySendId());
|
||||
if (ObjectUtils.isEmpty(salarySendPO))
|
||||
throw new SalaryRunTimeException("工资单不存在或已被删除");
|
||||
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySendPO.getSalarySobId()));
|
||||
Integer ackFeedbackStatus = salaryTemplates.get(0).getAckFeedbackStatus();
|
||||
if (ackFeedbackStatus!=null && NumberUtils.compare(ackFeedbackStatus,1) == 0) {
|
||||
// 默认为空时,未读未确认
|
||||
pageInfo.getList().stream().forEach(obj -> {
|
||||
SalarySendInfoListDTO dto = (SalarySendInfoListDTO) obj;
|
||||
if (StringUtils.isBlank( dto.getBillReadStatus() )){
|
||||
dto.setBillReadStatus(BillReadStatusEnum.UNREAD.getDefaultLabel());
|
||||
} else {
|
||||
dto.setBillReadStatus(BillReadStatusEnum.getDefaultLabelByValue( Integer.valueOf(dto.getBillReadStatus()) ));
|
||||
}
|
||||
if (StringUtils.isBlank(dto.getBillConfirmStatus())){
|
||||
dto.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getDefaultLabel());
|
||||
} else {
|
||||
dto.setBillConfirmStatus(BillConfimStatusEnum.getDefaultLabelByValue( Integer.valueOf(dto.getBillConfirmStatus()) ));
|
||||
}
|
||||
});
|
||||
}
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -728,6 +765,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
Map<String, Object> map = JsonUtil.parseMap(salaryTemplateContent, Object.class);
|
||||
return SalaryTemplatePO.builder()
|
||||
.id(Long.valueOf(map.getOrDefault("id", "0").toString()))
|
||||
.ackFeedbackStatus(Integer.valueOf(map.getOrDefault("ackFeedbackStatus", "0").toString()))
|
||||
.autoAckDays(Integer.valueOf(map.getOrDefault("autoAckDays", "0").toString()))
|
||||
.feedbackUrl(map.getOrDefault("feedbackUrl", "").toString())
|
||||
.name(map.getOrDefault("name", "").toString())
|
||||
.salarySobId(Long.valueOf(map.getOrDefault("salarySobId", "0").toString()))
|
||||
.useType(Integer.valueOf(map.getOrDefault("useType", "0").toString()))
|
||||
|
|
@ -960,9 +1000,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
if (isReplenish && StringUtils.isNotEmpty(salaryTemplate.getReplenishSalaryItemSetting())) {
|
||||
List<SalaryTemplateSalaryItemSetListDTO> salaryTemplateShowSetData = JsonUtil.parseList(salaryTemplate.getReplenishSalaryItemSetting(),
|
||||
SalaryTemplateSalaryItemSetListDTO.class);
|
||||
salaryTemplateShowSetData.stream().filter(f -> !f.getGroupId().equals(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)).forEach(e -> {
|
||||
salaryItems.addAll(e.getItems());
|
||||
});
|
||||
salaryTemplateShowSetData.stream().filter(f -> !f.getGroupId().equals(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)).forEach(e ->
|
||||
salaryItems.addAll(e.getItems())
|
||||
);
|
||||
}
|
||||
return salaryItems;
|
||||
}
|
||||
|
|
@ -1008,6 +1048,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
po.setSendStatus(SalarySendStatusEnum.ALREADYSEND.getValue());
|
||||
po.setSendTime(sendTime);
|
||||
po.setSalaryTemplate(JsonUtil.toJsonString(templatePO));
|
||||
po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue());
|
||||
po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue());
|
||||
po.setSendEmployeeId(Long.valueOf(user.getUID()));
|
||||
salarySendInfoMapper.updateGrantWithdraw(po, salarySendId, Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()), ids);
|
||||
|
||||
|
||||
|
|
@ -1242,6 +1285,8 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
// 撤回
|
||||
SalarySendInfoPO po = new SalarySendInfoPO();
|
||||
po.setSendStatus(SalarySendStatusEnum.WITHDRAW.getValue());
|
||||
po.setBillReadStatus(BillReadStatusEnum.UNREAD.getValue());
|
||||
po.setBillConfirmStatus(BillConfimStatusEnum.UNCONFIRMED.getValue());
|
||||
List<Integer> statusList = new ArrayList<>();
|
||||
statusList.add(SalarySendStatusEnum.ALREADYSEND.getValue());
|
||||
salarySendInfoMapper.updateGrantWithdraw(po, salarySendId, statusList, ids);
|
||||
|
|
@ -1440,7 +1485,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
if (Objects.isNull(salarySendPO)) {
|
||||
throw new SalaryRunTimeException("工资发放记录不存在或已被删除");
|
||||
}
|
||||
// return getSalaryAcctResultService(user).sumRow();
|
||||
|
||||
SalaryAcctResultQueryParam queryParam = SalaryAcctResultQueryParam.builder().salaryAcctRecordId(salarySendPO.getSalaryAccountingId()).build();
|
||||
// 查询薪资核算人员
|
||||
|
|
@ -1448,7 +1492,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
.listByResultQueryParam(queryParam);
|
||||
|
||||
if (org.apache.commons.collections4.CollectionUtils.isEmpty(salaryAcctEmployeePOS)) {
|
||||
return null;
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecordPO = getSalaryAcctRecordService(user).getById(queryParam.getSalaryAcctRecordId());
|
||||
|
|
@ -1471,7 +1515,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
// 是否是补发工资单
|
||||
List<SalarySendInfoPO> salarySendInfoPOS = getSalarySendInfoMapper().listSome(SalarySendInfoPO.builder().salarySendId(salarySendId).build());
|
||||
List<Long> sendEmployeeIds = salarySendInfoPOS.stream().map(SalarySendInfoPO::getEmployeeId).collect(Collectors.toList());
|
||||
salaryAcctResultPOS = salaryAcctResultPOS.stream().filter(PO -> sendEmployeeIds.contains(PO.getEmployeeId())).collect(Collectors.toList());
|
||||
salaryAcctResultPOS = salaryAcctResultPOS.stream().filter(po -> sendEmployeeIds.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
Map<Long, List<SalaryAcctResultPO>> acctResultMap = SalaryEntityUtil.group2Map(salaryAcctResultPOS, SalaryAcctResultPO::getSalaryItemId);
|
||||
|
|
@ -1573,4 +1617,28 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
|
|||
}
|
||||
return getSalarySendMapper().getNeedSendListBySalarySobIds(salarySobIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySendInfoPO> listUnConfirmedSendInfo(List<Long> salarySobIds) {
|
||||
if(CollectionUtils.isEmpty(salarySobIds))
|
||||
return Collections.emptyList();
|
||||
return getSalarySendInfoMapper().listUnConfirmedSendInfo(salarySobIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void autoConfirmSalaryBill(List<Long> needAutoSendIds) {
|
||||
if(CollectionUtils.isEmpty(needAutoSendIds)){
|
||||
return;
|
||||
}
|
||||
List<List<Long>> partition = Lists.partition((List) needAutoSendIds, 500);
|
||||
partition.forEach(getSalarySendInfoMapper()::autoConfirmSalaryBill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySendPO> getByIds(List<Long> salarySendId) {
|
||||
if(CollectionUtils.isEmpty(salarySendId)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalarySendMapper().getByIds(salarySendId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,6 +197,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0);
|
||||
salaryTemplateNew.setAutoSendStatus(saveParam.getAutoSendStatus()?1:0);
|
||||
salaryTemplateNew.setAutoSendCycleType(saveParam.getAutoSendCycleType());
|
||||
salaryTemplateNew.setAckFeedbackStatus(saveParam.getAckFeedbackStatus()?1:0);
|
||||
salaryTemplateNew.setAutoAckDays(saveParam.getAutoAckDays());
|
||||
salaryTemplateNew.setFeedbackUrl(saveParam.getFeedbackUrl());
|
||||
// todo 薪资项目设置检查校验
|
||||
salaryTemplateNew.setSalaryItemSetting(saveParam.getSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()) : "");
|
||||
salaryTemplateNew.setReplenishSalaryItemSetting(saveParam.getReplenishSalaryItemSetting() != null ? JSONUtil.toJsonStr(saveParam.getReplenishSalaryItemSetting()) : "");
|
||||
|
|
@ -352,4 +355,9 @@ public class SalaryTemplateServiceImpl extends Service implements SalaryTemplate
|
|||
public List<SalaryTemplatePO> getAutoSendTemplate() {
|
||||
return mapper.listSome(SalaryTemplatePO.builder().autoSendStatus(NumberUtils.INTEGER_ONE).useType(NumberUtils.INTEGER_ONE).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryTemplatePO> listNeedAckDefaultTemplate() {
|
||||
return mapper.listSome(SalaryTemplatePO.builder().useType(NumberUtils.INTEGER_ONE).ackFeedbackStatus(NumberUtils.INTEGER_ONE).build());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,19 @@ public class SalarySysConstant {
|
|||
* 删除薪资档案
|
||||
*/
|
||||
public static final String SALARY_ARCHIVE_DELETE = "salaryArchiveDelete";
|
||||
|
||||
/**
|
||||
* 工资单确认反馈状态
|
||||
*/
|
||||
public static final String SALARY_SEND_FEEDBACK = "SALARY_SEND_FEEDBACK";
|
||||
|
||||
/**
|
||||
* 工资单反馈自动确认
|
||||
*/
|
||||
public static final String SALARY_AUTO_ACK_DAYS = "SALARY_AUTO_ACK_DAYS";
|
||||
/**
|
||||
* 工资单反馈地址
|
||||
*/
|
||||
public static final String SALARY_FEEDBACK_URL = "SALARY_FEEDBACK_URL";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,9 @@ public class AppSettingVO {
|
|||
*/
|
||||
private String salaryArchiveDelete;
|
||||
|
||||
/**
|
||||
* 工资单反馈
|
||||
*/
|
||||
private String salarySendFeedback;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,4 +108,26 @@ public interface SalarySysConfService {
|
|||
* @param setting
|
||||
*/
|
||||
void saveArchiveDelete(String setting);
|
||||
|
||||
/**
|
||||
* 保存工资单反馈
|
||||
* @param param
|
||||
*/
|
||||
void saveSalarySendFeedback(SalarySysConfPO param);
|
||||
|
||||
/**
|
||||
* 根据code返回list
|
||||
* @param codes
|
||||
* @return
|
||||
*/
|
||||
List<SalarySysConfPO> getListByCodes(List<String> codes);
|
||||
|
||||
/**
|
||||
* 保存或者修改应用设置
|
||||
* @param confValue
|
||||
* @param confKey
|
||||
* @param title
|
||||
* @param app
|
||||
*/
|
||||
void saveSettingByType(String confValue, String confKey, String title, String app);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -421,7 +421,6 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
if (StringUtils.isBlank(param.getConfValue())) {
|
||||
throw new SalaryRunTimeException("无效规则!");
|
||||
}
|
||||
|
||||
saveSettingByType(param.getConfValue(), WITHDRAW_TAX_DECLARATION, "个税申报撤回", "basic");
|
||||
}
|
||||
|
||||
|
|
@ -433,6 +432,22 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
saveSettingByType(setting, SALARY_ARCHIVE_DELETE, "薪资、社保福利档案删除规则", "basic");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveSalarySendFeedback(SalarySysConfPO param) {
|
||||
if (StringUtils.isBlank(param.getConfValue())) {
|
||||
throw new SalaryRunTimeException("无效规则!");
|
||||
}
|
||||
saveSettingByType(param.getConfValue(), SALARY_SEND_FEEDBACK, "工资单反馈", "basic");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySysConfPO> getListByCodes(List<String> codes) {
|
||||
if(CollectionUtils.isEmpty(codes)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return getSalarySysConfMapper().getListByCodes(codes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者修改应用设置
|
||||
*
|
||||
|
|
@ -441,7 +456,8 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
* @param title
|
||||
* @param app
|
||||
*/
|
||||
private void saveSettingByType(String confValue, String confKey, String title, String app) {
|
||||
@Override
|
||||
public void saveSettingByType(String confValue, String confKey, String title, String app) {
|
||||
SalarySysConfPO po = getOneByCode(confKey);
|
||||
if (po == null) {
|
||||
SalarySysConfPO build = SalarySysConfPO.builder()
|
||||
|
|
@ -521,6 +537,15 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
|
|||
appSettingVO.setSalaryArchiveDelete(salaryArchiveDeletePO.getConfValue());
|
||||
}
|
||||
|
||||
|
||||
SalarySysConfPO salarySendFeedbackPO = salarySysConfMap.get(SALARY_SEND_FEEDBACK);
|
||||
if (salarySendFeedbackPO == null ) {
|
||||
// 是否开启工资单反馈,默认不开启
|
||||
appSettingVO.setSalarySendFeedback("0");
|
||||
} else {
|
||||
appSettingVO.setSalarySendFeedback(salarySendFeedbackPO.getConfValue());
|
||||
}
|
||||
|
||||
//默认加密开启
|
||||
if (StringUtils.isEmpty(appSettingVO.getIsOpenEncrypt())) {
|
||||
appSettingVO.setIsOpenEncrypt(OpenEnum.OPEN.getValue());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,71 @@
|
|||
package com.engine.salary.timer;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendInfoPO;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.service.SalarySendService;
|
||||
import com.engine.salary.service.SalaryTemplateService;
|
||||
import com.engine.salary.service.impl.SalarySendServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryTemplateServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import weaver.hrm.User;
|
||||
import weaver.interfaces.schedule.BaseCronJob;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author Harryxzy
|
||||
* @ClassName AutoConfirmSalaryBill
|
||||
* @date 2023/07/11 15:50
|
||||
* @description 自动确认工资单
|
||||
*/
|
||||
public class AutoConfirmSalaryBillCronJob extends BaseCronJob {
|
||||
private SalarySendService getSalarySendService(User user) {
|
||||
return ServiceUtil.getService(SalarySendServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryTemplateService getSalaryTemplateService(User user) {
|
||||
return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
User user = new User();
|
||||
user.setUid(1);
|
||||
user.setLoginid("sysadmin");
|
||||
// 获取所有需要确认反馈的默认工资单模板
|
||||
List<SalaryTemplatePO> templates = getSalaryTemplateService(user).listNeedAckDefaultTemplate();
|
||||
// key:薪资账套id,value:对应的自动确认天数
|
||||
Map<Long, Integer> salarySobAckDaysMap = SalaryEntityUtil.convert2Map(templates, SalaryTemplatePO::getSalarySobId, SalaryTemplatePO::getAutoAckDays);
|
||||
// 根据薪资账套id获取已发送,确认状态为未确认的工资单
|
||||
List<SalarySendInfoPO> unConfirmedList = getSalarySendService(user).listUnConfirmedSendInfo(new ArrayList<>(salarySobAckDaysMap.keySet()));
|
||||
List<SalarySendPO> sendList = getSalarySendService(user).getByIds(unConfirmedList.stream().map(SalarySendInfoPO::getSalarySendId).distinct().collect(Collectors.toList()));
|
||||
// key:工资单发放id,value:自动确认超时天数
|
||||
HashMap<Long, Integer> autoAckDaysMap = new HashMap<>();
|
||||
sendList.stream().forEach(send -> {
|
||||
Integer autoAckDays = salarySobAckDaysMap.getOrDefault(send.getSalarySobId(), 7);
|
||||
autoAckDaysMap.put(send.getId(), autoAckDays);
|
||||
});
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<Long> needAutoIds = unConfirmedList.stream().filter(po -> {
|
||||
LocalDateTime sendDateTime = SalaryDateUtil.dateToLocalDateTime(po.getSendTime());
|
||||
Integer autoDays = autoAckDaysMap.get(po.getSalarySendId());
|
||||
if (ObjectUtils.isEmpty(autoDays))
|
||||
return false;
|
||||
LocalDateTime autoDateTime = sendDateTime.plus(autoDays, ChronoUnit.DAYS);
|
||||
return !autoDateTime.isAfter(now);
|
||||
}).map(SalarySendInfoPO::getId).collect(Collectors.toList());
|
||||
// 自动确认
|
||||
getSalarySendService(user).autoConfirmSalaryBill(needAutoIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -545,6 +545,54 @@ public class SalaryBillController {
|
|||
}
|
||||
return new ResponseResult<Long, Map<String, Object>>(user).run(getSalarySendWrapper(user)::mySalaryBill, salaryInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认工资单
|
||||
*
|
||||
* @param salaryInfoId
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/confirmSalaryBill")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String confirmSalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) {
|
||||
User user = null;
|
||||
String recipient = request.getParameter("recipient");
|
||||
String em_auth_userid = request.getParameter("em_auth_userid");
|
||||
log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid);
|
||||
if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) {
|
||||
user = new User(Integer.parseInt(recipient));
|
||||
} else if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) {
|
||||
user = new User(Integer.parseInt(em_auth_userid));
|
||||
} else {
|
||||
user = HrmUserVarify.getUser(request, response);
|
||||
}
|
||||
return new ResponseResult<Long, Map<String, Object>>(user).run(getSalarySendWrapper(user)::confirmSalaryBill, salaryInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单反馈
|
||||
*
|
||||
* @param salaryInfoId
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/feedBackSalaryBill")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String feedBackSalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId) {
|
||||
User user = null;
|
||||
String recipient = request.getParameter("recipient");
|
||||
String em_auth_userid = request.getParameter("em_auth_userid");
|
||||
log.info("salary recipient: {} em_auth_userid: {}", recipient, em_auth_userid);
|
||||
if (StringUtils.isNotBlank(recipient) && NumberUtils.isCreatable(recipient)) {
|
||||
user = new User(Integer.parseInt(recipient));
|
||||
} else if (StringUtils.isNotBlank(em_auth_userid) && NumberUtils.isCreatable(em_auth_userid)) {
|
||||
user = new User(Integer.parseInt(em_auth_userid));
|
||||
} else {
|
||||
user = HrmUserVarify.getUser(request, response);
|
||||
}
|
||||
return new ResponseResult<Long, Map<String, Object>>(user).run(getSalarySendWrapper(user)::feedBackSalaryBill, salaryInfoId);
|
||||
}
|
||||
/******** 工资单发放 end ***********************************************************************************************/
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<TaxDeclarationFunctionEnum, Boolean>(user).run(getSalarySystemConfigWrapper(user)::operateTaxDeclarationFunction, TaxDeclarationFunctionEnum.parseByValue(param.getOperateTaxDeclaration()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取系统配置
|
||||
*
|
||||
|
|
@ -180,6 +181,13 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<MatchEmployeeModeSaveParam, String>(user).run(getSalarySystemConfigWrapper(user)::saveMatchEmployeeModeRule, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算人员匹配规则
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveSalaryAcctEmployeeRule")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
@ -188,6 +196,28 @@ public class SalarySystemConfigController {
|
|||
return new ResponseResult<String, String>(user).run(getSalarySystemConfigWrapper(user)::saveSalaryAcctEmployeeRule, param.getRule());
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单反馈
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveSalarySendFeedback")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String saveSalarySendFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySysConfPO param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySysConfPO, String>(user).run(getSalarySystemConfigWrapper(user)::saveSalarySendFeedback, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 撤回个税申报
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveWithDrawTaxDeclaration")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.wrapper;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBaseSetFormDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillAckFeedbackDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryBillWatermarkDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryBaseSetSaveParam;
|
||||
import com.engine.salary.service.SalaryBillBaseSetService;
|
||||
|
|
@ -45,7 +46,7 @@ public class SalaryBillBaseSetWrapper extends Service {
|
|||
public SalaryBaseSetFormDTO getBaseSetForm() {
|
||||
SalaryBaseSetFormDTO dto = new SalaryBaseSetFormDTO();
|
||||
SalaryBillWatermarkDTO salaryBillWatermark = getSalaryBillBaseSetService(user).getWatermarkSetting();
|
||||
// SalaryBillAckFeedbackDTO salaryBillAckFeedback = salaryBillBaseSetService.getAckFeedbackSetting();
|
||||
SalaryBillAckFeedbackDTO salaryBillAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting();
|
||||
|
||||
if (Objects.isNull(salaryBillWatermark)) {
|
||||
dto.setWatermarkStatus(false);
|
||||
|
|
@ -57,16 +58,16 @@ public class SalaryBillBaseSetWrapper extends Service {
|
|||
dto.setWatermarkSetting(salaryBillWatermark.getWmSetting());
|
||||
dto.setWatermark(salaryBillWatermark.getWatermarkType());
|
||||
}
|
||||
// if (Objects.nonNull(salaryBillAckFeedback)) {
|
||||
// data.put("ackStatus", salaryBillAckFeedback.getAckStatus());
|
||||
// data.put("feedbackStatus", salaryBillAckFeedback.getFeedbackStatus());
|
||||
// }
|
||||
if (Objects.nonNull(salaryBillAckFeedback)) {
|
||||
// 工资单反馈默认设置
|
||||
dto.setAckFeedbackSetting(salaryBillAckFeedback);
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存工资单水印设置
|
||||
* 保存工资单模板基础设置
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
|
|
@ -147,22 +148,10 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
// todo 目前就一个回算,那么没有冻结且是回算,就展示补发名称
|
||||
e.setTemplate(NumberUtils.INTEGER_ONE.equals(e.getSalaryAcctType()) ? optional.get().getReplenishName() : optional.get().getName());
|
||||
e.setTemplateId(optional.get().getId());
|
||||
e.setAckFeedbackStatus(optional.get().getAckFeedbackStatus() == null ? 0 : optional.get().getAckFeedbackStatus());
|
||||
}
|
||||
// e.setHaveBackCalc(NumberUtils.INTEGER_ZERO);
|
||||
});
|
||||
}
|
||||
// 薪资核算ID
|
||||
Set<Long> salaryAcctIds = SalaryEntityUtil.properties(pageList, SalarySendListDTO::getSalaryAcctId);
|
||||
// 获取是回算的薪资核算ID
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<SalaryAcctRecordPO> salaryAcctRecordPOS = getSalaryAcctRecordService(user).getBackCalcRecordByIds(salaryAcctIds);
|
||||
// Set<String> backCalcSalarySobs = SalaryEntityUtil.properties(salaryAcctRecordPOS, salaryAcctRecordPO -> salaryAcctRecordPO.getSalarySobId() + "-" + sdf.format(salaryAcctRecordPO.getSalaryMonth()));
|
||||
// // 判断是否回算过,haveBackCalc 属性
|
||||
// pageList.stream().forEach(salarySendDTO -> {
|
||||
// if (backCalcSalarySobs.contains(salarySendDTO.getSalarySobId() + "-" + sdf.format(salarySendDTO.getSalaryYearMonth()))) {
|
||||
// salarySendDTO.setHaveBackCalc(NumberUtils.INTEGER_ONE);
|
||||
// }
|
||||
// });
|
||||
List<WeaTableColumn> columns = buildWeaTableColumns();
|
||||
WeaTable table = new WeaTable();
|
||||
table.setColumns(columns);
|
||||
|
|
@ -327,7 +316,6 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
|
||||
PageInfo<SalarySendInfoListDTO> pageInfo = getSalarySendService(user).salarySendInfoListPage(queryParam);
|
||||
|
||||
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
|
@ -691,6 +679,20 @@ public class SalarySendWrapper extends Service implements SalarySendWrapperProxy
|
|||
|
||||
return PayrollCheckTypeEnum.parseByValue(conf.getConfValue());
|
||||
}
|
||||
|
||||
public void confirmSalaryBill(Long salaryInfoId) {
|
||||
if(ObjectUtil.isNull(salaryInfoId)){
|
||||
throw new SalaryRunTimeException("工资单id不能为空!");
|
||||
}
|
||||
getSalaryBillService(user).confirmSalaryBill(salaryInfoId);
|
||||
}
|
||||
|
||||
public void feedBackSalaryBill(Long salaryInfoId) {
|
||||
if(ObjectUtil.isNull(salaryInfoId)){
|
||||
throw new SalaryRunTimeException("工资单id不能为空!");
|
||||
}
|
||||
getSalaryBillService(user).feedBackSalaryBill(salaryInfoId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -159,4 +159,8 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
public void saveArchiveDelete(String setting) {
|
||||
getSalarySysConfService(user).saveArchiveDelete(setting);
|
||||
}
|
||||
|
||||
public void saveSalarySendFeedback(SalarySysConfPO param) {
|
||||
getSalarySysConfService(user).saveSalarySendFeedback(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.util.SalaryI18nUtil;
|
|||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.mzlion.core.utils.BeanUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import weaver.hrm.User;
|
||||
|
|
@ -60,6 +61,10 @@ public class SalaryTemplateWrapper extends Service {
|
|||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryBillBaseSetService getSalaryBillBaseSetService(User user) {
|
||||
return ServiceUtil.getService(SalaryBillBaseSetServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单模板列表
|
||||
*
|
||||
|
|
@ -154,6 +159,8 @@ public class SalaryTemplateWrapper extends Service {
|
|||
salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId());
|
||||
salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId());
|
||||
salaryTemplateBaseSetDTO.setAutoSendStatus(po.getAutoSendStatus() == null ? false : po.getAutoSendStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(po.getAckFeedbackStatus() == null ? false : NumberUtils.compare(po.getAckFeedbackStatus(), 1) == 0);
|
||||
salaryTemplateBaseSetDTO.setAutoAckDays(ObjectUtils.isEmpty(po.getAutoAckDays()) ? 7 : po.getAutoAckDays());
|
||||
// 规则赋值 如果为ALL传“” 如果为byRule传薪资项目ID
|
||||
salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? "" : po.getReplenishRule());
|
||||
// 规则设置赋值
|
||||
|
|
@ -182,6 +189,13 @@ public class SalaryTemplateWrapper extends Service {
|
|||
|
||||
// WeaForm salaryTemplateBase = SalaryFormatUtil.<SalaryTemplateBaseSetDTO>getInstance().buildForm(SalaryTemplateBaseSetDTO.class, SalaryTemplateBaseSetDTO.builder().salarySobOptions(salarySobOptions).sendEmailOptions(sendEmailOptions).build());
|
||||
|
||||
if(id == null){
|
||||
// 新建,获取默认的确认反馈信息
|
||||
SalaryBillAckFeedbackDTO defaultAckFeedback = getSalaryBillBaseSetService(user).getDefaultAckFeedbackSetting();
|
||||
salaryTemplateBaseSetDTO.setAckFeedbackStatus(StringUtils.equals(defaultAckFeedback.getAckStatus(),"1"));
|
||||
salaryTemplateBaseSetDTO.setAutoAckDays(defaultAckFeedback.getAutoAckDays());
|
||||
salaryTemplateBaseSetDTO.setFeedbackUrl(defaultAckFeedback.getFeedBackUrl());
|
||||
}
|
||||
Map<String, Object> salaryTemplateBase = new HashMap<>();
|
||||
salaryTemplateBase.put("data", salaryTemplateBaseSetDTO);
|
||||
salaryTemplateBase.put("salarySobOptions", salarySobOptions);
|
||||
|
|
|
|||
Loading…
Reference in New Issue