Merge branch 'release/2.18.1.2412.01' into feature/权限

# Conflicts:
#	src/com/engine/salary/service/impl/SalarySendServiceImpl.java
This commit is contained in:
钱涛 2024-12-17 16:27:46 +08:00
commit 9b9c169246
14 changed files with 98 additions and 99 deletions

View File

@ -34,5 +34,7 @@ public class SalaryMySalaryBillListDTO {
private Long employeeId;
private String salaryCode;
}

View File

@ -81,14 +81,12 @@ public class SalaryAcctRecordPO {
* 回算上次核算的薪资核算记录id
*/
@Deprecated
// //备用字段1", ignore = true)
private Long superId;
/**
* 回算最原始的那次薪资核算记录id
*/
@Deprecated
// //备用字段2", ignore = true)
private Long rootId;
/**

View File

@ -61,7 +61,7 @@ public class SalaryArchiveBO {
*
* @param salaryItems
*/
public static List<WeaTableColumn> buildSalaryArchiveTable(List<SalaryItemPO> salaryItems) {
public static List<WeaTableColumn> buildSalaryArchiveTable(List<SalaryItemPO> salaryItems, boolean openSecondaryAccount) {
// 表格表头
List<WeaTableColumn> columns = new ArrayList<>();
WeaTableColumn idColumn = new WeaTableColumn("100px", "id", "id");
@ -72,7 +72,9 @@ public class SalaryArchiveBO {
employeeIdColumn.setDisplay(WeaBoolAttr.FALSE);
columns.add(employeeIdColumn);
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "账号类型"), "accountType"));
if (openSecondaryAccount) {
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(85429, "账号类型"), "accountType"));
}
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), "taxAgentName"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "分部"), "subcompanyName"));
columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName"));

View File

