Commit ba76251f authored by maoying's avatar maoying

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

parents 608886ee 70ed9d94
...@@ -125,15 +125,18 @@ public class MetaHandler implements MetaObjectHandler { ...@@ -125,15 +125,18 @@ public class MetaHandler implements MetaObjectHandler {
*/ */
@Override @Override
public void updateFill(MetaObject metaObject) { public void updateFill(MetaObject metaObject) {
String userId = RequestContext.getExeUserId(); Class clazz = metaObject.getOriginalObject().getClass();
ReginParams reginParams = FillCommonUserField annotation = (FillCommonUserField) clazz.getAnnotation(FillCommonUserField.class);
JSONObject.parseObject(null != redisUtils.get(RedisKey.buildReginKey(userId, getToken())) ? if (annotation == null || annotation.isAutoFill()) {
redisUtils.get(RedisKey.buildReginKey(userId, getToken())).toString() : null, ReginParams.class); String userId = RequestContext.getExeUserId();
if (ObjectUtils.isEmpty(reginParams)) { ReginParams reginParams =
return; JSONObject.parseObject(null != redisUtils.get(RedisKey.buildReginKey(userId, getToken())) ?
redisUtils.get(RedisKey.buildReginKey(userId, getToken())).toString() : null, ReginParams.class);
if (ObjectUtils.isEmpty(reginParams)) {
return;
}
AgencyUserModel agencyUserModel = reginParams.getUserModel();
recInfoUpdate(metaObject, agencyUserModel);
} }
AgencyUserModel agencyUserModel = reginParams.getUserModel();
recInfoUpdate(metaObject, agencyUserModel);
} }
} }
\ No newline at end of file
...@@ -195,10 +195,9 @@ public interface EquipFeignClient { ...@@ -195,10 +195,9 @@ public interface EquipFeignClient {
@RequestMapping(value = "/monitorView/video/page", method = RequestMethod.GET) @RequestMapping(value = "/monitorView/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList( ResponseModel<Page<Map<String, Object>>> queryVideoPage(
@RequestParam(value = "viewId") Long viewId, @RequestParam(value = "nodeId") Long nodeId,
@RequestParam(value = "videoName" ,required =false) String videoName, @RequestParam(value = "nodeType" ,required =false) String nodeType,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size @RequestParam(value = "size") int size
); );
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</select> </select>
<select id='getEquipmentForSpecifyDate' resultType='map'> <select id='getEquipmentForSpecifyDate' resultType='map'>
select * from (
SELECT SELECT
MAX( MAX(
CASE CASE
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
where cd.group_code =#{groupCode} and cds.instance_id is not null and where cd.group_code =#{groupCode} and cds.instance_id is not null and
cd.is_delete=0 cd.is_delete=0
group by cd.instance_id group by cd.instance_id
) result group by ${groupByName}
</select> </select>
<select id='getInstanceIdForSpecifyDateAndEquipment' <select id='getInstanceIdForSpecifyDateAndEquipment'
......
...@@ -409,7 +409,7 @@ FROM ...@@ -409,7 +409,7 @@ FROM
FROM FROM
cb_org_usr cb_org_usr
WHERE WHERE
biz_org_name = #{departmentName} biz_org_name = #{departmentName} and is_delete = 0
) )
AND cou.biz_org_type = 'PERSON' AND cou.biz_org_type = 'PERSON'
......
...@@ -137,8 +137,8 @@ ...@@ -137,8 +137,8 @@
<if test="map.bizOrgCode != null and map.bizOrgCode != '-1'"> <if test="map.bizOrgCode != null and map.bizOrgCode != '-1'">
AND u.biz_org_code like concat(#{map.bizOrgCode}, '%') AND u.biz_org_code like concat(#{map.bizOrgCode}, '%')
</if> </if>
<if test="map.amosOrgId != null and map.amosOrgId != '-1'"> <if test="map.amosOrgCode != null and map.amosOrgCode != '-1'">
AND u.amos_org_id like concat(#{map.amosOrgId}, '%') AND u.amos_org_code like concat('%',#{map.amosOrgCode}, '%')
</if> </if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
......
...@@ -17,5 +17,5 @@ import java.util.List; ...@@ -17,5 +17,5 @@ import java.util.List;
*/ */
public interface ControllerMapper extends BaseMapper<Controller> { public interface ControllerMapper extends BaseMapper<Controller> {
public List<ControllerDto> getCurrentStationController(@Param("sequenceNbr") Long sequenceNbr); List<ControllerDto> getCurrentStationController(@Param("sequenceNbr") Long sequenceNbr);
} }
...@@ -351,13 +351,13 @@ public class CommandController extends BaseController { ...@@ -351,13 +351,13 @@ public class CommandController extends BaseController {
@ApiOperation(value = "分页查询视图下的视频列表") @ApiOperation(value = "分页查询视图下的视频列表")
@RequestMapping(value = "monitorView/video/page", method = RequestMethod.GET) @RequestMapping(value = "monitorView/video/page", method = RequestMethod.GET)
public ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList( public ResponseModel<Page<Map<String, Object>>> queryUncheckedVideoList(
@RequestParam(value = "viewId") Long viewId, @RequestParam(value = "nodeId") Long nodeId,
@RequestParam(value = "videoName" ,required =false) String videoName, @RequestParam(value = "nodeType" ,required =false) String nodeType,
@RequestParam(value = "videoCode" ,required =false) String videoCode,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) throws Exception @RequestParam(value = "size") int size
) throws Exception
{ {
ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.queryUncheckedVideoList(viewId,videoName, videoCode,current,size); ResponseModel<Page<Map<String, Object>>> data = equipFeignClient.queryVideoPage(nodeId,nodeType,current,size);
Page<Map<String, Object>> pag = data != null ? data.getResult() : null; Page<Map<String, Object>> pag = data != null ? data.getResult() : null;
List<Map<String, Object>> records = pag != null ? pag.getRecords() : null; List<Map<String, Object>> records = pag != null ? pag.getRecords() : null;
if (records != null && records.size() > 0) { if (records != null && records.size() > 0) {
......
...@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -50,6 +50,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
...@@ -350,18 +351,6 @@ public class OrgUsrController extends BaseController { ...@@ -350,18 +351,6 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.selectCompanyUsers(orgUnitId)); return ResponseHelper.buildResponse(iOrgUsrService.selectCompanyUsers(orgUnitId));
} }
/**
* 根据名称模糊匹配
*
* @param name
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getList", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据名称模糊匹配", notes = "根据名称模糊匹配")
public ResponseModel<List<ESOrgUsrDto>> selectById(HttpServletRequest request, String name) throws Exception {
return ResponseHelper.buildResponse(eSOrgUsrService.queryByKeys(name));
}
/** /**
* 根据名称模糊匹配 * 根据名称模糊匹配
...@@ -372,7 +361,7 @@ public class OrgUsrController extends BaseController { ...@@ -372,7 +361,7 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getdataList/unit", method = RequestMethod.GET) @RequestMapping(value = "/getdataList/unit", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据名称模糊匹配单位", notes = "根据名称模糊匹配单位") @ApiOperation(httpMethod = "GET", value = "根据名称模糊匹配单位", notes = "根据名称模糊匹配单位")
public ResponseModel<List<ESOrgUsrDto>> selectByIddata(HttpServletRequest request, String name) throws Exception { public ResponseModel<Set<ESOrgUsrDto>> selectByIddata(HttpServletRequest request, String name) throws Exception {
return ResponseHelper.buildResponse(eSOrgUsrService.queryByKeys(name)); return ResponseHelper.buildResponse(eSOrgUsrService.queryByKeys(name));
} }
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.LinkedHashSet;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Set;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
...@@ -125,7 +127,7 @@ public class ESOrgUsrService { ...@@ -125,7 +127,7 @@ public class ESOrgUsrService {
* *
*/ */
@SuppressWarnings({ "rawtypes" }) @SuppressWarnings({ "rawtypes" })
public List<ESOrgUsrDto> queryByKeys(String name) public Set<ESOrgUsrDto> queryByKeys(String name)
{ {
//创建builder //创建builder
FuzzyQueryBuilder queryBuilder =null; FuzzyQueryBuilder queryBuilder =null;
...@@ -135,7 +137,7 @@ public class ESOrgUsrService { ...@@ -135,7 +137,7 @@ public class ESOrgUsrService {
queryBuilder =QueryBuilders.fuzzyQuery("bizOrgName", name); queryBuilder =QueryBuilders.fuzzyQuery("bizOrgName", name);
} }
Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder); Iterable<ESOrgUsrDto> search = esOrgUsrDtoRepository.search(queryBuilder);
List<ESOrgUsrDto> list = new LinkedList<>(); Set<ESOrgUsrDto> list = new LinkedHashSet<>();
search.forEach(esOrgUsrDto->{ search.forEach(esOrgUsrDto->{
list.add(esOrgUsrDto); list.add(esOrgUsrDto);
}); });
......
...@@ -404,7 +404,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -404,7 +404,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
} }
/* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */ /* BUG2680 查询部门人员错误 传递参数类型不正确 修改为string 2021-09-14 陈召 开始 */
if (req.containsKey("amosOrgId") && !ObjectUtils.isEmpty(req.get("amosOrgId"))) { if (req.containsKey("amosOrgId") && !ObjectUtils.isEmpty(req.get("amosOrgId"))) {
map.put("amosOrgId", req.get("amosOrgId")); map.put("amosOrgCode", req.get("amosOrgId"));//当时给前端给的key名字错了,以为是传Id过来,现在传名字,那就将错就错吧
} }
req.remove("bizOrgName"); req.remove("bizOrgName");
......
...@@ -3,19 +3,14 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -3,19 +3,14 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Controller; import com.yeejoin.amos.boot.module.jcs.api.entity.Controller;
import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerLog;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerGroupEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerGroupEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerEquipServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerLogServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -41,7 +36,7 @@ public class ControllerController extends BaseController { ...@@ -41,7 +36,7 @@ public class ControllerController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "更新联动控制器状态", notes = "更新联动控制器状态") @ApiOperation(httpMethod = "POST", value = "更新联动控制器状态", notes = "更新联动控制器状态")
@PostMapping(value = "/updateControllerState") @PostMapping(value = "/updateControllerState")
public ResponseModel<Object> updateControllerState(@RequestBody Controller[] controllers) { public ResponseModel<Object> updateControllerState(@RequestBody ControllerDto[] controllers) {
return ResponseHelper.buildResponse(controllerServiceImpl.changeControllerState(controllers)); return ResponseHelper.buildResponse(controllerServiceImpl.changeControllerState(controllers));
} }
...@@ -66,6 +61,7 @@ public class ControllerController extends BaseController { ...@@ -66,6 +61,7 @@ public class ControllerController extends BaseController {
BeanUtils.copyProperties(controller, controllerDto); BeanUtils.copyProperties(controller, controllerDto);
controllerDto.setTypeEnum(anEnum); controllerDto.setTypeEnum(anEnum);
controllerDto.setTypeDescription(anEnum.getName()); controllerDto.setTypeDescription(anEnum.getName());
controllerDto.setState("0");
controllerDtos.add(controllerDto); controllerDtos.add(controllerDto);
} }
}); });
......
package com.yeejoin.amos.boot.module.jcs.biz.controller; package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip; import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerEquipServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.ControllerEquipServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
......
...@@ -98,19 +98,19 @@ public class VoiceRecordFileController extends BaseController { ...@@ -98,19 +98,19 @@ public class VoiceRecordFileController extends BaseController {
page.setSize(pageSize); page.setSize(pageSize);
String sortParam = ""; String sortParam = "";
String sortRule = ""; String sortRule = "";
// if(sort!=null) { // 排序失效 if(sort!=null) { // 排序失效
// String[] date= sort.split(","); String[] date= sort.split(",");
// if(date[1].equals("ascend")) { if(date[1].equals("ascend")) {
// sortParam = RedisKey.humpToLine(date[0]); sortParam = RedisKey.humpToLine(date[0]);
// sortRule = "asc"; sortRule = "asc";
// }else { }else {
// sortParam =RedisKey.humpToLine(date[0]); sortParam =RedisKey.humpToLine(date[0]);
// sortRule = "desc"; sortRule = "desc";
// } }
// }else { }else {
// sortParam = "tel_start_time"; sortParam = "tel_start_time";
// sortRule = "desc"; sortRule = "desc";
// } }
Page<VoiceRecordFileDto> pageBean = voiceRecordFileService.queryRecordListByQueryDto(page, Page<VoiceRecordFileDto> pageBean = voiceRecordFileService.queryRecordListByQueryDto(page,
model.getTelStartTimeStr(),model.getTelEndTimeStr(),model.getFileType(),model.getCaller(), model.getTelStartTimeStr(),model.getTelEndTimeStr(),model.getFileType(),model.getCaller(),
model.getCalled(),sortParam,sortRule); model.getCalled(),sortParam,sortRule);
......
...@@ -10,6 +10,9 @@ import java.util.function.Function; ...@@ -10,6 +10,9 @@ import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yeejoin.amos.boot.module.common.api.dto.ESOrgUsrDto;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.biz.service.impl.ESOrgUsrService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -121,6 +124,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -121,6 +124,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Autowired @Autowired
private EmqKeeper emqKeeper; private EmqKeeper emqKeeper;
@Autowired
ESOrgUsrService eSOrgUsrService;
@Value("${mqtt.topic.command.alert.notice}") @Value("${mqtt.topic.command.alert.notice}")
private String topic; private String topic;
...@@ -424,6 +430,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -424,6 +430,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 同步保存ES * 同步保存ES
*/ */
eSAlertCalledService.saveAlertCalledToES(alertCalled); eSAlertCalledService.saveAlertCalledToES(alertCalled);
// 事发单位保存进ES
if(!ValidationUtil.isEmpty(alertCalled.getUnitInvolved())) {
OrgUsr orgUsr = new OrgUsr();
orgUsr.setSequenceNbr(-1L);
orgUsr.setBizOrgName(alertCalled.getUnitInvolved());
eSOrgUsrService.saveAlertCalledToES(orgUsr);
}
} }
// toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr()); // toSendCompletePoliceSituationMatch(alertCalled.getSequenceNbr());
return alertCalledObjsDto; return alertCalledObjsDto;
...@@ -599,7 +616,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -599,7 +616,11 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/* /*
* if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); } * if(null == valueCode) { valueCode = alertFormValue.getFieldValue(); }
*/ */
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode)); if("flightNumber".equals(alertFormValue.getFieldCode()) || "aircraftModel".equals(alertFormValue.getFieldCode())) {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), alertFormValue.getFieldValueCode()));
} else {
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}
}); });
map.put("data", listdate); map.put("data", listdate);
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient; import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Controller; import com.yeejoin.amos.boot.module.jcs.api.entity.Controller;
import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip;
import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerLog;
import com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IControllerEquipService; import com.yeejoin.amos.boot.module.jcs.api.service.IControllerEquipService;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto; import java.util.Date;
import com.yeejoin.amos.boot.module.jcs.api.entity.ControllerEquip; import java.util.List;
import com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper;
/** /**
* <pre> * <pre>
...@@ -26,10 +32,17 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper; ...@@ -26,10 +32,17 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.ControllerEquipMapper;
*/ */
@Service @Service
public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto, ControllerEquip, ControllerEquipMapper> implements IControllerEquipService { public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto, ControllerEquip, ControllerEquipMapper> implements IControllerEquipService {
public static final String CONTROLLER_STATE_CHANGED_TOPIC = "controllerStateChanged";
@Autowired @Autowired
JcsControlServerClient jcsControlServerClient; JcsControlServerClient jcsControlServerClient;
@Autowired
ControllerLogServiceImpl controllerLogServiceImpl;
@Autowired
private EmqKeeper emqKeeper;
public List<ControllerEquipDto> queryAllForList() { public List<ControllerEquipDto> queryAllForList() {
return this.queryForList("", false); return this.queryForList("", false);
} }
...@@ -38,8 +51,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto, ...@@ -38,8 +51,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变警铃状态 0关闭,1开启 * 改变警铃状态 0关闭,1开启
*/ */
@Async @Async
public void changeBell(Controller controller, String type) { public void changeBell(ControllerDto controller, String type) {
if (controller == null) return; if (controller == null) return;
controller.setState(type);
saveLog(controller);
List<ControllerEquip> list = getControllerEquips(controller); List<ControllerEquip> list = getControllerEquips(controller);
list.forEach(controllerEquip -> jcsControlServerClient.sendBellAction(controllerEquip.getNum(), type)); list.forEach(controllerEquip -> jcsControlServerClient.sendBellAction(controllerEquip.getNum(), type));
} }
...@@ -48,8 +63,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto, ...@@ -48,8 +63,10 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变广播状态 0关闭,1开启 * 改变广播状态 0关闭,1开启
*/ */
@Async @Async
public void changeBroadcast(Controller controller, String type) { public void changeBroadcast(ControllerDto controller, String type) {
if (controller == null) return; if (controller == null) return;
controller.setState(type);
saveLog(controller);
List<ControllerEquip> list = getControllerEquips(controller); List<ControllerEquip> list = getControllerEquips(controller);
list.forEach(controllerEquip -> jcsControlServerClient.sendFileAction(controllerEquip.getNum(), "")); list.forEach(controllerEquip -> jcsControlServerClient.sendFileAction(controllerEquip.getNum(), ""));
} }
...@@ -58,14 +75,35 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto, ...@@ -58,14 +75,35 @@ public class ControllerEquipServiceImpl extends BaseService<ControllerEquipDto,
* 改变车库门状态 0关闭,1开启 * 改变车库门状态 0关闭,1开启
*/ */
@Async @Async
public void changeDoor(Controller controller, String type) { public void changeDoor(ControllerDto controller, String type) {
if (controller == null) return; if (controller == null) return;
controller.setState(type);
saveLog(controller);
List<ControllerEquip> list = getControllerEquips(controller); List<ControllerEquip> list = getControllerEquips(controller);
list.forEach(controllerEquip -> jcsControlServerClient.writeStateAction(controller.getIp(), controller.getPort(), Integer.parseInt(controllerEquip.getNum()), type)); list.forEach(controllerEquip -> jcsControlServerClient.writeStateAction(controller.getIp(), controller.getPort(), Integer.parseInt(controllerEquip.getNum()), type));
} }
private List<ControllerEquip> getControllerEquips(Controller controller) { private List<ControllerEquip> getControllerEquips(ControllerDto controller) {
LambdaQueryWrapper<ControllerEquip> wrapper = new LambdaQueryWrapper<ControllerEquip>().eq(ControllerEquip::getControllerSeq, controller.getSequenceNbr()); LambdaQueryWrapper<ControllerEquip> wrapper = new LambdaQueryWrapper<ControllerEquip>().eq(ControllerEquip::getControllerSeq, controller.getSequenceNbr());
return list(wrapper); return list(wrapper);
} }
/**
* 保存操作日志
*/
private void saveLog(ControllerDto controller) {
if (controller == null) return;
ControllerLog controllerLog = new ControllerLog();
controllerLog.setControllerSeq(controller.getSequenceNbr());
controllerLog.setState(controller.getState());
controllerLog.setExecuteDate(new Date());
controllerLogServiceImpl.save(controllerLog);
// 分发状态变更通知
try {
String value = new ObjectMapper().writeValueAsString(controller);
emqKeeper.getMqttClient().publish(CONTROLLER_STATE_CHANGED_TOPIC, value.getBytes(), 2, true);
} catch (MqttException | JsonProcessingException e) {
e.printStackTrace();
}
}
} }
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.function.IntFunction;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCarService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.*;
import com.yeejoin.amos.boot.module.jcs.api.entity.*; import com.yeejoin.amos.boot.module.jcs.api.entity.*;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -35,17 +38,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; ...@@ -35,17 +38,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper; import com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.DutyCarServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.CarStatusInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCarCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto;
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;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertFeedbackStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertFeedbackStatusEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.DutyInfoEnum;
import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
...@@ -424,8 +416,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -424,8 +416,9 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue(); List<AlertFormValue> alertFormValue = alertCalledObjsDto.getAlertFormValue();
String responseLevel = ""; String responseLevel = "";
List<AlertFormValue> list1 = alertFormValue.stream().filter(formValue -> formValue.getFieldCode().equals("responseLevel") ).collect(Collectors.toList());; List<AlertFormValue> list1 = alertFormValue.stream().filter(formValue -> formValue.getFieldCode().equals("responseLevel")).collect(Collectors.toList());
if(list1.size() > 0) { ;
if (list1.size() > 0) {
responseLevel = list1.get(0).getFieldValue(); responseLevel = list1.get(0).getFieldValue();
} }
...@@ -483,12 +476,17 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -483,12 +476,17 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
powerTransferCompanyDto.setPowerTransferCompanyResourcesDtoList(resourcesDtoList); powerTransferCompanyDto.setPowerTransferCompanyResourcesDtoList(resourcesDtoList);
// 更新车辆状态 // 更新车辆状态
equipFeignService.updateCarStatus(carStatusInfoDtoList); equipFeignService.updateCarStatus(carStatusInfoDtoList);
// 警情力量调派时,点击【任务派发】后,如果被调派的 力量包含消防车,那么该消防车所在的 大队的警铃、广播自动 启动,消防车所在的车库门自动开启 // 警情力量调派时,点击【任务派发】后,如果被调派的 力量包含消防车,那么该消防车所在的 大队的警铃、广播自动 启动,消防车所在的车库门自动开启
try { try {
List<Controller> controllers = controllerServiceImpl.list(new LambdaQueryWrapper<Controller>().eq(Controller::getFireTeamSeq, powerTransferCompanyDto.getCompanyId())); List<Controller> controllers = controllerServiceImpl.list(new LambdaQueryWrapper<Controller>().eq(Controller::getFireTeamSeq, powerTransferCompanyDto.getCompanyId()));
if (controllers.size() > 0) { if (controllers.size() > 0) {
controllerServiceImpl.changeControllerState(controllers.toArray(new Controller[0])); ControllerDto[] controllerDtos = new ControllerDto[controllers.size()];
for (int i = 0; i < controllers.size(); i++) {
ControllerDto controllerDto = new ControllerDto();
BeanUtils.copyProperties(controllers.get(i), controllerDto);
controllerDtos[i] = controllerDto;
}
controllerServiceImpl.changeControllerState(controllerDtos);
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
......
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