| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import org.apache.poi.hssf.record.DVALRecord; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.modules.eam.entity.Area; |
| | | import org.jeecg.modules.eam.entity.Team; |
| | | import org.jeecg.modules.eam.service.IAreaService; |
| | | import org.jeecg.modules.eam.service.ITeamService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.ParameterResolutionDelegate; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @Autowired |
| | | private IAreaService areaService; |
| | | |
| | | @Autowired |
| | | private ITeamService teamService; |
| | | |
| | | |
| | | @AutoLog(value = "车间-分页查询") |
| | | @ApiOperation(value = "车间-分页查询", notes = "车间-分页查询") |
| | | @GetMapping(value = "/list") |
| | |
| | | QueryWrapper<Area> queryWrapper = QueryGenerator.initQueryWrapper(area, req.getParameterMap()); |
| | | Page<Area> page = new Page<Area>(pageNo, pageSize); |
| | | IPage<Area> pageList = areaService.page(page, queryWrapper); |
| | | for (Area record : pageList.getRecords()) { |
| | | String teamNames =""; |
| | | String teamIds = record.getTeamId(); |
| | | if(StringUtils.isNotBlank(teamIds)){ |
| | | List<String> ids = Arrays.asList(teamIds.split(",")); |
| | | for (int i = 0; i < ids.size(); i++) { |
| | | Team team = teamService.getById(ids.get(i)); |
| | | String name = team.getName(); |
| | | teamNames +=name; |
| | | if(i != ids.size()-1){ |
| | | teamNames += ","; |
| | | } |
| | | } |
| | | } |
| | | record.setTeamNames(teamNames); |
| | | } |
| | | return Result.ok(pageList); |
| | | } |
| | | |