工程班组人员接口--大屏
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.TbPeople;
|
||||||
import com.bonus.base.domain.TbTeam;
|
import com.bonus.base.domain.TbTeam;
|
||||||
import com.bonus.base.vo.TbDeviceVo;
|
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 org.apache.ibatis.annotations.Param;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -12,6 +14,7 @@ import java.util.List;
|
||||||
* @author makejava
|
* @author makejava
|
||||||
* @since 2024-09-10 09:46:25
|
* @since 2024-09-10 09:46:25
|
||||||
*/
|
*/
|
||||||
|
@Mapper
|
||||||
public interface TbTeamMapper {
|
public interface TbTeamMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -122,5 +125,11 @@ public interface TbTeamMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TbTeam selectByName(TbTeam tbTeam);
|
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());
|
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.TbDeviceMapper;
|
||||||
import com.bonus.base.mapper.TbProDepartMapper;
|
import com.bonus.base.mapper.TbProDepartMapper;
|
||||||
import com.bonus.base.mapper.TbProjectMapper;
|
import com.bonus.base.mapper.TbProjectMapper;
|
||||||
|
import com.bonus.base.mapper.TbTeamMapper;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
import com.bonus.screen.mapper.TbDeviceDataRecord;
|
||||||
import com.bonus.screen.vo.DeviceViewVo;
|
import com.bonus.screen.vo.*;
|
||||||
import com.bonus.screen.vo.DeviceWarnRecordVo;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import com.bonus.screen.vo.ProjectAreaGroupVo;
|
|
||||||
import com.bonus.screen.vo.ProjectViewVo;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -37,6 +37,9 @@ public class ProjectViewServiceImpl {
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbProDepartMapper tbProDepartMapper;
|
private TbProDepartMapper tbProDepartMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TbTeamMapper tbTeamMapper;
|
||||||
|
|
||||||
public ProjectViewVo getProjectView() {
|
public ProjectViewVo getProjectView() {
|
||||||
return tbProjectMapper.getProjectView(
|
return tbProjectMapper.getProjectView(
|
||||||
ProjectTypeEnum.PROJECT_TYPE_POWER.getCode(),
|
ProjectTypeEnum.PROJECT_TYPE_POWER.getCode(),
|
||||||
|
|
@ -101,4 +104,26 @@ public class ProjectViewServiceImpl {
|
||||||
public List<DeviceWarnRecordVo> getDeviceModelDetailsPage(Integer code) {
|
public List<DeviceWarnRecordVo> getDeviceModelDetailsPage(Integer code) {
|
||||||
return tbDeviceMapper.getDeviceModelDetailsPage(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}
|
WHERE id = #{id}
|
||||||
</update>
|
</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>
|
</mapper>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue