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 1b784b42d..875879df1 100644 --- a/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java +++ b/src/com/engine/salary/remote/attend/service/impl/RemoteAttend4SalaryServiceImpl.java @@ -12,6 +12,7 @@ import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import weaver.general.Util; import java.util.*; import java.util.stream.Collectors; @@ -47,7 +48,7 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt .forEach(leave -> { Map map = Maps.newHashMapWithExpectedSize(2); map.put("code", leave.get("dataIndex").toString()); - map.put("name", leave.get("title") + "(" + leave.get("unit").toString() + ")"); + map.put("name", Util.null2String(column.get("title")) + "-" + leave.get("title") + "(" + leave.get("unit").toString() + ")"); columns.add(map); }); } @@ -56,14 +57,28 @@ public class RemoteAttend4SalaryServiceImpl extends Service implements RemoteAtt else if (dataIndex.equals("overtime") && column.get("children") != null) { List list = (List) column.get("children"); if (CollectionUtils.isNotEmpty(list)) { - list.stream() - .filter(leave -> leave.get("dataIndex") != null && StringUtils.isNotBlank(leave.get("dataIndex").toString())) - .forEach(leave -> { - Map map = Maps.newHashMapWithExpectedSize(2); - map.put("code", leave.get("dataIndex").toString()); - map.put("name", leave.get("title") + "(" + leave.get("unit").toString() + ")"); - columns.add(map); - }); + for (int i = 0; i < list.size(); i++) { + Map overtimeMap = list.get(i); + if (overtimeMap.get("dataIndex") != null && StringUtils.isNotBlank(overtimeMap.get("dataIndex").toString()) && overtimeMap.get("children") == null) { + Map map = Maps.newHashMapWithExpectedSize(2); + map.put("code", overtimeMap.get("dataIndex").toString()); + map.put("name", Util.null2String(column.get("title")) + "-" + overtimeMap.get("title") + "(" + overtimeMap.get("unit").toString() + ")"); + columns.add(map); + } + if (overtimeMap.get("dataIndex") != null && StringUtils.isNotBlank(overtimeMap.get("dataIndex").toString()) && overtimeMap.get("children") != null) { + List overtimes = (List) overtimeMap.get("children"); + if (CollectionUtils.isNotEmpty(overtimes)) { + overtimes.stream().filter(leave -> leave.get("dataIndex") != null && StringUtils.isNotBlank(leave.get("dataIndex").toString())) + .forEach(leave -> { + Map map = Maps.newHashMapWithExpectedSize(2); + map.put("code", leave.get("dataIndex").toString()); + map.put("name", Util.null2String(column.get("title")) + "-" + Util.null2String(overtimeMap.get("title")) + "-" + leave.get("title") + "(" + leave.get("unit").toString() + ")"); + columns.add(map); + }); + } + } + + } } } //普通考勤