Commit bbecde11 authored by tangwei's avatar tangwei

指令,前线联络,战评总结

parent a0c9c348
......@@ -7,12 +7,21 @@ public class KeyValueLabel {
private String key;
private String label;
private Object value;
private String unit;
public KeyValueLabel( String label,String key, Object value) {
super();
this.label = label;
this.key = key;
this.key = key;
this.value = value;
}
public KeyValueLabel(String label,String key, Object value, String unit) {
this.label = label;
this.key = key;
this.value = value;
this.unit = unit;
}
public KeyValueLabel() {
super();
}
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "AircraftDto", description = "航空器信息")
public class PowerData {
@ApiModelProperty(value = "所属单位")
private String companyName;
@ApiModelProperty(value = "车辆名称")
private String carName;
@ApiModelProperty(value = "车牌号")
private String carNum;
@ApiModelProperty(value = "随车人员")
private String user;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import lombok.Data;
@Data
public class StateDot {
private String name;
private boolean flag=false;
public StateDot(String name, boolean flag) {
this.name = name;
this.flag = flag;
}
public StateDot() {
super();
}
public StateDot(String name) {
this.name = name;
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 警情报送记录 Mapper 接口
......@@ -54,6 +55,6 @@ public interface AlertSubmittedMapper extends BaseMapper<AlertSubmitted> {
List<AlertSubmittedZHDto> listAlertSubmittedZHDto(@Param("id") Long id);
Map<String, Integer> getUseNum(@Param("id") Long id);
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
......@@ -59,4 +60,10 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> {
Map<String, Object> getPowerTransferInfoCount(@Param("beginDate") String beginDate,
@Param("endDate") String endDate);
Map<String, Integer> getCarNum(@Param("id") Long id);
Map<String, Integer> getCompanyNum(@Param("id") Long id);
List<PowerData> getPowerDataList(@Param("id") Long id);
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -38,5 +39,13 @@ public interface IAlertCalledService {
Object selectAlertCalledById( Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
Map<String,Object> selectAlertCalledKeyValueLabelById( Long id);
List<KeyValueLabel> selectAlertCalledcount( Long id);
List<KeyValueLabel> powercount( Long id);
List<PowerData> getPowerDataList(Long id);
AlertCalled getAlertCalledById(Long id);
}
......@@ -6,8 +6,10 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertSubmitted;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertSubmittedSMSDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.SchedulingReportingDto;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 警情报送记录 服务类
......@@ -48,5 +50,4 @@ public interface IAlertSubmittedService extends IService<AlertSubmitted> {
List<InstructionsZHDto> getInstructionsZHDtoList(Long id);
}
......@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import java.util.List;
import java.util.Map;
/**
* 力量调派 服务类
......@@ -27,4 +28,5 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
* 获取力量调派资源树
*/
List<FireBrigadeResourceDto> getPowerTree();
}
......@@ -120,7 +120,15 @@
<select id="getUseNum" resultType="Map">
SELECT
COUNT( DISTINCT b.rec_user_id ) useNum
FROM
jc_alert_submitted a
LEFT JOIN jc_alert_submitted_object b ON a.sequence_nbr = b.alert_submitted_id
WHERE
a.alert_called_id = ${id}
</select>
......
......@@ -107,4 +107,53 @@
order by pt.rec_date asc
</select>
<select id="getCarNum" resultType="Map">
SELECT
COUNT( DISTINCT b.company_id ) companyNum,
COUNT( DISTINCT c.resources_num ) carNum
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
WHERE
a.alert_called_id = ${id}
</select>
<select id="getCompanyNum" resultType="Map">
select COUNT(*) companyNum from
(SELECT DISTINCT
b.company_id
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
WHERE
a.alert_called_id = ${id} UNION ALL
SELECT DISTINCT
b.company_id
FROM
jc_alert_submitted a
LEFT JOIN jc_alert_submitted_object b ON a.sequence_nbr = b.alert_submitted_id
WHERE
a.alert_called_id = ${id}) m
</select>
<select id="getPowerDataList" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerData">
SELECT DISTINCT
b.company_name companyName,
c.resources_name carName,
c.resources_num carNum
FROM
jc_power_transfer a
LEFT JOIN jc_power_transfer_company b ON a.sequence_nbr = b.power_transfer_id
LEFT JOIN jc_power_transfer_company_resources c ON c.power_transfer_company_id = b.sequence_nbr
WHERE
a.alert_called_id = ${id}
</select>
</mapper>
......@@ -110,7 +110,7 @@ public class AlertSummaryController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AlertSummaryDto>> selectForList() {
return ResponseHelper.buildResponse(alertSummaryServiceImpl.queryForAlertSummaryList());
public ResponseModel<List<AlertSummaryDto>> selectForList(@RequestParam(value = "alertCalledId")Long alertCalledId) {
return ResponseHelper.buildResponse(alertSummaryServiceImpl.queryForAlertSummaryList(alertCalledId));
}
}
......@@ -10,6 +10,8 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.service.*;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.InstructionsZHDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.StateDot;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
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.IAlertSubmittedService;
......@@ -24,6 +26,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -458,7 +461,77 @@ public class CommandController extends BaseController {
}
/**
*
* 火灾现场统计
*
* **/
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "statistics/{id}")
@ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计")
public ResponseModel<Object> getStatistics(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledcount(id));
}
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/22
* </PRE>
* 到场力量统计
*/
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getpower/{id}")
@ApiOperation(httpMethod = "GET", value = "到场力量统计", notes = "到场力量统计")
public ResponseModel<Object> getpower(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.powercount(id));
}
/**
* * @param null
* @return
* <PRE>
* author tw
* date 2021/7/22
* </PRE>
* 到场力量统计列表
*/
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getPowerDataList/{id}")
@ApiOperation(httpMethod = "GET", value = "到场力量统计列表", notes = "到场力量统计列表")
public ResponseModel<Object> getPowerDataList(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.getPowerDataList(id));
}
/**
*
* 当前灾情阶段
*
* */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getstate/{id}")
@ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段")
public ResponseModel<Object> getstate(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id);
List<StateDot> list=new ArrayList<>();
list.add(new StateDot("警情接报"));
list.add(new StateDot("力量调派"));
list.add(new StateDot("值班确警"));
list.add(new StateDot("处置跟踪"));
list.add(new StateDot("处置结束"));
list.stream().forEach(stateDot->{
if(AlertCalled.getAlertStage().equals(stateDot.getName())){
stateDot.setFlag(true);
}
});
return ResponseHelper.buildResponse(list);
}
}
\ No newline at end of file
......@@ -95,11 +95,11 @@ public class FrontlineLiaisonController extends BaseController {
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "前线联络员分页查询", notes = "前线联络员分页查询")
public ResponseModel<Page<FrontlineLiaisonDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
(value = "size") int size,@RequestParam(value = "alertCalledId")Long alertCalledId) {
Page<FrontlineLiaisonDto> page = new Page<FrontlineLiaisonDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(frontlineLiaisonServiceImpl.queryForFrontlineLiaisonPage(page));
return ResponseHelper.buildResponse(frontlineLiaisonServiceImpl.queryForFrontlineLiaisonPage(page,alertCalledId));
}
/**
......
......@@ -4,6 +4,8 @@ import com.yeejoin.amos.boot.module.command.api.entity.AlertSummary;
import com.yeejoin.amos.boot.module.command.api.mapper.AlertSummaryMapper;
import com.yeejoin.amos.boot.module.command.api.service.IAlertSummaryService;
import com.yeejoin.amos.boot.module.command.api.dto.AlertSummaryDto;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -27,7 +29,7 @@ public class AlertSummaryServiceImpl extends BaseService<AlertSummaryDto,AlertSu
/**
* 列表查询 示例
*/
public List<AlertSummaryDto> queryForAlertSummaryList() {
return this.queryForList("" , false);
public List<AlertSummaryDto> queryForAlertSummaryList(@Condition(Operator.eq) Long alertCalledId) {
return this.queryForList("" , false,alertCalledId);
}
}
\ No newline at end of file
......@@ -4,6 +4,9 @@ import com.yeejoin.amos.boot.module.command.api.entity.FrontlineLiaison;
import com.yeejoin.amos.boot.module.command.api.mapper.FrontlineLiaisonMapper;
import com.yeejoin.amos.boot.module.command.api.service.IFrontlineLiaisonService;
import com.yeejoin.amos.boot.module.command.api.dto.FrontlineLiaisonDto;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -20,8 +23,10 @@ public class FrontlineLiaisonServiceImpl extends BaseService<FrontlineLiaisonDto
/**
* 分页查询
*/
public Page<FrontlineLiaisonDto> queryForFrontlineLiaisonPage(Page<FrontlineLiaisonDto> page) {
return this.queryForPage(page, null, false);
public Page<FrontlineLiaisonDto> queryForFrontlineLiaisonPage(Page<FrontlineLiaisonDto> page,@Condition(Operator.eq) Long alertCalledId) {
return this.queryForPage(page, null, false,alertCalledId);
}
/**
......
......@@ -12,17 +12,15 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertSubmittedMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.mapper.TemplateMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.component.rule.config.RuleConfig;
......@@ -77,8 +75,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
@Autowired
TemplateMapper templateMapper;
@Autowired
PowerTransferMapper powerTransferMapper;
@Autowired
AlertSubmittedMapper alertSubmittedMapper;
/**
*
* 指挥系统 未结束的警情列表
......@@ -368,4 +368,41 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return map;
}
@Override
public List<KeyValueLabel> selectAlertCalledcount(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
List<KeyValueLabel> listdate =new ArrayList<>();
listdate.add(new KeyValueLabel("被困人数","trappedNum",alertCalled.getTrappedNum()));
listdate.add(new KeyValueLabel("伤亡人数","casualtiesNum",alertCalled.getCasualtiesNum()));
return listdate;
}
@Override
public List<KeyValueLabel> powercount(Long id) {
Map<String,Integer> map=powerTransferMapper.getCarNum(id);
// Map<String,Integer> mapc=powerTransferMapper.getCompanyNum(id);
// Map<String,Integer> mapu= alertSubmittedMapper.getUseNum(id);
//统计参与人员
List<KeyValueLabel> listdate =new ArrayList<>();
listdate.add(new KeyValueLabel("调动人力","useNum","0","人"));
//统计参与车辆
listdate.add(new KeyValueLabel("调动人力","carNum",map.get("carNum"),"辆"));
//统计参与队伍
listdate.add(new KeyValueLabel("调动单位","companyNum",map.get("companyNum"),"个"));
return listdate;
}
@Override
public List<PowerData> getPowerDataList(Long id) {
List<PowerData> list=powerTransferMapper.getPowerDataList(id);
return list;
}
@Override
public AlertCalled getAlertCalledById(Long id) {
return this.getById(id);
}
}
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