488 lines
20 KiB
Java
488 lines
20 KiB
Java
|
|
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.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.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.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 org.apache.commons.collections.CollectionUtils;
|
||
|
|
import org.apache.commons.lang3.StringUtils;
|
||
|
|
import org.apache.ibatis.session.SqlSession;
|
||
|
|
import org.springframework.stereotype.Component;
|
||
|
|
import weaver.conn.mybatis.MyBatisFactory;
|
||
|
|
import weaver.hrm.User;
|
||
|
|
|
||
|
|
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
|
||
|
|
*/
|
||
|
|
public Map<String, Object> infoList(SalarySendInfoQueryParam queryParam) {
|
||
|
|
|
||
|
|
Map<String, Object> datas = new HashMap<>(16);
|
||
|
|
SalarySendInfoQueryParam.checkParam(queryParam);
|
||
|
|
// 发送状态
|
||
|
|
if (queryParam.getSendStatus() != null) {
|
||
|
|
queryParam.setSendStatusVal(queryParam.getSendStatus().getValue());
|
||
|
|
}
|
||
|
|
PageInfo<SalarySendInfoListDTO> pageInfo = getSalarySendService(user).salarySendInfoListPage(queryParam);
|
||
|
|
List<SalarySendInfoListDTO> list = pageInfo.getList();
|
||
|
|
list.forEach(e -> {
|
||
|
|
// 发放状态
|
||
|
|
int sendStatus = Integer.parseInt(e.getSendStatus());
|
||
|
|
e.setSendStatus(SalarySendStatusEnum.getDefaultLabelByValue(sendStatus));
|
||
|
|
e.setOperation(SalarySendStatusEnum.getNameByValue(sendStatus));
|
||
|
|
});
|
||
|
|
|
||
|
|
List<WeaTableColumn> columns = buildInfoListWeaTableColumns();
|
||
|
|
|
||
|
|
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",list);
|
||
|
|
datas.put("columns",columns);
|
||
|
|
datas.put("dataKey",result.getResultMap());
|
||
|
|
|
||
|
|
return datas;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 工资单信息列表
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
private List<WeaTableColumn> buildInfoListWeaTableColumns() {
|
||
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
||
|
|
WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id");
|
||
|
|
idColumn.setDisplay(WeaBoolAttr.TRUE);
|
||
|
|
list.add(new WeaTableColumn("20%","姓名", "username"));
|
||
|
|
list.add(new WeaTableColumn("20%","个税扣缴义务人", "taxAgent"));
|
||
|
|
list.add(new WeaTableColumn("20%","部门", "department"));
|
||
|
|
list.add(new WeaTableColumn("20%","手机号", "mobile"));
|
||
|
|
list.add(new WeaTableColumn("20%","工号", "jobNum"));
|
||
|
|
list.add(new WeaTableColumn("20%","发送状态", "sendStatus"));
|
||
|
|
list.add(new WeaTableColumn("20%","操作", "operation"));
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出-工资单发放信息列表
|
||
|
|
*
|
||
|
|
* @param queryParam
|
||
|
|
* @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;
|
||
|
|
// // TODO
|
||
|
|
// return null;
|
||
|
|
// }
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 工资单发放
|
||
|
|
*
|
||
|
|
* @param queryParam
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public String grant(SalarySendGrantParam queryParam) {
|
||
|
|
return getSalarySendService(user).grant(queryParam);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 工资单撤回
|
||
|
|
*
|
||
|
|
* @param queryParam
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public String withdraw(SalarySendWithdrawParam queryParam) {
|
||
|
|
return getSalarySendService(user).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) {
|
||
|
|
Map<String, Object> datas = new HashMap<>();
|
||
|
|
SalarySendDetailQueryParam.checkParam(queryParam);
|
||
|
|
SalarySendPO salarySend = getSalarySendService(user).getById(queryParam.getSalarySendId());
|
||
|
|
|
||
|
|
if (salarySend == null) {
|
||
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100510, "工资发放不存在"));
|
||
|
|
}
|
||
|
|
|
||
|
|
// 1.根据模板获取薪资项目设置
|
||
|
|
List<SalaryTemplatePO> salaryTemplates = getSalaryTemplateService(user).getDefaultTemplates(Collections.singletonList(salarySend.getSalarySobId()));
|
||
|
|
List<SalaryTemplateSalaryItemListDTO> salaryItems = getSalarySendService(user).getSalaryItemsSetting(CollectionUtils.isNotEmpty(salaryTemplates) ? salaryTemplates.get(0) : null);
|
||
|
|
|
||
|
|
// 2.获取基本数据
|
||
|
|
PageInfo<SalarySendDetailListDTO> pageInfo = getSalarySendService(user).salarySendInfoDetailListPage(queryParam);
|
||
|
|
|
||
|
|
List<SalarySendDetailListDTO> records = pageInfo.getList();
|
||
|
|
// 3.组装详情数据
|
||
|
|
List<Map<String, Object>> listMaps = getSalarySendService(user).buildDetailList(salaryItems, records, salarySend.getSalaryAccountingId());
|
||
|
|
|
||
|
|
List<Long> employeeIds = records.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);
|
||
|
|
|
||
|
|
|
||
|
|
List<WeaTableColumn> columns = buildDetailListWeaTableColumns();
|
||
|
|
|
||
|
|
|
||
|
|
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", records);
|
||
|
|
datas.put("columns",columns);
|
||
|
|
datas.put("dataKey",result.getResultMap());
|
||
|
|
|
||
|
|
return datas;
|
||
|
|
}
|
||
|
|
|
||
|
|
private List<WeaTableColumn> buildDetailListWeaTableColumns() {
|
||
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
||
|
|
WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id");
|
||
|
|
idColumn.setDisplay(WeaBoolAttr.TRUE);
|
||
|
|
list.add(new WeaTableColumn("20%","姓名", "username"));
|
||
|
|
list.add(new WeaTableColumn("20%","个税扣缴义务人", "taxAgent"));
|
||
|
|
list.add(new WeaTableColumn("20%","部门", "department"));
|
||
|
|
list.add(new WeaTableColumn("20%","手机号", "mobile"));
|
||
|
|
list.add(new WeaTableColumn("20%","工号", "jobNum"));
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 导出-工资单发放详情列表
|
||
|
|
*
|
||
|
|
* @param queryParam
|
||
|
|
* @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;
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 我的工资单列表
|
||
|
|
*
|
||
|
|
* @param queryParam
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map<String, Object> mySalaryBillList(SalaryBillQueryParam queryParam) {
|
||
|
|
Map<String, Object> datas = new HashMap<>();
|
||
|
|
queryParam.setEmployeeId((long)user.getUID());
|
||
|
|
queryParam.setSalaryMonth(
|
||
|
|
queryParam.getSalaryYearMonth().stream().map(m -> m.atDay(1)).collect(Collectors.toList()));
|
||
|
|
PageInfo<SalaryMySalaryBillListDTO> pageInfo = getSalarySendService(user).mySalaryBillListPage(queryParam);
|
||
|
|
List<SalaryMySalaryBillListDTO> records = pageInfo.getList();
|
||
|
|
|
||
|
|
records.forEach(e -> {
|
||
|
|
e.setTaxAgent(StringUtils.isEmpty(e.getTaxAgent()) ? "" : e.getTaxAgent());
|
||
|
|
e.setAcctTimes(e.getAcctTimes());
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
List<WeaTableColumn> columns = buildMySalaryBillListColumns();
|
||
|
|
|
||
|
|
|
||
|
|
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", records);
|
||
|
|
datas.put("columns",columns);
|
||
|
|
datas.put("dataKey",result.getResultMap());
|
||
|
|
|
||
|
|
return datas;
|
||
|
|
}
|
||
|
|
|
||
|
|
private List<WeaTableColumn> buildMySalaryBillListColumns() {
|
||
|
|
List<WeaTableColumn> list = new ArrayList<>();
|
||
|
|
WeaTableColumn idColumn = new WeaTableColumn("0px", "id", "id");
|
||
|
|
idColumn.setDisplay(WeaBoolAttr.TRUE);
|
||
|
|
list.add(new WeaTableColumn("20%","薪资所属月", "salaryYearMonth"));
|
||
|
|
list.add(new WeaTableColumn("40%","个税扣缴义务人", "taxAgent"));
|
||
|
|
list.add(new WeaTableColumn("40%","发放时间", "sendTime"));
|
||
|
|
return list;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 我的工资单
|
||
|
|
*
|
||
|
|
* @param salaryInfoId
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public Map<String, Object> mySalaryBill(Long salaryInfoId) {
|
||
|
|
return getSalarySendService(user).mySalaryBill(salaryInfoId, (long) user.getUID());
|
||
|
|
}
|
||
|
|
}
|