Commit 5be02e21 authored by fupeiyang's avatar fupeiyang

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

parents 610db93b 18feca27
spring.application.name=JCS
spring.application.name=JCS-tb
server.servlet.context-path=/jcs
server.port=11100
spring.profiles.active=dev
......@@ -22,3 +22,6 @@ spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=120000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1
#mqtt-警情初报消息主题
mqtt.topic.alert.reporting=alertReporting
\ No newline at end of file
......@@ -74,10 +74,9 @@ public class AircraftController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{ids}")
@DeleteMapping(value = "/batch")
@ApiOperation(httpMethod = "DELETE", value = "根据物理主键批量删除航空器信息", notes = "根据物理主键批量删除航空器信息")
public ResponseModel<List<Long>> deleteBySequenceNbr(HttpServletRequest request,
@PathVariable(value = "ids") String ids) throws Exception{
public ResponseModel<List<Long>> deleteBySequenceNbr(@RequestParam(value = "ids") String ids) throws Exception{
return ResponseHelper.buildResponse(aircraftServiceImpl.multDeleteAircraft(RequestContext.getAgencyCode(), ids));
}
......
......@@ -5,25 +5,31 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.*;
import com.yeejoin.amos.boot.biz.common.utils.Menu;
import com.yeejoin.amos.boot.biz.common.utils.MenuFrom;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.jcs.api.entity.DataDictionary;
import com.yeejoin.amos.boot.module.jcs.api.vo.AlertFormVo;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataDictionaryServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.ecCVCDSA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
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.Arrays;
import java.util.Collection;
import java.util.HashMap;
......@@ -169,6 +175,26 @@ public class DataDictionaryController extends BaseController {
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/dataDictionary", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询字典2", notes = "根据字典类型查询字典2")
public ResponseModel<Object> getDictionary(@RequestParam String type) throws Exception {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("type", type);
queryWrapper.orderByAsc("sort_num");
if (redisUtils.hasKey(RedisKey.DATA_DICTIONARY_CODE + type)) {
Object obj = redisUtils.get(RedisKey.DATA_DICTIONARY_CODE + type);
return ResponseHelper.buildResponse(obj);
} else {
Collection<DataDictionary> list = iDataDictionaryService.list(queryWrapper);
List<Menu> menus = TreeParser.getTree(null, list, DataDictionary.class.getName(), "getCode", 0, "getName", "getParent");
redisUtils.set(RedisKey.DATA_DICTIONARY_CODE + type, JSON.toJSON(menus), time);
return ResponseHelper.buildResponse(menus);
}
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gwmcDataDictionary/FireChemical/{type}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据字典类型查询危险品字典", notes = "根据字典类型查询危险品字典")
public ResponseModel<Object> gwmcDataDictionaryFireChemical( @PathVariable String type) throws Exception{
......
......@@ -245,7 +245,7 @@ public class WaterResourceController extends BaseController {
WaterResourceDto waterResourceDto = waterResourceServiceImpl.queryBySeq(sequenceNbr);
waterResourceDto.setRealityImgList(StringUtils.isEmpty(waterResourceDto.getRealityImg()) ? null :
JSONArray.fromObject(waterResourceDto.getRealityImg()));
waterResourceDto.setOrientationImgList(StringUtils.isEmpty(waterResourceDto.getOrientationImg()) ? null :
waterResourceDto.setOrientationImgList(StringUtils.isEmpty(waterResourceDto.getRealityImg()) ? null :
JSONArray.fromObject(waterResourceDto.getOrientationImg()));
// 查询属性信息
String resourceType = waterResourceDto.getResourceType();
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
......@@ -22,6 +9,21 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
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.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 航空器信息服务实现类
......@@ -64,9 +66,9 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
*/
public AircraftDto updateAircraft(String agencyCode, AircraftDto model) throws Exception {
AircraftDto oldModel = this.queryBySeq(model.getSequenceNbr());
if (ValidationUtil.isEmpty(oldModel))
if (ValidationUtil.isEmpty(oldModel)) {
throw new DataNotFound("找不到指定的航空器信息.");
}
//删除附件信息
Systemctl.fileInfoClient.deleteByAlias(agencyCode, Aircraft.class.getSimpleName(),
String.valueOf(model.getSequenceNbr()), null);
......@@ -136,7 +138,9 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
* @param page
* @return
*/
public Page<AircraftDto> queryForAircraftPage(Page<AircraftDto> page, Boolean isDelete, String aircraftModel,
public Page<AircraftDto> queryForAircraftPage(Page<AircraftDto> page,
Boolean isDelete,
@Condition(Operator.like) String aircraftModel,
String engineType, String fuelType) {
return this.queryForPage(page, null, false, isDelete, aircraftModel, engineType, fuelType);
}
......
......@@ -31,12 +31,16 @@ import com.yeejoin.amos.boot.module.jcs.api.vo.PowerTransferCompanyVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.SchedulingReportingVo;
import com.yeejoin.amos.boot.module.jcs.api.vo.TemplateVo;
import com.yeejoin.amos.boot.module.jcs.biz.rule.action.AlertCalledAction;
import com.yeejoin.amos.component.rule.config.ClazzUtils;
import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.StringUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -82,6 +86,12 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
@Autowired
private RedisUtils redisUtils;
@Autowired
private EmqKeeper emqKeeper;
@Value("${mqtt.topic.alert.reporting}")
private String topic;
@Override
public SchedulingReportingVo listSchedulingByParam(AlertSubmittedDto queryParam) {
SchedulingReportingVo schedulingReportingVo = new SchedulingReportingVo();
......@@ -153,11 +163,13 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
Set<String> mobiles = new HashSet<>();
HashMap<String, String> smsParams = new HashMap<>();
String alertCalledId = null;
// 根据id列表查询所有人员信息
List<Long> ids = StringUtil.String2LongList(sendIds);
if (object instanceof AlertCalledRo) {
AlertCalledRo calledRo = (AlertCalledRo) object;
String alertSubmittedId = calledRo.getAlertSubmittedId();
alertCalledId = calledRo.getSequenceNbr();
// 警情初报
if (alertSubmittedId == null) {
......@@ -223,6 +235,8 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
// 组织短信内容
// 调用短信发送接口
alertCalledAction.sendAlertCalleCmd(smsCode, mobiles, smsParams);
emqKeeper.getMqttClient().publish(topic, alertCalledId.getBytes(), RuleConfig.DEFAULT_QOS, false);
}
/**
......
......@@ -29,6 +29,7 @@ import org.springframework.stereotype.Service;
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.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
......@@ -121,6 +122,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
ResponseModel<Object> result = equipFeignService.getFireCarListAll();
if (!ObjectUtils.isEmpty(result)) {
List<Map<String, Object>> fireCarListMapList = (List<Map<String, Object>>) result.getResult();
if (!ValidationUtil.isEmpty(fireCarListMapList)) {
fireCarListMapList.stream().filter(car -> ObjectUtils.isNotEmpty(car.get("teamId"))).forEach(car -> {
FireBrigadeResourceDto fireCarDto = (FireBrigadeResourceDto) Bean.mapToBean(car, FireBrigadeResourceDto.class);
// TODO 后期根据车物联状态来返回,现在为"在位=执勤","其他=出动"
......@@ -133,6 +135,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
fireCarDtoList.add(fireCarDto);
});
}
}
// 2.查询消防队伍列表
List<FireTeam> fullTimeFireBrigadeList = fireTeamService.list(new QueryWrapper<FireTeam>().eq("type_code",
......@@ -140,6 +143,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if (!CollectionUtils.isEmpty(fullTimeFireBrigadeList)) {
Map<String, List<FireBrigadeResourceDto>> resultMap =
fireCarDtoList.stream().collect(Collectors.groupingBy(FireBrigadeResourceDto::getTeamId));
if (!ValidationUtil.isEmpty(fullTimeFireBrigadeList)) {
fullTimeFireBrigadeList.forEach(brigade -> {
if (!CollectionUtils.isEmpty(resultMap.get(brigade.getSequenceNbr().toString()))) {
FireBrigadeResourceDto fireCarResourceDto = new FireBrigadeResourceDto();
......@@ -157,6 +161,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}
});
}
}
// 3.消防队伍-监控大队
List<FireBrigadeResourceDto> monitorFireBrigadeList = fireTeamService.listMonitorFireBrigade();
......
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