@ -782,7 +782,7 @@ public class SalaryArchiveExcelBO extends Service {
// .modifier(importHandleParam.getCurrentEmployeeId())
.deleteType(NumberUtils.INTEGER_ZERO)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.employeeType(importHandleParam.isExtEmp() ? 1 : 0)
.employeeType(importHandleParam.isExtEmp() ? 1 : null)
.build();
// 定薪action 保持状态为待定薪
if (importHandleParam.isInit() && importHandleParam.getKeepStatus() != null && importHandleParam.getKeepStatus().equals(Boolean.TRUE)) {

View File

@ -15,4 +15,6 @@ import java.util.Map;
**/
public interface SQLMapper {
List<Map> runSQL(@Param("sql") String sql);
List<Long> listLong(@Param("sql") String sql);
}

View File

@ -4,4 +4,9 @@
<select id="runSQL" resultType="java.util.Map">
${sql}
</select>
<select id="listLong" resultType="long">
${sql}
</select>
</mapper>

View File

@ -441,7 +441,7 @@
hrsa_salary_archive t
LEFT JOIN hrsa_external_employee e ON e.id = t.employee_id
WHERE t.delete_type = 0
and t.employee_type is not null
and t.employee_type = 1
<if test="param.ids != null and param.ids.size()>0">
AND t.id IN
<foreach collection="param.ids" open="(" item="id" separator="," close=")">

View File

@ -2,12 +2,15 @@ package com.engine.salary.remote.attend.service.impl;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSONObject;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.kq.cmd.report.GetKQReportCmd;
import com.engine.salary.mapper.datacollection.AttendQuoteFieldMapper;
import com.engine.salary.remote.attend.cmd.GetSearchListCmd;
import com.engine.salary.remote.attend.entity.Attend4Salary;
import com.engine.salary.remote.attend.service.RemoteAttend4SalaryService;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.db.MapperProxyFactory;
@ -20,11 +23,14 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import static com.engine.salary.sys.constant.SalarySysConstant.ATTENDANCE_SERIAL_COLLECTION_BTN;
@Slf4j
public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAttend4SalaryService {
private final Boolean isLog = "true".equals(new BaseBean().getPropValue("hrmSalary", "log"));
@ -33,12 +39,23 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
return MapperProxyFactory.getProxy(AttendQuoteFieldMapper.class);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
//是否采集考勤班次数据
boolean isCollectAttendanceSerial = "1".equals(getSalarySysConfService(user).getValueByCode(ATTENDANCE_SERIAL_COLLECTION_BTN));
@Override
public List<Map<String, String>> getColumns() {
//兼容获取班次信息字段
List<String> attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials();
String attendanceSerial = Joiner.on(",").join((Iterable<?>) attendanceSerials);
//是否采集考勤班次数据
String attendanceSerial = "";
if (isCollectAttendanceSerial) {
List<String> attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials();
attendanceSerial = Joiner.on(",").join((Iterable<?>) attendanceSerials);
}
Map<String, Object> paramsMap = new HashMap<String, Object>();
paramsMap.put("typeselect", "3");
@ -146,7 +163,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
paramsMap.put("resourceId", String.join(",", resourceIds));
paramsMap.put("isNoAccount", "1");
//班次
paramsMap.put("attendanceSerial", attend4Salary.getAttendanceSerial());
paramsMap.put("attendanceSerial", isCollectAttendanceSerial ? attend4Salary.getAttendanceSerial() : "");
paramsMap.put("isFromMyAttendance", "1");
Map<String, Object> temp = new HashMap<String, Object>();
temp.put("data", JSONObject.toJSONString(paramsMap));

View File

@ -472,7 +472,7 @@ public class SalaryStatisticsReportWrapper extends Service {
SalaryStatisticsItemPO salaryStatisticsItemPO = salaryStatisticsItemMap.get(salaryItemId);
if (salaryStatisticsItemPO != null) {
Optional<String> textItemOptional = Arrays.stream(salaryStatisticsItemPO.getItemValue().split(",")).filter(itemId -> !numberItemIds.contains(itemId)).findFirst();
row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(Utils.null2String(map.get(k)))) ? new BigDecimal(Utils.null2String(map.get(k))) : map.getOrDefault(k, StringUtils.EMPTY));
row.add((!textItemOptional.isPresent() && NumberUtils.isCreatable(Utils.null2String(map.get(k)).replaceAll(",", ""))) ? new BigDecimal(Utils.null2String(map.get(k)).replaceAll(",", "")) : map.getOrDefault(k, StringUtils.EMPTY));
} else {
row.add(map.getOrDefault(k, StringUtils.EMPTY));
}

View File

@ -3167,6 +3167,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
.build();
String combineErrorMsg = "";
log.info("oldSocialInfoListSize:" + oldSocialInfoList.size());
//组装新数据
if (oldSocialInfoList.size() == 1) {
//老数据
@ -3435,6 +3436,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
return null;
}
log.info("自动调整前 基数信息{}", paymentBaseJson);
for (Map.Entry<String, String> entry : paymentBaseJson.entrySet()) {
//判断福利值是否为空/数字
@ -3447,13 +3449,14 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
//根据福利方案id险种id缴纳对象缴费状态查询明细
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey()));
log.info("福利方案id: {},, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
log.info("自动调整 福利方案id: {},, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
if (insuranceSchemeDetailPOList.size() == 0) {
log.info("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: {}, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
log.info("自动调整 根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: {}, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
throw new SalaryRunTimeException("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: "+primaryId+", 福利明细项id{}"+ Long.valueOf(entry.getKey()));
}
List<InsuranceSchemeDetailPO> isPaymentList = insuranceSchemeDetailPOList.stream()
.filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList());
log.info("自动调整 isPaymentList: {}", isPaymentList.size());
if (isPaymentList.size() > 0) {
InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0);
@ -3463,18 +3466,18 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) {
//数值低于对应福利明细下限
entry.setValue(lowerLimit);
log.info("自动调整 福利方案id: {},, 福利明细项id{},数值{}低于对应福利明细下限{} ", primaryId, Long.valueOf(entry.getKey()), entry.getValue(), lowerLimit);
}
if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) {
//数值高于对应福利明细上限
entry.setValue(upperLimit);
log.info("自动调整 福利方案id: {},, 福利明细项id{},数值{}数值高于对应福利明细上限{} ", primaryId, Long.valueOf(entry.getKey()), entry.getValue(), upperLimit);
}
} else {
log.info("福利明细项属于未缴费状态,不对上下限进行约束");
return null;
log.info("自动调整 福利明细项属于未缴费状态,不对上下限进行约束");
}
}
log.info("自动调整后 基数信息{}", paymentBaseJson);
return JSON.toJSONString(paymentBaseJson);
}

