diff --git a/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java b/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java index eeddfd41d..c54bbf10b 100644 --- a/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java +++ b/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java @@ -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> getColumns() { - //兼容获取班次信息字段 - List attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials(); - String attendanceSerial = Joiner.on(",").join((Iterable) attendanceSerials); + //是否采集考勤班次数据 + String attendanceSerial = ""; + if (isCollectAttendanceSerial) { + List attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials(); + attendanceSerial = Joiner.on(",").join((Iterable) attendanceSerials); + } Map paramsMap = new HashMap(); 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 temp = new HashMap(); temp.put("data", JSONObject.toJSONString(paramsMap)); diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java index 5ee5edea8..2b62276cd 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsReportServiceImpl.java @@ -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()); } }); diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index ce89f8196..67aff3ecd 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -1082,9 +1082,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc stopWatch.stop(); // 租户下所有的人员 stopWatch.start("薪资核算确认的人员"); - List salaryEmployees = getSalaryEmployeeService(user).listAllForReport(); - Map salaryEmployeeMap = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getUsername, DataCollectionEmployee::getEmployeeId); - Map emps = SalaryEntityUtil.convert2Map(salaryEmployees, DataCollectionEmployee::getEmployeeId); + List employeeIds = SalaryEntityUtil.properties(salaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); + List salaryEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); stopWatch.stop(); // 租户下所有的个税扣缴义务人 stopWatch.start("租户下所有的个税扣缴义务人"); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java index 431b56170..9e353083e 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveItemServiceImpl.java @@ -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()); diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index 4f5966095..7a3c052be 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -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"; } diff --git a/src/com/engine/salary/util/SalaryTokenUtil.java b/src/com/engine/salary/util/SalaryTokenUtil.java index aaa53e1d9..653a0a821 100644 --- a/src/com/engine/salary/util/SalaryTokenUtil.java +++ b/src/com/engine/salary/util/SalaryTokenUtil.java @@ -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 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 datas = JSONObject.parseObject(data, new TypeReference>() {}); // 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);