Commit d1a464ab authored by chenhao's avatar chenhao

Merge branch 'chenhao' into developer

parents 539887b0 6afdeaa8
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
<if test="alertSourceCode!= null "> <if test="alertSourceCode!= null ">
and alert_source_code = #{alertSourceCode} and alert_source_code = #{alertSourceCode}
</if> </if>
</where>
<if test="data != null and lift == 'ascend'"> <if test="data != null and lift == 'ascend'">
order by #{data} ASC limit #{current},#{size} order by #{data} ASC limit #{current},#{size}
</if> </if>
...@@ -135,7 +136,6 @@ ...@@ -135,7 +136,6 @@
<if test="data == null "> <if test="data == null ">
order by call_time DESC limit #{current},#{size} order by call_time DESC limit #{current},#{size}
</if> </if>
</where>
</select> </select>
......
...@@ -635,6 +635,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -635,6 +635,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr oriOrgUsr = getById(id); OrgUsr oriOrgUsr = getById(id);
BeanUtils.copyProperties(OrgPersonVo, orgUsr); BeanUtils.copyProperties(OrgPersonVo, orgUsr);
orgUsr.setSequenceNbr(id); orgUsr.setSequenceNbr(id);
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr parent = getById(OrgPersonVo.getParentId());
orgUsr.setBizOrgCode(parent.getBizOrgCode() + getOrgCodeStr());
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) { if (!ObjectUtils.isEmpty(OrgPersonVo.getAmosOrgId())) {
AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult(); AgencyUserModel user = Privilege.agencyUserClient.queryByUserId(OrgPersonVo.getAmosOrgId()).getResult();
oriOrgUsr.setAmosOrgCode(user.getRealName()); oriOrgUsr.setAmosOrgCode(user.getRealName());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper;
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 com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -20,7 +38,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData; ...@@ -20,7 +38,6 @@ import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
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.common.biz.service.impl.OrgUsrServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto; 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.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
...@@ -44,24 +61,6 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferMapper; ...@@ -44,24 +61,6 @@ 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.mapper.TemplateMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService; import com.yeejoin.amos.boot.module.jcs.api.service.IAlertCalledService;
import com.yeejoin.amos.component.rule.config.RuleConfig; import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
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 java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* 警情接警记录 服务实现类 * 警情接警记录 服务实现类
...@@ -144,16 +143,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -144,16 +143,21 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/** /**
* 接警记录 列表分页查询 * 接警记录 列表分页查询
**/ /* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/ **/ /* bug2407 筛选参数解析异常 修改筛选条件方法 XML中添加了selectAllPage 方法 data代表排序条件 lift 升降序 陈召 2021-09-03 开始*/
public IPage<AlertCalled> queryForCalledList(Page pageBean,Integer alertStatus, public IPage<AlertCalled> queryForCalledList(Page pageBean, Integer alertStatus,
String alertTypeCode , String alertTypeCode,
String alertSourceCode, String alertSourceCode,
String startTime, String startTime,
String endTime, String endTime,
String sort) { String sort) {
String data = null;
String lift = null;
if (StringUtils.isNotEmpty(sort)) {
String[] split = sort.split(","); String[] split = sort.split(",");
String data = RedisKey.humpToLine(split[0]); data = RedisKey.humpToLine(split[0]);
String lift =split[1]; lift = split[1];
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime,data,lift); }
List<AlertCalled> list = alertCalledMapper.selectAllPage(pageBean.getCurrent(), pageBean.getSize(), alertStatus, alertTypeCode, alertSourceCode, startTime, endTime, data, lift);
IPage<AlertCalled> iPage = new Page<>(); IPage<AlertCalled> iPage = new Page<>();
iPage.setRecords(list); iPage.setRecords(list);
iPage.setTotal(list.size()); iPage.setTotal(list.size());
...@@ -162,8 +166,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -162,8 +166,6 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
/** /**
* 根据灾情id 查询灾情详情 * 根据灾情id 查询灾情详情
**/ **/
...@@ -489,18 +491,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -489,18 +491,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
} }
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
public Boolean controlEquip() throws Exception public Boolean controlEquip() throws Exception {
{
/** /**
* 获取控制器设备 * 获取控制器设备
*/ */
List<ControllerEquipDto> controllerEquipDtoList = controllerEquipService.queryAllForList(); List<ControllerEquipDto> controllerEquipDtoList = controllerEquipService.queryAllForList();
Map<Long, List<String>> controllerEquipMap = new HashMap<>(); Map<Long, List<String>> controllerEquipMap = new HashMap<>();
for (ControllerEquipDto controllerEquipDto : controllerEquipDtoList) for (ControllerEquipDto controllerEquipDto : controllerEquipDtoList) {
{
List<String> numList = controllerEquipMap.get(controllerEquipDto.getControllerSeq()); List<String> numList = controllerEquipMap.get(controllerEquipDto.getControllerSeq());
if (ValidationUtil.isEmpty(numList)) if (ValidationUtil.isEmpty(numList)) {
{
numList = new ArrayList<>(); numList = new ArrayList<>();
} }
numList.add(controllerEquipDto.getNum()); numList.add(controllerEquipDto.getNum());
...@@ -510,30 +509,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -510,30 +509,23 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 获取联动控制器 * 获取联动控制器
*/ */
List<ControllerDto> controllerDtoList = controllerService.queryAllForList(); List<ControllerDto> controllerDtoList = controllerService.queryAllForList();
StringBuilder bellNumSb =new StringBuilder(); StringBuilder bellNumSb = new StringBuilder();
StringBuilder broadcastNumSb =new StringBuilder(); StringBuilder broadcastNumSb = new StringBuilder();
for (ControllerDto controllerDto : controllerDtoList) for (ControllerDto controllerDto : controllerDtoList) {
{
//消防警铃 //消防警铃
if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) if (controllerDto.getType().equals(ControllerTypeEnum.BELL.getCode())) {
{
List<String> bellNumList = controllerEquipMap.get(controllerDto.getSequenceNbr()); List<String> bellNumList = controllerEquipMap.get(controllerDto.getSequenceNbr());
if (!ValidationUtil.isEmpty(bellNumList)) if (!ValidationUtil.isEmpty(bellNumList)) {
{ for (String num : bellNumList) {
for (String num : bellNumList)
{
bellNumSb.append(num).append(","); bellNumSb.append(num).append(",");
} }
} }
} }
//广播 //广播
if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) if (controllerDto.getType().equals(ControllerTypeEnum.BROADCAST.getCode())) {
{
List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr()); List<String> broadcastList = controllerEquipMap.get(controllerDto.getSequenceNbr());
if (!ValidationUtil.isEmpty(broadcastList)) if (!ValidationUtil.isEmpty(broadcastList)) {
{ for (String num : broadcastList) {
for (String num : broadcastList)
{
broadcastNumSb.append(num).append(","); broadcastNumSb.append(num).append(",");
} }
} }
...@@ -542,27 +534,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -542,27 +534,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
/** /**
* 打开消防警铃 * 打开消防警铃
*/ */
if (!ValidationUtil.isEmpty(bellNumSb.toString())) if (!ValidationUtil.isEmpty(bellNumSb.toString())) {
{
String bellNum = bellNumSb.toString(); String bellNum = bellNumSb.toString();
bellNum = bellNum.substring(0, bellNum.length() -1); bellNum = bellNum.substring(0, bellNum.length() - 1);
jcsControlServerClient.sendBellAction(bellNum, "1"); jcsControlServerClient.sendBellAction(bellNum, "1");
} }
/** /**
* 播放广播 * 播放广播
*/ */
if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) if (!ValidationUtil.isEmpty(broadcastNumSb.toString())) {
{
String broadcastNum = broadcastNumSb.toString(); String broadcastNum = broadcastNumSb.toString();
broadcastNum = broadcastNum.substring(0, broadcastNum.length() -1); broadcastNum = broadcastNum.substring(0, broadcastNum.length() - 1);
jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3"); jcsControlServerClient.sendFileAction(broadcastNum, "1490075199246.mp3");
} }
/** /**
* 打开北站车库门 * 打开北站车库门
*/ */
List<ControllerDto> northDoor = controllerService.queryForList("3", ControllerTypeEnum.DOOR.getCode()); List<ControllerDto> northDoor = controllerService.queryForList("3", ControllerTypeEnum.DOOR.getCode());
if (!ValidationUtil.isEmpty(northDoor)) if (!ValidationUtil.isEmpty(northDoor)) {
{
ControllerDto controllerDto = northDoor.get(0); ControllerDto controllerDto = northDoor.get(0);
//打开北站车库门 //打开北站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1"); jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1,1,1,1");
...@@ -573,8 +562,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -573,8 +562,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
* 打开南站车库门 * 打开南站车库门
*/ */
List<ControllerDto> southDoor = controllerService.queryForList("2", ControllerTypeEnum.DOOR.getCode()); List<ControllerDto> southDoor = controllerService.queryForList("2", ControllerTypeEnum.DOOR.getCode());
if (!ValidationUtil.isEmpty(southDoor)) if (!ValidationUtil.isEmpty(southDoor)) {
{
ControllerDto controllerDto = southDoor.get(0); ControllerDto controllerDto = southDoor.get(0);
//打开南站车库门 //打开南站车库门
jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1"); jcsControlServerClient.writeStateAction(controllerDto.getIp(), controllerDto.getPort(), 100, "1");
......
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