weaver-hrm-salary/src/com/engine/salary/wrapper/VariableArchiveWrapper.java

191 lines
6.4 KiB
Java
Raw Normal View History

2024-08-09 10:21:40 +08:00
package com.engine.salary.wrapper;
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.component.SalaryWeaTable;
import com.engine.salary.entity.datacollection.bo.VariableArchiveBO;
import com.engine.salary.entity.datacollection.dto.VariableArchiveListDTO;
import com.engine.salary.entity.datacollection.dto.VariableItemListDTO;
import com.engine.salary.entity.datacollection.param.VariableArchiveImportHandleParam;
import com.engine.salary.entity.datacollection.param.VariableArchiveQueryParam;
import com.engine.salary.entity.datacollection.param.VariableArchiveSaveParam;
import com.engine.salary.entity.datacollection.po.VariableItemPO;
import com.engine.salary.service.VariableArchiveService;
import com.engine.salary.service.VariableItemService;
import com.engine.salary.service.impl.VariableArchiveServiceImpl;
import com.engine.salary.service.impl.VariableItemServiceImpl;
import com.engine.salary.util.page.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 浮动薪酬
* @Author: xzy
* @Date: 2024/8/6 17:39
*/
@Slf4j
public class VariableArchiveWrapper extends Service {
private VariableArchiveService getVariableArchiveService(User user) {
return ServiceUtil.getService(VariableArchiveServiceImpl.class, user);
}
private VariableItemService getVariableItemService(User user) {
return ServiceUtil.getService(VariableItemServiceImpl.class, user);
}
/**
* 数据采集-浮动薪酬列表(分页)
*
* @param queryParam
* @return
*/
public Map<String, Object> list(VariableArchiveQueryParam queryParam) {
//薪资档案列表
PageInfo<VariableArchiveListDTO> pageInfo = getVariableArchiveService(user).listPage(queryParam);
Collection<VariableArchiveListDTO> salaryArchives = pageInfo.getList();
// 获取所有浮动薪酬项目
List<VariableItemPO> variableItems = getVariableItemService(user).listAll();
//整合所有的显示列(固定列+薪资项目动态列)
List<Map<String, Object>> listMaps = getVariableArchiveService(user).buildVariableArchiveData(salaryArchives);
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 = VariableArchiveBO.buildVariableArchiveTable(variableItems);
SalaryWeaTable<VariableArchiveListDTO> table = new SalaryWeaTable<VariableArchiveListDTO>(user, VariableArchiveListDTO.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());
return datas;
}
/**
* 创建浮动薪酬档案
*
* @param saveParam
*/
public void createData(VariableArchiveSaveParam saveParam) {
getVariableArchiveService(user).createData(saveParam);
}
/**
* 浮动薪酬档案明细
*
* @param queryParam
* @return
*/
public Map<String, Object> getDetail(VariableArchiveQueryParam queryParam) {
return getVariableArchiveService(user).getDetail(queryParam);
}
public List<VariableItemListDTO> getCreateForm() {
return getVariableArchiveService(user).getCreateForm();
}
public XSSFWorkbook downloadTemplate(VariableArchiveQueryParam param) {
return getVariableArchiveService(user).downloadTemplate(param);
}
public Map<String, Object> preview(VariableArchiveImportHandleParam importParam) {
return getVariableArchiveService(user).preview(importParam);
}
public Map<String, Object> importData(VariableArchiveImportHandleParam importParam) {
return getVariableArchiveService(user).importData(importParam);
}
public XSSFWorkbook export(VariableArchiveQueryParam param) {
return getVariableArchiveService(user).export(param);
}
public void deleteSelectVariableArchive(Collection<Long> deleteIds) {
getVariableArchiveService(user).deleteSelectVariableArchive(deleteIds);
}
// /**
// * 导出-其他免税扣除列表
// *
// * @param queryParam
// * @return
// */
// public XSSFWorkbook export(OtherDeductionQueryParam queryParam) {
// return getOtherDeductionService(user).export(queryParam);
// }
//
// /**
// * 下载导入模板
// *
// * @param queryParam
// * @return
// */
// public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) {
// return getOtherDeductionService(user).downloadTemplate(queryParam);
// }
//
// /**
// * 预览
// */
// public Map<String, Object> preview(OtherDeductionImportParam importParam) {
// return getOtherDeductionService(user).preview(importParam);
// }
//
// /**
// * 导入数据
// */
// public Map<String, Object> importData(OtherDeductionImportParam importParam) {
// return getOtherDeductionService(user).importData(importParam);
// }
//
// /**
// * 编辑数据
// */
// public void editData(OtherDeductionParam otherDeductionParam) {
// getOtherDeductionService(user).editData(otherDeductionParam);
// }
//
//
// /**
// * 新增数据
// */
// public void createData(OtherDeductionParam otherDeductionParam) {
// getOtherDeductionService(user).createData(otherDeductionParam);
// }
//
// /**
// * 删除所选数据
// */
// public void deleteSelectData(AddUpDeductionRecordDeleteParam deleteParam) {
// getOtherDeductionService(user).deleteSelectData(deleteParam);
// }
//
//
// /**
// * 获取数据
// */
// public OtherDeductionRecordDTO getOtherDeduction(OtherDeductionParam otherDeductionParam) {
// return getOtherDeductionService(user).getOtherDeduction(otherDeductionParam);
// }
}