Commit 27d16e8a authored by chenhao's avatar chenhao

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

parents 9019eb31 df44b7ea
...@@ -18,10 +18,11 @@ public class OrgusrDataxDto { ...@@ -18,10 +18,11 @@ public class OrgusrDataxDto {
@ApiModelProperty(value = "单位基本信息") @ApiModelProperty(value = "单位基本信息")
private OrgUsrzhDto OrgUsrzhDto; private OrgUsrzhDto OrgUsrzhDto;
@ApiModelProperty(value = "现场图片") @ApiModelProperty(value = "消防通道布置图")
private List<String> scenePicture; private List<String> scenePicture;
@ApiModelProperty(value = "平面图") @ApiModelProperty(value = "建筑平面图")
private List<String> planePicture; private List<String> planePicture;
@ApiModelProperty(value = "建筑立面图")
private List<String> facadePicture;
} }
...@@ -90,4 +90,10 @@ public class DispatchPaperDto extends BaseDto { ...@@ -90,4 +90,10 @@ public class DispatchPaperDto extends BaseDto {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "到达时间")
private Date arriveTime;
@ApiModelProperty(value = "救援完成时间")
private Date saveTime;
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.entity; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -160,4 +161,16 @@ public class DispatchPaper extends BaseEntity { ...@@ -160,4 +161,16 @@ public class DispatchPaper extends BaseEntity {
@TableField("remark") @TableField("remark")
private String remark; private String remark;
/**
* 到达时间
*/
@TableField("arrive_time")
private Date arriveTime;
/**
* 救援完成时间
*/
@TableField("save_time")
private Date saveTime;
} }
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.mapper;
import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask; import com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/** /**
* 派遣任务 Mapper 接口 * 派遣任务 Mapper 接口
...@@ -11,4 +12,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +12,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface DispatchTaskMapper extends BaseMapper<DispatchTask> { public interface DispatchTaskMapper extends BaseMapper<DispatchTask> {
String returnDistanceByTaskId(@Param("taskId") Long taskId, @Param("lon")String lon, @Param("lat")String lat);
} }
...@@ -16,4 +16,6 @@ public interface IDispatchTaskService { ...@@ -16,4 +16,6 @@ public interface IDispatchTaskService {
Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser); Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser);
DispatchTaskDto getTaskInfo(String orgTypeCode, Long alertId); DispatchTaskDto getTaskInfo(String orgTypeCode, Long alertId);
String returnDistanceByTaskId(Long taskId, String longitude, String latitude);
} }
...@@ -2,4 +2,34 @@ ...@@ -2,4 +2,34 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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.tzs.api.mapper.DispatchTaskMapper"> <mapper namespace="com.yeejoin.amos.boot.module.tzs.api.mapper.DispatchTaskMapper">
<select id="returnDistanceByTaskId" resultType="java.lang.String">
select
(
ACOS(
SIN(
(#{lat} * PI()) / 180
) * SIN(
(
el.latitude * PI()
) / 180
) + COS(
(#{lat} * PI()) / 180
) * COS(
(
el.latitude * PI()
) / 180
) * COS(
(#{lon} * PI()) / 180 - (
el.longitude * PI()
) / 180
)
) * 6371000
) AS distance
from tz_dispatch_task ta
left JOIN tz_alert_called al on al.sequence_nbr = ta.alert_id
left JOIN tcb_elevator el on el.sequence_nbr = al.equipment_id
where ta.sequence_nbr = #{taskId}
</select>
</mapper> </mapper>
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
( (
ACOS( ACOS(
SIN( SIN(
(#{lat} * 3.1415) / 180 (#{lat} * PI()) / 180
) * SIN( ) * SIN(
( (
tcb_rescue_station.latitude * PI() tcb_rescue_station.latitude * PI()
) / 180 ) / 180
) + COS( ) + COS(
(#{lat} * 3.1415) / 180 (#{lat} * PI()) / 180
) * COS( ) * COS(
( (
tcb_rescue_station.latitude * PI() tcb_rescue_station.latitude * PI()
) / 180 ) / 180
) * COS( ) * COS(
(#{lon} * 3.1415) / 180 - ( (#{lon} * PI()) / 180 - (
tcb_rescue_station.longitude * PI() tcb_rescue_station.longitude * PI()
) / 180 ) / 180
) )
......
...@@ -845,11 +845,7 @@ public class CommandController extends BaseController { ...@@ -845,11 +845,7 @@ public class CommandController extends BaseController {
buildId = orgUsrzhDto.get(0).getBuildId(); buildId = orgUsrzhDto.get(0).getBuildId();
} }
} }
if (buildId != null) {
//现场照片 待完成,
//平面图。待完成orgUsrzhDto.getBuildId()
if (buildId != null) {
List<Map<String, Object>> list = equipFeignClient.findImgByFileCategory(buildId, "fourImg").getResult(); List<Map<String, Object>> list = equipFeignClient.findImgByFileCategory(buildId, "fourImg").getResult();
List<String> url = new ArrayList<>(); List<String> url = new ArrayList<>();
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
...@@ -857,7 +853,26 @@ public class CommandController extends BaseController { ...@@ -857,7 +853,26 @@ public class CommandController extends BaseController {
url.add(map.get("filePath").toString()); url.add(map.get("filePath").toString());
}); });
} }
//通道
List<Map<String, Object>> list1 = equipFeignClient.findImgByFileCategory(buildId, "secondImg").getResult();
List<String> url1 = new ArrayList<>();
if (list1 != null && list1.size() > 0) {
list1.stream().forEach(map -> {
url1.add(map.get("filePath").toString());
});
}
//立面
List<Map<String, Object>> list2 = equipFeignClient.findImgByFileCategory(buildId, "threeImg").getResult();
List<String> url2 = new ArrayList<>();
if (list2 != null && list2.size() > 0) {
list2.stream().forEach(map -> {
url2.add(map.get("filePath").toString());
});
}
orgusrDataxDto.setPlanePicture(url); orgusrDataxDto.setPlanePicture(url);
orgusrDataxDto.setScenePicture(url1);
orgusrDataxDto.setFacadePicture(url2);
} }
return ResponseHelper.buildResponse(orgusrDataxDto); return ResponseHelper.buildResponse(orgusrDataxDto);
} }
......
...@@ -5,13 +5,16 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController; ...@@ -5,13 +5,16 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation; import com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation;
import com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService;
import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService; import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel; import com.yeejoin.amos.feign.systemctl.model.SmsRecordModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,7 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -23,7 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.w3c.dom.Node; import org.w3c.dom.Node;
...@@ -62,6 +67,9 @@ public class WechatController extends BaseController { ...@@ -62,6 +67,9 @@ public class WechatController extends BaseController {
@Autowired @Autowired
WechatRelationServiceImpl wechatRelationServiceImpl; WechatRelationServiceImpl wechatRelationServiceImpl;
@Autowired
IDispatchTaskService dispatchTaskService;
/** /**
...@@ -182,7 +190,7 @@ public class WechatController extends BaseController { ...@@ -182,7 +190,7 @@ public class WechatController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getOpenIdTel/{code}") @GetMapping(value = "/getOpenIdTel/{code}")
@ApiOperation(httpMethod = "GET", value = "根据微信code获取openId和手机号接口", notes = "根据微信code获取openId和手机号接口") @ApiOperation(httpMethod = "GET", value = "根据微信code获取openId和手机号接口", notes = "根据微信code获取openId和手机号接口")
public ResponseModel<WechatAccessDto> getAccessToken(@PathVariable String code) { public ResponseModel<WechatAccessDto> getOpenIdTel(@PathVariable String code) {
WechatAccessDto wechatAccessDto = new WechatAccessDto(); WechatAccessDto wechatAccessDto = new WechatAccessDto();
String openId = wechatService.getOpenId(code); String openId = wechatService.getOpenId(code);
if(StringUtils.isNotEmpty(openId)) { if(StringUtils.isNotEmpty(openId)) {
...@@ -195,6 +203,32 @@ public class WechatController extends BaseController { ...@@ -195,6 +203,32 @@ public class WechatController extends BaseController {
return ResponseHelper.buildResponse(wechatAccessDto); return ResponseHelper.buildResponse(wechatAccessDto);
} }
/**
* 根据任务id 经纬度 返回现在距离任务距离
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/returnDistance")
@ApiOperation(httpMethod = "POST", value = "根据任务id 经纬度 返回现在距离任务距离", notes = "根据任务id 经纬度 返回现在距离任务距离")
public ResponseModel<String> returnDistance(@ApiParam(value = "任务id", required = true) @RequestParam(name = "taskId") Long taskId,
@ApiParam(value = "经度", required = true) @RequestParam(name = "longitude") String longitude,
@ApiParam(value = "纬度", required = true) @RequestParam(name = "latitude") String latitude) {
if (ValidationUtil.isEmpty(taskId)
|| ValidationUtil.isEmpty(longitude)
|| ValidationUtil.isEmpty(latitude)){
throw new BadRequest("参数校验失败.");
}
String distance = dispatchTaskService.returnDistanceByTaskId(taskId,longitude,latitude);
return ResponseHelper.buildResponse(distance);
}
/**
* 创建验证码
* @return
*/
public static String getrandom(){ public static String getrandom(){
String code = ""; String code = "";
Random random = new Random(); Random random = new Random();
......
...@@ -27,7 +27,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -27,7 +27,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
* @date 2021-09-22 * @date 2021-09-22
*/ */
@RestController @RestController
@Api(tags = "openId与手机号对应关系") @Api(tags = "openId与手机号对应关系API")
@RequestMapping(value = "/wechat-relation") @RequestMapping(value = "/wechat-relation")
public class WechatRelationController extends BaseController { public class WechatRelationController extends BaseController {
......
...@@ -168,6 +168,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc ...@@ -168,6 +168,11 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
return dispatchTaskDto; return dispatchTaskDto;
} }
@Override
public String returnDistanceByTaskId(Long taskId, String longitude, String latitude) {
return baseMapper.returnDistanceByTaskId(taskId, longitude, latitude);
}
@Transactional @Transactional
@Override @Override
public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) { public Boolean createDispatchTask(DispatchTaskDto dispatchTaskDto, AgencyUserModel sendUser) {
......
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