2022-03-28 16:36:40 +08:00
|
|
|
|
package com.engine.salary.wrapper;
|
|
|
|
|
|
|
2022-04-01 13:50:24 +08:00
|
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
2022-04-01 14:13:04 +08:00
|
|
|
|
import com.cloudstore.eccom.result.WeaResultMsg;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
|
|
|
|
|
import com.engine.core.impl.Service;
|
|
|
|
|
|
import com.engine.salary.biz.EmployBiz;
|
2022-04-01 14:13:04 +08:00
|
|
|
|
import com.engine.salary.component.SalaryWeaTable;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
2022-04-01 13:50:24 +08:00
|
|
|
|
import com.engine.salary.entity.salaryarchive.bo.SalaryArchiveBO;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveBaseInfoFormDTO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveFormDTO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
2022-09-07 09:45:37 +08:00
|
|
|
|
import com.engine.salary.entity.salaryarchive.param.*;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveDimissionPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
|
|
|
|
|
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
2022-05-31 16:41:11 +08:00
|
|
|
|
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
|
|
|
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
2022-04-07 20:05:58 +08:00
|
|
|
|
import com.engine.salary.enums.UserStatusEnum;
|
2022-10-10 14:58:29 +08:00
|
|
|
|
import com.engine.salary.enums.salaryarchive.*;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.salary.exception.SalaryRunTimeException;
|
|
|
|
|
|
import com.engine.salary.service.SalaryArchiveItemService;
|
|
|
|
|
|
import com.engine.salary.service.SalaryArchiveService;
|
2022-05-31 21:05:59 +08:00
|
|
|
|
import com.engine.salary.service.TaxAgentService;
|
2022-03-29 17:10:59 +08:00
|
|
|
|
import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl;
|
2022-03-31 15:41:55 +08:00
|
|
|
|
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
2022-05-31 21:05:59 +08:00
|
|
|
|
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
|
import com.engine.salary.util.page.PageInfo;
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
2022-04-07 20:05:58 +08:00
|
|
|
|
import com.google.common.collect.Maps;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
2022-03-29 17:10:59 +08:00
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
2022-07-18 16:19:15 +08:00
|
|
|
|
import weaver.conn.RecordSet;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
2022-03-28 16:36:40 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 薪资档案
|
|
|
|
|
|
* <p>Copyright: Copyright (c) 2022</p>
|
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author qiantao
|
|
|
|
|
|
* @version 1.0
|
|
|
|
|
|
**/
|
2022-03-28 20:04:27 +08:00
|
|
|
|
public class SalaryArchiveWrapper extends Service {
|
|
|
|
|
|
|
|
|
|
|
|
private SalaryArchiveService getSalaryArchiveService(User user) {
|
2022-07-18 18:08:59 +08:00
|
|
|
|
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-29 17:10:59 +08:00
|
|
|
|
private SalaryArchiveItemService getSalaryArchiveItemService(User user) {
|
2022-07-18 18:08:59 +08:00
|
|
|
|
return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user);
|
2022-03-29 17:10:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-28 20:04:27 +08:00
|
|
|
|
private EmployBiz employeeService = new EmployBiz();
|
2022-03-29 17:10:59 +08:00
|
|
|
|
|
2022-05-31 21:05:59 +08:00
|
|
|
|
private TaxAgentService getTaxAgentService(User user) {
|
|
|
|
|
|
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
2022-03-29 17:10:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-28 20:04:27 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 薪资档案列表(分页)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2022-07-18 18:08:59 +08:00
|
|
|
|
public Map<String, Object> list(SalaryArchiveQueryParam queryParam) {
|
2022-04-01 13:50:24 +08:00
|
|
|
|
//薪资档案列表
|
2022-03-29 17:10:59 +08:00
|
|
|
|
PageInfo<SalaryArchiveListDTO> pageInfo = getSalaryArchiveService(user).listPage(queryParam);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
Collection<SalaryArchiveListDTO> salaryArchives = pageInfo.getList();
|
2022-04-01 13:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
//所有个税扣缴义务人
|
2022-05-31 16:41:11 +08:00
|
|
|
|
Collection<TaxAgentPO> taxAgentLists = getTaxAgentService(user).listAll();
|
2022-04-01 13:50:24 +08:00
|
|
|
|
|
2022-03-28 20:04:27 +08:00
|
|
|
|
// 获取所有可被引用的薪资项目
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
2022-04-01 13:50:24 +08:00
|
|
|
|
|
2022-04-01 14:13:04 +08:00
|
|
|
|
//整合所有的显示列(固定列+薪资项目动态列)
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<Map<String, Object>> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<Map<String, Object>>(listMaps);
|
2022-05-25 13:13:03 +08:00
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
|
pageInfos.setPageNum(pageInfo.getPageNum());
|
|
|
|
|
|
pageInfos.setPageSize(pageInfo.getPageSize());
|
2022-03-28 20:04:27 +08:00
|
|
|
|
|
2022-04-01 14:13:04 +08:00
|
|
|
|
|
2022-04-01 13:50:24 +08:00
|
|
|
|
//动态列组装
|
2022-04-01 14:13:04 +08:00
|
|
|
|
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
|
|
|
|
|
|
|
|
|
|
|
|
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
|
|
|
|
|
|
table.setColumns(columns);
|
2022-04-01 13:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
2022-04-01 14:13:04 +08:00
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
2022-05-31 21:48:00 +08:00
|
|
|
|
|
2022-07-18 18:08:59 +08:00
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
2022-04-01 14:13:04 +08:00
|
|
|
|
datas.put("pageInfo", pageInfos);
|
2022-07-18 18:08:59 +08:00
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
2022-07-21 17:28:47 +08:00
|
|
|
|
datas.put("salaryArchives", salaryArchives);
|
2022-04-01 13:50:24 +08:00
|
|
|
|
return datas;
|
2022-03-28 20:04:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-10 14:58:29 +08:00
|
|
|
|
|
2022-10-10 15:15:23 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 薪资档案列表(分页)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> list(SalaryArchiveQueryParam queryParam, SalaryArchiveListTypeEnum listTypeEnum) {
|
|
|
|
|
|
//薪资档案列表
|
|
|
|
|
|
PageInfo<SalaryArchiveListDTO> pageInfo = getSalaryArchiveService(user).listPage(queryParam);
|
|
|
|
|
|
Collection<SalaryArchiveListDTO> salaryArchives = pageInfo.getList();
|
|
|
|
|
|
|
|
|
|
|
|
//所有个税扣缴义务人
|
|
|
|
|
|
Collection<TaxAgentPO> taxAgentLists = getTaxAgentService(user).listAll();
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有可被引用的薪资项目
|
|
|
|
|
|
List<SalaryItemPO> salaryItems = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
|
|
|
|
|
|
|
|
|
|
|
//整合所有的显示列(固定列+薪资项目动态列)
|
|
|
|
|
|
List<Map<String, Object>> listMaps = getSalaryArchiveService(user).buildSalaryArchiveData(salaryArchives, taxAgentLists, salaryItems, Boolean.TRUE);
|
|
|
|
|
|
|
|
|
|
|
|
PageInfo<Map<String, Object>> pageInfos = new PageInfo<Map<String, Object>>(listMaps);
|
|
|
|
|
|
pageInfos.setTotal(pageInfo.getTotal());
|
|
|
|
|
|
pageInfos.setPageNum(pageInfo.getPageNum());
|
|
|
|
|
|
pageInfos.setPageSize(pageInfo.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//动态列组装
|
|
|
|
|
|
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
|
|
|
|
|
|
|
|
|
|
|
|
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
|
|
|
|
|
|
table.setColumns(columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WeaResultMsg result = new WeaResultMsg(false);
|
|
|
|
|
|
result.putAll(table.makeDataResult());
|
|
|
|
|
|
result.success();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> datas = new HashMap<>();
|
|
|
|
|
|
datas.put("pageInfo", pageInfos);
|
|
|
|
|
|
datas.put("dataKey", result.getResultMap());
|
|
|
|
|
|
datas.put("salaryArchives", salaryArchives);
|
|
|
|
|
|
return datas;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-10 14:58:29 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取各tab总人数
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Long> queryTabTotal() {
|
|
|
|
|
|
return getSalaryArchiveService(user).queryTabTotal();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 待定薪列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> listPage(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
// queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue()));
|
|
|
|
|
|
// WeaTable<LinkedHashMap> weaTable = list(queryParam, SalaryArchiveListTypeEnum.PENDING);
|
|
|
|
|
|
Map<String, Object> list = list(queryParam);
|
|
|
|
|
|
return list;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-10 15:15:23 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 待定薪列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> pendingList(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.PENDING.getValue()));
|
|
|
|
|
|
return list(queryParam, SalaryArchiveListTypeEnum.PENDING);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 定薪列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> fixedList(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue(), SalaryArchiveStatusEnum.SUSPEND.getValue()));
|
|
|
|
|
|
return list(queryParam, SalaryArchiveListTypeEnum.FIXED);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 待停薪列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> suspendList(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.SUSPEND.getValue()));
|
|
|
|
|
|
return list(queryParam, SalaryArchiveListTypeEnum.SUSPEND);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 停薪列表
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> stopList(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue()));
|
|
|
|
|
|
return list(queryParam, SalaryArchiveListTypeEnum.STOP);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-13 14:57:52 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 设为定薪员工
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param ids
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> gotoFixed(Collection<Long> ids) {
|
|
|
|
|
|
return getSalaryArchiveService(user).gotoFixed(ids);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 一键全部定薪
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> allGotoFixed(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
return getSalaryArchiveService(user).allGotoFixed(queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-10-10 15:15:23 +08:00
|
|
|
|
// /**
|
|
|
|
|
|
// * 删除待定薪待办
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param ids
|
|
|
|
|
|
// * @param currentEmployeeId
|
|
|
|
|
|
// * @param currentTenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public String deletePendingTodo(Collection<Long> ids, Long currentEmployeeId, String currentTenantKey) {
|
|
|
|
|
|
// return getSalaryArchiveService(user).deletePendingTodo(ids, currentEmployeeId, currentTenantKey);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 停薪
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param ids
|
|
|
|
|
|
// * @param currentEmployeeId
|
|
|
|
|
|
// * @param currentTenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public Map<String, Object> gotoStop(Collection<Long> ids, Long currentEmployeeId, String currentTenantKey) {
|
|
|
|
|
|
// return getSalaryArchiveService(user).gotoStop(ids, currentEmployeeId, currentTenantKey);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 一键全部停薪
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param queryParam
|
|
|
|
|
|
// * @param currentEmployeeId
|
|
|
|
|
|
// * @param currentTenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public Map<String, Object> allGotoStop(SalaryArchiveQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) {
|
|
|
|
|
|
// return getSalaryArchiveService(user).allGotoStop(queryParam, currentEmployeeId, currentTenantKey);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 删除待停薪待办
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param ids
|
|
|
|
|
|
// * @param currentEmployeeId
|
|
|
|
|
|
// * @param currentTenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public String deleteSuspendTodo(Collection<Long> ids, Long currentEmployeeId, String currentTenantKey) {
|
|
|
|
|
|
// return getSalaryArchiveService(user).deleteSuspendTodo(ids, currentEmployeeId, currentTenantKey);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 取消停薪
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param ids
|
|
|
|
|
|
// * @param currentEmployeeId
|
|
|
|
|
|
// * @param currentTenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public String cancelStop(Collection<Long> ids, Long currentEmployeeId, String currentTenantKey) {
|
|
|
|
|
|
// return getSalaryArchiveService(user).cancelStop(ids, currentEmployeeId, currentTenantKey);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-28 20:04:27 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 获取薪资档案详情表单
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param salaryArchiveId
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public SalaryArchiveFormDTO getFrom(Long salaryArchiveId) {
|
|
|
|
|
|
if (salaryArchiveId == null) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100425, "薪资档案id不能为空"));
|
|
|
|
|
|
}
|
2022-03-29 17:10:59 +08:00
|
|
|
|
SalaryArchivePO po = getSalaryArchiveService(user).getById(salaryArchiveId);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
if (po == null) {
|
|
|
|
|
|
throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(100463, "薪资档案不存在") + "[id:%s]", salaryArchiveId));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<DataCollectionEmployee> employeeList = employeeService.getEmployeeByIdsAll(Collections.singletonList(po.getEmployeeId()));
|
|
|
|
|
|
if (CollectionUtils.isEmpty(employeeList)) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100465, "薪资档案员工信息不存在"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取当前已生效个税扣缴义务人
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<SalaryArchiveTaxAgentPO> taxAgentList = getSalaryArchiveService(user).getCurrentEffectiveTaxAgentList(Collections.singletonList(salaryArchiveId));
|
2022-03-28 20:04:27 +08:00
|
|
|
|
// 获取所有个税扣缴义务人
|
2022-05-31 16:41:11 +08:00
|
|
|
|
Collection<TaxAgentListDTO> taxAgentLists = getTaxAgentService(user).findAll();
|
2022-03-28 20:04:27 +08:00
|
|
|
|
String taxAgent = "";
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(taxAgentList)) {
|
|
|
|
|
|
SalaryArchiveTaxAgentPO salaryArchiveTaxAgent = taxAgentList.get(0);
|
2022-05-31 16:41:11 +08:00
|
|
|
|
Optional<TaxAgentListDTO> taxAgentOptional = taxAgentLists.stream().filter(f -> f.getId().equals(salaryArchiveTaxAgent.getTaxAgentId())).findFirst();
|
2022-03-28 20:04:27 +08:00
|
|
|
|
taxAgent = taxAgentOptional.isPresent() ? taxAgentOptional.get().getName() : taxAgent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 1.基本信息表单
|
|
|
|
|
|
Map<String, Object> baseInfo = new HashMap<>();
|
|
|
|
|
|
DataCollectionEmployee employee = employeeList.get(0);
|
|
|
|
|
|
SalaryArchiveBaseInfoFormDTO build = SalaryArchiveBaseInfoFormDTO.builder()
|
|
|
|
|
|
.username(employee.getUsername())
|
|
|
|
|
|
.department(employee.getDepartmentName())
|
|
|
|
|
|
.position(employee.getJobtitleName() == null ? "" : employee.getJobtitleName())
|
2022-04-28 10:05:27 +08:00
|
|
|
|
.hiredate(employee.getCompanystartdate())
|
2022-03-28 20:04:27 +08:00
|
|
|
|
.mobile(employee.getMobile())
|
|
|
|
|
|
.taxAgent(taxAgent)
|
|
|
|
|
|
.build();
|
|
|
|
|
|
baseInfo.put("employee", build);
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> salaryItems = Lists.newArrayList();
|
|
|
|
|
|
// 获取所有可被引用的薪资项目
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<SalaryItemPO> salaryItemList = getSalaryArchiveItemService(user).getCanAdjustSalaryItems();
|
2022-03-28 20:04:27 +08:00
|
|
|
|
Collection<Long> salaryItemIds = salaryItemList.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<SalaryArchiveItemPO> salaryArchiveItemList = getSalaryArchiveService(user).getCurrentEffectiveItemList(Collections.singletonList(salaryArchiveId), salaryItemIds);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
salaryArchiveItemList.forEach(m -> {
|
|
|
|
|
|
Optional<SalaryItemPO> optionalItem = salaryItemList.stream().filter(f -> f.getId().equals(m.getSalaryItemId())).findFirst();
|
|
|
|
|
|
if (optionalItem.isPresent()) {
|
|
|
|
|
|
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
|
|
|
|
|
salaryItemMap.put("id", m.getId());
|
|
|
|
|
|
salaryItemMap.put("name", optionalItem.get().getName());
|
|
|
|
|
|
salaryItemMap.put("value", m.getItemValue());
|
|
|
|
|
|
salaryItems.add(salaryItemMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return SalaryArchiveFormDTO.builder()
|
|
|
|
|
|
.id(salaryArchiveId)
|
|
|
|
|
|
.employeeId(employee.getEmployeeId())
|
|
|
|
|
|
.baseInfo(baseInfo)
|
|
|
|
|
|
.adjustSalaryItems(salaryItems)
|
|
|
|
|
|
.build();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 获取离职时段设置表单
|
|
|
|
|
|
*
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> getDimissionSetForm() {
|
2022-03-29 17:10:59 +08:00
|
|
|
|
List<SalaryArchiveDimissionPO> dimissionSets = getSalaryArchiveService(user).dimissionSets();
|
2022-03-28 20:04:27 +08:00
|
|
|
|
Map<String, Object> data = new LinkedHashMap<>();
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(dimissionSets)) {
|
|
|
|
|
|
data.put("dimissionTimeInterval", dimissionSets.get(0).getDimissionTimeInterval());
|
|
|
|
|
|
}
|
|
|
|
|
|
return data;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 保存离职时段设置
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param saveParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public String saveDimissionSet(SalaryArchiveDimissionSaveParam saveParam) {
|
2022-03-29 17:10:59 +08:00
|
|
|
|
return getSalaryArchiveService(user).saveDimissionSet(saveParam);
|
2022-03-28 20:04:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> getImportTypes() {
|
|
|
|
|
|
List<Map<String, Object>> importTypes = Arrays.stream(SalaryArchiveImportTypeEnum.values()).map(m -> {
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>(2);
|
|
|
|
|
|
map.put("id", String.valueOf(m.getValue()));
|
2022-03-29 17:10:59 +08:00
|
|
|
|
map.put("content", SalaryI18nUtil.getI18nLabel(m.getLabelId(), m.getDefaultLabel()));
|
2022-03-28 20:04:27 +08:00
|
|
|
|
return map;
|
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
return importTypes;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-28 16:36:40 +08:00
|
|
|
|
// /**
|
|
|
|
|
|
// * 导出薪资档案
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param queryParam
|
|
|
|
|
|
// * @param employeeId
|
|
|
|
|
|
// * @param tenantKey
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// public Map<String, Object> exportList(SalaryArchiveQueryParam queryParam, Long employeeId, String tenantKey) {
|
|
|
|
|
|
// // 构建异步导出参数
|
|
|
|
|
|
// Map<String, Object> map = salaryBatchService.buildeExportParam("exportSalaryArchive");
|
|
|
|
|
|
// String username = UserContext.getCurrentUser().getUsername();
|
|
|
|
|
|
// String eteamsId = TenantRpcContext.getEteamsId();
|
|
|
|
|
|
// taskExecutor.execute(() -> {
|
|
|
|
|
|
// try {
|
|
|
|
|
|
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
2022-03-29 17:10:59 +08:00
|
|
|
|
// getSalaryArchiveService(user).exportList(map, username, eteamsId, queryParam, employeeId, tenantKey);
|
2022-03-28 16:36:40 +08:00
|
|
|
|
// } finally {
|
|
|
|
|
|
// DSTenantKeyThreadVar.tenantKey.remove();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
//
|
|
|
|
|
|
// return map;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
2022-03-29 17:10:59 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 下载导入模板
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public XSSFWorkbook downloadTemplate(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
SalaryArchiveImportTypeEnum salaryArchiveImportTypeEnum = SalaryArchiveImportTypeEnum.parseByValue(queryParam.getImportType());
|
|
|
|
|
|
if (salaryArchiveImportTypeEnum == null) {
|
|
|
|
|
|
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100593, "导入类型不正确"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return getSalaryArchiveService(user).downloadTemplate(SalaryArchiveImportTypeEnum.parseByValue(queryParam.getImportType()), queryParam);
|
|
|
|
|
|
}
|
2022-03-31 15:41:55 +08:00
|
|
|
|
|
2022-07-18 18:08:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 预览
|
2022-09-07 09:45:37 +08:00
|
|
|
|
*
|
2022-07-18 18:08:59 +08:00
|
|
|
|
* @param param
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2022-03-31 15:41:55 +08:00
|
|
|
|
public Map<String, Object> preview(SalaryArchiveImportHandleParam param) {
|
|
|
|
|
|
return getSalaryArchiveService(user).preview(param);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-18 18:08:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 导入档案
|
2022-09-07 09:45:37 +08:00
|
|
|
|
*
|
2022-07-18 18:08:59 +08:00
|
|
|
|
* @param param
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> importSalaryArchive(SalaryArchiveImportHandleParam param) {
|
2022-04-19 15:13:08 +08:00
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchive(param);
|
2022-03-31 15:41:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-18 18:08:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 导出列表
|
2022-09-07 09:45:37 +08:00
|
|
|
|
*
|
2022-07-18 18:08:59 +08:00
|
|
|
|
* @param queryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2022-03-31 18:41:41 +08:00
|
|
|
|
public XSSFWorkbook exportList(SalaryArchiveQueryParam queryParam) {
|
|
|
|
|
|
return getSalaryArchiveService(user).exportList(queryParam);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-07 09:45:37 +08:00
|
|
|
|
public Map<String, Object> checkImportSalaryArchive(SalaryArchiveImportHandleParam param) {
|
2022-07-18 16:19:15 +08:00
|
|
|
|
String queryImageId = "select imagefileid from docimagefile where docid = ?";
|
2022-09-07 09:45:37 +08:00
|
|
|
|
if (param.getImageId() != null && !"".equals(param.getImageId())) {
|
2022-07-18 16:19:15 +08:00
|
|
|
|
RecordSet rs = new RecordSet();
|
2022-09-07 09:45:37 +08:00
|
|
|
|
rs.executeQuery(queryImageId, param.getImageId());
|
|
|
|
|
|
if (rs.next()) {
|
2022-07-18 16:19:15 +08:00
|
|
|
|
param.setImageId(rs.getString("imagefileid"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-09-07 09:45:37 +08:00
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchive(param, false);
|
2022-07-13 18:59:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-07 16:35:57 +08:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 检查导入文件
|
2022-10-10 14:58:29 +08:00
|
|
|
|
*
|
2022-09-07 16:35:57 +08:00
|
|
|
|
* @param param
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> checkImportSalaryArchiveParam(SalaryArchiveImportHandleParam param) {
|
|
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchive(param, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-07-18 18:08:59 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 人员状态列表
|
2022-09-07 09:45:37 +08:00
|
|
|
|
*
|
2022-07-18 18:08:59 +08:00
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public Map<String, Object> searchCondition() {
|
|
|
|
|
|
List<Map<String, String>> userStatus = UserStatusEnum.getList();
|
2022-04-07 20:05:58 +08:00
|
|
|
|
List<Map<String, String>> itemAdjustReasons = SalaryArchiveItemAdjustReasonEnum.getList();
|
|
|
|
|
|
List<Map<String, String>> TaxAgentAdjustReason = SalaryArchiveTaxAgentAdjustReasonEnum.getList();
|
2022-05-31 16:41:11 +08:00
|
|
|
|
Collection<TaxAgentListDTO> taxAgentList = getTaxAgentService(user).findAll();
|
2022-04-07 20:05:58 +08:00
|
|
|
|
HashMap map = Maps.newHashMap();
|
2022-07-18 18:08:59 +08:00
|
|
|
|
map.put("userStatus", userStatus);
|
|
|
|
|
|
map.put("itemAdjustReasons", itemAdjustReasons);
|
|
|
|
|
|
map.put("TaxAgentAdjustReason", TaxAgentAdjustReason);
|
|
|
|
|
|
map.put("taxAgentList", taxAgentList);
|
2022-04-07 20:05:58 +08:00
|
|
|
|
return map;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-07 09:45:37 +08:00
|
|
|
|
public Map<String, Object> selectSalaryArchiveColumns(String importType) {
|
2022-07-13 18:59:30 +08:00
|
|
|
|
return getSalaryArchiveService(user).selectSalaryArchiveColumns(SalaryArchiveImportTypeEnum.parseByValue(importType));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-07 09:45:37 +08:00
|
|
|
|
public Map<String, Object> importSalaryArchiveInit(SalaryArchiveImportActionParam importData) {
|
2022-09-20 18:02:45 +08:00
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchiveAction(importData, importData.isAddData());
|
2022-07-13 18:59:30 +08:00
|
|
|
|
}
|
2022-09-07 09:45:37 +08:00
|
|
|
|
|
2022-09-20 18:02:45 +08:00
|
|
|
|
|
2022-09-07 09:45:37 +08:00
|
|
|
|
public Map<String, Object> importSalaryArchiveSalaryItemAdjust(SalaryArchiveImportActionParam importData) {
|
2022-07-13 18:59:30 +08:00
|
|
|
|
importData.setImportType("salaryItemAdjust");
|
2022-09-07 09:45:37 +08:00
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchiveAction(importData, false);
|
2022-07-13 18:59:30 +08:00
|
|
|
|
}
|
2022-09-07 09:45:37 +08:00
|
|
|
|
|
|
|
|
|
|
public Map<String, Object> importSalaryArchiveTaxAgentAdjust(SalaryArchiveImportActionParam importData) {
|
2022-07-13 18:59:30 +08:00
|
|
|
|
importData.setImportType("taxAgentAdjust");
|
2022-09-07 09:45:37 +08:00
|
|
|
|
return getSalaryArchiveService(user).importSalaryArchiveAction(importData, false);
|
2022-07-13 18:59:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-07 09:45:37 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 停薪
|
2022-10-10 14:58:29 +08:00
|
|
|
|
*
|
2022-09-07 09:45:37 +08:00
|
|
|
|
* @param stopSalaryParam
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
|
|
|
|
|
public void stopSalary(SalaryArchiveStopParam stopSalaryParam) {
|
|
|
|
|
|
getSalaryArchiveService(user).stopSalary(stopSalaryParam);
|
|
|
|
|
|
}
|
2022-10-10 14:58:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
2022-03-28 16:36:40 +08:00
|
|
|
|
}
|