Commit 666ddb63 authored by tangwei's avatar tangwei

编写指挥接口

parent fac1ca15
package com.yeejoin.amos.boot.module.common.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 联动单位
*
* @author system_generator
* @date 2021-07-16
*/
@Data
@ApiModel(value = "LinkageUnitZhDto", description = "指挥联动单位")
public class LinkageUnitZhDto {
@ApiModelProperty(value = "主键ID")
protected Long sequenceNbr;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "经度")
private Double longitude;
@ApiModelProperty(value = "纬度")
private Double latitude;
@ApiModelProperty(value = "战备人数量")
private int userNum;
@ApiModelProperty(value = "战备车辆数量")
private int carNum;
@ApiModelProperty(value = "距离灾情点距离 单位 米")
private Double distance;
}
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto; import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit; import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -28,4 +32,15 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> { ...@@ -28,4 +32,15 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
@Param("groupCode") String groupCode, @Param("groupCode") String groupCode,
@Param("sequenceNbr") Long sequenceNbr @Param("sequenceNbr") Long sequenceNbr
); );
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/20
* </PRE>
*/
List<LinkageUnitZhDto> listLinkageUnitZhDto(@Param("pageNum")int pageNum, @Param("pageSize")int pageSize, @Param("par") RequestData par);
Integer listLinkageUnitZhDtoCount(@Param("par")RequestData par);
} }
package com.yeejoin.amos.boot.module.common.api.service; package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import java.util.List;
/** /**
* 联动单位接口类 * 联动单位接口类
* *
...@@ -9,4 +15,10 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -9,4 +15,10 @@ package com.yeejoin.amos.boot.module.common.api.service;
*/ */
public interface ILinkageUnitService { public interface ILinkageUnitService {
List<LinkageUnitZhDto> listLinkageUnitZhDto(Integer pageNum, Integer pageSize, RequestData par);
Integer listLinkageUnitZhDtoCount(RequestData par);
LinkageUnitDto queryOne(Long sequenceNbr);
} }
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_fire_team a FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.typeCode!=null'> <if test='par.typeCode!=null and par.typeCode!=""'>
and a.type_code= #{par.typeCode} and a.type_code in (#{par.typeCode})
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance} and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance}
...@@ -113,8 +113,9 @@ ...@@ -113,8 +113,9 @@
COUNT(a.sequence_nbr) num COUNT(a.sequence_nbr) num
FROM cb_fire_team a FROM cb_fire_team a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.typeCode!=null'>
and a.type_code= #{par.typeCode} <if test='par.typeCode!=null and par.typeCode!=""'>
and a.type_code in (#{par.typeCode})
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance} and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= #{par.distance}
......
...@@ -25,4 +25,36 @@ ...@@ -25,4 +25,36 @@
and lu.sequence_nbr = #{sequenceNbr} and lu.sequence_nbr = #{sequenceNbr}
and is_delete = #{isDelete} and is_delete = #{isDelete}
</select> </select>
<select id="listLinkageUnitZhDto" resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto">
select
a.sequence_nbr sequenceNbr,
a.unit_name unitName,
a.address,
a.latitude,
a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_linkage_unit a
where a.longitude is not null and a.latitude is not null
<if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
ORDER BY distance limit #{pageNum},#{pageSize}
</select>
<select id="listLinkageUnitZhDtoCount" resultType="Integer">
select
COUNT(a.sequence_nbr) num
FROM cb_linkage_unit a
where a.longitude is not null and a.latitude is not null
<if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
#{par.distance}
</if>
</select>
</mapper> </mapper>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance
FROM cb_water_resource a FROM cb_water_resource a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.resourceType!=null'> <if test='par.resourceType!=null and par.resourceType!=""'>
and a.resource_type= #{par.resourceType} and a.resource_type= #{par.resourceType}
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
COUNT(a.sequence_nbr) num COUNT(a.sequence_nbr) num
FROM cb_water_resource a FROM cb_water_resource a
where a.is_delete=0 and a.longitude is not null and a.latitude is not null where a.is_delete=0 and a.longitude is not null and a.latitude is not null
<if test='par.resourceType!=null'> <if test='par.resourceType!=null and par.resourceType!=""'>
and a.resource_type= #{par.resourceType} and a.resource_type= #{par.resourceType}
</if> </if>
<if test='par.distance!=null'> <if test='par.distance!=null'>
......
...@@ -39,6 +39,7 @@ public enum AlertStageEnums { ...@@ -39,6 +39,7 @@ public enum AlertStageEnums {
DQZD("115", "地区消防救援支队"), DQZD("115", "地区消防救援支队"),
ZZZD("116", "企(事)业单位专职消防救援支队"), ZZZD("116", "企(事)业单位专职消防救援支队"),
YWDD("117", "企(事)业单位义务消防救援大队"), YWDD("117", "企(事)业单位义务消防救援大队"),
YLJY("830", "企(事)业单位医疗救援队(站)"),
JKDD("118", "企(事)业单位监控大队"); JKDD("118", "企(事)业单位监控大队");
......
...@@ -8,10 +8,7 @@ import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao; ...@@ -8,10 +8,7 @@ import com.yeejoin.amos.boot.module.command.api.dao.SeismometeorologyDtoDao;
import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto; import com.yeejoin.amos.boot.module.command.api.dto.SeismometeorologyDto;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.service.IFireStationService; import com.yeejoin.amos.boot.module.common.api.service.*;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.api.service.IWaterResourceService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
...@@ -58,7 +55,8 @@ public class CommandController extends BaseController { ...@@ -58,7 +55,8 @@ public class CommandController extends BaseController {
SeismometeorologyDtoDao seismometeorologyDtoDao; SeismometeorologyDtoDao seismometeorologyDtoDao;
@Autowired @Autowired
IOrgUsrService iOrgUsrService; IOrgUsrService iOrgUsrService;
@Autowired
ILinkageUnitService iLinkageUnitService;
/** /**
* 警情列表 * 警情列表
* *
...@@ -74,7 +72,7 @@ public class CommandController extends BaseController { ...@@ -74,7 +72,7 @@ public class CommandController extends BaseController {
/** /**
* 微型消防站列表分页查询 * 保卫目标分页查询
* *
* @return * @return
*/ */
...@@ -89,6 +87,27 @@ public class CommandController extends BaseController { ...@@ -89,6 +87,27 @@ public class CommandController extends BaseController {
pageBean.setTotal(num); pageBean.setTotal(num);
return ResponseHelper.buildResponse(pageBean); return ResponseHelper.buildResponse(pageBean);
} }
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/21
* </PRE>
* 保卫目标详情
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "ZDDW/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "保卫目标详情", notes = "保卫目标详情")
public ResponseModel<OrgUsrFormDto> selectZDDWById(@PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.selectCompanyById(id));
}
/** /**
* 微型消防站列表分页查询 * 微型消防站列表分页查询
* *
...@@ -183,7 +202,39 @@ public class CommandController extends BaseController { ...@@ -183,7 +202,39 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(pageBean); return ResponseHelper.buildResponse(pageBean);
} }
/**
* 联动力量列表分页查询
*
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "linkageForce/list")
@ApiOperation(httpMethod = "GET", value = "联动力量列表分页查询", notes = "联动力量列表分页查询")
public ResponseModel<IPage<LinkageUnitZhDto>> linkageForcelistPage(Integer pageNum, Integer pageSize, RequestData par) {
Page<LinkageUnitZhDto> pageBean = new Page<>(pageNum, pageSize);
List<LinkageUnitZhDto> list= iLinkageUnitService.listLinkageUnitZhDto(pageNum,pageSize,par);
Integer num= iLinkageUnitService.listLinkageUnitZhDtoCount(par);
pageBean.setRecords(list);
pageBean.setTotal(num);
return ResponseHelper.buildResponse(pageBean);
}
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/21
* </PRE>
* 联动单位详情
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "linkageForce/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个联动单位", notes = "根据sequenceNbr查询单个联动单位")
public ResponseModel<LinkageUnitDto> selectlinkageForceOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(iLinkageUnitService.queryOne(sequenceNbr));
}
/** /**
* 消防队伍列表分页查询 * 消防队伍列表分页查询
...@@ -194,7 +245,9 @@ public class CommandController extends BaseController { ...@@ -194,7 +245,9 @@ public class CommandController extends BaseController {
@GetMapping(value = "ZQ/list") @GetMapping(value = "ZQ/list")
@ApiOperation(httpMethod = "GET", value = "执勤实力列表分页查询", notes = "执勤实力列表分页查询") @ApiOperation(httpMethod = "GET", value = "执勤实力列表分页查询", notes = "执勤实力列表分页查询")
public ResponseModel<IPage<FireTeamZhDto>> ZQlistPage(Integer pageNum, Integer pageSize, RequestData par) { public ResponseModel<IPage<FireTeamZhDto>> ZQlistPage(Integer pageNum, Integer pageSize, RequestData par) {
par.setTypeCode(AlertStageEnums.ZZZD.getCode()); if(par.getTypeCode()==null){
par.setTypeCode( AlertStageEnums.ZZZD.getCode()+","+AlertStageEnums.YLJY.getCode());
}
Page<FireTeamZhDto> pageBean = new Page<>(pageNum, pageSize); Page<FireTeamZhDto> pageBean = new Page<>(pageNum, pageSize);
List<FireTeamZhDto> list= iFireTeamService.getFireTeamList(pageNum,pageSize,par); List<FireTeamZhDto> list= iFireTeamService.getFireTeamList(pageNum,pageSize,par);
Integer num= iFireTeamService.getFireTeamListCount(par); Integer num= iFireTeamService.getFireTeamListCount(par);
...@@ -291,4 +344,10 @@ public class CommandController extends BaseController { ...@@ -291,4 +344,10 @@ public class CommandController extends BaseController {
} }
return ResponseHelper.buildResponse(li); return ResponseHelper.buildResponse(li);
} }
} }
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit; import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
...@@ -80,7 +82,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -80,7 +82,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
return model; return model;
} }
@Override
public LinkageUnitDto queryOne(Long sequenceNbr) { public LinkageUnitDto queryOne(Long sequenceNbr) {
boolean isDelete = false; boolean isDelete = false;
String groupCode = getGroupCode(); String groupCode = getGroupCode();
...@@ -126,4 +128,20 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -126,4 +128,20 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
} }
return sb.toString(); return sb.toString();
} }
@Override
public List<LinkageUnitZhDto> listLinkageUnitZhDto(Integer pageNum, Integer pageSize, RequestData par) {
if (null == pageNum || null == pageSize) {
pageNum = 1;
pageSize = Integer.MAX_VALUE;
} else {
pageNum = (pageNum - 1) * pageSize;
}
return linkageUnitMapper.listLinkageUnitZhDto(pageNum, pageSize, par);
}
@Override
public Integer listLinkageUnitZhDtoCount(RequestData par) {
return linkageUnitMapper.listLinkageUnitZhDtoCount(par);
}
} }
\ No newline at end of file
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