Commit 9f011e61 authored by chenhao's avatar chenhao

提交消防队伍的excle数据帅选功能

parent 0354406e
......@@ -50,7 +50,6 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
*/
IPage<FireTeamCardDto> getFireTeamForPage(Page page, FireTeamListDto par);
List<FireTeamDto> listFireTeamDto(Boolean isDelete);
/**
* 根据队伍id查询队伍下人员列表
......@@ -105,5 +104,9 @@ public interface FireTeamMapper extends BaseMapper<FireTeam> {
*/
List<FireTeam> byTeamId(Long teamId);
List<FireTeamDto> listFireTeamDto(Boolean isDelete, String nodeId, String nodeType, String name, String typeCode,List<String> nodeIds);
List<FireTeamDto> listFireTeamDtoTree(Boolean isDelete);
}
package com.yeejoin.amos.boot.module.common.api.service;
import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.FireTeamZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import java.util.List;
import java.util.Map;
/**
* 消防队伍 服务类
*
......
......@@ -70,6 +70,36 @@
from cb_fire_team t
left join cb_fire_team p on t.parent = p.sequence_nbr
where t.is_delete = #{isDelete}
<if test='nodeType != null and nodeType == "1" and nodeIds != null'>
and t.company in
<foreach collection="nodeIds" separator="," open="(" item="nodeId" close=")">
#{nodeId}
</foreach>
</if>
<if test='nodeType != null and nodeType == "0" and nodeIds != null'>
<if test="nodeIds.size() > 0" >
and t.parent in
<foreach collection="nodeIds" separator="," open="(" item="nodeId" close=")">
#{nodeId}
</foreach>
or t.sequence_nbr = #{nodeId}
</if>
<if test="nodeIds.size() == 0" >
and t.sequence_nbr = #{nodeId}
</if>
</if>
<if test='name!=null and name!=""'>
and t.name like CONCAT( '%', #{name}),'%')
</if>
<if test='typeCode!=null and typeCode!=""'>
and t.type_code = #{typeCode}
</if>
</select>
<select id="listFireTeamDtoTree" resultType="com.yeejoin.amos.boot.module.common.api.dto.FireTeamDto">
select t.*, p.name parentName
from cb_fire_team t
left join cb_fire_team p on t.parent = p.sequence_nbr
where t.is_delete = #{isDelete}
</select>
<!--消防队伍列表按时间倒叙排列order by x.rec_date desc 2021-09-08 by kongfm -->
......
......@@ -244,7 +244,7 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false, par);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false);
break;
......@@ -1551,7 +1551,7 @@ public class ExcelServiceImpl {
AircraftDto.class, dataSourcesImpl, false);
break;
case "XFDW":
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false);
List<FireTeamDto> fireTeamDtoList = fireTeamService.queryFireTeamForList(false,null);
ExcelUtil.createTemplate(response, excelDto.getFileName(), excelDto.getSheetName(), fireTeamDtoList,
FireTeamDto.class, dataSourcesImpl, false);
break;
......
......@@ -141,10 +141,30 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
return this.baseMapper.listFireTeamById(teamId);
}
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete) {
return fireTeamMapper.listFireTeamDto(isDelete);
public List<FireTeamDto> queryFireTeamForListTree(Boolean isDelete) {
return fireTeamMapper.listFireTeamDtoTree(isDelete);
}
public List<FireTeamDto> queryFireTeamForList(Boolean isDelete,Map map) {
if(map== null || map.size()<1) {
return fireTeamMapper.listFireTeamDto(isDelete,null,null,null,null,null);
}
String nodeId =map.containsKey("nodeId")?map.get("nodeId").toString():null;
String nodeType =map.containsKey("nodeType")?map.get("nodeType").toString():null;
String name =map.containsKey("name")?map.get("name").toString():null;
String typeCode =map.containsKey("typeCode")?map.get("typeCode").toString():null;
List<String> nodeIdsList=null;
// 查询单位
if (Objects.equals("1", nodeType)) {
List<OrgUsr> companyDeptList = orgUsrService.listOrgUserById(Long.parseLong(nodeId));
nodeIdsList = companyDeptList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList());
}
// 查询队伍
if (Objects.equals("0", nodeType)) {
List<FireTeam> teamList = listFireTeamById(Long.parseLong(nodeId));
nodeIdsList = teamList.stream().map(e -> e.getSequenceNbr().toString()).collect(Collectors.toList());
}
return fireTeamMapper.listFireTeamDto(isDelete,nodeId,nodeType,name,typeCode,nodeIdsList);
}
/**
* 根据列表构造队伍树
*
......@@ -179,7 +199,7 @@ public class FireTeamServiceImpl extends BaseService<FireTeamDto, FireTeam, Fire
});
// 消防队伍
List<MenuFrom> teamMenuList = Lists.newArrayList();
List<FireTeamDto> teamList = this.queryFireTeamForList(false);
List<FireTeamDto> teamList = this.queryFireTeamForList(false,null);
teamList.forEach(team -> {
if (ValidationUtil.isEmpty(team.getParent())) {
// 将单位下没有上级队伍的队伍直接挂在单位下(方便组成树结构)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment