Commit 184bea34 authored by chenhao's avatar chenhao

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

parents 2bbc1c04 315e86a4
package com.yeejoin.amos.boot.module.common.api.dto;
import io.swagger.annotations.ApiModelProperty;
/**
* @description:
* @author: tw
* @createDate: 2021/9/17
*/
public class KeySiteDateDto {
@ApiModelProperty(value = "id")
private String key;
@ApiModelProperty(value = "id")
private String value;
@ApiModelProperty(value = "重点部位名称")
private String label;
@ApiModelProperty(value = "位置")
private String fireLocation;
@ApiModelProperty(value = "經度")
private String floorLongitude;
@ApiModelProperty(value = "緯度")
private String floorLatitude;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getFireLocation() {
return fireLocation;
}
public void setFireLocation(String fireLocation) {
this.fireLocation = fireLocation;
}
public String getFloorLongitude() {
return floorLongitude;
}
public void setFloorLongitude(String floorLongitude) {
this.floorLongitude = floorLongitude;
}
public String getFloorLatitude() {
return floorLatitude;
}
public void setFloorLatitude(String floorLatitude) {
this.floorLatitude = floorLatitude;
}
}
package com.yeejoin.amos.boot.module.common.api.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
......@@ -137,4 +139,11 @@ public class KeySite extends BaseEntity {
@TableField("remark")
private String remark;
@TableField( "longitude")
private Double longitude;
@TableField("latitude")
private Double latitude;
}
......@@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
......@@ -33,4 +34,7 @@ public List<KeySiteDto> getKeySiteList();
*/
public KeySiteDto getSequenceNbr(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id);
}
package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
......@@ -64,4 +65,8 @@ public boolean saveExcel(List<KeySiteExcleDto> excelDtoList);
* @return
*/
public List<OrgMenuDto> getBuildAndKeyTree(Long sequenceNbr);
public List<KeySiteDateDto> getKeySiteDate(Long id);
}
......@@ -120,5 +120,21 @@
left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
where c.is_delete = FALSE;
</select>
<select id="getKeySiteDate" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto">
SELECT
c.sequence_nbr AS `key`,
c.sequence_nbr AS `value`,
c.`name` as label,
c.address_desc as fireLocation,
c.longitude as floorLongitude,
c.latitude AS floorLatitude
FROM cb_key_site c
where c.is_delete=FALSE
<if test="belongId != null and belongId!='-1' and belongId != -1">
AND c.`belong_id`= #{id}
</if>
</select>
</mapper>
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 机场机位旋转角度
*
* @author litw
* @date 2021-09-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AirportStandDto", description="机场机位旋转角度")
public class AirportStandDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "机位号")
private String standCode;
@ApiModelProperty(value = "坐标X")
private String coordinateX;
@ApiModelProperty(value = "坐标Y")
private String coordinateY;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
}
......@@ -7,37 +7,40 @@ package com.yeejoin.amos.boot.module.jcs.api.dto;
*/
public class NewsDate {
private Long id; // 物联警情id
private Double floorLongitude; // 建筑经度
private Double floorLatitude; // 建筑纬度
private String floorName; // 建筑名称
private Long id; // 物联警情id
private String contactUser;//联系人
private String contactPhone;//联系人电话
private String unitInvolvedId; // 事发单位
private String unitInvolvedName; // 事发单位名称
private Double longitude; // 建筑经度
private Double latitude; // 建筑纬度
private String address; // 地址
private String fireLocation;//火灾地址
private Double floorLongitude;//楼经度
private Double floorLatitude;//楼纬度
public Double getFloorLongitude() {
return floorLongitude;
public Long getId() {
return id;
}
public void setFloorLongitude(Double floorLongitude) {
this.floorLongitude = floorLongitude;
public void setId(Long id) {
this.id = id;
}
public Double getFloorLatitude() {
return floorLatitude;
public String getContactUser() {
return contactUser;
}
public void setFloorLatitude(Double floorLatitude) {
this.floorLatitude = floorLatitude;
public void setContactUser(String contactUser) {
this.contactUser = contactUser;
}
public String getFloorName() {
return floorName;
public String getContactPhone() {
return contactPhone;
}
public void setFloorName(String floorName) {
this.floorName = floorName;
public void setContactPhone(String contactPhone) {
this.contactPhone = contactPhone;
}
public String getUnitInvolvedId() {
......@@ -55,4 +58,52 @@ public class NewsDate {
public void setUnitInvolvedName(String unitInvolvedName) {
this.unitInvolvedName = unitInvolvedName;
}
public Double getLongitude() {
return longitude;
}
public void setLongitude(Double longitude) {
this.longitude = longitude;
}
public Double getLatitude() {
return latitude;
}
public void setLatitude(Double latitude) {
this.latitude = latitude;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getFireLocation() {
return fireLocation;
}
public void setFireLocation(String fireLocation) {
this.fireLocation = fireLocation;
}
public Double getFloorLongitude() {
return floorLongitude;
}
public void setFloorLongitude(Double floorLongitude) {
this.floorLongitude = floorLongitude;
}
public Double getFloorLatitude() {
return floorLatitude;
}
public void setFloorLatitude(Double floorLatitude) {
this.floorLatitude = floorLatitude;
}
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 机场机位旋转角度
*
* @author litw
* @date 2021-09-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_airport_stand")
public class AirportStand extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 机位号
*/
@TableField("stand_code")
private String standCode;
/**
* 坐标X
*/
@TableField("coordinate_x")
private String coordinateX;
/**
* 坐标Y
*/
@TableField("coordinate_y")
private String coordinateY;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
/**
* 更新时间
*/
@TableField("update_time")
private Date updateTime;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AirportStand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 机场机位旋转角度 Mapper 接口
*
* @author litw
* @date 2021-09-17
*/
public interface AirportStandMapper extends BaseMapper<AirportStand> {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 机场机位旋转角度接口类
*
* @author litw
* @date 2021-09-17
*/
public interface IAirportStandService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.AirportStandMapper">
</mapper>
package com.yeejoin.amos.boot.module.common.biz.controller;
import static org.hamcrest.CoreMatchers.nullValue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
......@@ -28,9 +26,9 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itextpdf.text.pdf.PdfStructTreeController.returnType;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDateDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
......@@ -225,4 +223,17 @@ public class KeySiteController extends BaseController {
public ResponseModel<List<OrgMenuDto>> getBuildTree(@PathVariable Long buildingId) {
return ResponseHelper.buildResponse(keySiteService.getBuildAndKeyTree(buildingId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "部位", notes = "部位")
@GetMapping(value = "/getKeySiteDate")
public ResponseModel<List<KeySiteDateDto>> getKeySiteDate(@RequestParam Long id) {
return ResponseHelper.buildResponse(keySiteService.getKeySiteDate(id));
}
}
......@@ -285,7 +285,7 @@ public class WaterResourceController extends BaseController {
// 查询基本信息
WaterResourceDto waterResourceDto = waterResourceServiceImpl.queryBySeq(sequenceNbr);
waterResourceDto.setRealityImgList(JSONArray.parseArray(waterResourceDto.getRealityImg(), Object.class));
waterResourceDto.setOrientationImgList(JSONArray.parseArray(waterResourceDto.getOrientationImg()));
waterResourceDto.setOrientationImgList(waterResourceDto.getOrientationImg()!=null?JSONArray.parseArray(waterResourceDto.getOrientationImg()):null);
Boolean isDelete = waterResourceDto.getIsDelete();
// 查询属性信息
String resourceType = waterResourceDto.getResourceType();
......
......@@ -8,11 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto;
import com.yeejoin.amos.boot.module.common.api.dto.KeySiteExcleDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrTreeDto;
import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.KeySite;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
......@@ -309,5 +305,10 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
return list1;
}
@Override
public List<KeySiteDateDto> getKeySiteDate(Long id) {
return keySiteMapper.getKeySiteDate(id);
}
}
......@@ -45,14 +45,11 @@ public class StartLoader implements ApplicationRunner {
try {
emqKeeper.getMqttClient().subscribe(topic, (s, mqttMessage) -> {
byte[] payload = mqttMessage.getPayload();
try {
String obj = new String(payload);
if (!ValidationUtil.isEmpty(obj)) {
JSONObject json = JSON.parseObject(obj);
JSONObject date = (JSONObject) JSON.toJSON(json.get("data"));
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", date.get("unitInvolvedName")+","+date.get("floorName")+"楼,发生警情,请处理。", date.get("id").toString(), obj);
AlertNewsDto alertNewsDto = new AlertNewsDto( "物联警情", json.get("unitInvolvedName")+","+json.get("address")+",发生警情,请处理。", json.get("id").toString(), obj);
emqKeeper.getMqttClient().publish(topicweb, JSONObject.toJSON(alertNewsDto).toString().getBytes(), RuleConfig.DEFAULT_QOS, true);
}
} catch (Exception e) {
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AirportStand;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AirportStandServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.AirportStandDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
* 机场机位旋转角度
*
* @author litw
* @date 2021-09-17
*/
@RestController
@Api(tags = "机场机位旋转角度Api")
@RequestMapping(value = "/airport-stand")
public class AirportStandController extends BaseController {
@Autowired
AirportStandServiceImpl airportStandServiceImpl;
/**
* 根据sequenceNbr查询
*
* @param standCode 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{standCode}")
@ApiOperation(httpMethod = "GET",value = "根据standCode查询单个机场机位旋转角度", notes = "根据standCode查询单个机场机位旋转角度")
public ResponseModel<AirportStandDto> selectOne(@PathVariable String standCode) {
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",standCode);
AirportStand airportStand = airportStandServiceImpl.getOne(queryWrapper);
AirportStandDto airportStandDto = new AirportStandDto();
BeanUtils.copyProperties(airportStand,airportStandDto);
return ResponseHelper.buildResponse(airportStandDto);
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AirportStand;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AirportStandMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAirportStandService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AirportStandDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 机场机位旋转角度服务实现类
*
* @author litw
* @date 2021-09-17
*/
@Service
public class AirportStandServiceImpl extends BaseService<AirportStandDto,AirportStand,AirportStandMapper> implements IAirportStandService {
/**
* 分页查询
*/
public Page<AirportStandDto> queryForAirportStandPage(Page<AirportStandDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AirportStandDto> queryForAirportStandList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
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