Commit 9e1bf66b by 丁伟峰

Merge branch 'feature-dingwf-0715' into develop

2 parents 47ca589f 7d7ea8db
......@@ -29,7 +29,7 @@ public class BusinessController {
return res;
}
@GetMapping("/business/warehouse/list")
@GetMapping("/business/team/warehouse/list")
public Result<?> getWarehouses(@Validated BusinessWarehousesDTO.Request reqDTO) {
Result<?> res = null;
try {
......
......@@ -26,19 +26,19 @@ public class BusinessTeamsDTO {
/**
* 当前页码
*/
private String pageCurrent;
private Integer pageCurrent;
/**
* 总页数
*/
private String pages;
private Integer pages;
/**
* 每业条数
*/
private String pageSize;
private Integer pageSize;
/**
* 总条数
*/
private String total;
private Integer total;
}
@lombok.Data
......
......@@ -42,11 +42,11 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
@Override
public Result<?> getTeams(BusinessTeamsDTO.Request req) {
List<BusinessTeamsDTO.Content> contens = new ArrayList<>();
List<BusinessTeamsDTO.Content> contents = new ArrayList<>();
Pageable pageable = PageRequest.of(req.getPage() - 1, req.getSize());
Page<OrgTeamEntity> teams = orgTeamDao.findAllByGroupId(req.getLevelValue(), pageable);
List<String> teamIds = teams.stream().map(OrgTeamEntity::getTeamId).collect(Collectors.toList());
for (OrgTeamEntity e:teams){
Page<OrgTeamEntity> page = orgTeamDao.findAllByGroupId(req.getLevelValue(), pageable);
List<String> teamIds = page.getContent().stream().map(OrgTeamEntity::getTeamId).collect(Collectors.toList());
for (OrgTeamEntity e:page.getContent()){
String engineers = orgTeamEngineerDao.findAllByTeamId(e.getTeamId()).stream().map(e2->{
return engineerInfoDao.getByEngineerCode(e2.getEngineerCode()).getName();
}).collect(Collectors.toList()).toString();
......@@ -56,7 +56,9 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
content.setEngineers(engineers);
// todo 工作队容量
}
return Result.success(new BusinessTeamsDTO.Result().setContent(contens));
BusinessTeamsDTO.Result rs = new BusinessTeamsDTO.Result();
rs.setContent(contents).setTotal(page.getTotalPages()).setPageSize(page.getSize());
return Result.success(rs);
}
private List<String> getWorkdaysChinese(String workDays){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!