Merge branch 'release/2.18.2.2412.02' into custom/喜盈门国际商业连锁企业

This commit is contained in:
Harryxzy 2024-12-24 15:41:56 +08:00
commit 4c8a3caca3
6 changed files with 36 additions and 12 deletions

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

@ -818,7 +818,7 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
data.getList().forEach(employee -> {
if (employee.getSubcompanyId() != null && employee.getSubcompanyId() != null) {
subComIdNameMap.put(employee.getSubcompanyId(), employee.getSubcompanyName());
subComIds.add(employee.getDepartmentId());
subComIds.add(employee.getSubcompanyId());
empIdSubComMap.put(employee.getEmployeeId(), employee.getSubcompanyId());
}
});

View File

@ -1082,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

@ -29,6 +29,7 @@ import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
import com.engine.salary.service.*;
import com.engine.salary.sys.entity.vo.UploadConfigResponse;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.SalaryLoggerUtil;
@ -41,6 +42,7 @@ import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.hrm.User;
@ -706,7 +708,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
String userstatus = queryParam.getUserstatus();
r.setUsername(employee.getUsername());
r.setDepartmentName(employee.getDepartmentName());
r.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(employee.getStatus())));
r.setEmployeeStatus(UserStatusEnum.getDefaultLabelByValue(Integer.parseInt(NumberUtils.isCreatable(employee.getStatus()) ? employee.getStatus() : "-1")));
r.setAdjustReason(SalaryArchiveItemAdjustReasonEnum.getDefaultLabelByValue(r.getAdjustReason()));
return (StringUtils.isBlank(username) || employee.getUsername().contains(username))
&& (CollectionUtils.isEmpty(departmentIds) || departmentIds.contains(employee.getDepartmentId()))
@ -739,7 +741,7 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
row.add(dto.getAdjustBefore());
row.add(dto.getAdjustAfter());
row.add(dto.getAdjustReason());
row.add(dto.getEffectiveTime() + "");
row.add(SalaryDateUtil.getFormatDate(dto.getEffectiveTime()));
row.add(dto.getOperator());
row.add(format.format(dto.getOperateTime()));
row.add(dto.getDescription());

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

@ -90,6 +90,9 @@ public class SalaryTokenUtil {
return heads;
}
BaseBean baseBean = new BaseBean();
// 获取是否是https
String isHttps = baseBean.getPropValue("hrmSalaryBillToken", "is_https");
String httpKey = (StringUtils.isNotBlank(isHttps) && isHttps.equals("true")) ? "https://" : "http://";
RecordSet rs = new RecordSet();
Map<String, String> resultMap = new HashMap<>();
@ -123,7 +126,7 @@ public class SalaryTokenUtil {
heads.put("appid", appid);
heads.put("cpk", cpk);
// 调用ECOLOGY系统接口进行注册
String data = post("http://" + ip + "/api/ec/dev/auth/regist", null, heads);
String data = post(httpKey + ip + "/api/ec/dev/auth/regist", null, heads);
Map<String, Object> datas = JSONObject.parseObject(data, new TypeReference<Map<String, Object>>() {});
// ECOLOGY返回的系统公钥
String spk = (String) (datas.get("spk"));
@ -144,7 +147,7 @@ public class SalaryTokenUtil {
heads.put("appid", appid);
heads.put("secret", secret);
//调用ECOLOGY系统接口进行注册
String data2 = post("http://" + ip + "/api/ec/dev/auth/applytoken", null, heads);
String data2 = post(httpKey + ip + "/api/ec/dev/auth/applytoken", null, heads);
// 通过第一步注册许可时返回spk公钥对userid进行加密生成的密文
sql= " SELECT conf_value FROM hrsa_salary_sys_conf t WHERE delete_type = 0 AND conf_key = 'SALARY_TOKEN_SPK'";
rs.execute(sql);