parent
31acdbb606
commit
1573abd1ee
|
|
@ -1,7 +0,0 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/salaryArchive")
|
||||
public class SalaryBillController extends com.engine.salary.web.SalaryBillController{
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.mapper.salarybill.SalarySendMapper;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
public class SalarySendBiz {
|
||||
/**
|
||||
* 根据id获取数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SalarySendPO getById(Long id) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalarySendMapper mapper = sqlSession.getMapper(SalarySendMapper.class);
|
||||
return mapper.getById(id);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
public class SalarySendInfoBiz {
|
||||
}
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
package com.engine.salary.biz;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.mapper.salarybill.SalaryTemplateMapper;
|
||||
import com.engine.salary.mapper.salarysob.SalarySobMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工资单模板
|
||||
*/
|
||||
public class SalaryTemplateBiz {
|
||||
|
||||
/**
|
||||
* 根据id获取数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SalaryTemplatePO getById(Long id) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
return mapper.getById(id);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id更新
|
||||
* @param salaryTemplateNew
|
||||
*/
|
||||
public void updateById(SalaryTemplatePO salaryTemplateNew) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
mapper.updateIgnoreNull(salaryTemplateNew);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据现有字段查询
|
||||
* @param po
|
||||
* @return
|
||||
*/
|
||||
public List<SalaryTemplatePO> listSome(SalaryTemplatePO po) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
return mapper.listSome(po);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param salaryTemplatePO
|
||||
* @return
|
||||
*/
|
||||
public void insert(SalaryTemplatePO salaryTemplatePO) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
mapper.insertIgnoreNull(salaryTemplatePO);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询工资单模板列表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public List<SalaryTemplateListDTO> list(SalaryTemplateQueryParam param) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
return mapper.list(param);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除工资单模板
|
||||
* @param ids
|
||||
*/
|
||||
public void deleteByIds(Collection<Long> ids) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
mapper.deleteByIds(ids);
|
||||
sqlSession.commit();
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认模板
|
||||
*/
|
||||
public List<SalaryTemplatePO> listDefaultTemplates(List<Long> ids) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
SalaryTemplateMapper mapper = sqlSession.getMapper(SalaryTemplateMapper.class);
|
||||
return mapper.listDefaultTemplates(ids);
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.engine.salary.constant;
|
||||
|
||||
/**
|
||||
* @Description: 二次身份认证常量
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/10 15:58
|
||||
*/
|
||||
public class SalrayCheckSecondAuthConstant {
|
||||
/**
|
||||
* token参数名
|
||||
*/
|
||||
public static final String TOKEN = "token";
|
||||
|
||||
// 错误编码============================================================================================
|
||||
/**
|
||||
* 验证失败或token过期
|
||||
*/
|
||||
public static final String CHECK_SECOND_FAIL = "checkSecondFail";
|
||||
|
||||
/**
|
||||
* 二次身份认证服务异常
|
||||
*/
|
||||
public static final String CHECK_SECOND_ERROR = "checkSecondError";
|
||||
|
||||
/**
|
||||
* token参数缺失
|
||||
*/
|
||||
public static final String CHECK_SECOND_FAIL_NO_TOKEN = "checkSecondFailNoToken";
|
||||
|
||||
// 模块编码============================================================================================
|
||||
/**
|
||||
* 模块编码
|
||||
*/
|
||||
public static final String MODULE_CODE = "HRMSALARY";
|
||||
|
||||
// 项目编码============================================================================================
|
||||
/**
|
||||
* 工资单
|
||||
*/
|
||||
public static final String SALARY_BILL = "SALARYBILL";
|
||||
|
||||
/**
|
||||
* 我的薪资福利
|
||||
*/
|
||||
public static final String SOCIAL_WlFARE_LIST = "SOCIALWlFARELIST";
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.bo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateSaveParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单
|
||||
*/
|
||||
public class SalaryTemplateBO {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SalaryTemplateBO{}";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存参数转表数据
|
||||
* @param saveParam
|
||||
* @param employeeId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
public static SalaryTemplatePO convertToPO(SalaryTemplateSaveParam saveParam, Long employeeId) {
|
||||
if (saveParam == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return SalaryTemplatePO.builder()
|
||||
.id(saveParam.getId())
|
||||
.name(saveParam.getName())
|
||||
.salarySobId(saveParam.getSalarySobId())
|
||||
.description(saveParam.getDescription())
|
||||
.emailStatus(saveParam.getEmailStatus()?1:0)
|
||||
.sendEmailId(saveParam.getEmailStatus()?saveParam.getSendEmail():0L)
|
||||
.msgStatus(saveParam.getMsgStatus()?1:0)
|
||||
.theme(saveParam.getTheme())
|
||||
.background(saveParam.getBackground())
|
||||
.textContent(saveParam.getTextContent())
|
||||
.textContentPosition(saveParam.getTextContentPosition())
|
||||
.salaryItemNullStatus(saveParam.getSalaryItemNullStatus()?1:0)
|
||||
.salaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0)
|
||||
.salaryItemSetting(JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()))
|
||||
.createTime(LocalDateTime.now())
|
||||
.updateTime(LocalDateTime.now())
|
||||
.creator(employeeId)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static List<SalaryTemplateSalaryItemSetListDTO> convertSalarySobItemAggregateToSalaryItemSet(SalarySobItemAggregateDTO salarySobItemAggregateDTO, Long currentEmployeeId) {
|
||||
List<SalaryTemplateSalaryItemSetListDTO> groups = new LinkedList<>();
|
||||
if (salarySobItemAggregateDTO!=null) {
|
||||
// 1.员工信息
|
||||
if (CollectionUtils.isNotEmpty(salarySobItemAggregateDTO.getEmpFields())) {
|
||||
List<SalaryTemplateSalaryItemListDTO> items = new LinkedList<>();
|
||||
salarySobItemAggregateDTO.getEmpFields().stream().forEach(e->{
|
||||
items.add(
|
||||
SalaryTemplateSalaryItemListDTO.builder()
|
||||
.id(String.valueOf(e.getId()))
|
||||
.salaryItemId(String.valueOf(e.getId()))
|
||||
.name(e.getFieldName())
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.build()
|
||||
);
|
||||
});
|
||||
groups.add(
|
||||
SalaryTemplateSalaryItemSetListDTO.builder()
|
||||
.groupId(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)
|
||||
.groupName("员工信息")
|
||||
.sortedIndex(-1)
|
||||
.items(items)
|
||||
.build());
|
||||
}
|
||||
// 2.普通分组
|
||||
if (CollectionUtils.isNotEmpty(salarySobItemAggregateDTO.getItemGroups())) {
|
||||
salarySobItemAggregateDTO.getItemGroups().stream().forEach(e->{
|
||||
List<SalaryTemplateSalaryItemListDTO> items = new LinkedList<>();
|
||||
e.getItems().stream().forEach(i->{
|
||||
items.add(
|
||||
SalaryTemplateSalaryItemListDTO.builder()
|
||||
.id(String.valueOf(i.getSalaryItemId()))
|
||||
.salaryItemId(String.valueOf(i.getSalaryItemId()))
|
||||
.name(i.getName())
|
||||
.sortedIndex(i.getSortedIndex())
|
||||
.build());
|
||||
});
|
||||
groups.add(
|
||||
SalaryTemplateSalaryItemSetListDTO.builder()
|
||||
.groupId(String.valueOf(e.getId()))
|
||||
.groupName(e.getName())
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.items(items)
|
||||
.build());
|
||||
});
|
||||
}
|
||||
// 3.无分类
|
||||
if (CollectionUtils.isNotEmpty(salarySobItemAggregateDTO.getItems())) {
|
||||
List<SalaryTemplateSalaryItemListDTO> items = new LinkedList<>();
|
||||
salarySobItemAggregateDTO.getItems().stream().forEach(e->{
|
||||
items.add(
|
||||
SalaryTemplateSalaryItemListDTO.builder()
|
||||
.id(String.valueOf(e.getSalaryItemId()))
|
||||
.salaryItemId(String.valueOf(e.getSalaryItemId()))
|
||||
.name(e.getName())
|
||||
.sortedIndex(e.getSortedIndex())
|
||||
.build());
|
||||
});
|
||||
groups.add(
|
||||
SalaryTemplateSalaryItemSetListDTO.builder()
|
||||
.groupId(SalaryTemplateSalaryItemSetGroupConstant.NO_TYPE_GROUP_ID)
|
||||
.groupName("无分类")
|
||||
.sortedIndex(salarySobItemAggregateDTO.getItemGroups().size())
|
||||
.items(items)
|
||||
.build());
|
||||
}
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 我的工资单
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/14 15:34
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("我的工资单")
|
||||
//@TableOperates(value = {
|
||||
// @Operates(index = 0, text = "查看", labelId = 90821)
|
||||
//}, tableType = WeaTableTypeEnum.NONE)
|
||||
public class SalaryMySalaryBillListDTO {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
// @WeaFormat(
|
||||
// label = "id",
|
||||
// tableColumn = @TableColumn(hide = "true")
|
||||
// )
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
// @WeaFormat(
|
||||
// label = "薪资所属月",
|
||||
// labelId = 87614,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM")
|
||||
private LocalDate salaryYearMonth;
|
||||
|
||||
// @ApiModelProperty("核算次数")
|
||||
private String acctTimes;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人")
|
||||
// @WeaFormat(
|
||||
// label = "个税扣缴义务人",
|
||||
// labelId = 86184,
|
||||
// tableColumn = @TableColumn(width = "40%")
|
||||
// )
|
||||
private String taxAgent;
|
||||
|
||||
// @ApiModelProperty("发放时间")
|
||||
// @WeaFormat(
|
||||
// label = "发放时间",
|
||||
// labelId = 93634,
|
||||
// tableColumn = @TableColumn(width = "40%")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.YearMonth;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放基本信息
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/14 14:02
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放基本信息")
|
||||
public class SalarySendBaseInfoDTO {
|
||||
|
||||
// @ApiModelProperty("已发送")
|
||||
private Integer sendNum;
|
||||
|
||||
// @ApiModelProperty("总数")
|
||||
private Integer sendTotal;
|
||||
|
||||
// @ApiModelProperty("工资单模板")
|
||||
private String template;
|
||||
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
private YearMonth salaryMonth;
|
||||
|
||||
// @ApiModelProperty("薪资账套的周期")
|
||||
private SalarySobCycleDTO salarySobCycle;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放信息
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-11 11:29
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放详情列表")
|
||||
public class SalarySendDetailListDTO {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
// @JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
// @JsonIgnore
|
||||
private Long employeeId;
|
||||
|
||||
/**
|
||||
* 用于发送工资单邮件
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private String email;
|
||||
|
||||
// @ApiModelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人")
|
||||
private String taxAgent;
|
||||
|
||||
// @ApiModelProperty("部门")
|
||||
private String department;
|
||||
|
||||
// @ApiModelProperty("手机号")
|
||||
private String mobile;
|
||||
|
||||
// @ApiModelProperty("工号")
|
||||
private String jobNum;
|
||||
}
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放信息列表")
|
||||
//@TableOperates(tableType = WeaTableTypeEnum.CHECKBOX)
|
||||
public class SalarySendInfoListDTO {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
private Long employeeId;
|
||||
|
||||
// @ApiModelProperty("姓名")
|
||||
// @WeaFormat(
|
||||
// label = "姓名",
|
||||
// labelId = 85429,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String username;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人")
|
||||
// @WeaFormat(
|
||||
// label = "个税扣缴义务人",
|
||||
// labelId = 86184,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String taxAgent;
|
||||
|
||||
// @ApiModelProperty("部门")
|
||||
// @WeaFormat(
|
||||
// label = "部门",
|
||||
// labelId = 86185,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String department;
|
||||
|
||||
// @ApiModelProperty("手机号")
|
||||
// @WeaFormat(
|
||||
// label = "手机号",
|
||||
// labelId = 86186,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String mobile;
|
||||
|
||||
// @ApiModelProperty("工号")
|
||||
// @WeaFormat(
|
||||
// label = "工号",
|
||||
// labelId = 86317,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String jobNum;
|
||||
|
||||
// @ApiModelProperty("发送状态")
|
||||
// @WeaFormat(
|
||||
// label = "发送状态",
|
||||
// labelId = 93242,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String sendStatus;
|
||||
|
||||
// @WeaFormat(
|
||||
// label = "操作",
|
||||
// labelId = 94303,
|
||||
// tableColumn = @TableColumn(width = "20%")
|
||||
// )
|
||||
private String operation;
|
||||
}
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SalaryTable(pageId = "a4f85287-289dff07669d7a23de0ef88d2f7129e7", operates = {
|
||||
@SalaryTableOperate(index = "0", text = "发放" ),
|
||||
@SalaryTableOperate(index = "1", text = "查看详情"),
|
||||
@SalaryTableOperate(index = "2", text = "更新模板")
|
||||
})
|
||||
public class SalarySendListDTO {
|
||||
|
||||
// 主键id
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
// @WeaFormat(
|
||||
// label = "薪资所属月",
|
||||
// labelId = 87614,
|
||||
// tableColumn = @TableColumn(width = "10%")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM")
|
||||
|
||||
// 薪资所属月
|
||||
@SalaryTableColumn(text = "薪资所属月", width = "10%", column = "salaryYearMonth")
|
||||
private LocalDate salaryYearMonth;
|
||||
|
||||
/**
|
||||
* 薪资账套id
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Long salarySobId;
|
||||
|
||||
// @ApiModelProperty("薪资账套")
|
||||
// @WeaFormat(
|
||||
// label = "薪资账套",
|
||||
// labelId = 87889,
|
||||
// tableColumn = @TableColumn(width = "35%")
|
||||
// )
|
||||
|
||||
// 薪资账套
|
||||
@SalaryTableColumn(text = "薪资账套", width = "35%", column = "username")
|
||||
private String salarySob;
|
||||
|
||||
// @ApiModelProperty("核算次数")
|
||||
// 核算次数
|
||||
private String acctTimes;
|
||||
|
||||
// @ApiModelProperty("工资单模板")
|
||||
// @WeaFormat(
|
||||
// label = "工资单模板",
|
||||
// labelId = 93214,
|
||||
// tableColumn = @TableColumn(width = "25%")
|
||||
// )
|
||||
@SalaryTableColumn(text = "工资单模板", width = "25%", column = "template")
|
||||
// 工资单模板
|
||||
private String template;
|
||||
|
||||
// @ApiModelProperty("工资单模板Id")
|
||||
// 工资单模板Id
|
||||
private Long templateId;
|
||||
|
||||
/**
|
||||
* 已发送数量
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Integer sendNum;
|
||||
|
||||
/**
|
||||
* 发送总数
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Integer sendTotal;
|
||||
|
||||
// @ApiModelProperty("已发放")
|
||||
// @WeaFormat(
|
||||
// label = "已发放",
|
||||
// labelId = 93212,
|
||||
// tableColumn = @TableColumn(width = "15%")
|
||||
// )
|
||||
// 已发放
|
||||
@SalaryTableColumn(text = "已发放", width = "15%", column = "sendSituation")
|
||||
private String sendSituation;
|
||||
|
||||
// @ApiModelProperty("最后发送时间")
|
||||
// @WeaFormat(
|
||||
// label = "最后发送时间",
|
||||
// labelId = 93213,
|
||||
// tableColumn = @TableColumn(width = "15%")
|
||||
// )
|
||||
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
// 最后发送时间
|
||||
@SalaryTableColumn(text = "最后发送时间", width = "15%", column = "lastSendTime")
|
||||
private LocalDateTime lastSendTime;
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryTemplateBaseFormDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
// 基础设置
|
||||
private Map<String, Object> salaryTemplateBaseSet;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryTemplateBaseSetDTO {
|
||||
|
||||
/* ===== 1.基础信息 ======================*/
|
||||
|
||||
// @ApiModelProperty("薪资账套")
|
||||
private Long salarySob;
|
||||
|
||||
private List<Map<String, Object>> salarySobOptions;
|
||||
|
||||
// @ApiModelProperty("工资单模板名称")
|
||||
private String name;
|
||||
|
||||
// @ApiModelProperty("备注")
|
||||
private String description;
|
||||
|
||||
/* ===== 2.发送设置 ======================*/
|
||||
|
||||
// @ApiModelProperty("邮件")
|
||||
private Boolean emailStatus;
|
||||
|
||||
// @ApiModelProperty("发送地址")
|
||||
private Long sendEmail;
|
||||
|
||||
// 邮件列表
|
||||
private List<Map<String, Object>> sendEmailOptions;
|
||||
|
||||
// @ApiModelProperty("消息中心")
|
||||
private Boolean msgStatus;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SalaryTable(pageId = "a4f85287-d36a8210dc050a5465fa852f9ecaa107", operates = {
|
||||
@SalaryTableOperate(index = "0", text = "编辑" ),
|
||||
@SalaryTableOperate(index = "1", text = "复制" ),
|
||||
@SalaryTableOperate(index = "2", text = "删除" ),
|
||||
@SalaryTableOperate(index = "3", text = "操作日志" )
|
||||
})
|
||||
public class SalaryTemplateListDTO {
|
||||
|
||||
//主键id
|
||||
@SalaryTableColumn(column = "id", display = false)
|
||||
private Long id;
|
||||
|
||||
//工资单模板名称
|
||||
@SalaryTableColumn(text = "工资单模板名称", width = "20%", column = "name")
|
||||
private String name;
|
||||
|
||||
|
||||
//所属薪资账套
|
||||
@SalaryTableColumn(text = "所属薪资账套", width = "20%", column = "salarySob")
|
||||
private String salarySob;
|
||||
|
||||
//默认使用
|
||||
@SalaryTableColumn(text = "默认使用", width = "20%", column = "useType")
|
||||
private String useType;
|
||||
|
||||
// 备注
|
||||
@SalaryTableColumn(text = "备注", width = "20%", column = "description")
|
||||
private String description;
|
||||
}
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 工资单薪资项目
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-08 14:44
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单薪资项目")
|
||||
public class SalaryTemplateSalaryItemListDTO {
|
||||
|
||||
// @ApiModelProperty("薪资账套项目id")
|
||||
private String id;
|
||||
|
||||
// @ApiModelProperty("薪资项目id")
|
||||
private String salaryItemId;
|
||||
|
||||
// @ApiModelProperty("薪资项目值")
|
||||
private String salaryItemValue;
|
||||
|
||||
// @ApiModelProperty("薪资项目名称")
|
||||
private String name;
|
||||
|
||||
// @ApiModelProperty("顺序")
|
||||
private Integer sortedIndex;
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单薪资项目设置
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单薪资项目设置")
|
||||
public class SalaryTemplateSalaryItemSetListDTO {
|
||||
|
||||
// @ApiModelProperty("组id")
|
||||
private String groupId;
|
||||
|
||||
// @ApiModelProperty("组名")
|
||||
private String groupName;
|
||||
|
||||
// @ApiModelProperty("顺序")
|
||||
private Integer sortedIndex;
|
||||
|
||||
// @ApiModelProperty("薪资项目")
|
||||
private List<SalaryTemplateSalaryItemListDTO> items;
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单显示设置表单")
|
||||
public class SalaryTemplateShowFormDTO {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("插入变量")
|
||||
private List<String> vars;
|
||||
|
||||
// @ApiModelProperty("主题及其他设置")
|
||||
private Map<String, Object> salaryTemplateShowSet;
|
||||
|
||||
// @ApiModelProperty("薪资项目设置")
|
||||
private List<SalaryTemplateSalaryItemSetListDTO> salaryTemplateSalaryItemSet;
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.dto;
|
||||
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateTextContentPositionEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-08 14:44
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("主题及其他设置")
|
||||
public class SalaryTemplateShowSetDTO {
|
||||
|
||||
// @ApiModelProperty("工资单主题")
|
||||
private String theme;
|
||||
|
||||
// @ApiModelProperty("工资单背景图")
|
||||
private String background;
|
||||
|
||||
// @ApiModelProperty("文本内容")
|
||||
private String textContent;
|
||||
|
||||
// @ApiModelProperty("文本内容位置")
|
||||
private String textContentPosition;
|
||||
|
||||
private List<Map<String, Object>> getTextContentPositionOptions () {
|
||||
return Arrays.stream(SalaryTemplateTextContentPositionEnum.values())
|
||||
.map(m->
|
||||
{
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", String.valueOf(m.getValue()));
|
||||
map.put("content", m.getDefaultLabel());
|
||||
return map;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// @ApiModelProperty("薪资项为空时不显示")
|
||||
private Boolean salaryItemNullStatus;
|
||||
|
||||
|
||||
// @ApiModelProperty("薪资项为0时不显示")
|
||||
private Boolean salaryItemZeroStatus;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 我的工资单
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放信息查询参数")
|
||||
public class SalaryBillQueryParam extends BaseQueryParam {
|
||||
|
||||
// @JsonIgnore
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("薪资所属月")
|
||||
private List<YearMonth> salaryYearMonth;
|
||||
|
||||
// @JsonIgnore
|
||||
private List<LocalDate> salaryMonth;
|
||||
|
||||
// @JsonIgnore
|
||||
private Long employeeId;
|
||||
|
||||
private String token;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.base.BaseQueryParam;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放信息查询参数")
|
||||
public class SalarySendDetailQueryParam extends BaseQueryParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
private Long salarySendId;
|
||||
|
||||
/**
|
||||
* 工资核算id
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Long salaryAccountingId;
|
||||
|
||||
// @ApiModelProperty("关键字(姓名)")
|
||||
private String keyword;
|
||||
|
||||
// @ApiModelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人的主键id")
|
||||
private Long taxAgentId;
|
||||
|
||||
// @ApiModelProperty("部门id")
|
||||
private List<Long> departmentIds;
|
||||
|
||||
// @ApiModelProperty("岗位id")
|
||||
private List<Long> positionIds;
|
||||
|
||||
// @ApiModelProperty("状态")
|
||||
private String userstatus;
|
||||
|
||||
// @ApiModelProperty("入职日期")
|
||||
private List<LocalDate> hiredate;
|
||||
|
||||
// @ApiModelProperty("合并计税")
|
||||
private Boolean mergeCountTax;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private List<Integer> sendStatuss;
|
||||
|
||||
public static String checkParam(SalarySendDetailQueryParam saveParam, Long employeeId, String tenantKey) {
|
||||
if (saveParam.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放参数
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/13 16:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放参数")
|
||||
public class SalarySendGrantParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
private Long salarySendId;
|
||||
|
||||
public static String checkParam(SalarySendGrantParam param, Long employeeId, String tenantKey) {
|
||||
if (param.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.base.BaseQueryParam;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放信息
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单发放信息查询参数")
|
||||
public class SalarySendInfoQueryParam extends BaseQueryParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
private Long salarySendId;
|
||||
|
||||
/**
|
||||
* 工资核算id
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Long salaryAccountingId;
|
||||
|
||||
// @ApiModelProperty("关键字(姓名)")
|
||||
private String keyword;
|
||||
|
||||
// @ApiModelProperty("姓名")
|
||||
private String username;
|
||||
|
||||
// @ApiModelProperty("个税扣缴义务人的主键id")
|
||||
private Long taxAgentId;
|
||||
|
||||
// @ApiModelProperty("部门id")
|
||||
private List<Long> departmentIds;
|
||||
|
||||
// @ApiModelProperty("岗位id")
|
||||
private List<Long> positionIds;
|
||||
|
||||
// @ApiModelProperty("状态")
|
||||
private String userstatus;
|
||||
|
||||
// @ApiModelProperty("入职日期")
|
||||
private List<LocalDate> hiredate;
|
||||
|
||||
// @ApiModelProperty("发送状态")
|
||||
private SalarySendStatusEnum sendStatus;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private Integer sendStatusVal;
|
||||
|
||||
/**
|
||||
* 发送状态
|
||||
*/
|
||||
// @JsonIgnore
|
||||
private List<Integer> sendStatuss;
|
||||
|
||||
public static String checkParam(SalarySendInfoQueryParam saveParam) {
|
||||
if (saveParam.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-11 11:28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalarySendQueryParam extends BaseQueryParam {
|
||||
|
||||
private List<YearMonth> salaryYearMonth;
|
||||
|
||||
@JsonIgnore
|
||||
private List<LocalDate> salaryMonth;
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @Description: 工资单撤回参数
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021/12/13 16:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单撤回参数")
|
||||
public class SalarySendWithdrawParam {
|
||||
|
||||
// @ApiModelProperty("主键id")
|
||||
private Collection<Long> ids;
|
||||
|
||||
// @ApiModelProperty("工资单发放Id")
|
||||
private Long salarySendId;
|
||||
|
||||
public static String checkParam(SalarySendWithdrawParam param, Long employeeId, String tenantKey) {
|
||||
if (param.getSalarySendId() == null) {
|
||||
throw new SalaryRunTimeException("工资单发放Id必传");
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单复制参数")
|
||||
public class SalaryTemplateCopyParam {
|
||||
|
||||
// @ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("模板名称")
|
||||
private String name;
|
||||
|
||||
public static void checkParam(SalaryTemplateCopyParam copyParam) {
|
||||
if (copyParam.getId() == null) {
|
||||
throw new SalaryRunTimeException("id必选");
|
||||
}
|
||||
if (StringUtils.isEmpty(copyParam.getName())) {
|
||||
throw new SalaryRunTimeException("模板名称必填");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板默认使用参数
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单模板默认使用参数")
|
||||
public class SalaryTemplateDefaultUseParam {
|
||||
|
||||
// @ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
public static void checkParam(SalaryTemplateDefaultUseParam copyParam) {
|
||||
if (copyParam.getId() == null) {
|
||||
throw new SalaryRunTimeException("id必传");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SalaryTemplateQueryParam extends BaseQueryParam {
|
||||
|
||||
// 主键id
|
||||
private Collection<Long> ids;
|
||||
|
||||
//薪资账套的主键id
|
||||
private Long salarySobId;
|
||||
|
||||
//工资单模板名称
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.param;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateTextContentPositionEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@ApiModel("工资单模板保存参数")
|
||||
public class SalaryTemplateSaveParam {
|
||||
|
||||
// @ApiModelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
// @ApiModelProperty("模板名称")
|
||||
private String name;
|
||||
|
||||
// @ApiModelProperty("薪资账套表的主键id")
|
||||
private Long salarySobId;
|
||||
|
||||
// @ApiModelProperty("备注")
|
||||
private String description;
|
||||
|
||||
// @ApiModelProperty("邮箱开启状态。false:关、true:开")
|
||||
private Boolean emailStatus;
|
||||
|
||||
// @ApiModelProperty("发送地址")
|
||||
private Long sendEmail;
|
||||
|
||||
// @ApiModelProperty("消息中心开启状态。false:关、true:开")
|
||||
private Boolean msgStatus;
|
||||
|
||||
// @ApiModelProperty("主题")
|
||||
private String theme;
|
||||
|
||||
// @ApiModelProperty("背景图")
|
||||
private String background;
|
||||
|
||||
// @ApiModelProperty("文本内容")
|
||||
private String textContent;
|
||||
|
||||
// @ApiModelProperty("文本内容位置。1:薪资项目前、2:薪资项目后")
|
||||
private Integer textContentPosition;
|
||||
|
||||
// @ApiModelProperty("薪资项为空时不显示开启状态。false:关、true:开")
|
||||
private Boolean salaryItemNullStatus;
|
||||
|
||||
// @ApiModelProperty("薪资项为0时不显示开启状态。false:关、true:开")
|
||||
private Boolean salaryItemZeroStatus;
|
||||
|
||||
// @ApiModelProperty("薪资项目设置")
|
||||
private List<SalaryTemplateSalaryItemSetListDTO> salaryItemSetting;
|
||||
|
||||
public static void checkParam(SalaryTemplateSaveParam saveParam) {
|
||||
if (saveParam.getSalarySobId() == null) {
|
||||
throw new SalaryRunTimeException("薪资账套表的主键id必传");
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(saveParam.getName())) {
|
||||
throw new SalaryRunTimeException("工资单模板名称必填");
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(saveParam.getTheme())) {
|
||||
throw new SalaryRunTimeException("工资单主题必填");
|
||||
}
|
||||
|
||||
if (saveParam.getEmailStatus() && saveParam.getSendEmail() == null) {
|
||||
throw new SalaryRunTimeException("开启邮箱后,发送地址必选");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(saveParam.getTextContent()) && saveParam.getTextContentPosition() == null) {
|
||||
throw new SalaryRunTimeException("文本内容不为空时,文本内容位置必选");
|
||||
}
|
||||
|
||||
if (saveParam.getTextContentPosition() !=null && saveParam.getTextContentPosition().equals(SalaryTemplateTextContentPositionEnum.BEFORE.getValue()) && saveParam.getTextContentPosition().equals(SalaryTemplateTextContentPositionEnum.AFTER.getValue())) {
|
||||
throw new SalaryRunTimeException("文本内容位置参数不对");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@TableName("hrsa_salary_send")
|
||||
//@ElogTransform(name = "工资单发放表")
|
||||
public class SalarySendPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
// @ElogTransform(name = "主键id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
// @ElogTransform(name = "薪资所属月")
|
||||
private LocalDate 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 LocalDateTime lastSendTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
// @ElogTransform(name = "创建人", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
// @ElogTransform(name = "创建时间", ignore = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
// @ElogTransform(name = "更新时间", ignore = true)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 是否已删除。0:未删除、1:已删除
|
||||
*/
|
||||
// @ElogTransform(name = "是否已删除。0:未删除、1:已删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
// @ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
}
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
package com.engine.salary.entity.salaryBill.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-08 14:44
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//@TableName("hrsa_salary_template")
|
||||
//@ElogTransform(name = "工资单模板表")
|
||||
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 = "创建时间", ignore = true)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
// @ElogTransform(name = "更新时间", ignore = true)
|
||||
private LocalDateTime 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;
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
package com.engine.salary.mapper.salarybill;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalarySendListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-11 11:28
|
||||
*/
|
||||
@Mapper
|
||||
public interface SalarySendMapper {
|
||||
|
||||
/**
|
||||
* 查询工资单发放列表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<SalarySendListDTO> list(@Param("param") SalarySendQueryParam param);
|
||||
|
||||
/**
|
||||
* 分页查询工资单发放列表
|
||||
* @param page
|
||||
* @param param
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// IPage<SalarySendListDTO> list(Page<SalarySendListDTO> page, @Param("param") SalarySendQueryParam param, @Param("tenantKey") String tenantKey);
|
||||
|
||||
/**
|
||||
* 根据主键id获取工资单发放
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SalarySendPO getById(@Param("id") Long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.weaver.hrm.salary.dao.SalarySendMapper">
|
||||
|
||||
<sql id="salarySendColumn">
|
||||
t1.id,
|
||||
t2.salary_month AS salaryYearMonth,
|
||||
t3.name AS salarySob,
|
||||
t3.id AS salarySobId,
|
||||
t1.send_num,
|
||||
t1.send_total,
|
||||
t1.last_send_time,
|
||||
t2.acct_times
|
||||
</sql>
|
||||
|
||||
<sql id="paramSql">
|
||||
<!-- 薪资所属月 -->
|
||||
<if test="param.salaryMonth != null">
|
||||
<if test="param.salaryMonth.size() == 1">
|
||||
AND t2.salary_month = #{param.salaryMonth[0]}
|
||||
</if>
|
||||
<if test="param.salaryMonth.size() == 2">
|
||||
AND (t2.salary_month BETWEEN #{param.salaryMonth[0]} AND #{param.salaryMonth[1]})
|
||||
</if>
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.weaver.hrm.salary.entity.salarybill.dto.SalarySendListDTO">
|
||||
SELECT
|
||||
<include refid="salarySendColumn"/>
|
||||
FROM
|
||||
hrsa_salary_send t1
|
||||
LEFT JOIN hrsa_salary_acct_record t2 ON t2.id = t1.salary_accounting_id
|
||||
LEFT JOIN hrsa_salary_sob t3 ON t3.id = t2.salary_sob_id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.id DESC
|
||||
</select>
|
||||
|
||||
<select id="getById" resultType="com.weaver.hrm.salary.entity.salarybill.po.SalarySendPO">
|
||||
SELECT
|
||||
id,
|
||||
salary_month,
|
||||
salary_accounting_id,
|
||||
salary_sob_id,
|
||||
send_num,
|
||||
send_total,
|
||||
last_send_time
|
||||
FROM hrsa_salary_send
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
package com.engine.salary.mapper.salarybill;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板设置
|
||||
*/
|
||||
@Mapper
|
||||
public interface SalaryTemplateMapper {
|
||||
/**
|
||||
* 查询工资单模板列表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplateListDTO> list(@Param("param") SalaryTemplateQueryParam param);
|
||||
|
||||
/**
|
||||
* 分页查询工资单模板列表
|
||||
* @param page
|
||||
* @param param
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// IPage<SalaryTemplateListDTO> list(Page<SalaryTemplateListDTO> page, @Param("param") SalaryTemplateQueryParam param, @Param("tenantKey") String tenantKey);
|
||||
|
||||
/**
|
||||
* 根据主键id获取工资单模板
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SalaryTemplatePO getById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量删除工资单模板
|
||||
* @param ids
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据id更新数据
|
||||
* @param salaryTemplateNew
|
||||
*/
|
||||
void updateIgnoreNull(SalaryTemplatePO salaryTemplateNew);
|
||||
|
||||
/**
|
||||
* 根据现有字段查询
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplatePO> listSome(@Param("param") SalaryTemplatePO params);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param salaryTemplatePO
|
||||
*/
|
||||
void insertIgnoreNull(SalaryTemplatePO salaryTemplatePO);
|
||||
|
||||
/**
|
||||
* 查询默认模板
|
||||
*/
|
||||
List<SalaryTemplatePO> listDefaultTemplates(List<Long> ids);
|
||||
}
|
||||
|
|
@ -1,569 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.salary.mapper.salarybill.SalaryTemplateMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="salary_sob_id" property="salarySobId"/>
|
||||
<result column="use_type" property="useType"/>
|
||||
<result column="description" property="description"/>
|
||||
<result column="email_status" property="emailStatus"/>
|
||||
<result column="send_email_id" property="sendEmailId"/>
|
||||
<result column="msg_status" property="msgStatus"/>
|
||||
<result column="theme" property="theme"/>
|
||||
<result column="background" property="background"/>
|
||||
<result column="text_content" property="textContent"/>
|
||||
<result column="text_content_position" property="textContentPosition"/>
|
||||
<result column="salary_item_null_status" property="salaryItemNullStatus"/>
|
||||
<result column="salary_item_setting" property="salaryItemSetting"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.name
|
||||
, t.salary_sob_id
|
||||
, t.use_type
|
||||
, t.description
|
||||
, t.email_status
|
||||
, t.send_email_id
|
||||
, t.msg_status
|
||||
, t.theme
|
||||
, t.background
|
||||
, t.text_content
|
||||
, t.text_content_position
|
||||
, t.salary_item_null_status
|
||||
, t.salary_item_setting
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_item t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_salary_template t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO">
|
||||
SELECT
|
||||
<include refid="baseColumns" />
|
||||
FROM hrsa_salary_template t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null and id != ''">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
AND name = #{name}
|
||||
</if>
|
||||
<if test="salarySobId != null and salarySobId != ''">
|
||||
AND salary_sob_id = #{salarySobId}
|
||||
</if>
|
||||
<if test="useType != null and useType != ''">
|
||||
AND use_type = #{useType}
|
||||
</if>
|
||||
<if test="description != null and description != ''">
|
||||
AND description = #{description}
|
||||
</if>
|
||||
<if test="emailStatus != null and emailStatus != ''">
|
||||
AND email_status = #{emailStatus}
|
||||
</if>
|
||||
<if test="sendEmailId != null and sendEmailId != ''">
|
||||
AND send_email_id = #{sendEmailId}
|
||||
</if>
|
||||
<if test="msgStatus != null and msgStatus != ''">
|
||||
AND msg_status = #{msgStatus}
|
||||
</if>
|
||||
<if test="pattern != null and pattern != ''">
|
||||
AND pattern = #{pattern}
|
||||
</if>
|
||||
<if test="theme != null and theme != ''">
|
||||
AND theme = #{theme}
|
||||
</if>
|
||||
<if test="background != null and background != ''">
|
||||
AND background = #{background}
|
||||
</if>
|
||||
<if test="textContent != null and textContent != ''">
|
||||
AND text_content = #{textContent}
|
||||
</if>
|
||||
<if test="textContentPosition != null and textContentPosition != ''">
|
||||
AND text_content_position = #{textContentPosition}
|
||||
</if>
|
||||
<if test="salaryItemNullStatus != null and salaryItemNullStatus != ''">
|
||||
AND salary_item_null_status = #{salaryItemNullStatus}
|
||||
</if>
|
||||
<if test="salaryItemZeroStatus != null and salaryItemZeroStatus != ''">
|
||||
AND salary_item_zero_status = #{salaryItemZeroStatus}
|
||||
</if>
|
||||
|
||||
<if test="salaryItemSetting != null and salaryItemSetting != ''">
|
||||
AND salary_item_setting = #{salaryItemSetting}
|
||||
</if>
|
||||
<if test="createTime != null and createTime != ''">
|
||||
AND createTime = #{createTime}
|
||||
</if>
|
||||
<if test="updateTime != null and updateTime != ''">
|
||||
AND update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null and deleteType != ''">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
<!-- 插入不为NULL的字段 -->
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.salaryBill.po.SalaryTemplatePO"
|
||||
keyProperty="id" keyColumn="id" useGeneratedKeys="true"
|
||||
>
|
||||
INSERT INTO hrsa_salary_item
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id,
|
||||
</if>
|
||||
<if test="useType != null">
|
||||
use_type,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="emailStatus != null">
|
||||
email_status,
|
||||
</if>
|
||||
<if test="sendEmailId != null">
|
||||
send_email_id,
|
||||
</if>
|
||||
<if test="msgStatus != null">
|
||||
msg_status,
|
||||
</if>
|
||||
<if test="theme != null">
|
||||
theme,
|
||||
</if>
|
||||
<if test="background != null">
|
||||
background,
|
||||
</if>
|
||||
<if test="textContent != null">
|
||||
text_content,
|
||||
</if>
|
||||
<if test="textContentPosition != null">
|
||||
text_content_position,
|
||||
</if>
|
||||
<if test="salaryItemNullStatus != null">
|
||||
salary_item_null_status,
|
||||
</if>
|
||||
<if test="salaryItemZeroStatus != null">
|
||||
salary_item_zero_status,
|
||||
</if>
|
||||
<if test="salaryItemSetting != null">
|
||||
salary_item_setting,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name},
|
||||
</if>
|
||||
<if test="code != null">
|
||||
#{code},
|
||||
</if>
|
||||
<if test="systemType != null">
|
||||
#{systemType},
|
||||
</if>
|
||||
<if test="sysSalaryItemId != null">
|
||||
#{sysSalaryItemId},
|
||||
</if>
|
||||
<if test="useDefault != null">
|
||||
#{useDefault},
|
||||
</if>
|
||||
<if test="useInEmployeeSalary != null">
|
||||
#{useInEmployeeSalary},
|
||||
</if>
|
||||
<if test="roundingMode != null">
|
||||
#{roundingMode},
|
||||
</if>
|
||||
<if test="pattern != null">
|
||||
#{pattern},
|
||||
</if>
|
||||
<if test="valueType != null">
|
||||
#{valueType},
|
||||
</if>
|
||||
<if test="formulaId != null">
|
||||
#{formulaId},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description},
|
||||
</if>
|
||||
<if test="canEdit != null">
|
||||
#{canEdit},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryitem.po.SalaryItemPO">
|
||||
UPDATE hrsa_salary_template
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name=#{name},
|
||||
</if>
|
||||
<if test="salarySobId != null">
|
||||
salary_sob_id=#{salarySobId},
|
||||
</if>
|
||||
<if test="useType != null">
|
||||
use_type=#{useType},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description=#{description},
|
||||
</if>
|
||||
<if test="emailStatus != null">
|
||||
email_status=#{emailStatus},
|
||||
</if>
|
||||
<if test="sendEmailId != null">
|
||||
send_email_id=#{sendEmailId},
|
||||
</if>
|
||||
<if test="msgStatus != null">
|
||||
msg_status=#{msgStatus},
|
||||
</if>
|
||||
<if test="theme != null">
|
||||
theme=#{theme},
|
||||
</if>
|
||||
<if test="background != null">
|
||||
background=#{background},
|
||||
</if>
|
||||
<if test="background != null">
|
||||
background=#{background},
|
||||
</if>
|
||||
<if test="textContent != null">
|
||||
text_content=#{textContent},
|
||||
</if>
|
||||
<if test="textContentPosition != null">
|
||||
text_content_position=#{textContentPosition},
|
||||
</if>
|
||||
<if test="salaryItemNullStatus != null">
|
||||
salary_item_null_status=#{salaryItemNullStatus},
|
||||
</if>
|
||||
<if test="salaryItemSetting != null">
|
||||
salary_item_setting=#{salaryItemSetting},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete" parameterType="com.engine.salary.entity.salaryitem.po.SalaryItemPO">
|
||||
UPDATE hrsa_salary_item
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
INSERT INTO hrsa_salary_item
|
||||
( name, code, system_type, sys_salary_item_id, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key, data_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey}, #{item.dataType})
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="oracle">
|
||||
INSERT INTO hrsa_salary_item
|
||||
(name, code, system_type, sys_salary_item_id, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key, data_type)
|
||||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select #{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey, #{item.dataType}} from dual
|
||||
</foreach>
|
||||
</insert>
|
||||
<insert id="batchInsert" databaseId="sqlserver">
|
||||
INSERT INTO hrsa_salary_item
|
||||
(name, code, system_type, sys_salary_item_id, use_default, use_in_employee_salary,
|
||||
rounding_mode, pattern, value_type, formula_id, description, can_edit, create_time,
|
||||
update_time, creator, delete_type, tenant_key, data_type)
|
||||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(#{item.name}, #{item.code}, #{item.systemType}, #{item.sysSalaryItemId},
|
||||
#{item.useDefault}, #{item.useInEmployeeSalary}, #{item.roundingMode},
|
||||
#{item.pattern},
|
||||
#{item.valueType}, #{item.formulaId}, #{item.description}, #{item.canEdit},
|
||||
#{item.createTime}, #{item.updateTime}, #{item.creator}, 0, #{item.tenantKey}, #{item.dataType})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE hrsa_salary_item
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="listByParam" resultType="com.engine.salary.entity.salaryitem.po.SalaryItemPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM
|
||||
hrsa_salary_item t
|
||||
WHERE
|
||||
delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
</select>
|
||||
|
||||
<sql id="paramSql">
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND name like CONCAT('%',#{param.name},'%')
|
||||
</if>
|
||||
<if test="param.description != null and param.description != ''">
|
||||
AND description like CONCAT('%',#{param.description},'%')
|
||||
</if>
|
||||
<if test="param.excludeIds != null and param.excludeIds.size()>0">
|
||||
AND id NOT IN
|
||||
<foreach collection="param.excludeIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
<if test="param.useDefault != null">
|
||||
AND use_default = #{param.useDefault}
|
||||
</if>
|
||||
<if test="param.valueType != null">
|
||||
AND value_type = #{param.valueType}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="paramSql" databaseId="oracle">
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND name like '%'||#{param.name}||'%'
|
||||
</if>
|
||||
<if test="param.description != null">
|
||||
AND description like '%'||#{param.description}||'%'
|
||||
</if>
|
||||
<if test="param.excludeIds != null and param.excludeIds.size()>0">
|
||||
AND id NOT IN
|
||||
<foreach collection="param.excludeIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
<if test="param.useDefault != null">
|
||||
AND use_default = #{param.useDefault}
|
||||
</if>
|
||||
<if test="param.valueType != null">
|
||||
AND value_type = #{param.valueType}
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="paramSql" databaseId="sqlserver">
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND name like '%'+#{param.name}+'%'
|
||||
</if>
|
||||
<if test="param.description != null and param.description != ''">
|
||||
AND description like '%'+#{param.description}+'%'
|
||||
</if>
|
||||
<if test="param.excludeIds != null and param.excludeIds.size()>0">
|
||||
AND id NOT IN
|
||||
<foreach collection="param.excludeIds" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.useInEmployeeSalary != null">
|
||||
AND use_in_employee_salary = #{param.useInEmployeeSalary}
|
||||
</if>
|
||||
<if test="param.useDefault != null">
|
||||
AND use_default = #{param.useDefault}
|
||||
</if>
|
||||
<if test="param.valueType != null">
|
||||
AND value_type = #{param.valueType}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.weaver.hrm.salary.entity.salarybill.dto.SalaryTemplateListDTO">
|
||||
SELECT
|
||||
<include refid="salaryTemplateColumn"/>
|
||||
FROM
|
||||
hrsa_salary_template t1
|
||||
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
<include refid="paramSql"/>
|
||||
ORDER BY t1.salary_sob_id,t1.id DESC
|
||||
</select>
|
||||
<select id="list" resultType="com.weaver.hrm.salary.entity.salarybill.dto.SalaryTemplateListDTO" databaseId="oracle">
|
||||
SELECT
|
||||
|
||||
t1.id,
|
||||
t1.name,
|
||||
t2.name AS salary_sob,
|
||||
t1.use_type,
|
||||
t1.description
|
||||
|
||||
FROM
|
||||
hrsa_salary_template t1
|
||||
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND t1.name like '%'||#{param.name}||'%'
|
||||
</if>
|
||||
|
||||
<if test="param.salarySobId != null">
|
||||
AND t1.salary_sob_id = #{param.salarySobId}
|
||||
</if>
|
||||
|
||||
ORDER BY t1.salary_sob_id,t1.id DESC
|
||||
</select>
|
||||
<select id="list" resultType="com.weaver.hrm.salary.entity.salarybill.dto.SalaryTemplateListDTO" databaseId="sqlserver">
|
||||
SELECT
|
||||
|
||||
t1.id,
|
||||
t1.name,
|
||||
t2.name AS salary_sob,
|
||||
t1.use_type,
|
||||
t1.description
|
||||
|
||||
FROM
|
||||
hrsa_salary_template t1
|
||||
LEFT JOIN hrsa_salary_sob t2 ON t1.salary_sob_id = t2.id
|
||||
WHERE
|
||||
t1.delete_type = 0
|
||||
AND t2.delete_type = 0
|
||||
|
||||
<if test="param.ids != null and param.ids.size()>0">
|
||||
AND t1.id IN
|
||||
<foreach collection="param.ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<if test="param.name != null and param.name != ''">
|
||||
AND t1.name like '%'+#{param.name}+'%'
|
||||
</if>
|
||||
|
||||
<if test="param.salarySobId != null">
|
||||
AND t1.salary_sob_id = #{param.salarySobId}
|
||||
</if>
|
||||
|
||||
ORDER BY t1.salary_sob_id,t1.id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE hrsa_salary_template
|
||||
SET delete_type = 1
|
||||
WHERE tenant_key = #{tenantKey} AND delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="listDefaultTemplates" resultMap="BaseResultMap" >
|
||||
SELECT
|
||||
<include refid="salaryTemplateColumn"/>
|
||||
FROM
|
||||
hrsa_salary_template t1
|
||||
WHERE
|
||||
t1.delete_type = 0 AND
|
||||
t1.use_type = 1 AND
|
||||
t1.salary_sob_id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
ORDER BY t1.salary_sob_id,t1.id DESC
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendDetailQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendGrantParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendInfoQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendWithdrawParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
*/
|
||||
public interface SalarySendService {
|
||||
|
||||
/**
|
||||
* 获取单个工资单发放
|
||||
*
|
||||
* @param salarySendId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
SalarySendPO getById(Long salarySendId, String tenantKey);
|
||||
|
||||
List<Long> findReAccountingIdsByAcctIds(List<Long> salaryAccountingIds, String tenantKey);
|
||||
|
||||
/**
|
||||
* 薪资核算-归档生成工资单
|
||||
* @param salaryAccountingId
|
||||
* @param currentTenantKey
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> generateSalaryBill(Long salaryAccountingId, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
/**
|
||||
* 薪资核算-归档撤销工资单
|
||||
* @param salaryAccountingId
|
||||
* @param currentTenantKey
|
||||
* @return
|
||||
*/
|
||||
void revokeSalaryBill(Long salaryAccountingId, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
/**
|
||||
* 工资单发放列表(分页)
|
||||
*
|
||||
* @param page
|
||||
* @param queryParam
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// Page<SalarySendListDTO> listPage(Page<SalarySendListDTO> page, SalarySendQueryParam queryParam, String tenantKey);
|
||||
|
||||
/**
|
||||
* 工资单发放
|
||||
* @param queryParam
|
||||
* @param currentEmployeeId
|
||||
* @param currentTenantKey
|
||||
* @return
|
||||
*/
|
||||
String grant(SalarySendGrantParam queryParam, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
/**
|
||||
* 工资单撤回
|
||||
* @param queryParam
|
||||
* @param currentEmployeeId
|
||||
* @param currentTenantKey
|
||||
* @return
|
||||
*/
|
||||
String withdraw(SalarySendWithdrawParam queryParam, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
/**
|
||||
* 工资单发放基本信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SalarySendBaseInfoDTO getBaseInfo(Long id);
|
||||
|
||||
/**
|
||||
* 我的工资单
|
||||
* @param salaryInfoId
|
||||
* @param currentEmployeeId
|
||||
* @param currentTenantKey
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> mySalaryBill(Long salaryInfoId, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
|
||||
/**
|
||||
* 工资单发放信息列表(分页)
|
||||
* @param page
|
||||
* @param queryParam
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// Page<SalarySendInfoListDTO> salarySendInfoListPage(Page<SalarySendInfoListDTO> page, SalarySendInfoQueryParam queryParam, String tenantKey);
|
||||
|
||||
/**
|
||||
* 我的工资单列表详情
|
||||
*
|
||||
* @param page
|
||||
* @param queryParam
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// Page<SalaryMySalaryBillListDTO> mySalaryBillListPage(Page<SalaryMySalaryBillListDTO> page, SalaryBillQueryParam queryParam, String tenantKey);
|
||||
|
||||
/**
|
||||
* 工资单发放详情列表
|
||||
* @param page
|
||||
* @param queryParam
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
// Page<SalarySendDetailListDTO> salarySendInfoDetailListPage(Page<SalarySendDetailListDTO> page, SalarySendDetailQueryParam queryParam, String tenantKey);
|
||||
|
||||
/**
|
||||
* 获取薪资项目设置
|
||||
*
|
||||
* @param salaryTemplatePO
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplateSalaryItemListDTO> getSalaryItemsSetting(SalaryTemplatePO salaryTemplatePO, String tenantKey);
|
||||
|
||||
/**
|
||||
* 构建详情列表
|
||||
*
|
||||
* @param salaryItems
|
||||
* @param records
|
||||
* @param salaryAccountingId
|
||||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> buildDetailList(List<SalaryTemplateSalaryItemListDTO> salaryItems, List<SalarySendDetailListDTO> records, Long salaryAccountingId, String tenantKey);
|
||||
|
||||
/**
|
||||
* 导出-工资单发放详情列表
|
||||
*
|
||||
* @param map
|
||||
* @param username
|
||||
* @param eteamsId
|
||||
* @param queryParam
|
||||
* @param currentEmployeeId
|
||||
* @param currentTenantKey
|
||||
*/
|
||||
void exportInfoList(Map<String, Object> map, String username, String eteamsId, SalarySendInfoQueryParam queryParam, Long currentEmployeeId, String currentTenantKey);
|
||||
|
||||
/**
|
||||
* 导出-工资单发放详情列表
|
||||
* @param map
|
||||
* @param username
|
||||
* @param eteamsId
|
||||
* @param salarySend
|
||||
* @param queryParam
|
||||
* @param currentEmployeeId
|
||||
* @param currentTenantKey
|
||||
*/
|
||||
void exportDetailList(Map<String, Object> map, String username, String eteamsId, SalarySendPO salarySend, SalarySendDetailQueryParam queryParam, Long currentEmployeeId, String currentTenantKey);
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateCopyParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateDefaultUseParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateSaveParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-08 14:44
|
||||
*/
|
||||
public interface SalaryTemplateService {
|
||||
|
||||
/**
|
||||
* 获取单个工资单模板记录
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
SalaryTemplatePO getById(Long id);
|
||||
|
||||
/**
|
||||
* 工资单模板列表(分页)
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
// Map<String, Object> listPage(SalaryTemplateQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 默认使用
|
||||
*
|
||||
* @param defaultUseParamy
|
||||
* @return
|
||||
*/
|
||||
String defaultUse(SalaryTemplateDefaultUseParam defaultUseParamy);
|
||||
|
||||
/**
|
||||
* 新建工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
String save(SalaryTemplateSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 编辑工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
String update(SalaryTemplateSaveParam saveParam);
|
||||
|
||||
/**
|
||||
* 复制工资单模板
|
||||
*
|
||||
* @param copyParam
|
||||
* @return
|
||||
*/
|
||||
String copy(SalaryTemplateCopyParam copyParam);
|
||||
|
||||
/**
|
||||
* 删除工资单模板
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
String delete(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获取薪资账套下拉列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> selectSalarySobList();
|
||||
|
||||
/**
|
||||
* 获取薪资项目设置
|
||||
*
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplateSalaryItemSetListDTO> getSalaryItemSet(Long salarySobId);
|
||||
|
||||
/**
|
||||
* 获取默认工资单模板
|
||||
*
|
||||
* @param salarySobIds
|
||||
* @return
|
||||
*/
|
||||
List<SalaryTemplatePO> getDefaultTemplates(List<Long> salarySobIds);
|
||||
}
|
||||
|
|
@ -1,916 +0,0 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64Encoder;
|
||||
import cn.weaver.ecology.framework.rpc.annotation.RpcReference;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySendBiz;
|
||||
import com.engine.salary.biz.SalarySendInfoBiz;
|
||||
import com.engine.salary.biz.SalarySobBiz;
|
||||
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalarySendBaseInfoDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalarySendListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
|
||||
import com.engine.salary.service.SalaryAcctRecordService;
|
||||
import com.engine.salary.service.SalarySendService;
|
||||
import com.engine.salary.service.SalaryTemplateService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-11 11:28
|
||||
*/
|
||||
public class SalarySendServiceImpl extends Service implements SalarySendService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SalarySendServiceImpl.class);
|
||||
|
||||
private SalarySendBiz mapper = new SalarySendBiz();
|
||||
private SalarySendInfoBiz salarySendInfoMapper = new SalarySendInfoBiz();
|
||||
|
||||
|
||||
private SalaryTemplateService getSalaryTemplateService(User user) {
|
||||
return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobBiz salarySobMapper = new SalarySobBiz();
|
||||
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
@Resource
|
||||
private SalaryAcctRecordMapper salaryAcctRecordMapper;
|
||||
@Resource
|
||||
private SalaryAcctEmployeeMapper salaryAcctEmployeeMapper;
|
||||
@Resource
|
||||
private SalaryAcctResultMapper salaryAcctResultMapper;
|
||||
@Resource
|
||||
private TaxAgentService taxAgentService;
|
||||
@RpcReference
|
||||
private FileDownloadClient fileDownloadClient;
|
||||
/**
|
||||
* 同步用RpcReference
|
||||
*/
|
||||
@RpcReference
|
||||
private SystemMessageRest systemMessageRest;
|
||||
/**
|
||||
* 异步用Autowired
|
||||
*/
|
||||
@Autowired
|
||||
private AsyncSystemMessageRest asyncSystemMessageRest;
|
||||
@RpcReference
|
||||
private MailBaseService mailBaseService;
|
||||
@Resource
|
||||
private SalaryBatchService salaryBatchService;
|
||||
@Autowired
|
||||
private LoggerTemplate salarySendLoggerTemplate;
|
||||
@Autowired
|
||||
private HrmCommonEmployeeService hrmCommonEmployeeService;
|
||||
@Autowired
|
||||
private ExecutorService taskExecutor;
|
||||
|
||||
@Override
|
||||
public SalarySendPO getById(Long salarySendId, String tenantKey) {
|
||||
return mapper.getById(salarySendId, tenantKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> findReAccountingIdsByAcctIds(List<Long> salaryAccountingIds, String tenantKey) {
|
||||
// 校验salaryAccountingId
|
||||
if (CollectionUtils.isEmpty(salaryAccountingIds)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, UserContext.getCurrentEmployeeId(), 100497, "核算id必传"));
|
||||
}
|
||||
|
||||
List<SalarySendPO> salarySends = new LambdaQueryChainWrapper<>(mapper)
|
||||
.eq(SalarySendPO::getDeleteType, 0)
|
||||
.eq(SalarySendPO::getTenantKey, tenantKey)
|
||||
.eq(SalarySendPO::getSendNum, 0)
|
||||
.in(SalarySendPO::getSalaryAccountingId, salaryAccountingIds)
|
||||
.list();
|
||||
|
||||
return salarySends.stream().map(SalarySendPO::getSalaryAccountingId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public WeaResult<Boolean> generateSalaryBill(Long salaryAccountingId, Long currentEmployeeId, String currentTenantKey) {
|
||||
// 校验salaryAccountingId
|
||||
if (salaryAccountingId == null) {
|
||||
return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100497, "核算id必传"));
|
||||
}
|
||||
|
||||
List<SalaryAcctRecordPO> acctRecords = new LambdaQueryChainWrapper<>(salaryAcctRecordMapper)
|
||||
.eq(SalaryAcctRecordPO::getDeleteType, 0)
|
||||
.eq(SalaryAcctRecordPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalaryAcctRecordPO::getId, salaryAccountingId)
|
||||
.eq(SalaryAcctRecordPO::getStatus, SalaryAcctRecordStatusEnum.ARCHIVED.getValue()).list();
|
||||
// 检查核算的归档记录
|
||||
if (CollectionUtils.isEmpty(acctRecords)) {
|
||||
return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100498, "核算记录不存在"));
|
||||
}
|
||||
|
||||
List<SalarySendPO> salarySends = new LambdaQueryChainWrapper<>(mapper)
|
||||
.eq(SalarySendPO::getDeleteType, 0)
|
||||
.eq(SalarySendPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendPO::getSalaryAccountingId, salaryAccountingId).list();
|
||||
if (CollectionUtils.isNotEmpty(salarySends)) {
|
||||
return WeaResult.fail(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100499, "工资单已生成过,不可再重复生成"));
|
||||
}
|
||||
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = new LambdaQueryChainWrapper<>(salaryAcctEmployeeMapper)
|
||||
.eq(SalaryAcctEmployeePO::getDeleteType, 0)
|
||||
.eq(SalaryAcctEmployeePO::getTenantKey, currentTenantKey)
|
||||
.eq(SalaryAcctEmployeePO::getSalaryAcctRecordId, salaryAccountingId).list();
|
||||
|
||||
Long salarySendId = IdGenerator.generate();
|
||||
|
||||
SalaryAcctRecordPO salaryAcctRecord = acctRecords.get(0);
|
||||
|
||||
List<SalarySendInfoPO> salarySendInfos = org.apache.commons.collections4.CollectionUtils.emptyIfNull(salaryAcctEmployees).stream().map(m ->
|
||||
SalarySendInfoPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.salarySendId(salarySendId)
|
||||
.employeeId(m.getEmployeeId())
|
||||
.salaryMonth(m.getSalaryMonth())
|
||||
.taxAgentId(m.getTaxAgentId())
|
||||
.salaryAcctRecordId(m.getSalaryAcctRecordId())
|
||||
.sendStatus(SalarySendStatusEnum.UNSEND.getValue())
|
||||
.salaryTemplate("")
|
||||
.creator(currentEmployeeId)
|
||||
.createTime(LocalDateTime.now())
|
||||
.updateTime(LocalDateTime.now())
|
||||
.tenantKey(currentTenantKey)
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
SalarySendPO salarySend = SalarySendPO.builder()
|
||||
.id(salarySendId)
|
||||
.salaryMonth(salaryAcctRecord.getSalaryMonth())
|
||||
.salaryAccountingId(salaryAccountingId)
|
||||
.salarySobId(salaryAcctRecord.getSalarySobId())
|
||||
.sendNum(0)
|
||||
.sendTotal(salarySendInfos.size())
|
||||
.lastSendTime(LocalDateTime.now())
|
||||
.creator(currentEmployeeId)
|
||||
.createTime(LocalDateTime.now())
|
||||
.updateTime(LocalDateTime.now())
|
||||
.tenantKey(currentTenantKey)
|
||||
.build();
|
||||
// 插入工资单发放记录
|
||||
mapper.insert(salarySend);
|
||||
// 插入工资单人员记录
|
||||
salarySendInfoMapper.batchInsert(salarySendInfos, currentTenantKey);
|
||||
|
||||
return WeaResult.success(Boolean.TRUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void revokeSalaryBill(Long salaryAccountingId, Long currentEmployeeId, String currentTenantKey) {
|
||||
// 校验salaryAccountingId
|
||||
if (salaryAccountingId == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100497, "核算id必传"));
|
||||
}
|
||||
|
||||
List<SalaryAcctRecordPO> acctRecords = new LambdaQueryChainWrapper<>(salaryAcctRecordMapper)
|
||||
.eq(SalaryAcctRecordPO::getDeleteType, 0)
|
||||
.eq(SalaryAcctRecordPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalaryAcctRecordPO::getId, salaryAccountingId)
|
||||
.list();
|
||||
// 检查核算的归档记录
|
||||
if (CollectionUtils.isEmpty(acctRecords)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100498, "核算记录不存在"));
|
||||
}
|
||||
|
||||
List<SalarySendPO> salarySends = new LambdaQueryChainWrapper<>(mapper)
|
||||
.eq(SalarySendPO::getDeleteType, 0)
|
||||
.eq(SalarySendPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendPO::getSalaryAccountingId, salaryAccountingId).list();
|
||||
if (CollectionUtils.isEmpty(salarySends)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100505, "工资单不存在"));
|
||||
}
|
||||
|
||||
SalarySendPO salarySend = salarySends.get(0);
|
||||
// 已发送工资单
|
||||
List<SalarySendInfoPO> salarySendInfos = new LambdaQueryChainWrapper<>(salarySendInfoMapper)
|
||||
.eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
.eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendInfoPO::getSalarySendId, salarySend.getId())
|
||||
.eq(SalarySendInfoPO::getSendStatus, SalarySendStatusEnum.ALREADYSEND.getValue()).list();
|
||||
if (salarySend.getSendNum() > 0 || CollectionUtils.isNotEmpty(salarySendInfos)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100507, "工资单已经发放,不可撤销"));
|
||||
}
|
||||
// 删除工资单
|
||||
new LambdaUpdateChainWrapper<>(mapper)
|
||||
.eq(SalarySendPO::getDeleteType, 0)
|
||||
.eq(SalarySendPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendPO::getId, salarySend.getId())
|
||||
.set(SalarySendPO::getSendNum, 0)
|
||||
.set(SalarySendPO::getDeleteType, 1).update();
|
||||
// 删除工资单发放
|
||||
new LambdaUpdateChainWrapper<>(salarySendInfoMapper)
|
||||
.eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
.eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendInfoPO::getSalarySendId, salarySend.getId())
|
||||
.set(SalarySendInfoPO::getDeleteType, 1).update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalarySendListDTO> listPage(SalarySendQueryParam queryParam) {
|
||||
mapper.list(queryParam);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SalarySendBaseInfoDTO getBaseInfo(Long id) {
|
||||
SalarySendPO salarySend = mapper.getById(id);
|
||||
if (salarySend == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100512, "工资单发放不存在"));
|
||||
}
|
||||
Long salaryAcctId = salarySend.getSalaryAccountingId();
|
||||
SalarySobCycleDTO salarySobCycleDTO = getSalaryAcctRecordService(user).getSalarySobCycleById(salaryAcctId);
|
||||
|
||||
String template = "";
|
||||
// 获取默认模板
|
||||
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()));
|
||||
if (CollectionUtils.isNotEmpty(salaryTemplates)) {
|
||||
template = salaryTemplates.get(0).getName();
|
||||
}
|
||||
|
||||
return SalarySendBaseInfoDTO.builder()
|
||||
.salaryMonth(salarySobCycleDTO == null ? null : salarySobCycleDTO.getSalaryMonth())
|
||||
.template(template)
|
||||
.salarySobCycle(salarySobCycleDTO)
|
||||
.sendNum(salarySend.getSendNum())
|
||||
.sendTotal(salarySend.getSendTotal())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> mySalaryBill(Long salaryInfoId, Long currentEmployeeId, String currentTenantKey) {
|
||||
List<SalarySendInfoPO> salarySendInfos = new LambdaQueryChainWrapper<>(salarySendInfoMapper)
|
||||
.eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
.eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendInfoPO::getId, salaryInfoId).list();
|
||||
if (CollectionUtils.isEmpty(salarySendInfos)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100511, "工资单信息不存在"));
|
||||
}
|
||||
SalarySendInfoPO salarySendInfo = salarySendInfos.get(0);
|
||||
List<SalarySendPO> salarySends = new LambdaQueryChainWrapper<>(mapper)
|
||||
.eq(SalarySendPO::getDeleteType, 0)
|
||||
.eq(SalarySendPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalarySendPO::getId, salarySendInfo.getSalarySendId()).list();
|
||||
if (CollectionUtils.isEmpty(salarySends)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100512, "工资单发放不存在"));
|
||||
}
|
||||
SalarySendPO salarySend = salarySends.get(0);
|
||||
LocalDate salaryMonth = salarySend.getSalaryMonth();
|
||||
// 获取模板
|
||||
String salaryTemplateContent = salarySendInfo.getSalaryTemplate();
|
||||
if (StringUtils.isBlank(salaryTemplateContent)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100513, "没有默认模板,无法查看"));
|
||||
}
|
||||
SalaryTemplatePO salaryTemplate = buildSalaryTemplateContent(salaryTemplateContent);
|
||||
if (StringUtils.isNotBlank(salaryTemplate.getBackground())) {
|
||||
FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey);
|
||||
String encode = Base64Encoder.encode(fileByte.getData());
|
||||
salaryTemplate.setBackground(encode);
|
||||
}
|
||||
|
||||
// 获取薪资项目数据
|
||||
List<Map<String, Object>> salaryAcctResultS = new LambdaQueryChainWrapper<>(salaryAcctResultMapper)
|
||||
.eq(SalaryAcctResultPO::getDeleteType, 0)
|
||||
.eq(SalaryAcctResultPO::getTenantKey, currentTenantKey)
|
||||
.eq(SalaryAcctResultPO::getSalaryAcctRecordId, salarySendInfo.getSalaryAcctRecordId())
|
||||
.eq(SalaryAcctResultPO::getEmployeeId, currentEmployeeId).list().stream().map(m -> {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("salaryItemId", m.getSalaryItemId());
|
||||
map.put("resultValue", m.getResultValue());
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("tenantName", TenantContext.getCurrentTenant().getTenantName());
|
||||
map.put("sendTime", SalaryDateUtil.getFormatLocalDateTime(salarySendInfo.getSendTime()));
|
||||
List<SalaryTemplateSalaryItemSetListDTO> listDTOS = JSONArray.parseArray(salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
Optional<SalaryTemplateSalaryItemSetListDTO> optionalEmployeeInformation = listDTOS.stream().filter(e -> SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).findFirst();
|
||||
SalaryTemplateSalaryItemSetListDTO employeeInformation = optionalEmployeeInformation.orElse(null);
|
||||
List<SalaryTemplateSalaryItemSetListDTO> itemSetListDTOS = listDTOS.stream().filter(e -> !SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).collect(Collectors.toList());
|
||||
itemSetListDTOS.stream().forEach(item -> {
|
||||
item.getItems().stream()
|
||||
.forEach(e -> {
|
||||
if (CollectionUtils.isEmpty(salaryAcctResultS)) {
|
||||
e.setSalaryItemValue("");
|
||||
} else {
|
||||
Object o = salaryAcctResultS.stream()
|
||||
.filter(f -> f.get("salaryItemId") != null && String.valueOf(f.get("salaryItemId")).equals(e.getSalaryItemId())).findFirst()
|
||||
.orElse(new HashMap<>())
|
||||
.get("resultValue");
|
||||
e.setSalaryItemValue(o == null ? "" : (String) o);
|
||||
}
|
||||
});
|
||||
});
|
||||
TaxAgentPO byId = taxAgentService.getById(salarySendInfo.getTaxAgentId(), currentTenantKey);
|
||||
SimpleEmployee simpleEmployee = hrmCommonEmployeeService.getEmployeeById(salarySendInfo.getEmployeeId(), currentTenantKey);
|
||||
buildEmployeeInfo(employeeInformation, simpleEmployee, byId.getName(), SalaryAcctResultBO.buildEmployeeFieldName());
|
||||
map.put("employeeInformation", employeeInformation);
|
||||
map.put("salaryGroups", itemSetListDTOS);
|
||||
|
||||
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, TenantContext.getCurrentTenant().getTenantName(), currentEmployeeId, currentTenantKey));
|
||||
map.put("salaryTemplate", salaryTemplate);
|
||||
map.put("salaryAcctResult", salaryAcctResultS);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
//TODO
|
||||
// @Override
|
||||
// public PageInfo<SalarySendInfoListDTO> salarySendInfoListPage(SalarySendInfoQueryParam queryParam) {
|
||||
// salarySendInfoMapper.list(page, queryParam, tenantKey);
|
||||
// return page;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Page<SalaryMySalaryBillListDTO> mySalaryBillListPage(Page<SalaryMySalaryBillListDTO> page, SalaryBillQueryParam queryParam, String tenantKey) {
|
||||
// salarySendInfoMapper.mySalaryBillList(page, queryParam, tenantKey);
|
||||
// return page;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Page<SalarySendDetailListDTO> salarySendInfoDetailListPage(Page<SalarySendDetailListDTO> page, SalarySendDetailQueryParam queryParam, String tenantKey) {
|
||||
// salarySendInfoMapper.detailList(page, queryParam, tenantKey);
|
||||
// return page;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取工资单标题
|
||||
// * @param theme
|
||||
// * @param salaryMonth
|
||||
// * @param tenantName
|
||||
// * @param currentEmployeeId
|
||||
// * @param currentTenantKey
|
||||
// * @return
|
||||
// */
|
||||
// private String getBillTitle(String theme, LocalDate salaryMonth, String tenantName, Long currentEmployeeId, String currentTenantKey) {
|
||||
// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "年");
|
||||
// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "月");
|
||||
// return theme
|
||||
// .replace("${companyName}", tenantName)
|
||||
// .replace("${salaryMonth}", salaryMonth.getYear() + yearI18n + salaryMonth.getMonth().getValue() + monthI18n);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据模板内容转为工资单模板对象
|
||||
// * 注意:不要通过反序列化,可能会因为历史原因修改字段名称而无法序列化
|
||||
// * @param salaryTemplateContent
|
||||
// * @return
|
||||
// */
|
||||
// private SalaryTemplatePO buildSalaryTemplateContent(String salaryTemplateContent) {
|
||||
// Map<String, Object> map = JsonUtil.parseMap(salaryTemplateContent, Object.class);
|
||||
// return SalaryTemplatePO.builder()
|
||||
// .id(Long.valueOf(map.getOrDefault("id","0").toString()))
|
||||
// .name(map.getOrDefault("name","").toString())
|
||||
// .salarySobId(Long.valueOf(map.getOrDefault("salarySobId","0").toString()))
|
||||
// .useType(Integer.valueOf(map.getOrDefault("useType","0").toString()))
|
||||
// .description(map.getOrDefault("description","").toString())
|
||||
// .emailStatus(Integer.valueOf(map.getOrDefault("emailStatus","0").toString()))
|
||||
// .sendEmailId(Long.valueOf(map.getOrDefault("sendEmailId","0").toString()))
|
||||
// .msgStatus(Integer.valueOf(map.getOrDefault("msgStatus","0").toString()))
|
||||
// .theme(map.getOrDefault("theme","").toString())
|
||||
// .background(map.getOrDefault("background","").toString())
|
||||
// .textContent(map.getOrDefault("textContent","").toString())
|
||||
// .textContentPosition(Integer.valueOf(map.getOrDefault("textContentPosition","0").toString()))
|
||||
// .salaryItemNullStatus(Integer.valueOf(map.getOrDefault("salaryItemNullStatus","0").toString()))
|
||||
// .salaryItemZeroStatus(Integer.valueOf(map.getOrDefault("salaryItemZeroStatus","0").toString()))
|
||||
// .salaryItemSetting(map.getOrDefault("salaryItemSetting","").toString())
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 构建工资单中的人员信息
|
||||
// * @param employeeInformation
|
||||
// * @param simpleEmployee
|
||||
// * @param taxAgentName
|
||||
// * @param employeeField
|
||||
// */
|
||||
// private void buildEmployeeInfo(SalaryTemplateSalaryItemSetListDTO employeeInformation, SimpleEmployee simpleEmployee, String taxAgentName, Map<String, String> employeeField) {
|
||||
// if (employeeInformation == null) {
|
||||
// return;
|
||||
// }
|
||||
// if (CollectionUtils.isNotEmpty(employeeInformation.getItems())) {
|
||||
// //获取员工信息的字段名和中文描述的map关系
|
||||
// SalaryFormulaEmployeeDTO salaryFormulaEmployeeDTO = SalaryFormulaEmployeeDTO.builder().employeeId(simpleEmployee.getEmployeeId())
|
||||
// .birthday(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getBirthdayDate()))
|
||||
// .departmentName(simpleEmployee.getDepartment() == null ? "" : simpleEmployee.getDepartment().getName())
|
||||
// .email(StringUtils.isEmpty(simpleEmployee.getEmail()) ? "" : simpleEmployee.getEmail())
|
||||
// .gradeName(simpleEmployee.getGrade() == null ? "" : simpleEmployee.getGrade().getName())
|
||||
// .hireDate(SalaryDateUtil.getFormatLocalDate(simpleEmployee.getHiredate()))
|
||||
// .sex(simpleEmployee.getSex() == null ? "" : simpleEmployee.getSex().getDescription())
|
||||
// .mobile(StringUtils.isEmpty(simpleEmployee.getMobile()) ? "" : simpleEmployee.getMobile())
|
||||
// .positionName(simpleEmployee.getPosition() == null ? "" : simpleEmployee.getPosition().getName())
|
||||
// .status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus().getDescription())
|
||||
// .telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
|
||||
// .username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
|
||||
// .taxAgentName(taxAgentName)
|
||||
// .build();
|
||||
// List<SalaryTemplateSalaryItemListDTO> items = employeeInformation.getItems();
|
||||
// Set<Entry<String, String>> entries = employeeField.entrySet();
|
||||
// for (SalaryTemplateSalaryItemListDTO e : items) {
|
||||
// Optional<Entry<String, String>> entry = entries.stream().filter(f -> Objects.equals(e.getName(), f.getValue())).findFirst();
|
||||
// if (entry.isPresent()) {
|
||||
// String key = entry.get().getKey();
|
||||
// if (StringUtils.isNotBlank(key)) {
|
||||
// String getter = "get" + key.substring(0, 1).toUpperCase() + key.substring(1);
|
||||
// try {
|
||||
// Method method = salaryFormulaEmployeeDTO.getClass().getMethod(getter);
|
||||
// Object invoke = method.invoke(salaryFormulaEmployeeDTO);
|
||||
// e.setSalaryItemValue((String) invoke);
|
||||
// } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) {
|
||||
// log.error("no such method", e);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 组装详情数据
|
||||
// *
|
||||
// * @param salaryItems
|
||||
// * @param list
|
||||
// * @param salaryAccountingId
|
||||
// * @param currentTenantKey
|
||||
// */
|
||||
// @Override
|
||||
// public List<Map<String, Object>> buildDetailList(List<SalaryTemplateSalaryItemListDTO> salaryItems, List<SalarySendDetailListDTO> list, Long salaryAccountingId,
|
||||
// String currentTenantKey) {
|
||||
// List<Map<String, Object>> listMaps = new ArrayList<>();
|
||||
// if (CollectionUtils.isEmpty(list)) {
|
||||
// return listMaps;
|
||||
// }
|
||||
// // 获取薪资项目数据
|
||||
// List<SalaryAcctResultPO> salaryAccountingResults = new LambdaQueryChainWrapper<>(salaryAcctResultMapper)
|
||||
// .eq(SalaryAcctResultPO::getDeleteType, 0)
|
||||
// .eq(SalaryAcctResultPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalaryAcctResultPO::getSalaryAcctRecordId, salaryAccountingId).list();
|
||||
//
|
||||
// // 动态列
|
||||
// list.forEach(e -> {
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
// map.put("id", e.getId());
|
||||
// map.put("employeeId", e.getEmployeeId());
|
||||
// map.put("username", e.getUsername());
|
||||
// map.put("taxAgent", e.getTaxAgent());
|
||||
// map.put("department", e.getDepartment());
|
||||
// map.put("mobile", e.getMobile());
|
||||
// map.put("jobNum", e.getJobNum());
|
||||
// map.put("email", e.getEmail());
|
||||
// salaryItems.forEach(i -> {
|
||||
// Optional<SalaryAcctResultPO> optional = salaryAccountingResults.stream()
|
||||
// .filter(r -> r.getEmployeeId().equals(e.getEmployeeId()) && r.getSalaryItemId().equals(Long.valueOf(i.getSalaryItemId()))).findFirst();
|
||||
// map.put(i.getSalaryItemId() + SalaryItemConstant.DYNAMIC_SUFFIX, optional.isPresent() ? optional.get().getResultValue() : "");
|
||||
// });
|
||||
//
|
||||
// listMaps.add(map);
|
||||
// });
|
||||
// return listMaps;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 通过薪资账套获取模板的薪资项目
|
||||
// *
|
||||
// * @param salaryTemplate
|
||||
// * @param currentTenantKey
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<SalaryTemplateSalaryItemListDTO> getSalaryItemsSetting(SalaryTemplatePO salaryTemplate, String currentTenantKey) {
|
||||
// List<SalaryTemplateSalaryItemListDTO> salaryItems = new ArrayList<>();
|
||||
//
|
||||
// if (salaryTemplate == null) {
|
||||
// return salaryItems;
|
||||
// }
|
||||
// if (StringUtils.isNotEmpty(salaryTemplate.getSalaryItemSetting())) {
|
||||
// List<SalaryTemplateSalaryItemSetListDTO> salaryTemplateShowSetData = JsonUtil.parseList(salaryTemplate.getSalaryItemSetting(),
|
||||
// SalaryTemplateSalaryItemSetListDTO.class);
|
||||
// salaryTemplateShowSetData.stream().filter(f -> !f.getGroupId().equals(SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID)).forEach(e -> {
|
||||
// salaryItems.addAll(e.getItems());
|
||||
// });
|
||||
// }
|
||||
// return salaryItems;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public String grant(SalarySendGrantParam param, Long currentEmployeeId, String currentTenantKey) {
|
||||
// if (param.getSalarySendId() == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100327, "工资单发放Id必传"));
|
||||
// }
|
||||
//
|
||||
// Long salarySendId = param.getSalarySendId();
|
||||
// Collection<Long> ids = param.getIds();
|
||||
//
|
||||
// SalarySendPO salarySend = mapper.getById(salarySendId, currentTenantKey);
|
||||
// if (salarySend == null) {
|
||||
// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100512, "工资单发放不存在") + "[id:%s]", salarySendId));
|
||||
// }
|
||||
// // 获取默认模板
|
||||
// List<SalaryTemplatePO> salaryTemplates = salaryTemplateService.getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()), currentTenantKey);
|
||||
// if (CollectionUtils.isEmpty(salaryTemplates)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100518, "没有默认模板,无法发送"));
|
||||
// }
|
||||
// LocalDateTime sendTime = LocalDateTime.now();
|
||||
// // 获取可发送的列表
|
||||
// List<Map<String, Object>> enableSendList = getEnableSendList(salarySend, ids, salaryTemplates.get(0), currentTenantKey);
|
||||
// // 1.发放
|
||||
// new LambdaUpdateChainWrapper<>(salarySendInfoMapper)
|
||||
// .eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
// .eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalarySendInfoPO::getSalarySendId, salarySendId)
|
||||
// .in(SalarySendInfoPO::getSendStatus, Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()))
|
||||
// // ids为空代表所有人
|
||||
// .in(CollectionUtils.isNotEmpty(ids), SalarySendInfoPO::getId, ids)
|
||||
// .set(SalarySendInfoPO::getSendStatus, SalarySendStatusEnum.ALREADYSEND.getValue())
|
||||
// .set(SalarySendInfoPO::getSendTime, sendTime)
|
||||
// .set(SalarySendInfoPO::getSalaryTemplate, JsonUtil.toJsonString(salaryTemplates.get(0)))
|
||||
// .update();
|
||||
// // 2.更新数量
|
||||
// List<SalarySendInfoPO> list = new LambdaQueryChainWrapper<>(salarySendInfoMapper)
|
||||
// .eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
// .eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalarySendInfoPO::getSalarySendId, salarySendId).list();
|
||||
// int sendNum = (int) list.stream().filter(e -> e.getSendStatus().equals(SalarySendStatusEnum.ALREADYSEND.getValue())).count();
|
||||
// int sendTotal = list.size();
|
||||
// SalarySendPO salarySendNew = new SalarySendPO();
|
||||
// BeanUtils.copyProperties(salarySend, salarySendNew);
|
||||
// salarySendNew.setSendNum(sendNum);
|
||||
// salarySendNew.setSendTotal(sendTotal);
|
||||
// salarySendNew.setLastSendTime(sendTime);
|
||||
// mapper.updateById(salarySendNew);
|
||||
// List<SalarySobPO> salarySobs = new LambdaQueryChainWrapper<>(salarySobMapper)
|
||||
// .eq(SalarySobPO::getTenantKey, TenantContext.getCurrentTenantKey())
|
||||
// .eq(SalarySobPO::getDeleteType, 0)
|
||||
// .eq(SalarySobPO::getId, salarySend.getSalarySobId())
|
||||
// .list();
|
||||
// // 记录日志
|
||||
// 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.异步发送消息:先修改数据再发消息,避免出错后无法撤回
|
||||
// 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();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// Map<String, Object> map = new HashMap<>(2);
|
||||
// map.put("sendNum", sendNum);
|
||||
// map.put("sendTotal", sendTotal);
|
||||
//
|
||||
// return JsonUtil.toJsonString(map);
|
||||
// }
|
||||
//
|
||||
// private List<Map<String, Object>> getEnableSendList(SalarySendPO salarySend, Collection<Long> ids, SalaryTemplatePO salaryTemplate, String currentTenantKey) {
|
||||
// // 1.根据模板获取薪资项目设置
|
||||
// List<SalaryTemplateSalaryItemListDTO> salaryItems = getSalaryItemsSetting(salaryTemplate, currentTenantKey);
|
||||
// SalarySendDetailQueryParam queryParam = new SalarySendDetailQueryParam();
|
||||
// queryParam.setSalarySendId(salarySend.getId());
|
||||
// // 空就是所有
|
||||
// queryParam.setIds(ids);
|
||||
// queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()));
|
||||
// // 2.获取基本数据
|
||||
// List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam, currentTenantKey);
|
||||
// // 3.组装详情数据
|
||||
// List<Map<String, Object>> listMaps = buildDetailList(salaryItems, list, salarySend.getSalaryAccountingId(), currentTenantKey);
|
||||
// return listMaps;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 发送消息
|
||||
// *
|
||||
// * @param salarySend
|
||||
// * @param enableSendList
|
||||
// * @param salaryTemplate
|
||||
// * @param currentTenantKey
|
||||
// */
|
||||
// private void sendMessage(SalarySendPO salarySend, List<Map<String, Object>> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName, Long currentEmployeeId, String currentTenantKey) {
|
||||
// if (StringUtils.isNotBlank(salaryTemplate.getBackground())) {
|
||||
// FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey);
|
||||
// String encode = Base64Encoder.encode(fileByte.getData());
|
||||
// salaryTemplate.setBackground(encode);
|
||||
// }
|
||||
// // 邮箱打开
|
||||
// boolean isEmailOpen = salaryTemplate.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue());
|
||||
//
|
||||
// LocalDate salaryMonth = salarySend.getSalaryMonth();
|
||||
// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "年");
|
||||
// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "月");
|
||||
// String text = salaryMonth.getYear() +
|
||||
// yearI18n +
|
||||
// salaryMonth.getMonth().getValue() +
|
||||
// monthI18n +
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100520, "工资待发明细");
|
||||
//
|
||||
// UserEntity sendUser = null;
|
||||
// // 标题
|
||||
// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName, currentEmployeeId, currentTenantKey);
|
||||
//
|
||||
// // 获取所有人员信息
|
||||
// List<Long> ids = enableSendList.stream().map(e->Long.valueOf(e.get("employeeId").toString())).collect(Collectors.toList());
|
||||
// List<SimpleEmployee> allEmployees = hrmCommonEmployeeService.getEmployeeByIds(ids, currentTenantKey);
|
||||
// List<SalaryTemplateSalaryItemSetListDTO> listDTOS = JSONArray.parseArray(salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
// Optional<SalaryTemplateSalaryItemSetListDTO> optionalEmployeeInformation = listDTOS.stream().filter(e -> SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).findFirst();
|
||||
// SalaryTemplateSalaryItemSetListDTO employeeInformation = optionalEmployeeInformation.orElse(null);
|
||||
// Map<String, String> employeeField = SalaryAcctResultBO.buildEmployeeFieldName();
|
||||
// enableSendList.forEach(e -> {
|
||||
// Optional<SimpleEmployee> optionalSimpleEmployee = allEmployees.stream().filter(f->f.getEmployeeId().equals(Long.valueOf(e.get("employeeId").toString()))).findFirst();
|
||||
// if (optionalSimpleEmployee.isPresent()) {
|
||||
// buildEmployeeInfo(employeeInformation, optionalSimpleEmployee.get(), e.get("taxAgent").toString(), employeeField);
|
||||
// }
|
||||
//
|
||||
// List<UserEntity> receivers = Collections.singletonList(
|
||||
// SalarySendBO.buildUser(Long.valueOf(e.get("employeeId").toString()), e.get("email") == null ? "" : e.get("email").toString(), currentTenantKey));
|
||||
// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单"));
|
||||
// EmailEntity emailInfo = new EmailEntity();
|
||||
// // 邮箱打开
|
||||
// if (isEmailOpen) {
|
||||
// String emailContent = SalarySendBO.buildEmailContent(e, employeeInformation, title, salaryTemplate);
|
||||
// emailInfo = SalarySendBO.buildEmailInfo(text, emailContent, salaryTemplate.getSendEmailId());
|
||||
// }
|
||||
// SendMessageEntity message = SalarySendBO.buildSendMessageEntity(text, sendUser, receivers, entity, emailInfo);
|
||||
// log.info("开始发送============:{}", JsonUtil.toJsonString(message));
|
||||
// // 开始发送
|
||||
// log.info("发送结果===:{}", JsonUtil.toJsonString(asyncSystemMessageRest.sendMsg(message)));
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public String withdraw(SalarySendWithdrawParam param, Long currentEmployeeId, String currentTenantKey) {
|
||||
// if (param.getSalarySendId() == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100327, "工资单发放Id必传"));
|
||||
// }
|
||||
//
|
||||
// Long salarySendId = param.getSalarySendId();
|
||||
// Collection<Long> ids = param.getIds();
|
||||
//
|
||||
// SalarySendPO salarySend = mapper.getById(salarySendId, currentTenantKey);
|
||||
// if (salarySend == null) {
|
||||
// throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100512, "工资单发放不存在") + "[id:%s]", salarySendId));
|
||||
// }
|
||||
//// // 获取可撤回的工资单
|
||||
//// List<SalarySendInfoPO> enableWithdrawList = new LambdaQueryChainWrapper<>(salarySendInfoMapper)
|
||||
//// .eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
//// .eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
//// .eq(SalarySendInfoPO::getSalarySendId, salarySendId)
|
||||
//// .eq(SalarySendInfoPO::getSendStatus, SalarySendStatusEnum.ALREADYSEND.getValue())
|
||||
//// .in(CollectionUtils.isNotEmpty(ids), SalarySendInfoPO::getId, ids)
|
||||
//// .list();
|
||||
// // 撤回
|
||||
// new LambdaUpdateChainWrapper<>(salarySendInfoMapper)
|
||||
// .eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
// .eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalarySendInfoPO::getSalarySendId, salarySendId)
|
||||
// .eq(SalarySendInfoPO::getSendStatus, SalarySendStatusEnum.ALREADYSEND.getValue())
|
||||
// .in(CollectionUtils.isNotEmpty(ids), SalarySendInfoPO::getId, ids)
|
||||
// .set(SalarySendInfoPO::getSendStatus, SalarySendStatusEnum.WITHDRAW.getValue())
|
||||
// .update();
|
||||
//
|
||||
// List<SalarySendInfoPO> list = new LambdaQueryChainWrapper<>(salarySendInfoMapper)
|
||||
// .eq(SalarySendInfoPO::getDeleteType, 0)
|
||||
// .eq(SalarySendInfoPO::getTenantKey, currentTenantKey)
|
||||
// .eq(SalarySendInfoPO::getSalarySendId, salarySendId).list();
|
||||
//
|
||||
// int sendNum = (int) list.stream().filter(e -> e.getSendStatus().equals(SalarySendStatusEnum.ALREADYSEND.getValue())).count();
|
||||
// int sendTotal = list.size();
|
||||
//
|
||||
// SalarySendPO salarySendNew = new SalarySendPO();
|
||||
// BeanUtils.copyProperties(salarySend, salarySendNew);
|
||||
// salarySendNew.setSendNum(sendNum);
|
||||
// salarySendNew.setSendTotal(sendTotal);
|
||||
// mapper.updateById(salarySendNew);
|
||||
// List<SalarySobPO> salarySobs = new LambdaQueryChainWrapper<>(salarySobMapper)
|
||||
// .eq(SalarySobPO::getTenantKey, TenantContext.getCurrentTenantKey())
|
||||
// .eq(SalarySobPO::getDeleteType, 0)
|
||||
// .eq(SalarySobPO::getId, salarySend.getSalarySobId())
|
||||
// .list();
|
||||
// // 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(salarySendLoggerTemplate,
|
||||
// salarySend.getId(),
|
||||
// salarySend.getSalaryMonth() + "-" + (CollectionUtils.isNotEmpty(salarySobs) ? salarySobs.get(0).getName() : ""),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100521, "撤回工资单发放"),
|
||||
// salarySend,
|
||||
// salarySendNew);
|
||||
//
|
||||
//// // 3.异步发送消息:先修改数据再发消息,避免出错后无法撤回
|
||||
//// taskExecutor.execute(() -> {
|
||||
//// try {
|
||||
//// DSTenantKeyThreadVar.tenantKey.set(currentTenantKey);
|
||||
////
|
||||
//// String text = "工资单撤回测试消息文案,不好意思,弄错了";
|
||||
//// String title = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单");
|
||||
//// enableWithdrawList.forEach(e->{
|
||||
//// CancleMessageEntity cme = SalarySendBO.buildCancleMessageEntity(e.getEmployeeId(),
|
||||
//// e.getMsgId(),
|
||||
//// text,
|
||||
//// title,
|
||||
//// currentEmployeeId,
|
||||
//// currentTenantKey);
|
||||
//// log.info("撤回结果===:{}", JsonUtil.toJsonString(asyncSystemMessageRest.cancleMsg(cme)));
|
||||
//// });
|
||||
//// } finally {
|
||||
//// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
//// }
|
||||
//// });
|
||||
//
|
||||
// Map<String, Object> map = new HashMap<>(2);
|
||||
// map.put("sendNum", sendNum);
|
||||
// map.put("sendTotal", sendTotal);
|
||||
// return JsonUtil.toJsonString(map);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void exportInfoList(Map<String, Object> map, String username, String eteamsId, SalarySendInfoQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) {
|
||||
// List<ExcelSheetData> sheetList = new ArrayList<>();
|
||||
//
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
// // 1.工作簿名称
|
||||
// String nameI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100528, "工资单发放信息");
|
||||
// excelSheetData.setSheetName(nameI18n);
|
||||
// String[] header = {
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85429, "姓名"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86184, "个税扣缴义务人"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86185, "部门"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86186, "手机号"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86317, "工号"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86317, "发送状态")
|
||||
// };
|
||||
// // 2.表头
|
||||
// excelSheetData.setHeaders(Collections.singletonList(header));
|
||||
//
|
||||
// // 校验
|
||||
// WeaResult<String> checkResult = SalarySendInfoQueryParam.checkParam(queryParam, currentEmployeeId, currentTenantKey);
|
||||
// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 84026, "参数错误"));
|
||||
// }
|
||||
// // 获取行数据
|
||||
// List<SalarySendInfoListDTO> list = salarySendInfoMapper.list(queryParam, currentTenantKey);
|
||||
// list.forEach(e -> {
|
||||
// // 发放状态
|
||||
// e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(Integer.valueOf(e.getSendStatus()), currentEmployeeId, currentTenantKey));
|
||||
// });
|
||||
//
|
||||
// // 3.添加行记录
|
||||
// List<List<Object>> rows = new ArrayList<>();
|
||||
// for (SalarySendInfoListDTO dto : list) {
|
||||
// List<Object> row = new ArrayList<>();
|
||||
// row.add(dto.getUsername());
|
||||
// row.add(dto.getTaxAgent());
|
||||
// row.add(dto.getDepartment());
|
||||
// row.add(dto.getMobile());
|
||||
// row.add(dto.getJobNum());
|
||||
// row.add(dto.getSendStatus());
|
||||
// rows.add(row);
|
||||
// }
|
||||
// // 3.表数据
|
||||
// excelSheetData.setRows(rows);
|
||||
//
|
||||
// sheetList.add(excelSheetData);
|
||||
//
|
||||
// salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
|
||||
// .bizId(map.get("biz").toString())
|
||||
// .flag(true)
|
||||
// .userId(currentEmployeeId)
|
||||
// .eteamsId(eteamsId)
|
||||
// .tenantKey(currentTenantKey)
|
||||
// .operator(username)
|
||||
// .module(map.get("module").toString())
|
||||
// .fileName(nameI18n + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now()))
|
||||
// .handlerName(map.get("function").toString())
|
||||
// .dataType(nameI18n)
|
||||
// .function(map.get("function").toString()).build(), sheetList);
|
||||
// }
|
||||
//
|
||||
// @BatchExportHandler("exportSalarySendInfo")
|
||||
// public void salarySendInfoExportHandler() {
|
||||
// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
|
||||
// System.out.println("接受到导出的结果" + JSONObject.toJSONString(message));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void exportDetailList(Map<String, Object> map, String username, String eteamsId, SalarySendPO salarySend, SalarySendDetailQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) {
|
||||
// List<ExcelSheetData> sheetList = new ArrayList<>();
|
||||
//
|
||||
// ExcelSheetData excelSheetData = new ExcelSheetData();
|
||||
//
|
||||
// // 1.根据模板获取薪资项目设置
|
||||
// List<SalaryTemplatePO> salaryTemplates = salaryTemplateService.getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()), currentTenantKey);
|
||||
// List<SalaryTemplateSalaryItemListDTO> salaryItems = getSalaryItemsSetting(CollectionUtils.isNotEmpty(salaryTemplates) ? salaryTemplates.get(0) : null, currentTenantKey);
|
||||
//
|
||||
// // 2.获取基本数据
|
||||
// List<SalarySendDetailListDTO> list = salarySendInfoMapper.detailList(queryParam, currentTenantKey);
|
||||
//
|
||||
// // 3.组装详情数据
|
||||
// List<Map<String, Object>> listMaps = buildDetailList(salaryItems, list, salarySend.getSalaryAccountingId(), currentTenantKey);
|
||||
//
|
||||
// // 1.工作簿名称
|
||||
// String nameI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 97036, "工资单发放详情");
|
||||
// excelSheetData.setSheetName(nameI18n);
|
||||
// List<String> header = new ArrayList<>();
|
||||
// header.add(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 85429, "姓名"));
|
||||
// header.add(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86185, "部门"));
|
||||
// header.add(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86186, "手机号"));
|
||||
// header.add(SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 86317, "工号"));
|
||||
// // 动态列
|
||||
// if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(salaryItems)) {
|
||||
// for (SalaryTemplateSalaryItemListDTO salaryItem : salaryItems) {
|
||||
// header.add(salaryItem.getName());
|
||||
// }
|
||||
// }
|
||||
// // 2.表头
|
||||
// excelSheetData.setHeaders(Collections.singletonList(header.toArray(new String[]{})));
|
||||
//
|
||||
// List<List<Object>> rows = new ArrayList<>();
|
||||
// for (Map<String, Object> dto : listMaps) {
|
||||
// List<Object> row = new ArrayList<>();
|
||||
// row.add(dto.get("username"));
|
||||
// row.add(dto.get("departmentName"));
|
||||
// row.add(dto.get("mobile"));
|
||||
// row.add(dto.get("jobNum"));
|
||||
//
|
||||
// // 动态列
|
||||
// Map<String, Object> mapColumn = listMaps.get(0);
|
||||
// for (SalaryTemplateSalaryItemListDTO salaryItem : salaryItems) {
|
||||
// if (mapColumn.containsKey(salaryItem.getId() + SalaryItemConstant.DYNAMIC_SUFFIX)) {
|
||||
// row.add(dto.get(salaryItem.getId() + SalaryItemConstant.DYNAMIC_SUFFIX));
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// rows.add(row);
|
||||
// }
|
||||
// // 3.表数据
|
||||
// excelSheetData.setRows(rows);
|
||||
//
|
||||
// sheetList.add(excelSheetData);
|
||||
//
|
||||
// salaryBatchService.simpleExportExcel(ExportExcelInfo.builder()
|
||||
// .bizId(map.get("biz").toString())
|
||||
// .flag(true)
|
||||
// .userId(currentEmployeeId)
|
||||
// .eteamsId(eteamsId)
|
||||
// .tenantKey(currentTenantKey)
|
||||
// .operator(username)
|
||||
// .module(map.get("module").toString())
|
||||
// .fileName(nameI18n + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now()))
|
||||
// .handlerName(map.get("function").toString())
|
||||
// .dataType(nameI18n)
|
||||
// .function(map.get("function").toString()).build(), sheetList);
|
||||
// }
|
||||
//
|
||||
// @BatchExportHandler("exportSalarySendDetail")
|
||||
// public void salarySendDetailExportHandler() {
|
||||
// BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
|
||||
// System.out.println("接受到导出的结果" + JSONObject.toJSONString(message));
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,276 +0,0 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalarySobBiz;
|
||||
import com.engine.salary.biz.SalaryTemplateBiz;
|
||||
import com.engine.salary.entity.salaryBill.bo.SalaryTemplateBO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateListDTO;
|
||||
import com.engine.salary.entity.salaryBill.dto.SalaryTemplateSalaryItemSetListDTO;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateCopyParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateDefaultUseParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateSaveParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalarySobItemService;
|
||||
import com.engine.salary.service.SalaryTemplateService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-12-08 14:44
|
||||
*/
|
||||
public class SalaryTemplateServiceImpl extends Service implements SalaryTemplateService {
|
||||
|
||||
private SalaryTemplateBiz mapper = new SalaryTemplateBiz();
|
||||
|
||||
private SalarySobBiz salarySobMapper = new SalarySobBiz();
|
||||
|
||||
private SalarySobItemService getSalarySobItemService(User user) {
|
||||
return ServiceUtil.getService(SalarySobItemServiceImpl.class, user);
|
||||
}
|
||||
// @Autowired
|
||||
// private LoggerTemplate salaryTemplateLoggerTemplate;
|
||||
|
||||
@Override
|
||||
public SalaryTemplatePO getById(Long id) {
|
||||
return mapper.getById(id);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Map<String, Object> listPage(SalaryTemplateQueryParam queryParam) {
|
||||
// mapper.list(queryParam);
|
||||
// return page;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String defaultUse(SalaryTemplateDefaultUseParam defaultUseParamy) {
|
||||
// 校验参数
|
||||
SalaryTemplateDefaultUseParam.checkParam(defaultUseParamy);
|
||||
|
||||
SalaryTemplatePO salaryTemplate = getById(defaultUseParamy.getId());
|
||||
|
||||
if (salaryTemplate == null) {
|
||||
throw new SalaryRunTimeException("工资单模板不存在");
|
||||
}
|
||||
|
||||
// 选中默认使用
|
||||
SalaryTemplatePO po = new SalaryTemplatePO();
|
||||
po.setDeleteType(0);
|
||||
po.setSalarySobId(salaryTemplate.getSalarySobId());
|
||||
po.setUseType(SalaryTemplateWhetherEnum.FALSE.getValue());
|
||||
mapper.updateById(po);
|
||||
|
||||
SalaryTemplatePO salaryTemplateNew = new SalaryTemplatePO();
|
||||
BeanUtils.copyProperties(salaryTemplate, salaryTemplateNew);
|
||||
salaryTemplateNew.setUseType(SalaryTemplateWhetherEnum.TRUE.getValue());
|
||||
mapper.updateById(salaryTemplateNew);
|
||||
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate,
|
||||
// salaryTemplate.getId(),
|
||||
// salaryTemplateNew.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"),
|
||||
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100534, "设为默认使用"),
|
||||
// salaryTemplate,
|
||||
// salaryTemplateNew);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String save(SalaryTemplateSaveParam saveParam) {
|
||||
// 校验参数
|
||||
SalaryTemplateSaveParam.checkParam(saveParam);
|
||||
|
||||
SalaryTemplatePO po = new SalaryTemplatePO();
|
||||
po.setDeleteType(0);
|
||||
po.setName(saveParam.getName());
|
||||
List<SalaryTemplatePO> salaryTemplates = mapper.listSome(po);
|
||||
|
||||
if (CollectionUtils.isNotEmpty(salaryTemplates)) {
|
||||
throw new SalaryRunTimeException("工资单模板名称不允许重复");
|
||||
}
|
||||
|
||||
SalarySobPO salarySobPO = new SalarySobPO();
|
||||
po.setDeleteType(0);
|
||||
po.setId(saveParam.getSalarySobId());
|
||||
List<SalarySobPO> salarySobs = salarySobMapper.listSome(salarySobPO);
|
||||
|
||||
if (CollectionUtils.isEmpty(salarySobs)) {
|
||||
throw new SalaryRunTimeException("薪资账套不存在");
|
||||
}
|
||||
// todo 薪资项目设置检查校验
|
||||
// 保存
|
||||
// saveParam.setId(IdGenerator.generate());
|
||||
SalaryTemplatePO salaryTemplate = SalaryTemplateBO.convertToPO(saveParam, (long) user.getUID());
|
||||
salaryTemplate.setSendEmailId(saveParam.getSendEmail());
|
||||
salaryTemplate.setEmailStatus(saveParam.getEmailStatus()?1:0);
|
||||
salaryTemplate.setMsgStatus(saveParam.getMsgStatus()?1:0);
|
||||
salaryTemplate.setTextContentPosition(saveParam.getTextContentPosition());
|
||||
salaryTemplate.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus()?1:0);
|
||||
salaryTemplate.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0);
|
||||
mapper.insert(salaryTemplate);
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordAddSingleLog(salaryTemplateLoggerTemplate,
|
||||
// salaryTemplate.getId(),
|
||||
// salaryTemplate.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100538, "新增工资单模板"),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100538, "新增工资单模板"),
|
||||
// salaryTemplate);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String update(SalaryTemplateSaveParam saveParam) {
|
||||
// 校验参数
|
||||
SalaryTemplateSaveParam.checkParam(saveParam);
|
||||
// 校验是否可以编辑
|
||||
if (saveParam.getId() == null) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
SalaryTemplatePO salaryTemplate = getById(saveParam.getId());
|
||||
if (salaryTemplate == null) {
|
||||
throw new SalaryRunTimeException("工资单模板不存在");
|
||||
}
|
||||
|
||||
// 工资单模板编辑时不允许调整账套
|
||||
if (!salaryTemplate.getSalarySobId().equals(saveParam.getSalarySobId())) {
|
||||
throw new SalaryRunTimeException("工资单模板编辑时不允许调整账套");
|
||||
}
|
||||
|
||||
SalaryTemplatePO po = new SalaryTemplatePO();
|
||||
po.setDeleteType(0);
|
||||
po.setName(saveParam.getName());
|
||||
List<SalaryTemplatePO> salaryTemplates = mapper.listSome(po);
|
||||
|
||||
boolean nameExist = salaryTemplates.stream().anyMatch(e -> !Objects.equals(e.getId(), saveParam.getId()));
|
||||
if (nameExist) {
|
||||
throw new SalaryRunTimeException("工资单模板名称不允许重复");
|
||||
}
|
||||
SalarySobPO salarySobPO = new SalarySobPO();
|
||||
po.setDeleteType(0);
|
||||
po.setId(saveParam.getSalarySobId());
|
||||
List<SalarySobPO> salarySobs = salarySobMapper.listSome(salarySobPO);
|
||||
|
||||
if (CollectionUtils.isEmpty(salarySobs)) {
|
||||
throw new SalaryRunTimeException("薪资账套不存在");
|
||||
}
|
||||
// 更新工资单
|
||||
SalaryTemplatePO salaryTemplateNew = new SalaryTemplatePO();
|
||||
BeanUtils.copyProperties(salaryTemplate, salaryTemplateNew);
|
||||
BeanUtils.copyProperties(saveParam, salaryTemplateNew);
|
||||
salaryTemplateNew.setUpdateTime(LocalDateTime.now());
|
||||
salaryTemplateNew.setSendEmailId(saveParam.getSendEmail());
|
||||
salaryTemplateNew.setEmailStatus(saveParam.getEmailStatus()?1:0);
|
||||
salaryTemplateNew.setMsgStatus(saveParam.getMsgStatus()?1:0);
|
||||
salaryTemplateNew.setTextContentPosition(saveParam.getTextContentPosition());
|
||||
salaryTemplateNew.setSalaryItemNullStatus(saveParam.getSalaryItemNullStatus()?1:0);
|
||||
salaryTemplateNew.setSalaryItemZeroStatus(saveParam.getSalaryItemZeroStatus()?1:0);
|
||||
// todo 薪资项目设置检查校验
|
||||
salaryTemplateNew.setSalaryItemSetting(JSONUtil.toJsonStr(saveParam.getSalaryItemSetting()));
|
||||
mapper.updateById(salaryTemplateNew);
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordUpdateSingleLog(salaryTemplateLoggerTemplate,
|
||||
// salaryTemplate.getId(),
|
||||
// salaryTemplateNew.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100539, "编辑工资单模板"),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100539, "编辑工资单模板"),
|
||||
// salaryTemplate,
|
||||
// salaryTemplateNew);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String copy(SalaryTemplateCopyParam copyParam) {
|
||||
// 校验参数
|
||||
SalaryTemplateCopyParam.checkParam(copyParam);
|
||||
|
||||
SalaryTemplatePO salaryTemplate = getById(copyParam.getId());
|
||||
if (salaryTemplate == null) {
|
||||
throw new SalaryRunTimeException("被复制的工资单不存在");
|
||||
}
|
||||
|
||||
List<SalaryTemplateListDTO> salaryTemplates = mapper.list(SalaryTemplateQueryParam.builder().name(copyParam.getName()).build());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(salaryTemplates)) {
|
||||
throw new SalaryRunTimeException("工资单模板名称不允许重复");
|
||||
}
|
||||
|
||||
SalaryTemplatePO salaryTemplateNew = new SalaryTemplatePO();
|
||||
BeanUtils.copyProperties(salaryTemplate, salaryTemplateNew);
|
||||
salaryTemplateNew.setName(copyParam.getName());
|
||||
salaryTemplateNew.setUseType(SalaryTemplateWhetherEnum.FALSE.getValue());
|
||||
// salaryTemplateNew.setId(IdGenerator.generate());
|
||||
mapper.insert(salaryTemplateNew);
|
||||
// 记录日志
|
||||
// SalaryLoggerUtil.recordAddSingleLog(salaryTemplateLoggerTemplate,
|
||||
// salaryTemplateNew.getId(),
|
||||
// salaryTemplateNew.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100541, "复制工资单模板"),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100541, "复制工资单模板"),
|
||||
// salaryTemplateNew);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String delete(Collection<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
List<SalaryTemplateListDTO> salaryTemplates = mapper.list(SalaryTemplateQueryParam.builder().ids(ids).build());
|
||||
if (CollectionUtils.isEmpty(salaryTemplates)) {
|
||||
throw new SalaryRunTimeException("要删除的工资单在不存在或已删除");
|
||||
}
|
||||
// TODO 正在使用的记录不允许删除
|
||||
mapper.deleteByIds(ids);
|
||||
// 记录日志
|
||||
// salaryTemplates.forEach(e -> SalaryLoggerUtil.recordDeleteSingleLog(salaryTemplateLoggerTemplate,
|
||||
// e.getId(),
|
||||
// e.getName(),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100542, "删除工资单模板"),
|
||||
// SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100542, "删除工资单模板")+":" + e.getName(),
|
||||
// e));
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> selectSalarySobList() {
|
||||
SalarySobPO po = new SalarySobPO();
|
||||
po.setDeleteType(0);
|
||||
List<SalarySobPO> salarySobs = salarySobMapper.listSome(po);
|
||||
|
||||
return salarySobs.stream().map(m->{
|
||||
Map<String, Object> map = new HashMap<>(2);
|
||||
map.put("id", String.valueOf(m.getId()));
|
||||
map.put("content", m.getName());
|
||||
return map;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryTemplateSalaryItemSetListDTO> getSalaryItemSet(Long salarySobId) {
|
||||
SalarySobItemAggregateDTO salarySobItemAggregate = getSalarySobItemService(user).getAggregateBySalarySobId(salarySobId);
|
||||
return SalaryTemplateBO.convertSalarySobItemAggregateToSalaryItemSet(salarySobItemAggregate, new Long(user.getUID()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SalaryTemplatePO> getDefaultTemplates(List<Long> salarySobIds) {
|
||||
return mapper.listDefaultTemplates(salarySobIds);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,6 @@ package com.engine.salary.util;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.engine.core.exception.ECException;
|
||||
import com.engine.salary.entity.salaryBill.param.SalarySendQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
|
@ -146,4 +144,5 @@ public class ResponseResult<T, R> {
|
|||
apidatas.put("status", true);
|
||||
return JSONObject.toJSONString(apidatas, SerializerFeature.DisableCircularReferenceDetect);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,409 +0,0 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.constant.SalrayCheckSecondAuthConstant;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.*;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.SalarySendWrapper;
|
||||
import com.engine.salary.wrapper.SalaryTemplateWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 工资单
|
||||
*/
|
||||
public class SalaryBillController {
|
||||
|
||||
private SalaryTemplateWrapper getSalaryTemplateWrapper(User user) {
|
||||
return ServiceUtil.getService(SalaryTemplateWrapper.class, user);
|
||||
}
|
||||
|
||||
private SalarySendWrapper getSalarySendWrapper(User user) {
|
||||
return ServiceUtil.getService(SalarySendWrapper.class, user);
|
||||
}
|
||||
|
||||
/******** 工资单模板 start ***********************************************************************************************/
|
||||
/**
|
||||
* 工资单模板列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String templateList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryTemplateQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryTemplateQueryParam, Map<String, Object>>().run(getSalaryTemplateWrapper(user)::list, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工资单模板基础设置表单
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/getBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Map<String, Object>>().run(getSalaryTemplateWrapper(user)::getBaseForm, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工资单模板显示设置表单
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/getShowForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getShowForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, SalaryTemplateShowFormDTO>().run(getSalaryTemplateWrapper(user)::getShowForm, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资项目设置
|
||||
*
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/template/getSalaryItemSet")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalaryItemSet(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("salarySobId") Long salarySobId) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<SalaryTemplateSalaryItemSetListDTO>>().run(getSalaryTemplateWrapper(user)::getSalaryItemSet, salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单模板默认使用
|
||||
*
|
||||
* @param defaultUseParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/defaultUse")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String defaultUse(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryTemplateDefaultUseParam defaultUseParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryTemplateDefaultUseParam, List<SalaryTemplateSalaryItemSetListDTO>>().run(getSalaryTemplateWrapper(user)::defaultUse, defaultUseParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryTemplateSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryTemplateSaveParam, String>().run(getSalaryTemplateWrapper(user)::save, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryTemplateSaveParam saveParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryTemplateSaveParam, String>().run(getSalaryTemplateWrapper(user)::update, saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制工资单模板
|
||||
*
|
||||
* @param copyParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/copy")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String copy(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryTemplateCopyParam copyParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryTemplateCopyParam, String>().run(getSalaryTemplateWrapper(user)::copy, copyParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工资单模板
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Collection<Long>, String>().run(getSalaryTemplateWrapper(user)::delete, ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资账套下拉列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/template/selectSalarySobList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String selectSalarySobList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<>().run(getSalaryTemplateWrapper(user)::selectSalarySobList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取租户名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// @POST
|
||||
// @Path("/template/getTenantName")
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public String getTenantName(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
// return WeaResult.success(TenantContext.getCurrentTenant().getTenantName());
|
||||
// }
|
||||
/******** 工资单模板 end ***********************************************************************************************/
|
||||
|
||||
/******** 工资单发放 start ***********************************************************************************************/
|
||||
/**
|
||||
* 工资单发放列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::list, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放基本信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/send/getBaseInfo")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getBaseInfo(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, SalarySendBaseInfoDTO>().run(getSalarySendWrapper(user)::getBaseInfo, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放信息列表的高级搜索
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/send/getInfoSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getInfoSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<>().run(getSalarySendWrapper(user)::getInfoSearchCondition);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放信息列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/infoList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String infoList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendInfoQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendInfoQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::infoList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-工资单发放信息列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/exportInfoList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String exportInfoList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendInfoQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendInfoQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::exportInfoList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单批量发放信息列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/batchSendInfoList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String batchSendInfoList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendInfoQueryParam queryParam) {
|
||||
// 包含未发送、已撤回
|
||||
queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.UNSEND.getValue(), SalarySendStatusEnum.WITHDRAW.getValue()));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendInfoQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::infoList, queryParam);
|
||||
|
||||
// WeaTable<SalarySendInfoListDTO> weaTable = salarySendWrapper.infoList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// weaTable.setOperatesPermission(new LinkedList<>());
|
||||
// weaTable.setOperates(new LinkedList<>());
|
||||
// return WeaResult.success(weaTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单批量撤回信息列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/batchWithdrawInfoList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String batchWithdrawInfoList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendInfoQueryParam queryParam) {
|
||||
// 包含已发送
|
||||
queryParam.setSendStatuss(Arrays.asList(SalarySendStatusEnum.ALREADYSEND.getValue()));
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
|
||||
return new ResponseResult<SalarySendInfoQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::infoList, queryParam);
|
||||
// WeaTable<SalarySendInfoListDTO> weaTable = salarySendWrapper.infoList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
||||
// weaTable.setOperatesPermission(new LinkedList<>());
|
||||
// weaTable.setOperates(new LinkedList<>());
|
||||
// return WeaResult.success(weaTable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/grant")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String grant(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendGrantParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendGrantParam, String>().run(getSalarySendWrapper(user)::grant, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单撤回
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/withdraw")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String withdraw(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendWithdrawParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendWithdrawParam, String>().run(getSalarySendWrapper(user)::withdraw, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放详情列表的高级搜索
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/getDetailSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getDetailSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Object, Map<String, Object>>().run(getSalarySendWrapper(user)::getDetailSearchCondition);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放详情列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/detailList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendDetailQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendDetailQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::detailList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出-工资单发放详情列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/send/exportDetailList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String exportDetailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySendDetailQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalarySendDetailQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::exportDetailList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的工资单列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/mySalaryBillList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String mySalaryBillList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryBillQueryParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
if (StringUtils.isEmpty(queryParam.getToken())) {
|
||||
throw new SalaryRunTimeException(SalrayCheckSecondAuthConstant.CHECK_SECOND_FAIL_NO_TOKEN);
|
||||
}
|
||||
return new ResponseResult<SalaryBillQueryParam, Map<String, Object>>().run(getSalarySendWrapper(user)::mySalaryBillList, queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的工资单
|
||||
*
|
||||
* @param salaryInfoId
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/mySalaryBill")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String mySalaryBill(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "salaryInfoId") Long salaryInfoId, @QueryParam(value = "token") String token) {
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
throw new SalaryRunTimeException(SalrayCheckSecondAuthConstant.CHECK_SECOND_FAIL_NO_TOKEN);
|
||||
}
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Map<String, Object>>().run(getSalarySendWrapper(user)::mySalaryBill, salaryInfoId);
|
||||
}
|
||||
/******** 工资单发放 end ***********************************************************************************************/
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,421 +0,0 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.cloudstore.eccom.constant.WeaBoolAttr;
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryItemConstant;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.*;
|
||||
import com.engine.salary.entity.salaryBill.po.SalarySendPO;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.TaxAgentListDTO;
|
||||
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
||||
import com.engine.salary.enums.salarybill.SalarySendStatusEnum;
|
||||
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.salarybill.SalarySendMapper;
|
||||
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
||||
import com.engine.salary.service.SalarySendService;
|
||||
import com.engine.salary.service.SalaryTemplateService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
//import com.engine.salary.service.impl.SalarySendServiceImpl;
|
||||
import com.engine.salary.service.impl.SalarySendServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryTemplateServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.stereotype.Component;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 工资单发放
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/16 13:57
|
||||
*/
|
||||
@Component
|
||||
public class SalarySendWrapper extends Service {
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySendService getSalarySendService(User user) {
|
||||
return ServiceUtil.getService(SalarySendServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryTemplateService getSalaryTemplateService(User user) {
|
||||
return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
// @Resource
|
||||
// private SalaryBatchService salaryBatchService;
|
||||
// @Autowired
|
||||
// private ExecutorService taskExecutor;
|
||||
|
||||
/**
|
||||
* 工资单发放列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> list(SalarySendQueryParam queryParam) {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
Map<String, Object> datas = new HashMap<>(16);
|
||||
try {
|
||||
queryParam.setSalaryMonth(
|
||||
queryParam.getSalaryYearMonth().stream().map(m -> m.atDay(1)).collect(Collectors.toList()));
|
||||
|
||||
SalarySendMapper salarySendMapper = sqlSession.getMapper(SalarySendMapper.class);
|
||||
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<SalarySendListDTO> list = salarySendMapper.list(queryParam);
|
||||
PageInfo<SalarySendListDTO> pageInfo = new PageInfo<>(list, SalarySendListDTO.class);
|
||||
List<SalarySendListDTO> pageList = pageInfo.getList();
|
||||
List<Long> salarySobIds = pageList.stream().map(SalarySendListDTO::getSalarySobId).distinct().collect(Collectors.toList());
|
||||
// 获取默认模板
|
||||
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(salarySobIds);
|
||||
pageList.forEach(e -> {
|
||||
// 已发放
|
||||
e.setSendSituation(e.getSendNum() + "/" + e.getSendTotal());
|
||||
// 工资单模板
|
||||
Optional<SalaryTemplatePO> optional = salaryTemplates.stream().filter(s -> s.getSalarySobId().equals(e.getSalarySobId())).findFirst();
|
||||
if (optional.isPresent()) {
|
||||
e.setTemplate(optional.get().getName());
|
||||
e.setTemplateId(optional.get().getId());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
List<WeaTableColumn> columns = buildWeaTableColumns();
|
||||
WeaTable table = new WeaTable();
|
||||
table.setColumns(columns);
|
||||
//设置check是否可用
|
||||
List<WeaTableCheckboxpopedom> checkboxpopedomList = new ArrayList<>();
|
||||
WeaTableCheckboxpopedom checkboxpopedom = new WeaTableCheckboxpopedom();
|
||||
checkboxpopedom.setPopedompara("column:system_type");
|
||||
checkboxpopedom.setShowmethod("com.engine.salary.transmethod.TaxRateTransMethod.getCheckBoxPopedom");
|
||||
checkboxpopedomList.add(checkboxpopedom);
|
||||
table.setCheckboxList(checkboxpopedomList);
|
||||
table.setCheckboxpopedom(null);
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
|
||||
|
||||
datas.put("pageInfo", pageInfo);
|
||||
datas.put("datas", pageList);
|
||||
datas.put("columns", columns);
|
||||
datas.put("dataKey",result.getResultMap());
|
||||
return datas;
|
||||
}finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建表展示字段
|
||||
* @return
|
||||
*/
|
||||
private List<WeaTableColumn> buildWeaTableColumns() {
|
||||
List<WeaTableColumn> list = new ArrayList<>();
|
||||
WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id");
|
||||
idColumn.setDisplay(WeaBoolAttr.FALSE);
|
||||
list.add(new WeaTableColumn("10%","薪资所属月", "salaryYearMonth"));
|
||||
list.add(new WeaTableColumn("35%","薪资账套", "salarySob"));
|
||||
list.add(new WeaTableColumn("25%","工资单模板", "template"));
|
||||
list.add(new WeaTableColumn("15%","已发放", "sendSituation"));
|
||||
list.add(new WeaTableColumn("15%","最后发送时间", "lastSendTime"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 工资单发放基本信息
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SalarySendBaseInfoDTO getBaseInfo(Long id) {
|
||||
return getSalarySendService(user).getBaseInfo(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单发放信息列表的高级搜索
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
// public Map<String, Object> getInfoSearchCondition() {
|
||||
// List<WeaSearchConditionOption> taxAgentList = new ArrayList<>();
|
||||
// // 获取所有个税扣缴义务人
|
||||
// Collection<TaxAgentListDTO> taxAgentLists = taxAgentService.findAll(tenantKey);
|
||||
// taxAgentLists.forEach(e -> taxAgentList.add(new WeaSearchConditionOption(e.getId().toString(), e.getName())));
|
||||
//
|
||||
// WeaSearchCondition weaSearchCondition = SalaryFormatUtil.<SalarySendInfoSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalarySendInfoSearchConditionDTO.class,
|
||||
// SalarySendInfoSearchConditionDTO.builder().taxAgentOptions(taxAgentList).build(),
|
||||
// "salarySendInfo");
|
||||
// // 入职日期-添加范围
|
||||
// SalaryArchiveBO.addDatePickerRangeOtherParams(weaSearchCondition, "hiredate", employeeId, tenantKey);
|
||||
// // 只保留常用条件
|
||||
// weaSearchCondition.setGroups(weaSearchCondition.getGroups().stream().filter(e -> "commonGroup".equals(e.getId())).collect(Collectors.toList()));
|
||||
//
|
||||
// return weaSearchCondition;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 工资单发放信息列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
// TODO
|
||||
// public Map<String, Object> infoList(SalarySendInfoQueryParam queryParam) {
|
||||
// SalarySendInfoQueryParam.checkParam(queryParam);
|
||||
//
|
||||
// // 发送状态
|
||||
// if (queryParam.getSendStatus() != null) {
|
||||
// queryParam.setSendStatusVal(queryParam.getSendStatus().getValue());
|
||||
// }
|
||||
//
|
||||
// Page<SalarySendInfoListDTO> page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true);
|
||||
// page = salarySendService.salarySendInfoListPage(page, queryParam);
|
||||
// page.getRecords().forEach(e -> {
|
||||
// // 发放状态
|
||||
// int sendStatus = Integer.parseInt(e.getSendStatus());
|
||||
// e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(sendStatus));
|
||||
// e.setOperation(SalarySendStatusEnum.getNameByValue(sendStatus));
|
||||
// });
|
||||
// WeaTable<SalarySendInfoListDTO> weaTable = FormatManager.<SalarySendInfoListDTO>getInstance()
|
||||
// .genTable(SalarySendInfoListDTO.class, page);
|
||||
// weaTable.setModule("hrmsalary");
|
||||
// return weaTable;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出-工资单发放信息列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportInfoList(SalarySendInfoQueryParam queryParam) {
|
||||
// // 构建异步导出参数
|
||||
// Map<String, Object> map = salaryBatchService.buildeExportParam("exportSalarySendInfo");
|
||||
//
|
||||
// String username = UserContext.getCurrentUser().getUsername();
|
||||
// String eteamsId = TenantRpcContext.getEteamsId();
|
||||
// taskExecutor.execute(() -> {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salarySendService.exportInfoList(map, username, eteamsId, queryParam, employeeId, tenantKey);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// });
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 工资单发放
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public String grant(SalarySendGrantParam queryParam) {
|
||||
// return salarySendService.grant(queryParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 工资单撤回
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public String withdraw(SalarySendWithdrawParam queryParam) {
|
||||
// return salarySendService.withdraw(queryParam);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 工资单发放详情列表的高级搜索
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> getDetailSearchCondition() {
|
||||
// List<WeaSearchConditionOption> taxAgentList = new ArrayList<>();
|
||||
// // 获取所有个税扣缴义务人
|
||||
// Collection<TaxAgentListDTO> taxAgentLists = taxAgentService.findAll(tenantKey);
|
||||
// taxAgentLists.forEach(e -> taxAgentList.add(new WeaSearchConditionOption(e.getId().toString(), e.getName())));
|
||||
//
|
||||
// WeaSearchCondition weaSearchCondition = SalaryFormatUtil.<SalarySendDetailSearchConditionDTO>getInstance()
|
||||
// .buildCondition(SalarySendDetailSearchConditionDTO.class,
|
||||
// SalarySendDetailSearchConditionDTO.builder().taxAgentOptions(taxAgentList).build(),
|
||||
// "salarySendDetail");
|
||||
// // 入职日期-添加范围
|
||||
// SalaryArchiveBO.addDatePickerRangeOtherParams(weaSearchCondition, "hiredate", employeeId, tenantKey);
|
||||
// // 只保留常用条件
|
||||
// weaSearchCondition.setGroups(weaSearchCondition.getGroups().stream().filter(e -> "commonGroup".equals(e.getId())).collect(Collectors.toList()));
|
||||
//
|
||||
// return weaSearchCondition;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 工资单发放详情列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> detailList(SalarySendDetailQueryParam queryParam) {
|
||||
// WeaResult<String> checkResult = SalarySendDetailQueryParam.checkParam(queryParam, employeeId, tenantKey);
|
||||
// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误"));
|
||||
// }
|
||||
// SalarySendPO salarySend = salarySendService.getById(queryParam.getSalarySendId(), tenantKey);
|
||||
//
|
||||
// if (salarySend == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100510, "工资发放不存在"));
|
||||
// }
|
||||
//
|
||||
// // 1.根据模板获取薪资项目设置
|
||||
// List<SalaryTemplatePO> salaryTemplates = salaryTemplateService.getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()), tenantKey);
|
||||
// List<SalaryTemplateSalaryItemListDTO> salaryItems = salarySendService.getSalaryItemsSetting(CollectionUtils.isNotEmpty(salaryTemplates) ? salaryTemplates.get(0) : null, tenantKey);
|
||||
//
|
||||
// // 2.获取基本数据
|
||||
// Page<SalarySendDetailListDTO> page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true);
|
||||
// page = salarySendService.salarySendInfoDetailListPage(page, queryParam, tenantKey);
|
||||
//
|
||||
// // 3.组装详情数据
|
||||
// List<Map<String, Object>> listMaps = salarySendService.buildDetailList(salaryItems, page.getRecords(), salarySend.getSalaryAccountingId(), tenantKey);
|
||||
//
|
||||
// List<Long> employeeIds = page.getRecords().stream().map(SalarySendDetailListDTO::getEmployeeId).collect(Collectors.toList());
|
||||
//
|
||||
// // 是否合并计税
|
||||
// // TODO: 1/25/22 判断是否合并计税
|
||||
//
|
||||
// Page<Map<String, Object>> listPage = new Page<>(page.getCurrent(), page.getSize(), page.getTotal(), page.isSearchCount());
|
||||
// listPage.setRecords(listMaps);
|
||||
//
|
||||
// WeaTable<LinkedHashMap> weaTable = FormatManager.<LinkedHashMap>getInstance()
|
||||
// .genTable(LinkedHashMap.class, listPage);
|
||||
// weaTable.setModule("hrmsalary");
|
||||
// // 表格表头
|
||||
// List<WeaTableColumn> columns = new ArrayList<>();
|
||||
// columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 85429, "姓名"), "username", "100"));
|
||||
// columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86184, "个税扣缴义务人"), "taxAgent", "100"));
|
||||
// columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86185, "部门"), "department", "100"));
|
||||
// columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86186, "手机号"), "mobile", "100"));
|
||||
// columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 86317, "工号"), "jobNum", "100"));
|
||||
// for (SalaryTemplateSalaryItemListDTO salaryItem : salaryItems) {
|
||||
// columns.add(new WeaTableColumn(salaryItem.getName(), salaryItem.getId() + SalaryItemConstant.DYNAMIC_SUFFIX, "100"));
|
||||
// }
|
||||
// weaTable.setColumns(columns);
|
||||
// // 姓名固定在左侧
|
||||
// weaTable.getColumns().forEach(e -> {
|
||||
// if ("username".equals(e.getDataIndex())) {
|
||||
// e.setFixed("left");
|
||||
// }
|
||||
// });
|
||||
// // 复选框
|
||||
// weaTable.setCheckBoxPermission(this.getDefaultCheckBoxPermission(listMaps.size()));
|
||||
//
|
||||
// return weaTable;
|
||||
// }
|
||||
//
|
||||
// private List<Permission> getDefaultCheckBoxPermission(int recordSize) {
|
||||
// List<Permission> permissionList = Lists.newArrayList();
|
||||
// for (int i = 0; i < recordSize; i++) {
|
||||
// permissionList.add(new Permission(true, false));
|
||||
// }
|
||||
// return permissionList;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导出-工资单发放详情列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @param employeeId
|
||||
// * @param tenantKey
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> exportDetailList(SalarySendDetailQueryParam queryParam) {
|
||||
// // 获取发放详情
|
||||
// WeaResult<String> checkResult = SalarySendDetailQueryParam.checkParam(queryParam, employeeId, tenantKey);
|
||||
// if (checkResult.getCode() == WeaResultCodeEnum.ERROR.getCode()) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 84026, "参数错误"));
|
||||
// }
|
||||
// SalarySendPO salarySend = salarySendService.getById(queryParam.getSalarySendId(), tenantKey);
|
||||
// if (salarySend == null) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 100512, "工资单发放不存在"));
|
||||
// }
|
||||
//
|
||||
// // 构建异步导出参数
|
||||
// Map<String, Object> map = salaryBatchService.buildeExportParam("exportSalarySendDetail");
|
||||
//
|
||||
// String username = UserContext.getCurrentUser().getUsername();
|
||||
// String eteamsId = TenantRpcContext.getEteamsId();
|
||||
// taskExecutor.execute(() -> {
|
||||
// try {
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// salarySendService.exportDetailList(map, username, eteamsId, salarySend, queryParam, employeeId, tenantKey);
|
||||
// } finally {
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// });
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 我的工资单列表
|
||||
// *
|
||||
// * @param queryParam
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> mySalaryBillList(SalaryBillQueryParam queryParam) {
|
||||
// Page<SalaryMySalaryBillListDTO> page = new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true);
|
||||
// queryParam.setEmployeeId(employeeId);
|
||||
// queryParam.setSalaryMonth(
|
||||
// org.apache.commons.collections4.CollectionUtils.emptyIfNull(queryParam.getSalaryYearMonth()).stream().map(m -> m.atDay(1)).collect(Collectors.toList()));
|
||||
// page = salarySendService.mySalaryBillListPage(page, queryParam, tenantKey);
|
||||
//
|
||||
// page.getRecords().forEach(e -> {
|
||||
// e.setTaxAgent(StringUtils.isEmpty(e.getTaxAgent()) ? "" : e.getTaxAgent());
|
||||
// e.setAcctTimes(e.getAcctTimes());
|
||||
// });
|
||||
//
|
||||
// WeaTable<SalaryMySalaryBillListDTO> weaTable = FormatManager.<SalaryMySalaryBillListDTO>getInstance()
|
||||
// .genTable(SalaryMySalaryBillListDTO.class, page);
|
||||
//
|
||||
// // 在外展示操作按钮
|
||||
// weaTable.getOperates().forEach(e -> e.setOuter(Boolean.TRUE));
|
||||
// weaTable.setModule("hrmsalary");
|
||||
// return weaTable;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 我的工资单
|
||||
// *
|
||||
// * @param salaryInfoId
|
||||
// * @return
|
||||
// */
|
||||
// public Map<String, Object> mySalaryBill(Long salaryInfoId) {
|
||||
// return salarySendService.mySalaryBill(salaryInfoId, employeeId, tenantKey);
|
||||
// }
|
||||
}
|
||||
|
|
@ -1,282 +0,0 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.salaryBill.dto.*;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateCopyParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateDefaultUseParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateQueryParam;
|
||||
import com.engine.salary.entity.salaryBill.param.SalaryTemplateSaveParam;
|
||||
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateVarEnum;
|
||||
import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.SalarySobService;
|
||||
import com.engine.salary.service.SalaryTemplateService;
|
||||
import com.engine.salary.service.impl.SalarySobServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryTemplateServiceImpl;
|
||||
import com.engine.salary.util.db.DBType;
|
||||
import com.mzlion.core.json.fastjson.JsonUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 工资单模板
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2022/3/16 13:56
|
||||
*/
|
||||
@Component
|
||||
public class SalaryTemplateWrapper extends Service {
|
||||
|
||||
private SalaryTemplateService getSalaryTemplateService(User user) {
|
||||
return ServiceUtil.getService(SalaryTemplateServiceImpl.class, user);
|
||||
}
|
||||
// @RpcReference
|
||||
// private MailBaseService mailBaseService;
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单模板列表
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> list(SalaryTemplateQueryParam queryParam) {
|
||||
SalaryWeaTable<SalaryTemplateListDTO> table = new SalaryWeaTable<SalaryTemplateListDTO>(user, SalaryTemplateListDTO.class);
|
||||
|
||||
String fields = " t.id" +
|
||||
" , t.name" +
|
||||
" , t.salary_sob_id as salarySob" +
|
||||
" , t.use_type as useType" +
|
||||
" , t.description";
|
||||
|
||||
String from = " from hrsa_salary_template t";
|
||||
|
||||
table.setBackfields(fields);
|
||||
table.setSqlform(from);
|
||||
table.setSqlwhere(makeSqlWhere(queryParam));
|
||||
table.setSqlorderby("t.id DESC");
|
||||
table.setSqlprimarykey("t.id");
|
||||
table.setSqlisdistinct("false");
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
return result.getResultMap();
|
||||
}
|
||||
|
||||
private String makeSqlWhere(SalaryTemplateQueryParam queryParam) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
|
||||
String sqlWhere = " t.delete_type = 0 ";
|
||||
|
||||
String name = queryParam.getName();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
sqlWhere += " AND t.name " + dbType.like(name);
|
||||
}
|
||||
|
||||
Collection<Long> ids = queryParam.getIds();
|
||||
|
||||
if(ids != null && ids.size() > 0) {
|
||||
sqlWhere += " AND t.id in ("+ ids.stream().map(Object::toString).collect(Collectors.joining(",")) + ") ";
|
||||
}
|
||||
|
||||
Long salarySobId = queryParam.getSalarySobId();
|
||||
|
||||
if(salarySobId != null) {
|
||||
sqlWhere += " AND t.salary_sob_id = " + salarySobId;
|
||||
}
|
||||
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工资单模板基础设置表单
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SalaryTemplateBaseFormDTO getBaseForm(Long id) {
|
||||
|
||||
SalaryTemplateBaseSetDTO salaryTemplateBaseSetDTO = new SalaryTemplateBaseSetDTO();
|
||||
|
||||
if (id != null) {
|
||||
SalaryTemplatePO po = getSalaryTemplateService(user).getById(id);
|
||||
if (po == null) {
|
||||
throw new SalaryRunTimeException("工资单模板不存在");
|
||||
}
|
||||
BeanUtils.copyProperties(po, salaryTemplateBaseSetDTO);
|
||||
salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId());
|
||||
salaryTemplateBaseSetDTO.setEmailStatus(po.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setMsgStatus(po.getMsgStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
salaryTemplateBaseSetDTO.setSalarySob(po.getSalarySobId());
|
||||
salaryTemplateBaseSetDTO.setSendEmail(po.getSendEmailId());
|
||||
}
|
||||
|
||||
|
||||
// 查询所有启用的薪资账套
|
||||
List<SalarySobPO> salarySobs = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
|
||||
List<Map<String, Object>> salarySobOptions = salarySobs.stream()
|
||||
.map(salarySobPO -> {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("id", salarySobPO.getId());
|
||||
item.put("name", salarySobPO.getName());
|
||||
return item;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 邮箱下拉
|
||||
// List<WeaFormOption> sendEmailOptions = Lists.newArrayList();
|
||||
// MailPublicAccountListObj mailPublicAccountListObj = mailBaseService.getMailPublicAccountList(employeeId, tenantKey);
|
||||
// List<MailPublicAccountBo> mailPublicAccountBos = mailPublicAccountListObj.getMailPublicAccountList();
|
||||
// mailPublicAccountBos.forEach(e->sendEmailOptions.add(new WeaFormOption(String.valueOf(e.getId()), e.getMailAddress())));
|
||||
|
||||
// WeaForm salaryTemplateBase = SalaryFormatUtil.<SalaryTemplateBaseSetDTO>getInstance().buildForm(SalaryTemplateBaseSetDTO.class, SalaryTemplateBaseSetDTO.builder().salarySobOptions(salarySobOptions).sendEmailOptions(sendEmailOptions).build());
|
||||
|
||||
Map<String, Object> salaryTemplateBase = new HashMap<>();
|
||||
salaryTemplateBase.put("data", salaryTemplateBaseSetDTO);
|
||||
salaryTemplateBase.put("salarySobOptions", salarySobOptions);
|
||||
// 编辑时禁止修改薪资账套 前端实现
|
||||
// 分组 前端实现
|
||||
|
||||
return SalaryTemplateBaseFormDTO.builder()
|
||||
.id(id)
|
||||
.salaryTemplateBaseSet(salaryTemplateBase)
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工资单模板显示设置表单
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public SalaryTemplateShowFormDTO getShowForm(Long id) {
|
||||
SalaryTemplateShowSetDTO salaryTemplateShowSetDTO = new SalaryTemplateShowSetDTO();
|
||||
|
||||
SalaryTemplatePO po = new SalaryTemplatePO();
|
||||
if (id != null) {
|
||||
po = getSalaryTemplateService(user).getById(id);
|
||||
if (po == null) {
|
||||
throw new SalaryRunTimeException("工资单模板不存在");
|
||||
}
|
||||
BeanUtils.copyProperties(po, salaryTemplateShowSetDTO);
|
||||
salaryTemplateShowSetDTO.setTextContentPosition(po.getTextContentPosition().toString());
|
||||
salaryTemplateShowSetDTO.setSalaryItemNullStatus(po.getSalaryItemNullStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue()));
|
||||
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(), SalaryTemplateSalaryItemSetListDTO.class);
|
||||
}
|
||||
|
||||
return SalaryTemplateShowFormDTO.builder()
|
||||
.id(id)
|
||||
.vars(Arrays.stream(SalaryTemplateVarEnum.values()).map(SalaryTemplateVarEnum::getValue).collect(Collectors.toList()))
|
||||
.salaryTemplateShowSet(salaryTemplateShowSet)
|
||||
.salaryTemplateSalaryItemSet(salaryTemplateShowSetData)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资项目设置
|
||||
*
|
||||
* @param salarySobId
|
||||
* @return
|
||||
*/
|
||||
public List<SalaryTemplateSalaryItemSetListDTO> getSalaryItemSet(Long salarySobId) {
|
||||
return getSalaryTemplateService(user).getSalaryItemSet(salarySobId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工资单模板默认使用
|
||||
*
|
||||
* @param defaultUseParam
|
||||
* @return
|
||||
*/
|
||||
public String defaultUse(SalaryTemplateDefaultUseParam defaultUseParam) {
|
||||
return getSalaryTemplateService(user).defaultUse(defaultUseParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public String save(SalaryTemplateSaveParam saveParam) {
|
||||
return getSalaryTemplateService(user).save(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑工资单模板
|
||||
*
|
||||
* @param saveParam
|
||||
* @return
|
||||
*/
|
||||
public String update(SalaryTemplateSaveParam saveParam) {
|
||||
return getSalaryTemplateService(user).update(saveParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制工资单模板
|
||||
*
|
||||
* @param copyParam
|
||||
* @return
|
||||
*/
|
||||
public String copy(SalaryTemplateCopyParam copyParam) {
|
||||
return getSalaryTemplateService(user).copy(copyParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工资单模板
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public String delete(Collection<Long> ids) {
|
||||
return getSalaryTemplateService(user).delete(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取薪资账套下拉列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> selectSalarySobList() {
|
||||
return getSalaryTemplateService(user).selectSalarySobList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue