万德隆
This commit is contained in:
parent
5e634b1e79
commit
8399c61020
|
|
@ -106,13 +106,28 @@ public class EmployBiz extends BaseBean {
|
|||
* @return
|
||||
*/
|
||||
public List<PositionInfo> listPositionInfo(List<Long> list) {
|
||||
List<PositionInfo> resultList = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>();
|
||||
return resultList;
|
||||
}
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.listPositionInfo(list);
|
||||
List<List<Long>> partition = Lists.partition(list, 500);
|
||||
partition.forEach(part -> {
|
||||
resultList.addAll(mapper.listPositionInfo(part));
|
||||
});
|
||||
return resultList;
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PositionInfo> listAllPositionInfo() {
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
try {
|
||||
EmployMapper mapper = sqlSession.getMapper(EmployMapper.class);
|
||||
return mapper.listPositionInfo(Collections.emptyList());
|
||||
} finally {
|
||||
sqlSession.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,50 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.WdlGzjgDtPO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName WdlGzjgDTO
|
||||
* @author Harryxzy
|
||||
* @date 2025/6/20 10:34
|
||||
* @description 万德隆 工资结构
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WdlGzjgDTO {
|
||||
// id
|
||||
private Integer id;
|
||||
|
||||
// 类别
|
||||
private Integer lb;
|
||||
|
||||
// 办公地点
|
||||
private Integer bgdd;
|
||||
|
||||
// 岗位名称
|
||||
private Integer gwmc;
|
||||
|
||||
// 岗位职级
|
||||
private String gwzj;
|
||||
|
||||
// 工资水平
|
||||
private Integer gzsp;
|
||||
|
||||
// 明细表默认
|
||||
private String mxbmr;
|
||||
|
||||
// 岗位职级
|
||||
private String gwzj1;
|
||||
|
||||
private String lsbb;
|
||||
|
||||
// 金额明细
|
||||
private List<WdlGzjgDtPO> detailList;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.common.BaseQueryParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName wldDynamicSalaryReportQueryParam
|
||||
* @author Harryxzy
|
||||
* @date 2025/6/20 10:11
|
||||
* @description 万德隆薪酬动态表
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class wldDynamicSalaryReportQueryParam extends BaseQueryParam {
|
||||
|
||||
boolean isExport;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @ClassName WdlGzjgDtPO
|
||||
* @author Harryxzy
|
||||
* @date 2025/6/20 10:35
|
||||
* @description 万德隆工资结构明细表
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WdlGzjgDtPO {
|
||||
|
||||
// id
|
||||
private Integer id;
|
||||
|
||||
// 主表id
|
||||
private Integer mianid;
|
||||
|
||||
// 薪资项目
|
||||
private String xzxm;
|
||||
|
||||
// 金额
|
||||
private Integer je;
|
||||
}
|
||||
|
|
@ -145,6 +145,7 @@ public interface SalaryAcctExcelService {
|
|||
*/
|
||||
Map<String, Object> exportTemplateList(SalaryAcctResultTemplateSaveParam param);
|
||||
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 薪资核算结果校验异常导出
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO;
|
|||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
|
@ -231,4 +232,11 @@ public interface SalaryAcctResultService {
|
|||
* @version 1.0
|
||||
**/
|
||||
List<SalaryAcctResultPO> listBySobSalaryMonth(Date salaryMonth, Long salarySobId, List<Long> employeeIds);
|
||||
|
||||
|
||||
Map<String, Object> wdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param);
|
||||
|
||||
XSSFWorkbook exportWdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param);
|
||||
|
||||
Map<String, Object> importWdlDynamicSalaryReport(SalaryAcctImportParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ public interface SalaryArchiveService {
|
|||
|
||||
String getEffectiveItemValue(SalaryArchiveQueryParam param);
|
||||
|
||||
List<Map<String, Object>> getEffectiveValueList(SalaryArchiveQueryParam param);
|
||||
|
||||
void generateWdlData(WdlGzsqydtjParam param);
|
||||
|
||||
void forceToFixed(List<Long> salaryArchiveIds);
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ public interface SalaryEmployeeService {
|
|||
|
||||
List<PositionInfo> listPositionInfo(List<Long> positionIds);
|
||||
|
||||
List<PositionInfo> listAllPositionInfo();
|
||||
|
||||
PositionInfo getPositionInfoById(Long positionId);
|
||||
|
||||
List<DataCollectionEmployee> listEmployee();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.cache.SalaryCacheKey;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.component.WeaTableColumnGroup;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
|
|
@ -22,6 +24,7 @@ import com.engine.salary.entity.salaryacct.bo.*;
|
|||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.WdlGzjgDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salaryacct.po.*;
|
||||
import com.engine.salary.entity.salaryformula.ExpressFormula;
|
||||
|
|
@ -51,6 +54,9 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtilPlus;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
|
|
@ -64,12 +70,24 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
||||
import org.springframework.util.StopWatch;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.formmode.data.ModeDataIdUpdate;
|
||||
import weaver.formmode.setup.ModeRightInfo;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.TimeUtil;
|
||||
import weaver.hrm.User;
|
||||
import weaver.wechat.util.Utils;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.BlockingDeque;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
|
@ -77,6 +95,7 @@ import java.util.concurrent.LinkedBlockingDeque;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.sys.constant.SalarySysConstant.SALARY_ACCT_SYNC_TYPE;
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
|
|
@ -1283,4 +1302,488 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
encryptUtil.decryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
|
||||
return salaryAcctResultPOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> wdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param) {
|
||||
RecordSet rs = new RecordSet();
|
||||
// 获取有哪些薪资项目
|
||||
rs.execute("select xzxm from uf_lcmxmr t left join uf_lcmxmr_dt1 d on t.id = d.mainid");
|
||||
List<Long> salaryItemIds = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
String xzxm = rs.getString("xzxm");
|
||||
if (NumberUtils.isCreatable(xzxm)) {
|
||||
salaryItemIds.add(Long.valueOf(xzxm));
|
||||
}
|
||||
}
|
||||
salaryItemIds = salaryItemIds.stream().distinct().collect(Collectors.toList());
|
||||
List<SalaryItemPO> salaryItemList = getSalaryItemService(user).listByIds(salaryItemIds);
|
||||
Map<Long, String> itemNameMap = SalaryEntityUtil.convert2Map(salaryItemList, SalaryItemPO::getId, SalaryItemPO::getName);
|
||||
// 获取所有工资结构信息
|
||||
List<WdlGzjgDTO> wdlGzjgDTOList = listAllWdlGzjg();
|
||||
PageInfo<WdlGzjgDTO> wdlGzjgDTOPageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), wdlGzjgDTOList);
|
||||
wdlGzjgDTOList = wdlGzjgDTOPageInfo.getList();
|
||||
|
||||
// 表头
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumnGroup("150", "类别", "lb", "lb"));
|
||||
columns.add(new WeaTableColumnGroup("150", "办公地点", "bgdd", "bgdd"));
|
||||
columns.add(new WeaTableColumnGroup("150", "岗位名称", "gwmc", "gwmc"));
|
||||
columns.add(new WeaTableColumnGroup("150", "岗位职级", "gwzj", "gwzj"));
|
||||
columns.add(new WeaTableColumnGroup("150", "工资水平", "gzsp", "gzsp"));
|
||||
for (Long itemId : salaryItemIds) {
|
||||
String itemName = itemNameMap.getOrDefault(itemId, "");
|
||||
columns.add(new WeaTableColumnGroup("150", itemName, itemId.toString(), itemId.toString()));
|
||||
}
|
||||
|
||||
BaseBean baseBean = new BaseBean();
|
||||
// 查询类别信息
|
||||
String lbFieldId = baseBean.getPropValue("wdlSalary", "bzgzbz_lb_field_id");
|
||||
rs.execute("select selectValue,selectname from workflow_selectitem where fieldid=" + lbFieldId);
|
||||
Map <Integer, String> lbValueMap = new HashMap<>();
|
||||
while (rs.next()) {
|
||||
Integer selectValue = rs.getInt("selectValue");
|
||||
String selectName = rs.getString("selectname");
|
||||
lbValueMap.put(selectValue, selectName);
|
||||
}
|
||||
// 查询办公地点信息
|
||||
rs.execute("SELECT id,locationname FROM hrmlocations");
|
||||
Map <Integer, String> locationValueMap = new HashMap<>();
|
||||
while (rs.next()) {
|
||||
Integer id = rs.getInt("id");
|
||||
String value = rs.getString("locationname");
|
||||
locationValueMap.put(id, value);
|
||||
}
|
||||
// 查询岗位名称信息
|
||||
List<Long> gwIdList = wdlGzjgDTOList.stream()
|
||||
.map(WdlGzjgDTO::getGwmc)
|
||||
.filter(gw -> gw != null)
|
||||
.distinct()
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
Map<Long, String> positionMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).listPositionInfo(gwIdList), PositionInfo::getId, PositionInfo::getName);
|
||||
|
||||
List<Map<String, Object>> valueList = new ArrayList<>();
|
||||
for (WdlGzjgDTO dto : wdlGzjgDTOList) {
|
||||
Map<String, Object> singleValueMap = new HashMap<>();
|
||||
singleValueMap.put("lb" ,lbValueMap.getOrDefault(dto.getLb(), ""));
|
||||
singleValueMap.put("bgdd" ,locationValueMap.getOrDefault(dto.getBgdd(), ""));
|
||||
singleValueMap.put("gwmc" ,positionMap.getOrDefault(dto.getGwmc(), ""));
|
||||
// TODO 岗位职级标准要转换一下
|
||||
singleValueMap.put("gwzj" ,dto.getGwzj());
|
||||
singleValueMap.put("gzsp" ,dto.getGzsp());
|
||||
List<WdlGzjgDtPO> detailList = dto.getDetailList();
|
||||
Map<String, Integer> detailJeMap = SalaryEntityUtil.convert2Map(detailList, WdlGzjgDtPO::getXzxm, WdlGzjgDtPO::getJe);
|
||||
for (SalaryItemPO item : salaryItemList) {
|
||||
singleValueMap.put(item.getId().toString() ,Utils.null2String(detailJeMap.get(String.valueOf(item.getId()))));
|
||||
}
|
||||
valueList.add(singleValueMap);
|
||||
}
|
||||
PageInfo<Map<String, Object>> pageInfo = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize());
|
||||
pageInfo.setTotal(wdlGzjgDTOPageInfo.getTotal());
|
||||
pageInfo.setList(valueList);
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("columns", columns);
|
||||
resultMap.put("pageInfo", pageInfo);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private List<WdlGzjgDTO> listAllWdlGzjg() {
|
||||
RecordSet rs = new RecordSet();
|
||||
List<WdlGzjgDTO> resultList = new ArrayList<>();
|
||||
// 获取所有主表数据
|
||||
rs.execute("select * from uf_bzgzjgb");
|
||||
while (rs.next()) {
|
||||
WdlGzjgDTO wdlGzjgDTO = new WdlGzjgDTO();
|
||||
wdlGzjgDTO.setId(rs.getInt("id"));
|
||||
wdlGzjgDTO.setLb(SalaryEntityUtil.string2Integer(rs.getString("lb")));
|
||||
wdlGzjgDTO.setBgdd(SalaryEntityUtil.string2Integer(rs.getString("bgdd")));
|
||||
wdlGzjgDTO.setGwmc(SalaryEntityUtil.string2Integer(rs.getString("gwmc")));
|
||||
wdlGzjgDTO.setGwzj(rs.getString("gwzj"));
|
||||
wdlGzjgDTO.setGzsp(SalaryEntityUtil.string2Integer(rs.getString("gzsp")));
|
||||
wdlGzjgDTO.setMxbmr(rs.getString("mxbmr"));
|
||||
wdlGzjgDTO.setGwzj1(rs.getString("gwzj1"));
|
||||
resultList.add(wdlGzjgDTO);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(resultList)) {
|
||||
return resultList;
|
||||
}
|
||||
rs.execute("select * from uf_bzgzjgb_dt1");
|
||||
List<WdlGzjgDtPO> detailList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
WdlGzjgDtPO wdlGzjgDtPO = new WdlGzjgDtPO();
|
||||
wdlGzjgDtPO.setId(rs.getInt("id"));
|
||||
wdlGzjgDtPO.setMianid(rs.getInt("mainid"));
|
||||
wdlGzjgDtPO.setXzxm(Utils.null2String(rs.getString("xzxm")));
|
||||
wdlGzjgDtPO.setJe(SalaryEntityUtil.string2Integer(rs.getString("je")));
|
||||
detailList.add(wdlGzjgDtPO);
|
||||
}
|
||||
Map<Integer, List<WdlGzjgDtPO>> detailMap = SalaryEntityUtil.group2Map(detailList, WdlGzjgDtPO::getMianid);
|
||||
for (WdlGzjgDTO dto : resultList) {
|
||||
List<WdlGzjgDtPO> details = detailMap.get(dto.getId());
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
dto.setDetailList(details);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出万德隆薪资动态表
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public XSSFWorkbook exportWdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param) {
|
||||
Map<String, Object> resultMap = wdlDynamicSalaryReport(param);
|
||||
List<WeaTableColumn> columns = (List<WeaTableColumn>)resultMap.get("columns");
|
||||
PageInfo<Map<String, Object>> pageInfo = (PageInfo<Map<String, Object>>)resultMap.get("pageInfo");
|
||||
List<Map<String, Object>> list = pageInfo.getList();
|
||||
|
||||
// 组装数据
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
List<Object> headerList = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList());
|
||||
rows.add(headerList);
|
||||
|
||||
// 3.表数据
|
||||
for (Map<String, Object> map : list) {
|
||||
List<Object> singleList = new ArrayList<>();
|
||||
for (WeaTableColumn col : columns) {
|
||||
singleList.add(Utils.null2String(map.get(col.getColumn())));
|
||||
}
|
||||
rows.add(singleList);
|
||||
}
|
||||
return ExcelUtilPlus.genWorkbookV2(rows, "万德隆薪资动态表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 万德隆导入数据
|
||||
* @param param
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> importWdlDynamicSalaryReport(SalaryAcctImportParam param) {
|
||||
// 需要将原始数据拷贝至历史标准工资结构表
|
||||
copyWdlReport2HistoryData();
|
||||
// 处理导入数据
|
||||
List<WdlGzjgDTO> needInsertList = new ArrayList<>();
|
||||
Map<String, Object> map = importWdlReport(param.getImageId(), needInsertList);
|
||||
// 删除原有数据
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.execute("delete from uf_bzgzjgb");
|
||||
rs.execute("delete from uf_bzgzjgb_dt1");
|
||||
// 插入新数据
|
||||
BaseBean baseBean = new BaseBean();
|
||||
List<Integer> mainIds = new ArrayList<>();
|
||||
Integer bzgzjgModeId = NumberUtils.isCreatable(baseBean.getPropValue("wdlSalary", "bzgzjg_mode_id")) ? Integer.valueOf(baseBean.getPropValue("wdlSalary", "bzgzjg_mode_id")) : 0;
|
||||
for (WdlGzjgDTO mainData : needInsertList) {
|
||||
int newId = ModeDataIdUpdate.getInstance().getModeDataNewIdByUUID("uf_bzgzjgb", bzgzjgModeId, user.getUID(), 0, "", "");
|
||||
mainData.setId(newId);
|
||||
String sql = "update uf_bzgzjgb set lb=?,bgdd=?,gwmc=?,gwzj=?,gzsp=? where id =" + newId;
|
||||
rs.executeUpdate(sql, Arrays.asList(mainData.getLb(), mainData.getBgdd(), mainData.getGwmc(), mainData.getGwzj(), mainData.getGzsp()));
|
||||
List<WdlGzjgDtPO> detailList = mainData.getDetailList();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("insert into uf_bzgzjgb_dt1(mainid,xzxm,je) values ");
|
||||
for (WdlGzjgDtPO detail : detailList) {
|
||||
sb.append("(")
|
||||
.append(newId).append(",'")
|
||||
.append(detail.getXzxm()).append("',")
|
||||
.append(detail.getJe()).append("),");
|
||||
}
|
||||
rs.execute(sb.substring(0, sb.length() - 1).toString());
|
||||
}
|
||||
// 权限重构
|
||||
for (Integer mainId : mainIds) {
|
||||
Integer modeIdValue = Integer.valueOf(bzgzjgModeId);
|
||||
ModeRightInfo ModeRightInfo = new ModeRightInfo();
|
||||
ModeRightInfo.setNewRight(true);
|
||||
ModeRightInfo.editModeDataShare(1, modeIdValue, mainId);
|
||||
}
|
||||
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
private Map<String, Object> importWdlReport(String imageId, List<WdlGzjgDTO> needInsertList) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
|
||||
// 索引(用于计算进度)
|
||||
int index = 0;
|
||||
// 失败的数量
|
||||
int failCount = 0;
|
||||
// 成功的数量
|
||||
int successCount = 0;
|
||||
|
||||
|
||||
// 获取可以导入哪些薪资项目
|
||||
RecordSet rs = new RecordSet();
|
||||
// 获取有哪些薪资项目
|
||||
rs.execute("select xzxm from uf_lcmxmr t left join uf_lcmxmr_dt1 d on t.id = d.mainid");
|
||||
List<Long> salaryItemIds = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
String xzxm = rs.getString("xzxm");
|
||||
if (NumberUtils.isCreatable(xzxm)) {
|
||||
salaryItemIds.add(Long.valueOf(xzxm));
|
||||
}
|
||||
}
|
||||
Map<String, Long> salaryItemNameMap = SalaryEntityUtil.convert2Map(getSalaryItemService(user).listByIds(salaryItemIds), SalaryItemPO::getName, SalaryItemPO::getId);
|
||||
|
||||
// 查询类别信息
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String lbFieldId = baseBean.getPropValue("wdlSalary", "bzgzbz_lb_field_id");
|
||||
rs.execute("select selectValue,selectname from workflow_selectitem where fieldid=" + lbFieldId);
|
||||
Map <String, Integer> lbValueMap = new HashMap<>();
|
||||
while (rs.next()) {
|
||||
Integer selectValue = rs.getInt("selectValue");
|
||||
String selectName = rs.getString("selectname");
|
||||
lbValueMap.put(selectName, selectValue);
|
||||
}
|
||||
// 查询办公地点信息
|
||||
rs.execute("SELECT id,locationname FROM hrmlocations");
|
||||
Map <String, Integer> locationValueMap = new HashMap<>();
|
||||
while (rs.next()) {
|
||||
Integer id = rs.getInt("id");
|
||||
String value = rs.getString("locationname");
|
||||
locationValueMap.put(value, id);
|
||||
}
|
||||
// 查询岗位名称信息
|
||||
Map<String, Long> positionMap = SalaryEntityUtil.convert2Map(getSalaryEmployeeService(user).listAllPositionInfo(), PositionInfo::getName, PositionInfo::getId);
|
||||
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId));
|
||||
Workbook workbook = ExcelSupport.parseFile(fileInputStream, EXCEL_TYPE_XLSX);
|
||||
Sheet sheet = workbook.getSheetAt(0);
|
||||
|
||||
// 错误提示信息
|
||||
List<Map> excelComments = Lists.newArrayList();
|
||||
// 存在错误的那行数据
|
||||
List<Map<String, Object>> errorDatas = Lists.newArrayList();
|
||||
|
||||
List<String> headers;
|
||||
headers = ExcelSupport.getSheetHeader(sheet, 0);
|
||||
|
||||
// 处理数值
|
||||
List<Map<String, Object>> data;
|
||||
data = ExcelParseHelper.parse2Map(sheet, 1, 0);
|
||||
|
||||
if (CollectionUtils.isEmpty(headers)) {
|
||||
throw new RuntimeException("表头为空");
|
||||
}
|
||||
if (CollectionUtils.isEmpty(data)) {
|
||||
throw new RuntimeException("无数据");
|
||||
}
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
String row = "第" + (i + 2) + "行";
|
||||
boolean isError = false;
|
||||
Map<String, Object> map = data.get(i);
|
||||
WdlGzjgDTO mainData = new WdlGzjgDTO();
|
||||
List<WdlGzjgDtPO> detailList = new ArrayList<>();
|
||||
mainData.setDetailList(detailList);
|
||||
|
||||
for (int j = 0; j < headers.size(); j++) {
|
||||
String header = headers.get(j);
|
||||
String dataKey = header;
|
||||
if (dataKey == null) {
|
||||
continue;
|
||||
}
|
||||
String dataValue = (String) map.getOrDefault(dataKey, "");
|
||||
if (StringUtils.equals("类别", dataKey.toString())) {
|
||||
if (StringUtils.isNotBlank(dataValue)) {
|
||||
Integer lbValue = lbValueMap.get(dataValue);
|
||||
if (lbValue == null) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + "类别信息不存在");
|
||||
excelComments.add(errorMessageMap);
|
||||
} else {
|
||||
mainData.setLb(lbValue);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals("办公地点", dataKey) ) {
|
||||
if (StringUtils.isNotBlank(dataValue)) {
|
||||
Integer bgddValue = locationValueMap.get(dataValue);
|
||||
if (bgddValue == null) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + "办公地点信息不存在");
|
||||
excelComments.add(errorMessageMap);
|
||||
} else {
|
||||
mainData.setBgdd(bgddValue);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals("岗位名称", dataKey) ) {
|
||||
if (StringUtils.isNotBlank(dataValue)) {
|
||||
Long positionValue = positionMap.get(dataValue);
|
||||
if (positionValue == null) {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + "岗位名称信息不存在");
|
||||
excelComments.add(errorMessageMap);
|
||||
} else {
|
||||
mainData.setGwmc(positionValue.intValue());
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals("工资水平", dataKey) ) {
|
||||
if (StringUtils.isNotBlank(dataValue)) {
|
||||
if (NumberUtils.isCreatable(dataValue)) {
|
||||
mainData.setGzsp(SalaryEntityUtil.string2Integer(dataValue));
|
||||
} else {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + "工资水平非数值");
|
||||
excelComments.add(errorMessageMap);
|
||||
}
|
||||
}
|
||||
} else if (StringUtils.equals("岗位职级", dataKey) ) {
|
||||
// todo
|
||||
if (StringUtils.isNotBlank(dataValue)) {
|
||||
|
||||
}
|
||||
} else if (salaryItemNameMap.containsKey(dataKey) && salaryItemNameMap.get(dataKey) != null) {
|
||||
WdlGzjgDtPO detail = WdlGzjgDtPO.builder()
|
||||
.xzxm(salaryItemNameMap.get(dataKey).toString())
|
||||
.je(SalaryEntityUtil.string2Integer(dataValue))
|
||||
.build();
|
||||
detailList.add(detail);
|
||||
} else {
|
||||
isError = true;
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", row + dataKey + "薪资项目不存在,无法导入");
|
||||
excelComments.add(errorMessageMap);
|
||||
}
|
||||
|
||||
}
|
||||
// 每处理50个数据更新一次进度
|
||||
index++;
|
||||
if (isError) {
|
||||
failCount++;
|
||||
errorDatas.add(map);
|
||||
continue;
|
||||
}
|
||||
needInsertList.add(mainData);
|
||||
successCount++;
|
||||
|
||||
}
|
||||
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", failCount);
|
||||
apidatas.put("errorData", excelComments);
|
||||
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
|
||||
return apidatas;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准工资结构表 数据复制到历史标准工资结构表
|
||||
*/
|
||||
private void copyWdlReport2HistoryData() {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.execute("select id,lb,bgdd,gwmc,gwzj,gzsp,mxbmr,gwzj1 from uf_bzgzjgb");
|
||||
List<WdlGzjgDTO> mainList = new ArrayList<>();
|
||||
|
||||
String dateStr = SalaryDateUtil.getFormatLocalDateTime(new Date()).replace("-", "").replace(":", "").replace(" ", "");
|
||||
String lsbb = StringUtils.substring(dateStr, 0, 12);
|
||||
while (rs.next()) {
|
||||
WdlGzjgDTO wdlGzjgDTO = new WdlGzjgDTO();
|
||||
wdlGzjgDTO.setId(rs.getInt("id"));
|
||||
wdlGzjgDTO.setLb(StringUtils.isBlank(rs.getString("lb")) ? null : rs.getInt("lb"));
|
||||
wdlGzjgDTO.setBgdd(StringUtils.isBlank(rs.getString("bgdd")) ? null : rs.getInt("bgdd"));
|
||||
wdlGzjgDTO.setGwmc(StringUtils.isBlank(rs.getString("gwmc")) ? null : rs.getInt("gwmc"));
|
||||
wdlGzjgDTO.setGwzj(rs.getString("gwzj"));
|
||||
wdlGzjgDTO.setGzsp(StringUtils.isBlank(rs.getString("gzsp")) ? null : rs.getInt("gzsp"));
|
||||
wdlGzjgDTO.setMxbmr(rs.getString("mxbmr"));
|
||||
wdlGzjgDTO.setGwzj1(rs.getString("gwzj1"));
|
||||
wdlGzjgDTO.setLsbb(lsbb);
|
||||
mainList.add(wdlGzjgDTO);
|
||||
}
|
||||
|
||||
rs.execute("select id,mainid,xzxm,je from uf_bzgzjgb_dt1");
|
||||
List<WdlGzjgDtPO> detailList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
WdlGzjgDtPO detail = new WdlGzjgDtPO();
|
||||
detail.setId(rs.getInt("id"));
|
||||
detail.setMianid(rs.getInt("mainid"));
|
||||
detail.setXzxm(rs.getString("xzxm"));
|
||||
detail.setJe(StringUtils.isBlank(rs.getString("je")) ? null : rs.getInt("je"));
|
||||
detailList.add(detail);
|
||||
}
|
||||
|
||||
// 入库
|
||||
// 获取建模模块id
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String modeId = baseBean.getPropValue("wdlSalary", "lsbzgzjg_mode_id");
|
||||
if (CollectionUtils.isNotEmpty(mainList)) {
|
||||
String currDate = String.format("'%s'", TimeUtil.getCurrentDateString());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
|
||||
String currTime = String.format("'%s'", sdf.format(new Date()));
|
||||
|
||||
List<List<WdlGzjgDTO>> partition = Lists.partition(mainList, 500);
|
||||
partition.forEach(part -> {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("insert into uf_bzgzjgbls_temp(formmodeid,modedatacreater,modedatacreatertype,modedatacreatedate,modedatacreatetime,id,lb,bgdd,gwmc,gwzj,gzsp,mxbmr,gwzj1,lsbb) values ");
|
||||
for (WdlGzjgDTO data : part) {
|
||||
sb.append("(")
|
||||
.append(modeId).append(",1,0,").append(currDate).append(",").append(currTime).append(",")
|
||||
.append(data.getId()).append(",")
|
||||
.append(data.getLb()).append(",")
|
||||
.append(data.getBgdd()).append(",")
|
||||
.append(data.getGwmc()).append(",'")
|
||||
.append(data.getGwzj()).append("',")
|
||||
.append(data.getGzsp()).append(",'")
|
||||
.append(data.getMxbmr()).append("','")
|
||||
.append(data.getGwzj1()).append("','")
|
||||
.append(data.getLsbb()).append("'),");
|
||||
}
|
||||
boolean execute = rs.execute(sb.substring(0, sb.length() - 1).toString());
|
||||
if (!execute) {
|
||||
baseBean.writeLog("主表复制失败" + rs.getExceptionMsg());
|
||||
throw new SalaryRunTimeException("导入失败,请联系管理员");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
|
||||
List<List<WdlGzjgDtPO>> partition = Lists.partition(detailList, 500);
|
||||
partition.forEach(part -> {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("insert into uf_bzgzjgbls_temp_dt1(id,mainid,xzxm,je) values ");
|
||||
for (WdlGzjgDtPO data : part) {
|
||||
sb.append("(")
|
||||
.append(data.getId()).append(",")
|
||||
.append(data.getMianid()).append(",'")
|
||||
.append(data.getXzxm()).append("',")
|
||||
.append(data.getJe()).append("),");
|
||||
}
|
||||
boolean execute = rs.execute(sb.substring(0, sb.length() - 1).toString());
|
||||
if (!execute) {
|
||||
baseBean.writeLog("明细复制失败" + rs.getExceptionMsg());
|
||||
throw new SalaryRunTimeException("导入失败,请联系管理员" + rs.getExceptionMsg());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 权限重构
|
||||
if (modeId != null && NumberUtils.isCreatable(modeId)) {
|
||||
new Thread() {
|
||||
public void run() {
|
||||
baseBean.writeLog("开始权限重构历史版本数据");
|
||||
for (WdlGzjgDTO data : mainList) {
|
||||
Integer modeIdValue = Integer.valueOf(modeId);
|
||||
ModeRightInfo modeRightInfo = new ModeRightInfo();
|
||||
modeRightInfo.setNewRight(true);
|
||||
modeRightInfo.editModeDataShare(1, modeIdValue, data.getId());
|
||||
}
|
||||
baseBean.writeLog("完成权限重构历史版本数据");
|
||||
}
|
||||
}.start();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1488,6 +1488,52 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getEffectiveValueList(SalaryArchiveQueryParam param) {
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
if (param.getEmployeeId() == null || StringUtils.isBlank(param.getTaxAgentName())) {
|
||||
return resultList;
|
||||
}
|
||||
Map<String, Long> taxAgentNameMap = SalaryEntityUtil.convert2Map(getTaxAgentService(user).listAll(), TaxAgentPO::getName, TaxAgentPO::getId);
|
||||
Long taxAgentId = taxAgentNameMap.get(param.getTaxAgentName());
|
||||
if (taxAgentId == null) {
|
||||
return resultList;
|
||||
}
|
||||
SalaryArchivePO salaryArchivePO = getByTaxAgentIdAndEmployeeId(taxAgentId, param.getEmployeeId());
|
||||
if (salaryArchivePO == null) {
|
||||
return resultList;
|
||||
}
|
||||
// 获取所有可被引用的薪资项目
|
||||
List<SalaryItemPO> salaryItems = salaryItemMapper.getCanAdjustSalaryItems();
|
||||
Collection<Long> salaryItemIds = salaryItems.stream().map(SalaryItemPO::getId).collect(Collectors.toList());
|
||||
// 获取薪资档案所对应的当前生效的薪资项目数据
|
||||
List<SalaryArchiveItemPO> salaryArchiveItemList = getCurrentEffectiveItemList(Collections.singletonList(salaryArchivePO.getId()), salaryItemIds);
|
||||
|
||||
salaryItems.forEach(item -> {
|
||||
Optional<SalaryArchiveItemPO> optionalItem = salaryArchiveItemList.stream().filter(f -> f.getSalaryItemId().equals(item.getId())).findFirst();
|
||||
// 过滤值为0的
|
||||
if (optionalItem.isPresent() && StringUtils.isNotBlank(optionalItem.get().getItemValue())) {
|
||||
if (NumberUtils.isCreatable(optionalItem.get().getItemValue())) {
|
||||
if (new BigDecimal(optionalItem.get().getItemValue()).compareTo(BigDecimal.ZERO) == 0) {
|
||||
} else {
|
||||
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||
salaryItemMap.put("salaryItemId", item.getId());
|
||||
salaryItemMap.put("salaryItemName", item.getName());
|
||||
salaryItemMap.put("value", optionalItem.get().getItemValue());
|
||||
resultList.add(salaryItemMap);
|
||||
}
|
||||
} else {
|
||||
Map<String, Object> salaryItemMap = new LinkedHashMap<>();
|
||||
salaryItemMap.put("salaryItemId", item.getId());
|
||||
salaryItemMap.put("salaryItemName", item.getName());
|
||||
salaryItemMap.put("value", optionalItem.get().getItemValue());
|
||||
resultList.add(salaryItemMap);
|
||||
}
|
||||
}
|
||||
});
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成万德隆分段扣款数据
|
||||
* @param
|
||||
|
|
|
|||
|
|
@ -384,6 +384,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee
|
|||
return SalaryI18nUtil.i18nList(employBiz.listPositionInfo(positionIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionInfo> listAllPositionInfo() {
|
||||
return SalaryI18nUtil.i18nList(employBiz.listAllPositionInfo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionInfo getPositionInfoById(Long positionId) {
|
||||
return SalaryI18nUtil.i18n(employBiz.getPositionInfoById(positionId));
|
||||
|
|
|
|||
|
|
@ -928,4 +928,80 @@ public class SalaryAcctController {
|
|||
}
|
||||
|
||||
/**********************************线下对比 end*********************************/
|
||||
/**********************************万德隆薪资动态表 start********************************/
|
||||
|
||||
//万德隆薪资动态表
|
||||
@POST
|
||||
@Path("/wdl/dynamicSalaryReport")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String wdlDynamicSalaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody wldDynamicSalaryReportQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<wldDynamicSalaryReportQueryParam, Map<String, Object>>(user).run(getSalaryAcctResultWrapper(user)::wdlDynamicSalaryReport, param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出万德隆薪资动态表
|
||||
*/
|
||||
@GET
|
||||
@Path("/wdl/exportDynamicSalaryReport")
|
||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||
public Response exportWdlDynamicSalaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
wldDynamicSalaryReportQueryParam param = new wldDynamicSalaryReportQueryParam();
|
||||
param.setExport(true);
|
||||
XSSFWorkbook workbook = getSalaryAcctResultWrapper(user).exportWdlDynamicSalaryReport(param);
|
||||
String time = LocalDate.now().toString();
|
||||
String fileName = "万德隆薪资动态表" + time;
|
||||
try {
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
StreamingOutput output = outputStream -> {
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
};
|
||||
response.setContentType("application/octet-stream");
|
||||
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
|
||||
} catch (Exception e) {
|
||||
log.error("万德隆薪资动态表导出异常", e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 万德隆 导入数据
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/wdl/importWdlDynamicSalaryReport")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String importWdlDynamicSalaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctImportParam, Map<String, Object>>(user).run(getSalaryAcctResultWrapper(user)::importWdlDynamicSalaryReport, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 万德隆 预览数据
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/wdl/previewWdlDynamicSalaryReport")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String previewWdlDynamicSalaryReport(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctImportParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryAcctImportParam, Map<String, Object>>(user).run(getSalaryAcctResultWrapper(user)::previewWdlDynamicSalaryReport, param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -762,6 +762,14 @@ public class SalaryArchiveController {
|
|||
return new ResponseResult<SalaryArchiveQueryParam, String>(user).run(getSalaryArchiveItemWrapper(user)::getEffectiveItemValue, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/getEffectiveValueList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getEffectiveValueList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryArchiveQueryParam, List<Map<String, Object>>>(user).run(getSalaryArchiveItemWrapper(user)::getEffectiveValueList, param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除薪资项目调整
|
||||
|
|
|
|||
|
|
@ -17,17 +17,26 @@ import com.engine.salary.service.impl.*;
|
|||
import com.engine.salary.sys.service.SalarySysConfService;
|
||||
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.engine.salary.wrapper.proxy.SalaryAcctResultWrapperProxy;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.math.NumberUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* 薪资核算结果
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -279,6 +288,36 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
getSalaryAcctResultService(user).batchUpdate(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> wdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param) {
|
||||
return getSalaryAcctResultService(user).wdlDynamicSalaryReport(param);
|
||||
}
|
||||
|
||||
public XSSFWorkbook exportWdlDynamicSalaryReport(wldDynamicSalaryReportQueryParam param) {
|
||||
return getSalaryAcctResultService(user).exportWdlDynamicSalaryReport(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> importWdlDynamicSalaryReport(SalaryAcctImportParam param) {
|
||||
return getSalaryAcctResultService(user).importWdlDynamicSalaryReport(param);
|
||||
}
|
||||
|
||||
public Map<String, Object> previewWdlDynamicSalaryReport(SalaryAcctImportParam param) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (StringUtils.isBlank(param.getImageId())) {
|
||||
return map;
|
||||
}
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
map.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
map.put("list", ExcelParseHelper.parse2List(sheet, 1, 1));
|
||||
return map;
|
||||
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算-校验
|
||||
*
|
||||
|
|
|
|||
|
|
@ -572,6 +572,10 @@ public class SalaryArchiveItemWrapper extends Service implements SalaryArchiveIt
|
|||
return getSalaryArchiveService(user).getEffectiveItemValue(param);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getEffectiveValueList(SalaryArchiveQueryParam param) {
|
||||
return getSalaryArchiveService(user).getEffectiveValueList(param);
|
||||
}
|
||||
|
||||
public void initSalaryItem4Workflow(SalaryArchiveItemSaveParam saveParam) {
|
||||
// 个税扣缴义务人
|
||||
List<TaxAgentPO> taxAgentList = getTaxAgentService(user).listAll();
|
||||
|
|
|
|||
Loading…
Reference in New Issue