Merge branch 'release/2.15.2.2409.01' into feature/权限
This commit is contained in:
commit
9edf23fa37
|
|
@ -36,6 +36,10 @@ public class AttendQuoteDataBO {
|
|||
continue;
|
||||
}
|
||||
String key = field.getCode();
|
||||
//兼容出勤班次的key
|
||||
if(key.startsWith("attendanceSerial_")){
|
||||
key = key.replace("attendanceSerial_", "");
|
||||
}
|
||||
if (m.containsKey(key)) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("employeeId", m.get("resourceId"));
|
||||
|
|
|
|||
|
|
@ -104,4 +104,10 @@ public interface AttendQuoteFieldMapper {
|
|||
* @return
|
||||
*/
|
||||
List<AttendQuoteFieldPO> listSome(@Param("param") AttendQuoteFieldPO param);
|
||||
|
||||
/**
|
||||
* 获取出勤班次
|
||||
* @return
|
||||
*/
|
||||
List<String> getAttendanceSerials();
|
||||
}
|
||||
|
|
@ -486,4 +486,8 @@
|
|||
</delete>
|
||||
|
||||
|
||||
<select id="getAttendanceSerials" resultType="string">
|
||||
select id from kq_ShiftManagement where isdelete is null or isdelete <![CDATA[ <> ]]> '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -26,4 +26,9 @@ public class Attend4Salary {
|
|||
private List<Long> onlyEmpIds;
|
||||
|
||||
private Map<String, Object> extendParam;
|
||||
|
||||
/**
|
||||
* 出勤班次
|
||||
*/
|
||||
private String attendanceSerial;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ import com.alibaba.druid.support.json.JSONUtils;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
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.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -26,15 +29,22 @@ import java.util.stream.Collectors;
|
|||
public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAttend4SalaryService {
|
||||
private final Boolean isLog = "true".equals(new BaseBean().getPropValue("hrmSalary", "log"));
|
||||
|
||||
private AttendQuoteFieldMapper getAttendQuoteFieldMapper() {
|
||||
return MapperProxyFactory.getProxy(AttendQuoteFieldMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, String>> getColumns() {
|
||||
|
||||
//兼容获取班次信息字段
|
||||
List<String> attendanceSerials = getAttendQuoteFieldMapper().getAttendanceSerials();
|
||||
String attendanceSerial = Joiner.on(",").join((Iterable<?>) attendanceSerials);
|
||||
|
||||
Map<String, Object> paramsMap = new HashMap<String, Object>();
|
||||
// paramsMap.put("pageIndex", 1);
|
||||
// paramsMap.put("pageSize", 10);
|
||||
paramsMap.put("typeselect", "3");
|
||||
paramsMap.put("viewScope", "0");
|
||||
paramsMap.put("isNoAccount", "1");
|
||||
paramsMap.put("attendanceSerial", "");
|
||||
paramsMap.put("attendanceSerial", attendanceSerial);
|
||||
paramsMap.put("isFromMyAttendance", "1");
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("data", JSONObject.toJSONString(paramsMap));
|
||||
|
|
@ -60,6 +70,21 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
});
|
||||
}
|
||||
}
|
||||
//出勤班次
|
||||
else if (dataIndex.equals("attendanceSerial") && column.get("children") != null) {
|
||||
List<Map> list = (List<Map>) column.get("children");
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
list.stream()
|
||||
.filter(leave -> leave.get("dataIndex") != null && StringUtils.isNotBlank(leave.get("dataIndex").toString()))
|
||||
.forEach(leave -> {
|
||||
Map<String, String> map = Maps.newHashMapWithExpectedSize(2);
|
||||
map.put("code", "attendanceSerial_" + leave.get("dataIndex").toString());
|
||||
String unit = "".equals(leave.get("unit").toString()) ? "" : "(" + leave.get("unit").toString() + ")";
|
||||
map.put("name", Util.null2String(column.get("title")) + "-" + leave.get("title") + unit);
|
||||
columns.add(map);
|
||||
});
|
||||
}
|
||||
}
|
||||
//加班
|
||||
else if (dataIndex.equals("overtime") && column.get("children") != null) {
|
||||
List<Map> list = (List<Map>) column.get("children");
|
||||
|
|
@ -121,7 +146,8 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt
|
|||
List<String> resourceIds = attend4Salary.getOnlyEmpIds().stream().map(String::valueOf).collect(Collectors.toList());
|
||||
paramsMap.put("resourceId", String.join(",", resourceIds));
|
||||
paramsMap.put("isNoAccount", "1");
|
||||
paramsMap.put("attendanceSerial", "");
|
||||
//班次
|
||||
paramsMap.put("attendanceSerial", attend4Salary.getAttendanceSerial());
|
||||
paramsMap.put("isFromMyAttendance", "1");
|
||||
Map<String, Object> temp = new HashMap<String, Object>();
|
||||
temp.put("data", JSONObject.toJSONString(paramsMap));
|
||||
|
|
|
|||
|
|
@ -129,7 +129,9 @@ public class SalaryStatisticsReportBO {
|
|||
param.setDepart(((List<Map>) JSON.parseArray(po.getDepartSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
// param.setGrade(((List<Map>) JSON.parseArray(po.getGradeSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
// param.setPosition(((List<Map>) JSON.parseArray(po.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
if (po.getPositionSetting() != null) {
|
||||
param.setPosition(((List<Map>) JSON.parseArray(po.getPositionSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
}
|
||||
if (po.getStatusSetting() != null) {
|
||||
param.setStatus(((List<Map>) JSON.parseArray(po.getStatusSetting(), Map.class)).stream().map(m -> m.get(key).toString()).collect(Collectors.toList()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -445,8 +445,18 @@ public class SalaryStatisticsReportServiceImpl extends Service implements Salary
|
|||
// 获取报表统计薪资项目
|
||||
List<Long> salaryItemIds = salaryStatisticsItemPOS.stream().filter(item -> StringUtils.isNotBlank(item.getItemValue())).map(p -> p.getItemValue().split(",")).flatMap(Arrays::stream).map(Long::valueOf).collect(Collectors.toList());
|
||||
// 参数转换
|
||||
param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth()));
|
||||
param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth()));
|
||||
String salaryStartMonth = param.getSalaryStartMonth();
|
||||
if (salaryStartMonth == null) {
|
||||
param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryStartMonth()));
|
||||
} else {
|
||||
param.setSalaryStartMonth(SalaryDateUtil.getFormatYearMonth(SalaryDateUtil.dateStrToLocalDate(salaryStartMonth)));
|
||||
}
|
||||
String salaryEndMonth = param.getSalaryEndMonth();
|
||||
if (salaryEndMonth == null) {
|
||||
param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(reportPO.getSalaryEndMonth()));
|
||||
} else {
|
||||
param.setSalaryEndMonth(SalaryDateUtil.getFormatYearMonth(SalaryDateUtil.dateStrToLocalDate(salaryEndMonth)));
|
||||
}
|
||||
String key = "id";
|
||||
if (reportPO.getTaxAgentSetting() != null) {
|
||||
param.setTaxAgent(((List<Map>) JSON.parseArray(reportPO.getTaxAgentSetting(), Map.class)).stream().map(m -> Long.valueOf(m.get(key).toString())).collect(Collectors.toList()));
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ import org.apache.poi.util.IOUtils;
|
|||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.general.BaseBean;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
import weaver.wechat.util.Utils;
|
||||
|
||||
|
|
@ -131,7 +132,6 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
}
|
||||
|
||||
|
||||
|
||||
private RemoteAttend4SalaryService getRemoteAttend4SalaryService(User user) {
|
||||
return ServiceUtil.getService(RemoteAttend4SalaryServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -250,6 +250,16 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// 获取最终结果
|
||||
List<Map<String, Object>> listMaps = getListMaps(attendQuoteDataBases);
|
||||
|
||||
|
||||
//当前引用的值
|
||||
List<String> effectiveColumns = listMaps.stream()
|
||||
.map(Map::keySet)
|
||||
.max(Comparator.comparingInt(Set::size))
|
||||
.orElse(new HashSet<>())
|
||||
.stream()
|
||||
.map(key -> key.split("_")[0])
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 1.工作簿名称
|
||||
String sheetName = SalaryI18nUtil.getI18nLabel(93931, "考勤数据");
|
||||
List<Object> header = new ArrayList<>();
|
||||
|
|
@ -258,10 +268,16 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
header.add(SalaryI18nUtil.getI18nLabel(86186, "手机号"));
|
||||
header.add(SalaryI18nUtil.getI18nLabel(86317, "工号"));
|
||||
// 动态列
|
||||
List<AttendQuoteFieldPO> effectiveFields = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(listMaps)) {
|
||||
for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) {
|
||||
header.add(attendQuoteField.getFieldName());
|
||||
}
|
||||
effectiveFields = attendQuoteFields.stream()
|
||||
.filter(attendQuoteField -> effectiveColumns.contains(Util.null2String(attendQuoteField.getId())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
effectiveFields.forEach(attendQuoteField -> {
|
||||
header.add(attendQuoteField.getFieldName());
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
List<List<Object>> rows = new ArrayList<>();
|
||||
|
|
@ -276,7 +292,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
row.add(dto.get("jobNum"));
|
||||
|
||||
// 动态列
|
||||
for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) {
|
||||
for (AttendQuoteFieldPO attendQuoteField : effectiveFields) {
|
||||
Object o = dto.get(attendQuoteField.getId().toString() + "_attendQuoteData");
|
||||
try {
|
||||
if (o != null && NumberUtil.isNumber(o.toString())) {
|
||||
|
|
@ -509,13 +525,17 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
attend4Salary.setBeginDate(attendCycleRange.getFromDate());
|
||||
attend4Salary.setEndDate(attendCycleRange.getEndDate());
|
||||
attend4Salary.setOnlyEmpIds(part);
|
||||
//班次信息
|
||||
String attendanceSerial = attendQuoteFields.stream()
|
||||
.filter(f -> f.getCode() != null && f.getCode().startsWith("attendanceSerial_"))
|
||||
.map(f -> f.getCode().replace("attendanceSerial_", ""))
|
||||
.collect(Collectors.joining(","));
|
||||
attend4Salary.setAttendanceSerial(attendanceSerial);
|
||||
|
||||
List<Map<String, String>> attendResult = getRemoteAttend4SalaryService(user).getDatas(attend4Salary);
|
||||
|
||||
AttendQuoteDataBO.buildAttendDataFromRemote(attendResult, attendQuoteFields, attendQuoteSyncData);
|
||||
// attend4Salary.setUnit("day");
|
||||
// attendResult = remoteAttend4SalaryService.getWorkTimeSummary(attend4Salary);
|
||||
// log.info("考勤数据[按天]:{}", JSONUtils.toJSONString(attendResult.getData()));
|
||||
// AttendQuoteDataBO.buildAttendDataFromRemote("day", attendResult.getData(), attendQuoteFields, attendQuoteSyncData);
|
||||
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("salaryAttend获取考勤数据错误失败:{}", String.format("参数:%s,错误信息:%s", JSONObject.toJSONString(attend4Salary), e.getMessage()), e);
|
||||
|
|
@ -663,7 +683,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0";
|
||||
|
||||
// 获取租户下所有的人员
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||
List<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL);
|
||||
// 获取已设置的可同步的考勤字段
|
||||
List<AttendQuoteFieldPO> attendQuoteFields = getAttendQuoteSetFields(AttendQuoteSourceTypeEnum.IMPORT);
|
||||
// 生成获取考勤引用
|
||||
|
|
|
|||
|
|
@ -714,19 +714,20 @@ public class SalaryAcctEmployeeServiceImpl extends Service implements SalaryAcct
|
|||
// }
|
||||
// list = list.stream().filter(po -> employeeIdsByGradeFilter.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
// }
|
||||
// // 岗位过滤
|
||||
// if (CollectionUtils.isNotEmpty(param.getPosition())) {
|
||||
// Set<Long> employeeIdsByPostionFilter = new HashSet<>();
|
||||
// simpleEmployeeList.forEach(simpleEmployee -> {
|
||||
// if (simpleEmployee.getPosition() != null && param.getPosition().contains(simpleEmployee.getPosition().getId())) {
|
||||
// employeeIdsByPostionFilter.add(simpleEmployee.getEmployeeId());
|
||||
// }
|
||||
// });
|
||||
// if (CollectionUtils.isEmpty(employeeIdsByPostionFilter)) {
|
||||
// return Lists.newArrayList();
|
||||
// }
|
||||
// list = list.stream().filter(po -> employeeIdsByPostionFilter.contains(po.getEmployeeId())).collect(Collectors.toList());
|
||||
// }
|
||||
// 岗位过滤
|
||||
List<Long> position = param.getPosition();
|
||||
if (CollectionUtils.isNotEmpty(position)) {
|
||||
// Set<Long> employeeIdsByPostionFilter = new HashSet<>();
|
||||
// simpleEmployeeList.forEach(simpleEmployee -> {
|
||||
// if (simpleEmployee.getPosition() != null && param.getPosition().contains(simpleEmployee.getPosition().getId())) {
|
||||
// employeeIdsByPostionFilter.add(simpleEmployee.getEmployeeId());
|
||||
// }
|
||||
// });
|
||||
// if (CollectionUtils.isEmpty(employeeIdsByPostionFilter)) {
|
||||
// return Lists.newArrayList();
|
||||
// }
|
||||
employeeList = employeeList.stream().filter(emp -> position.contains(emp.getJobtitleId())).collect(Collectors.toList());
|
||||
}
|
||||
// 人事状态过滤
|
||||
if (CollectionUtils.isNotEmpty(param.getStatus())) {
|
||||
Set<Long> employeeIdsByStatus = new HashSet<>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue