2022-03-15 09:34:53 +08:00
|
|
|
package com.engine.salary.service.impl;
|
|
|
|
|
|
2022-04-19 17:46:24 +08:00
|
|
|
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
2022-03-15 09:34:53 +08:00
|
|
|
import com.engine.core.impl.Service;
|
2022-03-15 17:39:19 +08:00
|
|
|
import com.engine.salary.biz.SIArchivesBiz;
|
2022-03-16 18:26:49 +08:00
|
|
|
import com.engine.salary.cmd.siarchives.SIArchivesTipsCmd;
|
2022-03-18 18:00:51 +08:00
|
|
|
import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam;
|
2022-03-16 18:26:49 +08:00
|
|
|
import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
|
2022-04-19 17:46:24 +08:00
|
|
|
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
|
2022-03-15 17:39:19 +08:00
|
|
|
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
|
2022-04-19 17:46:24 +08:00
|
|
|
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
|
2022-03-15 09:34:53 +08:00
|
|
|
import com.engine.salary.service.SIArchivesService;
|
2022-04-19 17:46:24 +08:00
|
|
|
import com.engine.salary.util.SalaryI18nUtil;
|
|
|
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.salary.util.excel.ExcelUtil;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
2022-03-15 17:39:19 +08:00
|
|
|
import weaver.general.Util;
|
2022-03-15 09:34:53 +08:00
|
|
|
|
2022-04-19 17:46:24 +08:00
|
|
|
import java.util.*;
|
2022-03-15 09:34:53 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author weaver_cl
|
|
|
|
|
* @Description: TODO
|
|
|
|
|
* @Date 2022/3/11
|
|
|
|
|
* @Version V1.0
|
|
|
|
|
**/
|
|
|
|
|
public class SIArchivesServiceImpl extends Service implements SIArchivesService {
|
|
|
|
|
|
2022-04-19 17:46:24 +08:00
|
|
|
private SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
|
2022-03-15 09:34:53 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getTips(Map<String, Object> params) {
|
|
|
|
|
return commandExecutor.execute(new SIArchivesTipsCmd(params,user));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getBaseForm(Map<String, Object> params) {
|
2022-03-15 17:39:19 +08:00
|
|
|
Map<String, Object> apidatas = new HashMap<>(16);
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum)params.get("welfareTypeEnum");
|
|
|
|
|
Long employeeId = Long.valueOf(Util.null2String(params.get("employeeId")));
|
2022-03-16 17:04:21 +08:00
|
|
|
apidatas = siArchivesBiz.getBaseForm(welfareTypeEnum, employeeId,(long) user.getUID(),user);
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
2022-03-15 17:39:19 +08:00
|
|
|
|
2022-03-16 17:04:21 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getPaymentForm(Map<String, Object> params) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>(16);
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
WelfareTypeEnum welfareTypeEnum = (WelfareTypeEnum)params.get("welfareTypeEnum");
|
|
|
|
|
Long employeeId = Long.valueOf(Util.null2String(params.get("employeeId")));
|
|
|
|
|
Long schemeId = Long.valueOf(Util.null2String(params.get("schemeId")));
|
|
|
|
|
apidatas = siArchivesBiz.getPaymentForm(user,welfareTypeEnum, employeeId,(long) user.getUID(),schemeId);
|
2022-03-15 17:39:19 +08:00
|
|
|
return apidatas;
|
2022-03-15 09:34:53 +08:00
|
|
|
}
|
2022-03-16 18:26:49 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String insert(InsuranceArchivesSaveParam param) {
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
siArchivesBiz.insert(param,(long) user.getUID());
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2022-03-18 18:00:51 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> listPage(InsuranceArchivesListParam param) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>(16);
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
apidatas = siArchivesBiz.listPage(param,(long) user.getUID());
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 19:47:46 +08:00
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> getSearchCondition(Map<String, Object> param) {
|
|
|
|
|
Map<String, Object> apidatas = new HashMap<>(16);
|
|
|
|
|
SIArchivesBiz siArchivesBiz = new SIArchivesBiz();
|
|
|
|
|
apidatas = siArchivesBiz.getSearchCondition(user);
|
|
|
|
|
return apidatas;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-19 17:46:24 +08:00
|
|
|
@Override
|
|
|
|
|
public XSSFWorkbook export(InsuranceArchivesListParam param) {
|
|
|
|
|
InsuranceArchivesListParam request = InsuranceArchivesListParam.builder().build();
|
|
|
|
|
if (param.getHireDate() != null && param.getHireDate().length == 2) {
|
|
|
|
|
param.setHiredateStart(param.getHireDate()[0]);
|
|
|
|
|
param.setHiredateEnd(param.getHireDate()[1]);
|
|
|
|
|
}
|
|
|
|
|
if (param.getDimissionDate() != null && param.getDimissionDate().length == 2) {
|
|
|
|
|
param.setDimissionDateStart(param.getDimissionDate()[0]);
|
|
|
|
|
param.setDimissionDateEnd(param.getDimissionDate()[1]);
|
|
|
|
|
}
|
|
|
|
|
if (Objects.equals("fromQuickSearch", param.getDataSource())) {
|
|
|
|
|
request.setStatuses(param.getStatuses());
|
|
|
|
|
request.setKeyword(param.getUserName());
|
|
|
|
|
} else {
|
|
|
|
|
request = param;
|
|
|
|
|
}
|
|
|
|
|
request.setPageSize(null);
|
|
|
|
|
request.setStartNum(null);
|
|
|
|
|
List<InsuranceArchivesEmployeePO> insuranceArchivesEmployeePOS = listPageEmployeePOS(request);
|
|
|
|
|
if (insuranceArchivesEmployeePOS == null) {
|
|
|
|
|
insuranceArchivesEmployeePOS = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
List<Map<String, Object>> records = siArchivesBiz.buildTableData(insuranceArchivesEmployeePOS);
|
|
|
|
|
List<WeaTableColumn> columns = siArchivesBiz.buildWeaTableColumns(insuranceArchivesEmployeePOS,user.getUID());
|
|
|
|
|
|
|
|
|
|
//工作簿list
|
|
|
|
|
List<List<Object>> excelSheetData = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//工作簿名称
|
|
|
|
|
String sheetName = SalaryI18nUtil.getI18nLabel(85368, "社保福利档案"); //表头
|
|
|
|
|
//表头
|
|
|
|
|
excelSheetData.add(Collections.singletonList(columns.stream().map(WeaTableColumn::getText).toArray(String[]::new)));
|
|
|
|
|
//工作簿数据
|
|
|
|
|
List<List<Object>> rows = new LinkedList<>();
|
|
|
|
|
for (Map<String, Object> recordData : records) {
|
|
|
|
|
List<Object> row = new LinkedList<>();
|
|
|
|
|
for (WeaTableColumn column : columns) {
|
|
|
|
|
row.add(recordData.get(column.getColumn()));
|
|
|
|
|
}
|
|
|
|
|
rows.add(row);
|
|
|
|
|
}
|
|
|
|
|
excelSheetData.addAll(rows);
|
|
|
|
|
return ExcelUtil.genWorkbookV2(excelSheetData, sheetName);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InsuranceArchivesEmployeePO> listPageEmployeePOS(InsuranceArchivesListParam param) {
|
|
|
|
|
return MapperProxyFactory.getProxy(SocialSchemeMapper.class).listPageEmployeePOS(param);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-18 18:00:51 +08:00
|
|
|
|
2022-03-15 09:34:53 +08:00
|
|
|
}
|