View File

@ -521,6 +521,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
// 查询薪资核算记录所用的薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItems = config.getSalarySobItems();
salarySobItems = salarySobItems.stream().filter(salarySobItemPO -> salarySobItemPO.getItemHide() == null || salarySobItemPO.getItemHide() == 0).collect(Collectors.toList());
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
// 查询薪资项目
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
@ -615,6 +616,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
// 查询薪资核算记录所用的薪资账套的薪资项目副本
List<SalarySobItemPO> salarySobItems = salaryAcctConfig.getSalarySobItems();
salarySobItems = salarySobItems.stream().filter(salarySobItemPO -> salarySobItemPO.getItemHide() == null || salarySobItemPO.getItemHide() == 0).collect(Collectors.toList());
Set<Long> salaryItemIds = SalaryEntityUtil.properties(salarySobItems, SalarySobItemPO::getSalaryItemId);
// 查询薪资项目
List<SalaryItemPO> salaryItems = getSalaryItemService(user).listByIds(salaryItemIds);
@ -1080,9 +1082,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc
stopWatch.stop();
// 租户下所有的人员
stopWatch.start("薪资核算确认的人员");
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).listAllForReport();
Map<String, Long> salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId);
Map<Long, DataCollectionEmployee> emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId);
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
List<DataCollectionEmployee> salaryEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
stopWatch.stop();
// 租户下所有的个税扣缴义务人
stopWatch.start("租户下所有的个税扣缴义务人");

View File

