parent
528f9945cb
commit
4169bd103c
|
@ -1,6 +1,8 @@
|
||||||
package com.zjyr.beidouservice.controller;
|
package com.zjyr.beidouservice.controller;
|
||||||
|
|
||||||
import com.zjyr.beidouservice.pojo.MyResp;
|
import com.zjyr.beidouservice.pojo.MyResp;
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DevTaskExecRespDTO;
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskExecReqDTO;
|
||||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||||
import com.zjyr.beidouservice.service.DeviceTaskService;
|
import com.zjyr.beidouservice.service.DeviceTaskService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
@ -33,4 +35,15 @@ public class DeviceTaskController {
|
||||||
return MyResp.success(deviceTaskRespDTOS);
|
return MyResp.success(deviceTaskRespDTOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行任务
|
||||||
|
*
|
||||||
|
* @return MyResp
|
||||||
|
*/
|
||||||
|
@PostMapping("task/exec")
|
||||||
|
public MyResp<DevTaskExecRespDTO> deviceTaskExec(DeviceTaskExecReqDTO deviceTaskExecReqDTO) {
|
||||||
|
DevTaskExecRespDTO deviceTaskExecResp = deviceTaskService.deviceTaskExec(deviceTaskExecReqDTO);
|
||||||
|
return MyResp.success(deviceTaskExecResp);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,6 @@ public class DevBasicInfoDO implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String countyCode;
|
private String countyCode;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属单位
|
* 所属单位
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.zjyr.beidouservice.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DevTaskExecRespDTO {
|
||||||
|
/**
|
||||||
|
* 任务执行情况
|
||||||
|
*/
|
||||||
|
List<TaskExecRespContentDTO> data;
|
||||||
|
}
|
|
@ -25,4 +25,9 @@ public class DeviceInfoByLocDTO {
|
||||||
* 区编码
|
* 区编码
|
||||||
*/
|
*/
|
||||||
private String countyCode;
|
private String countyCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,4 +30,11 @@ public class DeviceReqDTO {
|
||||||
* 厂家
|
* 厂家
|
||||||
*/
|
*/
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备名称
|
||||||
|
*/
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,16 @@ public class DeviceRespDTO {
|
||||||
*/
|
*/
|
||||||
private String installAddr;
|
private String installAddr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 警报器厂家
|
* 警报器厂家
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zjyr.beidouservice.pojo.dto;
|
package com.zjyr.beidouservice.pojo.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -26,12 +27,14 @@ public class DeviceTaskContentDTO {
|
||||||
/**
|
/**
|
||||||
* 回示时间
|
* 回示时间
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date respTime;
|
private Date respTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行状态
|
* 执行状态
|
||||||
*/
|
*/
|
||||||
private String execStateMsg;
|
private Integer execState;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.zjyr.beidouservice.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DeviceTaskExecReqDTO {
|
||||||
|
/**
|
||||||
|
* 控制通道。2:无线 3:北斗 4:电话 5:all-前端处罚位置在哪?
|
||||||
|
*/
|
||||||
|
private Integer controlChannel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省份编码
|
||||||
|
*/
|
||||||
|
private String provinceCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地市编码
|
||||||
|
*/
|
||||||
|
private String cityCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区编码
|
||||||
|
*/
|
||||||
|
private String countyCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id,多个设备,相隔
|
||||||
|
*/
|
||||||
|
private String deviceIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制模式 0:无声演练模式 1:大声警报模式-前端处罚位置在哪?
|
||||||
|
*/
|
||||||
|
private Integer controlMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行命令
|
||||||
|
*/
|
||||||
|
private String execCmd;
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.zjyr.beidouservice.pojo.dto;
|
package com.zjyr.beidouservice.pojo.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -26,6 +27,7 @@ public class DeviceTaskRespDTO {
|
||||||
/**
|
/**
|
||||||
* 记录时间
|
* 记录时间
|
||||||
*/
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private Date recodeTime;
|
private Date recodeTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.zjyr.beidouservice.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TaskExecRespContentDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id,多个设备,相隔
|
||||||
|
*/
|
||||||
|
private String deviceIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否支持任务执行 1:任务可执行 0:任务已执行中,不支持下发
|
||||||
|
*/
|
||||||
|
private Integer supportExecState;
|
||||||
|
}
|
|
@ -1,7 +1,10 @@
|
||||||
package com.zjyr.beidouservice.service;
|
package com.zjyr.beidouservice.service;
|
||||||
|
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DevTaskExecRespDTO;
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskExecReqDTO;
|
||||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface DeviceTaskService {
|
public interface DeviceTaskService {
|
||||||
|
@ -11,4 +14,13 @@ public interface DeviceTaskService {
|
||||||
* @return DeviceTaskRespDTO
|
* @return DeviceTaskRespDTO
|
||||||
*/
|
*/
|
||||||
List<DeviceTaskRespDTO> getDeviceTaskInfo();
|
List<DeviceTaskRespDTO> getDeviceTaskInfo();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行任务
|
||||||
|
*
|
||||||
|
* @return MyResp
|
||||||
|
*/
|
||||||
|
DevTaskExecRespDTO deviceTaskExec(DeviceTaskExecReqDTO deviceTaskExecReqDTO);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class DeviceServiceImpl implements DeviceService {
|
||||||
searchDTO.setProvinceCode(deviceReqDTO.getProvinceCode());
|
searchDTO.setProvinceCode(deviceReqDTO.getProvinceCode());
|
||||||
searchDTO.setCityCode(deviceReqDTO.getCityCode());
|
searchDTO.setCityCode(deviceReqDTO.getCityCode());
|
||||||
searchDTO.setCountyCode(deviceReqDTO.getCountyCode());
|
searchDTO.setCountyCode(deviceReqDTO.getCountyCode());
|
||||||
|
searchDTO.setDeviceName(deviceReqDTO.getDeviceName());
|
||||||
log.info("device search info : [{}]", searchDTO);
|
log.info("device search info : [{}]", searchDTO);
|
||||||
|
|
||||||
List<DevBasicInfoDO> devBasicInfoList = devBasicInfoMapper.selectDeviceByLoc(searchDTO);
|
List<DevBasicInfoDO> devBasicInfoList = devBasicInfoMapper.selectDeviceByLoc(searchDTO);
|
||||||
|
@ -69,6 +70,11 @@ public class DeviceServiceImpl implements DeviceService {
|
||||||
deviceResp.setCityCode(devBasicInfo.getCityCode());
|
deviceResp.setCityCode(devBasicInfo.getCityCode());
|
||||||
deviceResp.setCountyCode(devBasicInfo.getCountyCode());
|
deviceResp.setCountyCode(devBasicInfo.getCountyCode());
|
||||||
|
|
||||||
|
//获取设备安装地址、经纬度
|
||||||
|
deviceResp.setInstallAddr(devBasicInfo.getInstallAddr());
|
||||||
|
deviceResp.setLatitude(devBasicInfo.getLatitude());
|
||||||
|
deviceResp.setLatitude(devBasicInfo.getLatitude());
|
||||||
|
|
||||||
deviceRespList.add(deviceResp);
|
deviceRespList.add(deviceResp);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package com.zjyr.beidouservice.service.impl;
|
package com.zjyr.beidouservice.service.impl;
|
||||||
|
|
||||||
import com.zjyr.beidouservice.constenum.ExecStatusEnum;
|
|
||||||
import com.zjyr.beidouservice.mapper.DevTaskMapper;
|
import com.zjyr.beidouservice.mapper.DevTaskMapper;
|
||||||
import com.zjyr.beidouservice.mapper.TaskMapper;
|
import com.zjyr.beidouservice.mapper.TaskMapper;
|
||||||
import com.zjyr.beidouservice.pojo.dataobject.DevTaskDO;
|
import com.zjyr.beidouservice.pojo.dataobject.DevTaskDO;
|
||||||
import com.zjyr.beidouservice.pojo.dataobject.TaskDO;
|
import com.zjyr.beidouservice.pojo.dataobject.TaskDO;
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DevTaskExecRespDTO;
|
||||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskContentDTO;
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskContentDTO;
|
||||||
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskExecReqDTO;
|
||||||
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
import com.zjyr.beidouservice.pojo.dto.DeviceTaskRespDTO;
|
||||||
import com.zjyr.beidouservice.service.DeviceTaskService;
|
import com.zjyr.beidouservice.service.DeviceTaskService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
@ -13,8 +14,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ public class DeviceTaskServiceImpl implements DeviceTaskService {
|
||||||
devTaskContent.setDeviceName(devTask.getDeviceName());
|
devTaskContent.setDeviceName(devTask.getDeviceName());
|
||||||
//回示时间为dev task表中的更新时间,收到执行状态后更新时间
|
//回示时间为dev task表中的更新时间,收到执行状态后更新时间
|
||||||
devTaskContent.setRespTime(devTask.getUpdateTime());
|
devTaskContent.setRespTime(devTask.getUpdateTime());
|
||||||
devTaskContent.setExecStateMsg(ExecStatusEnum.getByCode(devTask.getExecState()));
|
devTaskContent.setExecState(devTask.getExecState());
|
||||||
|
|
||||||
devTaskContents.add(devTaskContent);
|
devTaskContents.add(devTaskContent);
|
||||||
|
|
||||||
|
@ -93,4 +92,16 @@ public class DeviceTaskServiceImpl implements DeviceTaskService {
|
||||||
|
|
||||||
return respDTOList;
|
return respDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DevTaskExecRespDTO deviceTaskExec(DeviceTaskExecReqDTO deviceTaskExecReqDTO) {
|
||||||
|
DevTaskExecRespDTO deviceTaskRespDTO = new DevTaskExecRespDTO();
|
||||||
|
|
||||||
|
//todo 北斗号 beidouId,如果以市为单位,则携带市北斗号,区为单位携带区北斗号,具体设备则携带区北斗号
|
||||||
|
|
||||||
|
//todo 控制类型 controlType:。1:单点控制 2:市属控制 3:区属控制
|
||||||
|
|
||||||
|
return deviceTaskRespDTO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,9 @@
|
||||||
<if test="countyCode != null and countyCode != ''">
|
<if test="countyCode != null and countyCode != ''">
|
||||||
and county_code = #{countyCode}
|
and county_code = #{countyCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="deviceName != null and deviceName != ''">
|
||||||
|
and device_name = #{deviceName}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue