Commit 09676cd8 authored by tianbo's avatar tianbo

增加集结点、警情二次定位接口

parent de97b84d
......@@ -14,6 +14,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.Date;
import java.util.Map;
/**
* @author Dell
......@@ -39,10 +40,10 @@ public class MetaHandler implements MetaObjectHandler {
*/
@Override
public void insertFill(MetaObject metaObject) {
autoFillUser(metaObject);
autoFillUser(metaObject, metaObject.getOriginalObject());
}
private void autoFillUser(MetaObject metaObject) {
private void autoFillUser(MetaObject metaObject, Object entity) {
//获取用户信息 以及当前用户登录公司部门,角色
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(RedisKey.buildKey(getToken())) ?
......@@ -54,12 +55,12 @@ public class MetaHandler implements MetaObjectHandler {
if(ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(agencyUserModel)){
return;
}
Object entity = metaObject.getOriginalObject();
}
// Object entity = metaObject.getOriginalObject();
if (isExistField("recUserId", entity)) {
this.setFieldValByName("recUserId", agencyUserModel.getUserId(), metaObject);
}
if (isExistField("recUserName", entity)) {
this.setFieldValByName("recUserName", agencyUserModel.getUserName(), metaObject);
}
......@@ -71,8 +72,8 @@ public class MetaHandler implements MetaObjectHandler {
Date currentDate = new Date();
this.setFieldValByName("recDate", currentDate, metaObject);
}
// if (isExistField("companyCode", entity)) {
// this.setFieldValByName("companyCode", reginParams.getDepartment().getOrgCode(), metaObject);
// }
......@@ -102,6 +103,8 @@ public class MetaHandler implements MetaObjectHandler {
*/
@Override
public void updateFill(MetaObject metaObject) {
Object updateEntity = ((Map)metaObject.getOriginalObject()).get("et");
autoFillUser(metaObject, updateEntity);
Date currentDate = new Date();
this.setFieldValByName("updateTime", currentDate, metaObject);
}
......
......@@ -35,7 +35,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
<#else>
@Controller
</#if>
@RequestMapping(value = "<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
@RequestMapping(value = "/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
......
......@@ -306,10 +306,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto;
@ApiModelProperty("设施定义id")
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 44)
private String equipName;
@ApiModelProperty("设施分类id")
private Long equipCategoryId;
@ApiModelProperty("设施分类名称")
@ExcelProperty(value = "设施分类名称", index = 45)
private String equipCategoryName;
......
......@@ -50,4 +50,5 @@ public interface ILinkageUnitService {
public List<Menu> getEmergencyLinkageUnitCodeGroupBy(String type, String rootName) ;
List<LinkageUnitDto> exportToExcel();
List<LinkageUnitDto> queryForLinkageUnitList(Boolean isDelete);
}
......@@ -110,8 +110,8 @@
when ISNULL(belong_fighting_system) = 0 and LENGTH(trim(belong_fighting_system)) > 0
then belong_fighting_system
else '其他' end) belong_fighting_system,
resource_type,
resource_type_name
equip_id as resource_type,
equip_name as resource_type_name
from cb_water_resource
where is_delete = #{isDelete}
</select>
......
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 system_generator
* @date 2021-08-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertLocationLogDto", description="")
public class AlertLocationLogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
}
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 system_generator
* @date 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RallyPointDto", description="集结点")
public class RallyPointDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
}
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 system_generator
* @date 2021-08-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_alert_location_log")
public class AlertLocationLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 警情id
*/
@TableField("alert_id")
private Long alertId;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
}
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 system_generator
* @date 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_rally_point")
public class RallyPoint extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 名称
*/
@TableField("name")
private String name;
/**
* 地址
*/
@TableField("address")
private String address;
/**
* 警情id
*/
@TableField("alert_id")
private Long alertId;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2021-08-26
*/
public interface AlertLocationLogMapper extends BaseMapper<AlertLocationLog> {
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 集结点 Mapper 接口
*
* @author system_generator
* @date 2021-08-25
*/
public interface RallyPointMapper extends BaseMapper<RallyPoint> {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2021-08-26
*/
public interface IAlertLocationLogService {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 集结点接口类
*
* @author system_generator
* @date 2021-08-25
*/
public interface IRallyPointService {
}
<?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.AlertLocationLogMapper">
</mapper>
<?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.RallyPointMapper">
</mapper>
......@@ -348,12 +348,12 @@ public class WaterResourceController extends BaseController {
@RequestParam(value = "size") int size, String name,
@RequestParam(value = "belongBuildingId", required = false) ArrayList<Long> belongBuildingId,
Long belongFightingSystemId, Long sequenceNbr,
String resourceType) {
String classifyId) {
Page<WaterResourceDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryForWaterResourcePage(page, name,
resourceType, belongBuildingId, belongFightingSystemId, sequenceNbr));
classifyId, belongBuildingId, belongFightingSystemId, sequenceNbr));
}
/**
......@@ -384,9 +384,9 @@ public class WaterResourceController extends BaseController {
@GetMapping(value = "/select_list")
public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr,
Long belongFightingSystemId, Long belongBuildingId,
String belongBuilding, String resourceType, String classifyId) {
String belongBuilding, String resourceType) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name,
sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType, classifyId));
sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType));
}
/**
......
......@@ -111,6 +111,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
/**
* 列表查询 示例
*/
@Override
public List<LinkageUnitDto> queryForLinkageUnitList(@Condition(Operator.eq) Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
......
......@@ -56,13 +56,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
*/
public Page<WaterResourceDto> queryForWaterResourcePage(Page<WaterResourceDto> page,
@Condition(Operator.like) String name,
@Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId,
@Condition(Operator.in) ArrayList<Long> belongBuildingId,
@Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long sequenceNbr) {
// return this.queryForPage(page, null, false, name, resourceType, belongBuildingId, belongFightingSystemId,
// sequenceNbr, isDelete);
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, resourceType, belongBuildingId,
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, equipId, belongBuildingId,
belongFightingSystemId, sequenceNbr);
}
......@@ -82,10 +80,9 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long belongBuildingId,
@Condition(Operator.like) String belongBuilding,
@Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId) {
@Condition(Operator.eq) String resourceType) {
return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId,
belongBuilding, resourceType, equipId);
belongBuilding, resourceType);
}
......
......@@ -299,4 +299,17 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.controlEquip());
}
/**
* 警情重新定位
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/reLocate")
@ApiOperation(httpMethod = "PUT", value = "警情重新定位", notes = "警情重新定位")
public ResponseModel<Boolean> reLocateById(@RequestParam String alertCalled, @RequestParam String longitude,
@RequestParam String latitude) {
return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, latitude));
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.controller;
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.AlertLocationLogServiceImpl;
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.AlertLocationLogDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
*
*
* @author system_generator
* @date 2021-08-26
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/alert-location-log")
public class AlertLocationLogController extends BaseController {
@Autowired
AlertLocationLogServiceImpl alertLocationLogServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<AlertLocationLogDto> save(@RequestBody AlertLocationLogDto model) {
model = alertLocationLogServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<AlertLocationLogDto> updateBySequenceNbrAlertLocationLog(@RequestBody AlertLocationLogDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<AlertLocationLogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<AlertLocationLogDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<AlertLocationLogDto> page = new Page<AlertLocationLogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryForAlertLocationLogPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AlertLocationLogDto>> selectForList() {
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryForAlertLocationLogList());
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.RallyPointDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.RallyPointServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.foundation.utils.Bean;
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.List;
/**
* 集结点
*
* @author system_generator
* @date 2021-08-25
*/
@RestController
@Api(tags = "集结点Api")
@RequestMapping(value = "/rally-point")
public class RallyPointController extends BaseController {
@Autowired
RallyPointServiceImpl rallyPointServiceImpl;
/**
* 新增集结点
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增集结点", notes = "新增集结点")
public ResponseModel<RallyPointDto> save(@RequestBody RallyPointDto model) {
model = rallyPointServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新集结点", notes = "根据sequenceNbr更新集结点")
public ResponseModel<RallyPoint> updateBySequenceNbrRallyPoint(@RequestBody RallyPointDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
RallyPoint rallyPoint = new RallyPoint();
BeanUtils.copyProperties(model, rallyPoint);
rallyPointServiceImpl.saveOrUpdate(rallyPoint);
return ResponseHelper.buildResponse(rallyPoint);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除集结点", notes = "根据sequenceNbr删除集结点")
public ResponseModel<Boolean> deleteBySequenceNbr(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个集结点", notes = "根据sequenceNbr查询单个集结点")
public ResponseModel<RallyPointDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "集结点分页查询", notes = "集结点分页查询")
public ResponseModel<Page<RallyPointDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<RallyPointDto> page = new Page<RallyPointDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryForRallyPointPage(page));
}
/**
* 根据警情id查询集结点列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据警情id查询集结点列表", notes = "根据警情id查询集结点列表")
@GetMapping(value = "/list")
public ResponseModel<List<RallyPointDto>> selectForList(@RequestParam String alertId) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryForRallyPointList(alertId));
}
}
......@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum;
......@@ -86,6 +87,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private ControllerServiceImpl controllerService;
@Autowired
private ControllerEquipServiceImpl controllerEquipService;
@Autowired
private AlertLocationLogServiceImpl alertLocationLogService;
@Autowired
private EmqKeeper emqKeeper;
@Value("${mqtt.topic.command.alert.notice}")
......@@ -538,4 +543,34 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return true;
}
/**
* 警情重新定位
*
* @param alertId 警情id
* @param longitude 经度
* @param latitude 纬度
* @return
*/
public Boolean reLocate(String alertId, String longitude, String latitude) {
try {
// 更新警情主表
AlertCalled alertCalled = this.baseMapper.selectById(alertId);
alertCalled.setCoordinateX(Double.valueOf(longitude));
alertCalled.setCoordinateY(Double.valueOf(latitude));
this.updateById(alertCalled);
// 插入定位日志表
AlertLocationLog alertLocationLog = new AlertLocationLog();
alertLocationLog.setAlertId(Long.valueOf(alertId));
alertLocationLog.setLongitude(longitude);
alertLocationLog.setLatitude(latitude);
alertLocationLogService.save(alertLocationLog);
return true;
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
throw new RuntimeException("警情定位失败!");
}
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertLocationLogMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertLocationLogService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertLocationLogDto;
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 system_generator
* @date 2021-08-26
*/
@Service
public class AlertLocationLogServiceImpl extends BaseService<AlertLocationLogDto,AlertLocationLog,AlertLocationLogMapper> implements IAlertLocationLogService {
/**
* 分页查询
*/
public Page<AlertLocationLogDto> queryForAlertLocationLogPage(Page<AlertLocationLogDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AlertLocationLogDto> queryForAlertLocationLogList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import javax.annotation.Resource;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -70,7 +70,7 @@ public class DataSourcesImpl implements DataSources {
private RestTemplate restTemplate;
@Autowired
LinkageUnitServiceImpl linkageUnitServiceImpl;
ILinkageUnitService linkageUnitServiceImpl;
@Value("${security.systemctl.name}")
private String systemctl;
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.RallyPointDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.yeejoin.amos.boot.module.jcs.api.mapper.RallyPointMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IRallyPointService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 集结点服务实现类
*
* @author system_generator
* @date 2021-08-25
*/
@Service
public class RallyPointServiceImpl extends BaseService<RallyPointDto, RallyPoint, RallyPointMapper> implements IRallyPointService {
/**
* 分页查询
*/
public Page<RallyPointDto> queryForRallyPointPage(Page<RallyPointDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<RallyPointDto> queryForRallyPointList(String alertId) {
return this.queryForList("", false, alertId);
}
}
\ No newline at end of file
......@@ -97,5 +97,49 @@
ADD COLUMN maintenance_period VARCHAR ( 10 ) COMMENT '维保周期';
</sql>
</changeSet>
<changeSet author="tb" id="2021-08-27-tb-1">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_rally_point"/>
</not>
</preConditions>
<comment>create table jc_rally_point</comment>
<sql>
CREATE TABLE `jc_rally_point` (
`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
`name` varchar(100) DEFAULT NULL COMMENT '名称',
`address` varchar(255) DEFAULT NULL COMMENT '地址',
`alert_id` bigint(30) NOT NULL COMMENT '警情id',
`longitude` varchar(20) NOT NULL COMMENT '经度',
`latitude` varchar(20) NOT NULL COMMENT '纬度',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新用户id',
`rec_user_name` varchar(30) NOT NULL COMMENT '更新用户名称',
`rec_date` datetime NOT NULL COMMENT '更新日期',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1:删除,0:未删除)',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集结点';
</sql>
</changeSet>
<changeSet author="tb" id="2021-08-27-tb-2">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_alert_location_log"/>
</not>
</preConditions>
<comment>create table jc_alert_location_log</comment>
<sql>
CREATE TABLE `jc_alert_location_log` (
`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
`alert_id` bigint(30) NOT NULL COMMENT '警情id',
`longitude` varchar(30) NOT NULL COMMENT '经度',
`latitude` varchar(30) NOT NULL COMMENT '纬度',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新人员id',
`rec_user_name` varchar(50) NOT NULL COMMENT '更新人员名称',
`rec_date` datetime NOT NULL COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1: 已删除,0:未删除)',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
</sql>
</changeSet>
</databaseChangeLog>
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