@ -17,6 +17,7 @@ import com.engine.salary.config.SalaryElogConfig;
import com.engine.salary.constant.SalaryArchiveConstant;
import com.engine.salary.constant.SalaryItemConstant;
import com.engine.salary.constant.SalaryTemplateSalaryItemSetGroupConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.AddUpSituation;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
@ -49,6 +50,7 @@ import com.engine.salary.enums.salarybill.*;
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
import com.engine.salary.enums.salarysend.SalarySendGrantTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.SQLMapper;
import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper;
import com.engine.salary.mapper.salaryacct.SalaryAcctRecordMapper;
import com.engine.salary.mapper.salaryacct.SalaryAcctResultMapper;
@ -66,6 +68,7 @@ import com.engine.salary.util.SalaryDateUtil;
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.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
@ -203,6 +206,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
return ServiceUtil.getService(AuthServiceImpl.class, user);
}
private SQLMapper getSQLMapper() {
return MapperProxyFactory.getProxy(SQLMapper.class);
}
@Override
public SalarySendPO getById(Long salarySendId) {
return mapper.getById(salarySendId);
@ -490,9 +497,18 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
if (salarySendInfo == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "工资单信息不存在"));
}
Long employeeId = salarySendInfo.getEmployeeId();
if (currentEmployeeId.compareTo(employeeId) != 0) {
if (currentEmployeeId.compareTo(salarySendInfo.getEmployeeId()) != 0) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单"));
//主账号可以查看次账号工资单
String sql = "select id from Hrmresource a where belongto= " + currentEmployeeId;
List<Long> belongtoIds = getSQLMapper().listLong(sql);
if (CollUtil.isNotEmpty(belongtoIds) && belongtoIds.contains(employeeId)) {
//切换user
// this.user = new User(new Integer(employeeId + ""));
} else {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100511, "当前账号无法查看此工资单"));
}
}
// 获取默认模板信息
@ -573,12 +589,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
// 获取薪资项目数据
Long salaryAcctRecordId = salarySendInfo.getSalaryAcctRecordId();
SalaryAcctResultPO build = SalaryAcctResultPO.builder()
.salaryAcctRecordId(salaryAcctRecordId)
.taxAgentId(salarySendInfo.getTaxAgentId())
.employeeId(currentEmployeeId)
.build();
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(build);
List<SalaryAcctResultPO> salaryAcctResultPOS = getSalaryAcctResultMapper().listSome(SalaryAcctResultPO.builder().salaryAcctRecordId(salaryAcctRecordId).employeeId(employeeId).build());
if (CollUtil.isEmpty(salaryAcctResultPOS)) {
throw new SalaryRunTimeException("薪资核算结果不存在!");
}
@ -656,7 +667,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
}
}
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(salarySendInfo.getEmployeeId());
DataCollectionEmployee simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
SalaryAcctEmployeePO acctEmployeePO = getSalaryAcctEmployeeService(user).getById(salaryAcctResultPOS.get(0).getSalaryAcctEmpId());
SalaryAcctEmployeeBO.copyAcctEmp(simpleEmployee, acctEmployeePO);
TaxAgentPO taxAgentPO = getTaxAgentService(user).getById(acctEmployeePO.getTaxAgentId());
@ -664,9 +675,9 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
map.put("employeeInformation", employeeInformation);
map.put("salaryGroups", itemSetListDTOS);
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, currentEmployeeId));
salaryTemplate.setTheme(getBillTitle(salaryTemplate.getTheme(), salaryMonth, employeeId));
// 工资单水印文本型动态变量 == 处理
handleSalaryWatermark(salaryTemplate, salarySendInfo, currentEmployeeId);
handleSalaryWatermark(salaryTemplate, salarySendInfo, employeeId);
map.put("salaryTemplate", salaryTemplate);
map.put("salaryAcctResult", salaryAcctResultS);
@ -736,7 +747,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
* @param salaryTemplate
* @param salarySendInfo
*/
private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long currentEmployeeId) {
private void handleSalaryWatermark(SalaryTemplatePO salaryTemplate, SalarySendInfoPO salarySendInfo, Long employeeId) {
SalaryBillWatermarkDTO salaryBillWatermark = JsonUtil.parseObject(salaryTemplate.getSalaryWatermark(), SalaryBillWatermarkDTO.class);
if (Objects.isNull(salaryBillWatermark) || Boolean.FALSE.equals(salaryBillWatermark.getWatermarkStatus())) {
return;
@ -750,7 +761,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
boolean needQueryEmp = (boolean) salaryBillWatermark.getWmSetting().getOrDefault("needQueryEmp", false);
DataCollectionEmployee simpleEmployee = null;
if (needQueryEmp) {
simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(currentEmployeeId);
simpleEmployee = getSalaryEmployeeService(user).getEmployeeById(employeeId);
}
String wmText = salaryBillWatermark.getWmSetting().getOrDefault("wmText", StringUtils.EMPTY).toString();
@ -839,7 +850,10 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
}
return true;
})
.peek(dto -> dto.setEmployeeId((long) user.getUID()))
.peek(dto -> {
dto.setEmployeeId((long) user.getUID());
dto.setSalaryCode(AESEncryptUtil.encrypt4SalaryBill(String.valueOf(user.getUID())));
})
.collect(Collectors.toList());
PageInfo<SalaryMySalaryBillListDTO> pageInfo = new PageInfo<>(list, SalaryMySalaryBillListDTO.class);
@ -878,12 +892,12 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
*
* @param theme
* @param salaryMonth
* @param currentEmployeeId
* @param employeeId
* @return
*/
private String getBillTitle(String theme, Date salaryMonth, Long currentEmployeeId) {
private String getBillTitle(String theme, Date salaryMonth, Long employeeId) {
String companyName = "";
if (currentEmployeeId != null) {
if (employeeId != null) {
ResourceComInfo resourceComInfo = null;
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
try {
@ -892,7 +906,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
} catch (Exception e) {
log.error("资源异常", e);
}
companyName = subCompanyComInfo.getSubCompanyname(resourceComInfo.getSubCompanyID(currentEmployeeId + ""));
companyName = subCompanyComInfo.getSubCompanyname(resourceComInfo.getSubCompanyID(employeeId + ""));
}
return theme.replace("${companyName}", companyName)
.replace("${salaryMonth}", new SimpleDateFormat("yyyy年MM月").format(salaryMonth))
@ -970,7 +984,7 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
.jobtitleName(simpleEmployee.getJobtitleName())
.jobtitleId(simpleEmployee.getJobtitleId())
.status(simpleEmployee.getStatus() == null ? "" : simpleEmployee.getStatus())
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(),"1"))).getDefaultLabel())
.statusName(simpleEmployee.getStatus() == null ? "" : UserStatusEnum.parseByValue(new Integer(Util.null2s(simpleEmployee.getStatus(), "1"))).getDefaultLabel())
.accountTypeName(simpleEmployee.getAccountType() == null ? "" : AccountTypeEnum.parseByValue(simpleEmployee.getAccountType()).getDefaultLabel())
.telephone(StringUtils.isEmpty(simpleEmployee.getTelephone()) ? "" : simpleEmployee.getTelephone())
.username(StringUtils.isEmpty(simpleEmployee.getUsername()) ? "" : simpleEmployee.getUsername())
@ -1367,64 +1381,6 @@ public class SalarySendServiceImpl extends Service implements SalarySendService
}
// /**
// * 发送消息
// *
// * @param salarySend
// * @param enableSendList
// * @param salaryTemplate
// * @param currentTenantKey
// */
// private void sendMessage(SalarySendPO salarySend, List<Map<String, Object>> enableSendList, SalaryTemplatePO salaryTemplate, String tenantName, Long currentEmployeeId, String currentTenantKey) {
// if (StringUtils.isNotBlank(salaryTemplate.getBackground())) {
// FileData fileByte = fileDownloadClient.getFileByte(Long.valueOf(salaryTemplate.getBackground()), currentTenantKey);
// String encode = Base64Encoder.encode(fileByte.getData());
// salaryTemplate.setBackground(encode);
// }
// // 邮箱打开
// boolean isEmailOpen = salaryTemplate.getEmailStatus().equals(SalaryTemplateWhetherEnum.TRUE.getValue());
//
// LocalDate salaryMonth = salarySend.getSalaryMonth();
// String yearI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100325, "");
// String monthI18n = SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100326, "");
// String text = salaryMonth.getYear() +
// yearI18n +
// salaryMonth.getMonth().getValue() +
// monthI18n +
// SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 100520, "工资待发明细");
//
// UserEntity sendUser = null;
// // 标题
// String title = getBillTitle(salaryTemplate.getTheme(), salaryMonth, tenantName, currentEmployeeId, currentTenantKey);
//
// // 获取所有人员信息
// List<Long> ids = enableSendList.stream().map(e->Long.valueOf(e.get("employeeId").toString())).collect(Collectors.toList());
// List<DataCollectionEmployee> allEmployees = hrmCommonEmployeeService.getEmployeeByIds(ids, currentTenantKey);
// List<SalaryTemplateSalaryItemSetListDTO> listDTOS = JSONArray.parseArray(salaryTemplate.getSalaryItemSetting(), SalaryTemplateSalaryItemSetListDTO.class);
// Optional<SalaryTemplateSalaryItemSetListDTO> optionalEmployeeInformation = listDTOS.stream().filter(e -> SalaryTemplateSalaryItemSetGroupConstant.EMPLOYEE_INFO_GROUP_ID.equals(e.getGroupId())).findFirst();
// SalaryTemplateSalaryItemSetListDTO employeeInformation = optionalEmployeeInformation.orElse(null);
// Map<String, String> employeeField = SalaryAcctResultBO.buildEmployeeFieldName();
// enableSendList.forEach(e -> {
// Optional<DataCollectionEmployee> optionalSimpleEmployee = allEmployees.stream().filter(f->f.getEmployeeId().equals(Long.valueOf(e.get("employeeId").toString()))).findFirst();
// if (optionalSimpleEmployee.isPresent()) {
// buildEmployeeInfo(employeeInformation, optionalSimpleEmployee.get(), e.get("taxAgent").toString(), employeeField);
// }
//
// List<UserEntity> receivers = Collections.singletonList(
// SalarySendBO.buildUser(Long.valueOf(e.get("employeeId").toString()), e.get("email") == null ? "" : e.get("email").toString(), currentTenantKey));
// Entity entity = SalarySendBO.buildEntity(e.get("id").toString(), SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 94626, "工资单"));
// EmailEntity emailInfo = new EmailEntity();
// // 邮箱打开
// if (isEmailOpen) {
// String emailContent = SalarySendBO.buildEmailContent(e, employeeInformation, title, salaryTemplate);
// emailInfo = SalarySendBO.buildEmailInfo(text, emailContent, salaryTemplate.getSendEmailId());
// }
// SendMessageEntity message = SalarySendBO.buildSendMessageEntity(text, sendUser, receivers, entity, emailInfo);
// log.info("开始发送============:{}", JsonUtil.toJsonString(message));
// // 开始发送
// log.info("发送结果===:{}", JsonUtil.toJsonString(asyncSystemMessageRest.sendMsg(message)));
// });
// }
@Override
public Map<String, Object> withdraw(SalarySendWithdrawParam param) {

View File

@ -214,4 +214,7 @@ public class SalarySysConstant {
* 快照时间点
*/
public static final String SHOT_EMP_TIME_TYPE = "SHOT_EMP_TIME_TYPE";
//是否采集考勤班次数据,0关闭 1开启
public static final String ATTENDANCE_SERIAL_COLLECTION_BTN = "ATTENDANCE_SERIAL_COLLECTION_BTN";
}

View File

@ -26,6 +26,8 @@ import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.process.salaryArchive.SalaryArchiveProcessQueryParam;
import com.engine.salary.service.*;
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.page.PageInfo;
import com.google.common.collect.Lists;
@ -38,6 +40,8 @@ import weaver.hrm.User;
import java.util.*;
import java.util.stream.Collectors;
import static com.engine.salary.sys.constant.SalarySysConstant.OPEN_SECONDARY_ACCOUNT;
/**
* 薪资档案
* <p>Copyright: Copyright (c) 2022</p>
@ -73,6 +77,12 @@ public class SalaryArchiveWrapper extends Service {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
//主次账号是否开启
boolean openSecondaryAccount = "1".equals(getSalarySysConfService(user).getValueByCode(OPEN_SECONDARY_ACCOUNT));
/**
* 薪资档案列表分页
@ -101,7 +111,7 @@ public class SalaryArchiveWrapper extends Service {
//动态列组装
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems, openSecondaryAccount);
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
table.setColumns(columns);
@ -153,7 +163,7 @@ public class SalaryArchiveWrapper extends Service {
//动态列组装
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems);
List<WeaTableColumn> columns = SalaryArchiveBO.buildSalaryArchiveTable(salaryItems, openSecondaryAccount);
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, SalaryArchiveListDTO.class);
table.setColumns(columns);