港湾批量调薪 逻辑调整支持多义务人

This commit is contained in:
Harryxzy 2025-02-10 14:40:13 +08:00
parent 8c194074e7
commit 1c9ec2b943
2 changed files with 26 additions and 2 deletions

View File

@ -2,6 +2,8 @@ package com.engine.salary.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.engine.common.service.HrmCommonService;
import com.engine.common.service.impl.HrmCommonServiceImpl;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.hrmelog.entity.dto.LoggerContext;
@ -50,6 +52,7 @@ import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.excel.ExcelUtilPlus;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
@ -2207,6 +2210,17 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
throw new SalaryRunTimeException("报表参数错误");
}
BaseBean baseBean = new BaseBean();
// 查询是否拥有对应的角色
Long roleId = NumberUtils.isCreatable(baseBean.getPropValue("shgwSalaryBz", "report_role_id")) ? Long.valueOf(baseBean.getPropValue("shgwSalaryBz", "report_role_id")) : null;
if (roleId == null) {
return Collections.emptyMap();
}
HrmCommonService hcs = new HrmCommonServiceImpl();
List<Long> userIdList = hcs.getRoleMembers(roleId.intValue(),"0").stream().map(userId -> new Long(userId.toString())).collect(Collectors.toList());
if (CollectionUtils.isEmpty(userIdList) || !userIdList.contains(Long.valueOf(user.getUID()))) {
return Collections.emptyMap();
}
Long fylxSalaryItemId = NumberUtils.isCreatable(baseBean.getPropValue("shgwSalaryBz", "fylx_salary_item_id")) ? Long.valueOf(baseBean.getPropValue("shgwSalaryBz", "fylx_salary_item_id")) : 0L;
// 查询标准的义务人id(上海港湾) 以该义务人配置的为报表标准
Long rmbTaxAgentId = NumberUtils.isCreatable(baseBean.getPropValue("shgwSalaryBz", "rmb_tax_agent_id")) ? Long.valueOf(baseBean.getPropValue("shgwSalaryBz", "rmb_tax_agent_id")) : 0L;
@ -2366,6 +2380,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
@Override
public Map<String, Object> hwxzhzReportSum(SalaryAcctRecordQueryParam param) {
Map<String, Object> resultMap = hwxzhzReport(param);
if (resultMap.get("dataList") == null) {
return Collections.emptyMap();
}
List<Map<String, Object>> resultList = (List<Map<String, Object>>)resultMap.get("dataList");
BaseBean baseBean = new BaseBean();
// 查询标准的义务人id(上海港湾) 以该义务人配置的为报表标准
@ -2409,6 +2426,9 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
public XSSFWorkbook hwxzhzReportExport(SalaryAcctRecordQueryParam param) {
param.setExport(true);
Map<String, Object> resultMap = hwxzhzReport(param);
if (resultMap.get("dataList") == null) {
return null;
}
List<Map<String, Object>> resultList = (List<Map<String, Object>>)resultMap.get("dataList");
BaseBean baseBean = new BaseBean();
// 查询标准的义务人id(上海港湾) 以该义务人配置的为报表标准

View File

@ -123,6 +123,7 @@ public class ExcelUtilPlus {
XSSFRow row = sheet.createRow(rowIndex);
float height = 18;
float finalHeight = 18;
boolean containChangeRow = false;
for (int cellIndex = 0; cellIndex < infoList.size(); cellIndex++) {
XSSFCell cell = row.createCell(cellIndex);
@ -149,10 +150,13 @@ public class ExcelUtilPlus {
//判断是否要调整高度
int width = sheet.getColumnWidth(cellIndex) / 256;
finalHeight = getFinalHeight(o, width, finalHeight, height);
if (o != null && o.toString().contains("/n")) {
finalHeight = finalHeight * 2;
if (o != null && o.toString().contains("\n")) {
containChangeRow = true;
}
}
if (containChangeRow) {
finalHeight = finalHeight * 2;
}
row.setHeightInPoints(finalHeight);
}
return workbook;