Commit aba14081 by 丁伟峰

显示内容优化:排序、数组

1 parent 2537d27c
...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -50,13 +51,13 @@ public class BusinessTeamServiceImpl implements BusinessTeamService { ...@@ -50,13 +51,13 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
page = orgTeamDao.findAllByGroupId(req.getLevelValue(), pageable); page = orgTeamDao.findAllByGroupId(req.getLevelValue(), pageable);
} }
for (OrgTeamEntity e : page.getContent()) { for (OrgTeamEntity e : page.getContent()) {
String engineers = orgTeamEngineerDao.findAllByTeamId(e.getTeamId()).stream().map(e2 -> { List<String> engineers = orgTeamEngineerDao.findAllByTeamId(e.getTeamId()).stream().map(e2 -> {
return engineerInfoDao.getByEngineerCode(e2.getEngineerCode()).getName(); return engineerInfoDao.getByEngineerCode(e2.getEngineerCode()).getName();
}).collect(Collectors.toList()).toString(); }).collect(Collectors.toList());
BusinessTeamsDTO.Content content = new BusinessTeamsDTO.Content(); BusinessTeamsDTO.Content content = new BusinessTeamsDTO.Content();
content.setTeamId(e.getTeamId()).setTeamName(e.getTeamName()); content.setTeamId(e.getTeamId()).setTeamName(e.getTeamName());
content.setWorkdays(String.join(",", getWorkdaysChinese(e.getWorkdays()))); content.setWorkdays(String.join("", getWorkdaysChinese(e.getWorkdays())));
content.setEngineers(String.join(",", engineers)); content.setEngineers(String.join(";", engineers));
// todo 工作队容量 // todo 工作队容量
OrgWarehouseInfoEntity warehouse = warehouseInfoDao.getByTeamAssigned(e.getTeamId()); OrgWarehouseInfoEntity warehouse = warehouseInfoDao.getByTeamAssigned(e.getTeamId());
if (warehouse != null){ if (warehouse != null){
...@@ -66,7 +67,6 @@ public class BusinessTeamServiceImpl implements BusinessTeamService { ...@@ -66,7 +67,6 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
// ordersNum 当前单数 // ordersNum 当前单数
// pepleMinute 人数/分钟数 // pepleMinute 人数/分钟数
contents.add(content); contents.add(content);
} }
BusinessTeamsDTO.Result rs = new BusinessTeamsDTO.Result(); BusinessTeamsDTO.Result rs = new BusinessTeamsDTO.Result();
rs.setContent(contents).setTotal(page.getTotalPages()).setPageSize(page.getSize()); rs.setContent(contents).setTotal(page.getTotalPages()).setPageSize(page.getSize());
...@@ -75,7 +75,9 @@ public class BusinessTeamServiceImpl implements BusinessTeamService { ...@@ -75,7 +75,9 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
private List<String> getWorkdaysChinese(String workDays) { private List<String> getWorkdaysChinese(String workDays) {
// 将 1,2,3 转换为 周一、周二、周三 // 将 1,2,3 转换为 周一、周二、周三
return Arrays.stream(workDays.split(",")).map(e -> { List<String> days = Arrays.asList(workDays.split(","));
Collections.sort(days);
return days.stream().map(e -> {
return Week.of(Integer.valueOf(e)).toChinese("周"); return Week.of(Integer.valueOf(e)).toChinese("周");
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!