2022-04-12 10:11:53 +08:00
|
|
|
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.*;
|
2022-12-02 17:35:14 +08:00
|
|
|
import com.engine.salary.entity.salaryBill.param.*;
|
2022-04-12 10:11:53 +08:00
|
|
|
import com.engine.salary.entity.salaryBill.po.SalaryTemplatePO;
|
2022-12-02 17:35:14 +08:00
|
|
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
|
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
|
2022-04-12 10:11:53 +08:00
|
|
|
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
2022-12-02 17:35:14 +08:00
|
|
|
import com.engine.salary.enums.salarybill.SalaryTemplateReplenishRuleEnum;
|
2022-04-12 10:11:53 +08:00
|
|
|
import com.engine.salary.enums.salarybill.SalaryTemplateVarEnum;
|
|
|
|
|
import com.engine.salary.enums.salarybill.SalaryTemplateWhetherEnum;
|
|
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
2022-12-02 17:35:14 +08:00
|
|
|
import com.engine.salary.service.*;
|
|
|
|
|
import com.engine.salary.service.impl.*;
|
2022-06-06 16:55:02 +08:00
|
|
|
import com.engine.salary.util.SalaryEntityUtil;
|
2022-12-02 17:35:14 +08:00
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
2022-04-12 10:11:53 +08:00
|
|
|
import com.engine.salary.util.db.DBType;
|
|
|
|
|
import com.mzlion.core.json.fastjson.JsonUtil;
|
2022-04-13 10:33:56 +08:00
|
|
|
import com.mzlion.core.utils.BeanUtils;
|
2022-06-06 16:55:02 +08:00
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
2022-04-12 10:11:53 +08:00
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
|
|
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
|
|
|
|
|
*/
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-02 17:35:14 +08:00
|
|
|
private SalarySobBackItemService getSalarySobBackItemService(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalarySobBackItemServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private SalaryItemService getSalaryItemService(User user) {
|
|
|
|
|
return ServiceUtil.getService(SalaryItemServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-06 16:55:02 +08:00
|
|
|
private TaxAgentService getTaxAgentService(User user) {
|
|
|
|
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 10:11:53 +08:00
|
|
|
/**
|
|
|
|
|
* 工资单模板列表
|
|
|
|
|
*
|
|
|
|
|
* @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" +
|
2022-12-06 15:29:08 +08:00
|
|
|
" , t.replenish_name as replenishName" +
|
2022-04-14 09:08:04 +08:00
|
|
|
" , s.name as salarySob" +
|
2022-04-12 10:11:53 +08:00
|
|
|
" , t.use_type as useType" +
|
|
|
|
|
" , t.description";
|
|
|
|
|
|
2022-04-14 09:08:04 +08:00
|
|
|
String from = " from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id ";
|
2022-04-12 10:11:53 +08:00
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
2022-06-06 16:55:02 +08:00
|
|
|
if (ids != null && ids.size() > 0) {
|
|
|
|
|
sqlWhere += " AND t.id in (" + ids.stream().map(Object::toString).collect(Collectors.joining(",")) + ") ";
|
2022-04-12 10:11:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Long salarySobId = queryParam.getSalarySobId();
|
|
|
|
|
|
2022-06-06 16:55:02 +08:00
|
|
|
if (salarySobId != null) {
|
2022-04-12 10:11:53 +08:00
|
|
|
sqlWhere += " AND t.salary_sob_id = " + salarySobId;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-06 16:55:02 +08:00
|
|
|
long currentEmployeeId = user.getUID();
|
|
|
|
|
Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
|
|
|
|
|
if (needAuth) {
|
|
|
|
|
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByDisable(NumberUtils.INTEGER_ZERO);
|
|
|
|
|
Set<Long> salarySobIds = SalaryEntityUtil.properties(salarySobPOS, SalarySobPO::getId);
|
|
|
|
|
if (CollectionUtils.isNotEmpty(salarySobIds)) {
|
|
|
|
|
sqlWhere += " AND t.salary_sob_id in (" + salarySobIds.stream().map(Object::toString).collect(Collectors.joining(",")) + ") ";
|
|
|
|
|
} else {
|
|
|
|
|
sqlWhere += " AND 1=2 ";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-04-12 10:11:53 +08:00
|
|
|
return sqlWhere;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取工资单模板基础设置表单
|
|
|
|
|
*
|
|
|
|
|
* @param id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public SalaryTemplateBaseFormDTO getBaseForm(Long id) {
|
|
|
|
|
|
|
|
|
|
SalaryTemplateBaseSetDTO salaryTemplateBaseSetDTO = new SalaryTemplateBaseSetDTO();
|
|
|
|
|
|
2022-12-06 15:29:08 +08:00
|
|
|
List<Map<String, String>> replenishRuleSetOptionList = Collections.emptyList();
|
2022-04-12 10:11:53 +08:00
|
|
|
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());
|
2022-12-02 17:35:14 +08:00
|
|
|
// 规则赋值
|
|
|
|
|
salaryTemplateBaseSetDTO.setReplenishRule(SalaryTemplateReplenishRuleEnum.ALL.getValue().equals(po.getReplenishRule()) ? po.getReplenishRule() : SalaryTemplateReplenishRuleEnum.BYRULE.getValue());
|
|
|
|
|
// 规则设置赋值
|
|
|
|
|
salaryTemplateBaseSetDTO.setReplenishRuleSet(po.getReplenishRule());
|
|
|
|
|
// 修改时获取补规则设置下拉列表
|
|
|
|
|
replenishRuleSetOptionList = getReplenishRuleSetOptions(po.getSalarySobId());
|
2022-04-12 10:11:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询所有启用的薪资账套
|
|
|
|
|
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)
|
2022-12-02 17:35:14 +08:00
|
|
|
.replenishRuleSetOption(replenishRuleSetOptionList)
|
2022-04-12 10:11:53 +08:00
|
|
|
.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(), List.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) {
|
2022-12-06 15:29:08 +08:00
|
|
|
return getSalaryTemplateService(user).getSalaryItemSet(salarySobId, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<SalaryTemplateSalaryItemSetListDTO> getReplenishSalaryItemSet(Long salarySobId) {
|
|
|
|
|
return getSalaryTemplateService(user).getSalaryItemSet(salarySobId, true);
|
2022-04-12 10:11:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 工资单模板默认使用
|
|
|
|
|
*
|
|
|
|
|
* @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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-12-02 17:35:14 +08:00
|
|
|
/**
|
|
|
|
|
* 获取补发规则设置下拉列表
|
|
|
|
|
*
|
|
|
|
|
* @param salarySobId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
2022-12-06 15:29:08 +08:00
|
|
|
public List<Map<String, String>> getReplenishRuleSetOptions(Long salarySobId) {
|
2022-12-02 17:35:14 +08:00
|
|
|
if (salarySobId == null) {
|
2022-12-06 15:29:08 +08:00
|
|
|
return Collections.emptyList();
|
2022-12-02 17:35:14 +08:00
|
|
|
}
|
|
|
|
|
SalarySobPO salarySob = getSalarySobService(user).getById(salarySobId);
|
|
|
|
|
if (salarySob == null) {
|
2022-12-06 15:29:08 +08:00
|
|
|
return Collections.emptyList();
|
2022-12-02 17:35:14 +08:00
|
|
|
}
|
|
|
|
|
// 查询薪资账套的回算薪资项目
|
|
|
|
|
List<SalarySobBackItemPO> salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySobId);
|
|
|
|
|
if (CollectionUtils.isEmpty(salarySobBackItems)) {
|
|
|
|
|
salarySobBackItems = getSalarySobBackItemService(user).listBySalarySobId(salarySob.getId());
|
|
|
|
|
}
|
|
|
|
|
List<SalaryItemPO> salaryItemPOS = getSalaryItemService(user).listByIds(salarySobBackItems.stream().map(SalarySobBackItemPO::getSalaryItemId).collect(Collectors.toList()));
|
|
|
|
|
|
|
|
|
|
String ruleTip = "(" + SalaryI18nUtil.getI18nLabel( 140142, "不等于0")+")";
|
|
|
|
|
|
|
|
|
|
List<Map<String, String>> result = salaryItemPOS.stream().map(m -> {
|
|
|
|
|
Map<String, String> map = new HashMap<>(2);
|
|
|
|
|
map.put("id", String.valueOf(m.getId()));
|
|
|
|
|
map.put("content", m.getName() + ruleTip);
|
|
|
|
|
return map;
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
2022-12-06 15:29:08 +08:00
|
|
|
return result;
|
|
|
|
|
// if(result!= null && result.size()>0){
|
|
|
|
|
// return result.get(0);
|
|
|
|
|
// }
|
|
|
|
|
// return Collections.emptyMap();
|
2022-12-02 17:35:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取工资单模板补发设置表单
|
|
|
|
|
*
|
|
|
|
|
* @param replenishFormQueryParam
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public SalaryTemplateReplenishFormDTO getReplenishForm(ReplenishFormQueryParam replenishFormQueryParam) {
|
2022-12-06 15:29:08 +08:00
|
|
|
Long id = replenishFormQueryParam.getId();
|
|
|
|
|
SalaryTemplateReplenishFormDTO salaryTemplateReplenishSetDTO = new SalaryTemplateReplenishFormDTO();
|
|
|
|
|
|
|
|
|
|
// 补发薪资项目设置
|
|
|
|
|
List<SalaryTemplateSalaryItemSetListDTO> replenishSalaryItemSetting;
|
|
|
|
|
if (id != null) {
|
|
|
|
|
SalaryTemplatePO po = getSalaryTemplateService(user).getById(id);
|
|
|
|
|
if (po == null) {
|
|
|
|
|
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(100533, "工资单模板不存在")+"[id:%s]", id));
|
|
|
|
|
}
|
|
|
|
|
BeanUtils.copyProperties(po, salaryTemplateReplenishSetDTO);
|
|
|
|
|
if (StringUtils.isNotEmpty(po.getReplenishSalaryItemSetting())) {
|
|
|
|
|
replenishSalaryItemSetting = JsonUtil.fromJson(po.getReplenishSalaryItemSetting(), List.class);
|
|
|
|
|
} else {
|
|
|
|
|
replenishSalaryItemSetting = getReplenishSalaryItemSet(replenishFormQueryParam.getSalarySobId());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
replenishSalaryItemSetting = getReplenishSalaryItemSet(replenishFormQueryParam.getSalarySobId());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SalaryTemplateReplenishFormDTO.builder()
|
|
|
|
|
.id(id)
|
|
|
|
|
.replenishSalaryTemplateSalaryItemSet(replenishSalaryItemSetting)
|
|
|
|
|
.build();
|
2022-12-02 17:35:14 +08:00
|
|
|
}
|
|
|
|
|
|
2022-04-12 10:11:53 +08:00
|
|
|
}
|