工程班组人员接口--大屏
This commit is contained in:
parent
74b79d3bcc
commit
56b77d83f0
|
|
@ -3,6 +3,8 @@ package com.bonus.base.mapper;
|
|||
import com.bonus.base.domain.TbPeople;
|
||||
import com.bonus.base.domain.TbTeam;
|
||||
import com.bonus.base.vo.TbDeviceVo;
|
||||
import com.bonus.screen.vo.TeamJoinPersonVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -12,6 +14,7 @@ import java.util.List;
|
|||
* @author makejava
|
||||
* @since 2024-09-10 09:46:25
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbTeamMapper {
|
||||
|
||||
/**
|
||||
|
|
@ -122,5 +125,11 @@ public interface TbTeamMapper {
|
|||
* @return
|
||||
*/
|
||||
TbTeam selectByName(TbTeam tbTeam);
|
||||
|
||||
/**
|
||||
* 根据工程id查询班组人员
|
||||
* @param proId 工程id
|
||||
*/
|
||||
List<TeamJoinPersonVo> getTeamJoinPersonListByProId(@Param("proId") Integer proId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ public class ProjectViewController extends BaseController {
|
|||
return success(projectViewService.getAreaList());
|
||||
}
|
||||
|
||||
@GetMapping("/getTeamPersonListByProId")
|
||||
public AjaxResult getTeamPersonListByProId(Integer proId) {
|
||||
return projectViewService.getTeamJoinPersonListByProId(proId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,15 @@ import com.bonus.base.config.ProjectTypeEnum;
|
|||
import com.bonus.base.mapper.TbDeviceMapper;
|
||||
import com.bonus.base.mapper.TbProDepartMapper;
|
||||
import com.bonus.base.mapper.TbProjectMapper;
|
||||
import com.bonus.base.mapper.TbTeamMapper;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
||||
import com.bonus.screen.vo.DeviceViewVo;
|
||||
import com.bonus.screen.vo.DeviceWarnRecordVo;
|
||||
import com.bonus.screen.vo.ProjectAreaGroupVo;
|
||||
import com.bonus.screen.vo.ProjectViewVo;
|
||||
import com.bonus.screen.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
@ -37,6 +37,9 @@ public class ProjectViewServiceImpl {
|
|||
@Autowired
|
||||
private TbProDepartMapper tbProDepartMapper;
|
||||
|
||||
@Autowired
|
||||
private TbTeamMapper tbTeamMapper;
|
||||
|
||||
public ProjectViewVo getProjectView() {
|
||||
return tbProjectMapper.getProjectView(
|
||||
ProjectTypeEnum.PROJECT_TYPE_POWER.getCode(),
|
||||
|
|
@ -101,4 +104,26 @@ public class ProjectViewServiceImpl {
|
|||
public List<DeviceWarnRecordVo> getDeviceModelDetailsPage(Integer code) {
|
||||
return tbDeviceMapper.getDeviceModelDetailsPage(code);
|
||||
}
|
||||
|
||||
|
||||
public AjaxResult getTeamJoinPersonListByProId(Integer proId){
|
||||
List<TeamJoinPersonVo> teamPersonList = tbTeamMapper.getTeamJoinPersonListByProId(proId);
|
||||
|
||||
// 定义去重集合
|
||||
Map<Integer, List<TeamJoinPersonVo>> teamMap = new HashMap<>();
|
||||
|
||||
// 循环,把数据分组
|
||||
for (TeamJoinPersonVo vo : teamPersonList) {
|
||||
// 判断是否已存在
|
||||
if (teamMap.containsKey(vo.getTeamId())) {
|
||||
teamMap.get(vo.getTeamId()).add(vo);
|
||||
} else {
|
||||
List<TeamJoinPersonVo> list = new java.util.ArrayList<>();
|
||||
list.add(vo);
|
||||
teamMap.put(vo.getTeamId(), list);
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success(teamMap);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package com.bonus.screen.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author : 阮世耀
|
||||
* @version : 1.0
|
||||
* @PackagePath: com.bonus.screen.vo
|
||||
* @CreateTime: 2024-09-20 13:38
|
||||
* @Description: 班组人员关联数据
|
||||
*/
|
||||
@Data
|
||||
public class TeamJoinPersonVo {
|
||||
|
||||
private Integer teamId;
|
||||
|
||||
private String teamName;
|
||||
|
||||
private Integer peopleId;
|
||||
|
||||
private String peopleName;
|
||||
|
||||
private String peoplePhone;
|
||||
|
||||
}
|
||||
|
|
@ -230,5 +230,20 @@
|
|||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getTeamJoinPersonListByProId" resultType="com.bonus.screen.vo.TeamJoinPersonVo">
|
||||
SELECT
|
||||
t.id AS teamId, t.team_name AS teamName, p.id AS peopleId, p.rel_name AS peopleName, p.rel_phone as peoplePhone
|
||||
FROM
|
||||
tb_team t
|
||||
LEFT JOIN
|
||||
tb_people p ON t.id = p.team_id
|
||||
WHERE
|
||||
t.del_flag = 0 AND p.del_flag = 0
|
||||
<if test="proId != null">
|
||||
AND t.pro_id = #{proId}
|
||||
</if>
|
||||
ORDER BY
|
||||
t.id, p.id;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue