Commit 2060a721 authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents d426904a 8f34b909
...@@ -7,6 +7,8 @@ import lombok.Data; ...@@ -7,6 +7,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 消防队伍 * 消防队伍
* *
...@@ -59,4 +61,15 @@ public class FireTeamDto extends BaseDto { ...@@ -59,4 +61,15 @@ public class FireTeamDto extends BaseDto {
@ApiModelProperty(value = "操作人名称") @ApiModelProperty(value = "操作人名称")
private String recUserName; private String recUserName;
@ApiModelProperty(value = "消防队类型(专职消防队,监控大队)")
private String type;
@ApiModelProperty(value = "执勤车辆数")
private String onDutyCount;
@ApiModelProperty(value = "出动车辆数")
private String outCount;
@ApiModelProperty(value = "队伍下车辆")
private List<FireCarDto> children;
} }
package com.yeejoin.amos.boot.module.jcs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 消防队伍类型枚举
*
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum FireBrigadeTypeEnum {
专职消防队("fullTime", "116", "专职消防队"),
监控大队("monitorTeam", "118", "监控大队");
private String key;
private String code;
private String name;
}
...@@ -58,4 +58,12 @@ public interface EquipFeignClient { ...@@ -58,4 +58,12 @@ public interface EquipFeignClient {
*/ */
@RequestMapping(value = "/equipSpecific/getAirEquipSpecificDetail", method = RequestMethod.GET) @RequestMapping(value = "/equipSpecific/getAirEquipSpecificDetail", method = RequestMethod.GET)
ResponseModel<Object> getAirEquipSpecificDetail(@RequestParam Long stockDetailId) throws InnerInvokException; ResponseModel<Object> getAirEquipSpecificDetail(@RequestParam Long stockDetailId) throws InnerInvokException;
/**
* 获取车辆列表
*
* @return
*/
@RequestMapping(value = "/car/list-all", method = RequestMethod.GET)
ResponseModel<Object> getFireCarListAll();
} }
package com.yeejoin.amos.boot.module.jcs.api.service;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/**
* 装备服务feign
*
* @author Dell
*/
@FeignClient(name = "AMOS-EQUIPMANAGE", path = "equip")
//@FeignClient(name = "AMOS-AUTOSYS", url = "http://172.16.10.66:8085", path = "fireAutoSys")
public interface EquipFeignService {
/**
* 获取车辆列表
*
* @return
*/
@RequestMapping(value = "/car/list-all", method = RequestMethod.GET)
ResponseModel<Object> getFireCarListAll();
}
...@@ -79,13 +79,13 @@ public class AlertCalledController extends BaseController { ...@@ -79,13 +79,13 @@ public class AlertCalledController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录") @ApiOperation(httpMethod = "POST", value = "新增警情接警记录", notes = "新增警情接警记录")
@Transactional @Transactional
public ResponseModel<AlertCalledVo> saveAlertCalled(HttpServletRequest request, public ResponseModel<AlertCalledVo> saveAlertCalled(HttpServletRequest request,
@RequestBody AlertCalledVo alertCalledVo) throws Exception{ @RequestBody AlertCalledVo alertCalledVo) throws Exception{
if (ValidationUtil.isEmpty(alertCalledVo) if (ValidationUtil.isEmpty(alertCalledVo)
|| ValidationUtil.isEmpty(alertCalledVo.getAlertCalled())) || ValidationUtil.isEmpty(alertCalledVo.getAlertCalled()))
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
return ResponseHelper.buildResponse(iAlertCalledService.createAlertCalled(alertCalledVo)); return ResponseHelper.buildResponse(iAlertCalledService.createAlertCalled(alertCalledVo));
} }
...@@ -124,7 +124,7 @@ public class AlertCalledController extends BaseController { ...@@ -124,7 +124,7 @@ public class AlertCalledController extends BaseController {
@RequestMapping(value = "/{id}", method = RequestMethod.GET) @RequestMapping(value = "/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询") @ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> selectById(HttpServletRequest request, @PathVariable Long id) { public ResponseModel<Object> selectById(HttpServletRequest request, @PathVariable Long id) {
if(redisUtils.hasKey(RedisKey.ALERTCALLED_ID+id)){ if(redisUtils.hasKey(RedisKey.ALERTCALLED_ID+id)){
Object obj= redisUtils.get(RedisKey.ALERTCALLED_ID+id); Object obj= redisUtils.get(RedisKey.ALERTCALLED_ID+id);
return ResponseHelper.buildResponse(obj); return ResponseHelper.buildResponse(obj);
...@@ -140,10 +140,10 @@ public class AlertCalledController extends BaseController { ...@@ -140,10 +140,10 @@ public class AlertCalledController extends BaseController {
for (AlertFormValue alertFormValue : list) { for (AlertFormValue alertFormValue : list) {
FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.isBlock()); FormValue value = new FormValue(alertFormValue.getFieldCode(), alertFormValue.getFieldName(), "text", alertFormValue.getFieldValue(),alertFormValue.isBlock());
formValue.add(value); formValue.add(value);
} }
} }
AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue); AlertCalledFormVo alertCalledFormVo = new AlertCalledFormVo(alertCalled, formValue);
redisUtils.set(RedisKey.ALERTCALLED_ID+id,JSON.toJSON(alertCalledFormVo),time); redisUtils.set(RedisKey.ALERTCALLED_ID+id,JSON.toJSON(alertCalledFormVo),time);
return ResponseHelper.buildResponse(alertCalledFormVo); return ResponseHelper.buildResponse(alertCalledFormVo);
} }
...@@ -161,7 +161,7 @@ public class AlertCalledController extends BaseController { ...@@ -161,7 +161,7 @@ public class AlertCalledController extends BaseController {
Page<AlertCalled> pageBean; Page<AlertCalled> pageBean;
IPage<AlertCalled> page; IPage<AlertCalled> page;
QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>(); QueryWrapper<AlertCalled> alertCalledQueryWrapper = new QueryWrapper<>();
setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort); setQueryWrapper(alertCalledQueryWrapper, alertCalled,sort);
if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) { if (StringUtils.isBlank(pageNum) || StringUtils.isBlank(pageSize)) {
...@@ -172,9 +172,9 @@ public class AlertCalledController extends BaseController { ...@@ -172,9 +172,9 @@ public class AlertCalledController extends BaseController {
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
/** /**
* *
* <pre> * <pre>
* 相似警情分页查询 * 相似警情分页查询
* </pre> * </pre>
...@@ -196,7 +196,7 @@ public class AlertCalledController extends BaseController { ...@@ -196,7 +196,7 @@ public class AlertCalledController extends BaseController {
} }
/** /**
* *
* <pre> * <pre>
* 初始化ES * 初始化ES
* </pre> * </pre>
...@@ -209,7 +209,7 @@ public class AlertCalledController extends BaseController { ...@@ -209,7 +209,7 @@ public class AlertCalledController extends BaseController {
public ResponseModel<Boolean> initEs() throws Exception { public ResponseModel<Boolean> initEs() throws Exception {
return ResponseHelper.buildResponse(eSAlertCalledService.initEs()); return ResponseHelper.buildResponse(eSAlertCalledService.initEs());
} }
/** /**
* 列表无分页查询 * 列表无分页查询
* *
...@@ -228,18 +228,18 @@ public class AlertCalledController extends BaseController { ...@@ -228,18 +228,18 @@ public class AlertCalledController extends BaseController {
private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled,String sort){ private QueryWrapper<AlertCalled> setQueryWrapper(QueryWrapper<AlertCalled> queryWrapper, AlertCalled alertCalled,String sort){
Class<? extends AlertCalled> aClass = alertCalled.getClass(); Class<? extends AlertCalled> aClass = alertCalled.getClass();
queryWrapper.eq("is_delete", 0); queryWrapper.eq("is_delete", 0);
if(sort!=null) { if(sort!=null) {
String[] date= sort.split(","); String[] date= sort.split(",");
if(date[1].equals("ascend")) { if(date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0])); queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else { }else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0])); queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
} }
}else { }else {
queryWrapper.orderByDesc("call_time"); queryWrapper.orderByDesc("call_time");
} }
if (alertCalled.getCallTimeStart() != null && alertCalled.getCallTimeEnd() != null) { if (alertCalled.getCallTimeStart() != null && alertCalled.getCallTimeEnd() != null) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(), alertCalled.getCallTimeEnd()); queryWrapper.between("call_time", alertCalled.getCallTimeStart(), alertCalled.getCallTimeEnd());
} }
......
...@@ -4,6 +4,7 @@ import java.util.Arrays; ...@@ -4,6 +4,7 @@ import java.util.Arrays;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -180,7 +181,7 @@ public class PowerTransferController extends BaseController { ...@@ -180,7 +181,7 @@ public class PowerTransferController extends BaseController {
@GetMapping(value = "/power/tree") @GetMapping(value = "/power/tree")
@ApiOperation(value = "力量调派资源树", notes = "力量调派资源树") @ApiOperation(value = "力量调派资源树", notes = "力量调派资源树")
public ResponseModel<Object> getPowerTree() { public ResponseModel<Object> getPowerTree() {
iPowerTransferService.getPowerTree(); powerTransferService.getPowerTree();
return ResponseHelper.buildResponse(""); return ResponseHelper.buildResponse("");
} }
} }
......
...@@ -79,7 +79,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -79,7 +79,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
/** /**
* 同步保存ES * 同步保存ES
*/ */
eSAlertCalledService.saveAlertCalledToES(alertCalled); // eSAlertCalledService.saveAlertCalledToES(alertCalled);
return alertCalledVo; return alertCalledVo;
} }
......
...@@ -28,7 +28,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum; ...@@ -28,7 +28,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository; import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
/** /**
* *
* <pre> * <pre>
* 警情信息ES检索服务 * 警情信息ES检索服务
* </pre> * </pre>
...@@ -41,22 +41,22 @@ public class ESAlertCalledService { ...@@ -41,22 +41,22 @@ public class ESAlertCalledService {
@Autowired @Autowired
private ElasticsearchRestTemplate elasticsearchTemplate; private ElasticsearchRestTemplate elasticsearchTemplate;
@Autowired @Autowired
private ESAlertCalledRepository esAlertCalledRepository; private ESAlertCalledRepository esAlertCalledRepository;
@Autowired @Autowired
private AlertCalledServiceImpl alertCalledService; private AlertCalledServiceImpl alertCalledService;
@PostConstruct @PostConstruct
public void init() throws Exception public void init() throws Exception
{ {
//初始化ES,重建索引 //初始化ES,重建索引
initEs(); initEs();
} }
/** /**
* 重建索引 * 重建索引
*/ */
...@@ -66,26 +66,26 @@ public class ESAlertCalledService { ...@@ -66,26 +66,26 @@ public class ESAlertCalledService {
* 同步历史48小时以内的警情处置记录 * 同步历史48小时以内的警情处置记录
*/ */
QueryWrapper<AlertCalled> wrapper = new QueryWrapper<>(); QueryWrapper<AlertCalled> wrapper = new QueryWrapper<>();
long currentTime = System.currentTimeMillis() ; long currentTime = System.currentTimeMillis() ;
currentTime = currentTime - 480*60*60*1000; currentTime = currentTime - 480*60*60*1000;
Date date=new Date(currentTime); Date date=new Date(currentTime);
wrapper.ge("call_time", date); wrapper.ge("call_time", date);
List<AlertCalled> alertCalleds = alertCalledService.list(wrapper); List<AlertCalled> alertCalleds = alertCalledService.list(wrapper);
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
{ {
for (AlertCalled alertCalled : alertCalleds) for (AlertCalled alertCalled : alertCalleds)
{ {
saveAlertCalledToES(alertCalled); saveAlertCalledToES(alertCalled);
} }
} }
return true; return true;
} }
/** /**
* *
* <pre> * <pre>
* 批量保存 * 批量保存
* </pre> * </pre>
...@@ -93,18 +93,18 @@ public class ESAlertCalledService { ...@@ -93,18 +93,18 @@ public class ESAlertCalledService {
* @param list 警情信息列表 * @param list 警情信息列表
*/ */
public void saveAll(List<AlertCalled> alertCalleds) throws Exception{ public void saveAll(List<AlertCalled> alertCalleds) throws Exception{
if (!ValidationUtil.isEmpty(alertCalleds)) if (!ValidationUtil.isEmpty(alertCalleds))
{ {
for (AlertCalled alertCalled : alertCalleds) for (AlertCalled alertCalled : alertCalleds)
{ {
this.saveAlertCalledToES(alertCalled); this.saveAlertCalledToES(alertCalled);
} }
} }
} }
/** /**
* *
* <pre> * <pre>
* 根据警情记录批量保存 * 根据警情记录批量保存
* </pre> * </pre>
...@@ -127,7 +127,7 @@ public class ESAlertCalledService { ...@@ -127,7 +127,7 @@ public class ESAlertCalledService {
if (alertCalled.getAlertStatus()) if (alertCalled.getAlertStatus())
{ {
esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode()); esAlertCalled.setAlertStatusStr(AlertStatusEnum.CLOSED.getCode());
}else }else
{ {
esAlertCalled.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getCode()); esAlertCalled.setAlertStatusStr(AlertStatusEnum.UNCLOSED.getCode());
} }
...@@ -135,14 +135,14 @@ public class ESAlertCalledService { ...@@ -135,14 +135,14 @@ public class ESAlertCalledService {
esAlertCalled.setUnitInvolved(alertCalled.getUnitInvolved()); esAlertCalled.setUnitInvolved(alertCalled.getUnitInvolved());
esAlertCalled.setCoordinateX(alertCalled.getCoordinateX()); esAlertCalled.setCoordinateX(alertCalled.getCoordinateX());
esAlertCalled.setCoordinateY(alertCalled.getCoordinateY()); esAlertCalled.setCoordinateY(alertCalled.getCoordinateY());
esAlertCalledRepository.save(esAlertCalled); esAlertCalledRepository.save(esAlertCalled);
return esAlertCalled; return esAlertCalled;
} }
/** /**
* *
* <pre> * <pre>
* 从ES库批量删除 * 从ES库批量删除
* </pre> * </pre>
...@@ -162,7 +162,7 @@ public class ESAlertCalledService { ...@@ -162,7 +162,7 @@ public class ESAlertCalledService {
return true; return true;
} }
/** /**
* 根据id查询ES存储对象 * 根据id查询ES存储对象
* *
...@@ -182,16 +182,16 @@ public class ESAlertCalledService { ...@@ -182,16 +182,16 @@ public class ESAlertCalledService {
* @return * @return
*/ */
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings({ "rawtypes" })
public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledRequestDto alertCalledVo, int current, int size) public Page<ESAlertCalledDto> queryByKeys(ESAlertCalledRequestDto alertCalledVo, int current, int size)
{ {
Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size); Page<ESAlertCalledDto> result = new Page<ESAlertCalledDto>(current, size);
String[] alertStatus = alertCalledVo.getAlertStatus(); String[] alertStatus = alertCalledVo.getAlertStatus();
if (ValidationUtil.isEmpty(alertStatus)) if (ValidationUtil.isEmpty(alertStatus))
{ {
return result; return result;
} }
AlertCalled alertCalled = alertCalledVo.getAlertCalled(); AlertCalled alertCalled = alertCalledVo.getAlertCalled();
if (ValidationUtil.isEmpty(alertCalled)) if (ValidationUtil.isEmpty(alertCalled))
{ {
...@@ -244,13 +244,13 @@ public class ESAlertCalledService { ...@@ -244,13 +244,13 @@ public class ESAlertCalledService {
.must(QueryBuilders.matchQuery("unitInvolved", alertCalled.getUnitInvolved())); .must(QueryBuilders.matchQuery("unitInvolved", alertCalled.getUnitInvolved()));
boolMust.should(qb5); boolMust.should(qb5);
} }
/** /**
* 一般火灾,条件构造 * 一般火灾,条件构造
*/ */
// 创建查询构造器 // 创建查询构造器
NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder() NativeSearchQueryBuilder queryBuilder = new NativeSearchQueryBuilder()
// 分页 // 分页
...@@ -262,7 +262,7 @@ public class ESAlertCalledService { ...@@ -262,7 +262,7 @@ public class ESAlertCalledService {
// 对高亮词条进行操作 // 对高亮词条进行操作
SearchHits<ESAlertCalled> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESAlertCalled.class); SearchHits<ESAlertCalled> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESAlertCalled.class);
List<ESAlertCalledDto> list = new LinkedList<>(); List<ESAlertCalledDto> list = new LinkedList<>();
for (SearchHit searchHit : searchHits.getSearchHits()) for (SearchHit searchHit : searchHits.getSearchHits())
{ {
...@@ -272,8 +272,8 @@ public class ESAlertCalledService { ...@@ -272,8 +272,8 @@ public class ESAlertCalledService {
} }
result.setRecords(list); result.setRecords(list);
result.setTotal(searchHits.getTotalHits()); result.setTotal(searchHits.getTotalHits());
return result; return result;
} }
} }
...@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl; ...@@ -2,7 +2,9 @@ package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireCarDto; import com.yeejoin.amos.boot.module.jcs.api.dto.FireCarDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.FireTeamDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto; 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.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
...@@ -13,15 +15,11 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; ...@@ -13,15 +15,11 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template; import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireCarStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.EquipFeignService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertFormValueService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyResourcesService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyService;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferService;
import com.yeejoin.amos.boot.module.jcs.api.service.ITemplateService;
import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyResourcesVo; import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyResourcesVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo; import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferVo; import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferVo;
...@@ -31,6 +29,7 @@ import org.springframework.beans.BeanUtils; ...@@ -31,6 +29,7 @@ import org.springframework.beans.BeanUtils;
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 org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
...@@ -66,11 +65,12 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -66,11 +65,12 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
AlertFormValueServiceImpl alertFormValueService; AlertFormValueServiceImpl alertFormValueService;
@Autowired @Autowired
EquipFeignService equipFeignService; EquipFeignClient equipFeignService;
@Autowired @Autowired
FireTeamServiceImpl fireTeamService; FireTeamServiceImpl fireTeamService;
@Override
public PowerTransferVo getPowerTransferList(Long alertCalledId) { public PowerTransferVo getPowerTransferList(Long alertCalledId) {
List<PowerTransferCompanyResourcesVo> powerTransferList = List<PowerTransferCompanyResourcesVo> powerTransferList =
this.baseMapper.getPowerTransferList(alertCalledId); this.baseMapper.getPowerTransferList(alertCalledId);
...@@ -132,7 +132,29 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -132,7 +132,29 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}); });
} }
// 2.查询消防队伍列表 // 2.查询消防队伍列表
List<FireTeam> fullTimeFireBrigadeList = fireTeamService.list(new QueryWrapper<FireTeam>().eq("type_code", "")); List<FireTeam> fullTimeFireBrigadeList = fireTeamService.list(new QueryWrapper<FireTeam>().eq("type_code",
FireBrigadeTypeEnum.专职消防队.getCode()));
List<FireTeam> monitorFireBrigadeList = fireTeamService.list(new QueryWrapper<FireTeam>().eq("type_code",
FireBrigadeTypeEnum.监控大队.getCode()));
// 3.组装专职消防队伍车辆
// List<FireTeamDto> fireTeamDtoList = Lists.newArrayList();
// if (!CollectionUtils.isEmpty(fullTimeFireBrigadeList)) {
// fullTimeFireBrigadeList.forEach(brigade -> {
// FireTeamDto teamDto = new FireTeamDto();
// BeanUtils.copyProperties(brigade, teamDto);
// teamDto.setType(FireBrigadeTypeEnum.专职消防队.getKey());
//
//// teamDto.setChildren();
// });
// }
fireCarDtoList.stream().collect(Collectors.groupingBy(FireCarDto::getTeamId));
try {
TreeParser.getTree(null, monitorFireBrigadeList, FireTeam.class.getName(), "getSequenceNbr", 2, "getName",
"getParent");
} catch (Exception e) {
e.printStackTrace();
}
} }
private List<PowerTransferCompanyResources> DtoEntityBatchConvert(List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList, Long powerTransferCompanySequenceNbr) { private List<PowerTransferCompanyResources> DtoEntityBatchConvert(List<PowerTransferCompanyResourcesDto> powerTransferCompanyResourcesDtoList, Long powerTransferCompanySequenceNbr) {
...@@ -207,6 +229,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -207,6 +229,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
} }
@Override
public List<PowerTransferCompanyVo> getLastPowerTransferCompany(Long alertCalledId) { public List<PowerTransferCompanyVo> getLastPowerTransferCompany(Long alertCalledId) {
return this.baseMapper.getLastPowerTransferCompany(alertCalledId); return this.baseMapper.getLastPowerTransferCompany(alertCalledId);
} }
......
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