diff --git a/alarm/pom.xml b/alarm/pom.xml new file mode 100644 index 0000000..766264d --- /dev/null +++ b/alarm/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + com.yingji + yingjiAlgorithms + 0.0.1-SNAPSHOT + + + alarm + + + 8 + 8 + UTF-8 + + + + + alarm + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.yingji.AlarmApplication + + + + repackage + + repackage + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yingji/YingjiAlgorithmsApplication.java b/alarm/src/main/java/com/yingji/AlarmApplication.java similarity index 81% rename from src/main/java/com/yingji/YingjiAlgorithmsApplication.java rename to alarm/src/main/java/com/yingji/AlarmApplication.java index 4edf7ba..81dc1b9 100644 --- a/src/main/java/com/yingji/YingjiAlgorithmsApplication.java +++ b/alarm/src/main/java/com/yingji/AlarmApplication.java @@ -15,9 +15,9 @@ import org.springframework.scheduling.annotation.EnableScheduling; @MapperScan("com.yingji.mapper") @EnableAsync @EnableScheduling -public class YingjiAlgorithmsApplication { +public class AlarmApplication { public static void main(String[] args) { - SpringApplication.run(YingjiAlgorithmsApplication.class, args); + SpringApplication.run(AlarmApplication.class, args); } } \ No newline at end of file diff --git a/src/main/java/com/yingji/base/constant/HttpStatus.java b/alarm/src/main/java/com/yingji/base/constant/HttpStatus.java similarity index 100% rename from src/main/java/com/yingji/base/constant/HttpStatus.java rename to alarm/src/main/java/com/yingji/base/constant/HttpStatus.java diff --git a/src/main/java/com/yingji/base/controller/BaseController.java b/alarm/src/main/java/com/yingji/base/controller/BaseController.java similarity index 100% rename from src/main/java/com/yingji/base/controller/BaseController.java rename to alarm/src/main/java/com/yingji/base/controller/BaseController.java diff --git a/src/main/java/com/yingji/base/domain/AjaxResult.java b/alarm/src/main/java/com/yingji/base/domain/AjaxResult.java similarity index 100% rename from src/main/java/com/yingji/base/domain/AjaxResult.java rename to alarm/src/main/java/com/yingji/base/domain/AjaxResult.java diff --git a/src/main/java/com/yingji/config/MybatisPlusConfig.java b/alarm/src/main/java/com/yingji/config/MybatisPlusConfig.java similarity index 100% rename from src/main/java/com/yingji/config/MybatisPlusConfig.java rename to alarm/src/main/java/com/yingji/config/MybatisPlusConfig.java diff --git a/src/main/java/com/yingji/config/SwaggerConfig.java b/alarm/src/main/java/com/yingji/config/SwaggerConfig.java similarity index 100% rename from src/main/java/com/yingji/config/SwaggerConfig.java rename to alarm/src/main/java/com/yingji/config/SwaggerConfig.java diff --git a/alarm/src/main/java/com/yingji/entity/Alarm.java b/alarm/src/main/java/com/yingji/entity/Alarm.java new file mode 100644 index 0000000..c190e5b --- /dev/null +++ b/alarm/src/main/java/com/yingji/entity/Alarm.java @@ -0,0 +1,196 @@ +package com.yingji.entity; + +import cn.hutool.core.annotation.Alias; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * (Alarm)表实体类 + * + * @author wu + * @since 2024-05-07 14:50:30 + */ +@Data +@ApiModel("实体类") +@TableName(value = "alarm") +public class Alarm implements Serializable { + + private static final long serialVersionUID = -61131421311961793L; + + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + @TableId(type = IdType.AUTO) + private Long emergencyEventId; + + + private Integer emergencyEventSource; + + + private Integer emergencyEventStatus; + + + private Integer warnResponseStatus; + + + private Integer emergencyResponseStatus; + + + private String emergencyEventTitle; + + + private Integer emergencyEventType; + + + private Integer emergencyEventLevel; + + /** + * 报警时间 + */ + @ApiModelProperty(value = "报警时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime emergencyEventTime; + + /** + * 报警内容 + */ + @ApiModelProperty(value = "报警内容") + @Alias("bjnr") + private String emergencyEventDesc; + + /** + * 报警地址 + */ + @Alias("sfdd") + @ApiModelProperty(value = "报警地址") + private String emergencyEventAddress; + + + private String emergencyEventArea; + + + private Double emergencyEventLon; + + + private Double emergencyEventLat; + + + private String submitUnit; + + + private String submitUnitContact; + + + private String submitUnitTelephone; + + + private String reportPerson; + + + private String reportPersonTelephone; + + + private String remark; + + + private String fileUrls; + + /** + * 是否删除 0未删除 1删除 + */ + @ApiModelProperty(value = "是否删除 0未删除 1删除") + private Integer delFlag; + + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 最后更新人 + */ + @ApiModelProperty(value = "最后更新人") + private String updateBy; + + /** + * 最后更新时间 + */ + @ApiModelProperty(value = "最后更新时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + + private String sendOutTimes; + + + private Long groupId; + + + private Integer isRehearsal; + + /** + * 手机号 + */ + @ApiModelProperty(value = "报警电话") + @Alias("bjdh") + private String alarmPhoneNumber; + + /** + * 源id + */ + @ApiModelProperty(value = "源id") + private String sourceId; + + + private Integer isJudged; + + + private String eventDetail; + + /** + * 预警大类 + */ + @ApiModelProperty(value = "预警大类") + private String aiClass; + + /** + * 预警小类 + */ + @ApiModelProperty(value = "预警小类") + private String aiClass2; + + /** + * 紧急程度 + */ + @ApiModelProperty(value = "紧急程度") + private String aiLevel; + + /** + * 紧急系数 + */ + @ApiModelProperty(value = "紧急系数") + private Double aiNum; +} + diff --git a/src/main/java/com/yingji/entity/Source.java b/alarm/src/main/java/com/yingji/entity/Source.java similarity index 92% rename from src/main/java/com/yingji/entity/Source.java rename to alarm/src/main/java/com/yingji/entity/Source.java index a59046f..515f536 100644 --- a/src/main/java/com/yingji/entity/Source.java +++ b/alarm/src/main/java/com/yingji/entity/Source.java @@ -1,14 +1,13 @@ package com.yingji.entity; -import java.io.Serializable; - import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableField; -import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.io.Serializable; + /** * (Source)表实体类 diff --git a/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java b/alarm/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java similarity index 96% rename from src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java rename to alarm/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java index bdce96c..e491c77 100644 --- a/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java +++ b/alarm/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java @@ -15,8 +15,8 @@ import java.time.LocalDateTime; * @author wu * @since 2024/4/30 下午3:59 */ -@ApiModel(value = "Alarm查询请求类") @Data +@ApiModel(value = "Alarm查询请求类") public class AlarmFindRequest implements Serializable { @@ -59,13 +59,13 @@ public class AlarmFindRequest implements Serializable { * 预警大类 */ @ApiModelProperty(value = "预警大类") - private String aiCategories; + private String aiClass; /** * 预警小类 */ @ApiModelProperty(value = "预警小类") - private String aiSubCategories; + private String aiClass2; /** * 紧急程度 diff --git a/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java b/alarm/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java similarity index 100% rename from src/main/java/com/yingji/entity/dto/request/AlarmRequest.java rename to alarm/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java diff --git a/src/main/java/com/yingji/exception/GlobalExceptionHandler.java b/alarm/src/main/java/com/yingji/exception/GlobalExceptionHandler.java similarity index 88% rename from src/main/java/com/yingji/exception/GlobalExceptionHandler.java rename to alarm/src/main/java/com/yingji/exception/GlobalExceptionHandler.java index 062e4df..59aa9d6 100644 --- a/src/main/java/com/yingji/exception/GlobalExceptionHandler.java +++ b/alarm/src/main/java/com/yingji/exception/GlobalExceptionHandler.java @@ -81,4 +81,14 @@ public class GlobalExceptionHandler { public AjaxResult handleDemoModeException(NotLoginException e) { return AjaxResult.error(e.getMessage()); } + + /** + * 业务异常 + */ + @ExceptionHandler(ServiceException.class) + public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { + log.error(e.getMessage(), e); + Integer code = e.getCode(); + return code != null ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); + } } diff --git a/alarm/src/main/java/com/yingji/exception/ServiceException.java b/alarm/src/main/java/com/yingji/exception/ServiceException.java new file mode 100644 index 0000000..4d1e94a --- /dev/null +++ b/alarm/src/main/java/com/yingji/exception/ServiceException.java @@ -0,0 +1,64 @@ +package com.yingji.exception; + +/** + * 业务异常 + * + * @author ruoyi + */ +public final class ServiceException extends RuntimeException { + private static final long serialVersionUID = 1L; + + /** + * 错误码 + */ + private Integer code; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + *

+ * 和 {@link CommonResult#getDetailMessage()} 一致的设计 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public ServiceException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public String getDetailMessage() { + return detailMessage; + } + + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } +} \ No newline at end of file diff --git a/alarm/src/main/java/com/yingji/mapper/AlarmMapper.java b/alarm/src/main/java/com/yingji/mapper/AlarmMapper.java new file mode 100644 index 0000000..6ae47ad --- /dev/null +++ b/alarm/src/main/java/com/yingji/mapper/AlarmMapper.java @@ -0,0 +1,32 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Alarm; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 报警事件(Alarm)表数据库访问层 + * + * @author wu + * @since 2024-05-06 09:15:01 + */ +public interface AlarmMapper extends BaseMapper { + + + /** + * 获取最新一条数据的时间 + * + * @return 最新一条数据的时间 + */ + LocalDateTime findNowTime(); + + /** + * 批量插入数据 + * + * @param list 数据 + */ + void saveAll(List list); +} + diff --git a/alarm/src/main/java/com/yingji/mapper/SourceMapper.java b/alarm/src/main/java/com/yingji/mapper/SourceMapper.java new file mode 100644 index 0000000..15349f3 --- /dev/null +++ b/alarm/src/main/java/com/yingji/mapper/SourceMapper.java @@ -0,0 +1,24 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Source; + +import java.util.List; + +/** + * (Source)表数据库访问层 + * + * @author wu + * @since 2024-05-07 18:03:09 + */ +public interface SourceMapper extends BaseMapper { + + /** + * 保存任务源id + * + * @param list 任务源id + */ + void addList(List list); + +} + diff --git a/alarm/src/main/java/com/yingji/quartz/AlarmQuartz.java b/alarm/src/main/java/com/yingji/quartz/AlarmQuartz.java new file mode 100644 index 0000000..7ea393e --- /dev/null +++ b/alarm/src/main/java/com/yingji/quartz/AlarmQuartz.java @@ -0,0 +1,130 @@ +package com.yingji.quartz; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.yingji.entity.Alarm; +import com.yingji.entity.dto.request.AlarmRequest; +import com.yingji.service.AlarmService; +import com.yingji.service.SourceService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + * 110数据保存定时任务 + * + * @author wu + * @since 2024/05/06 10:18 + */ +@Configuration +public class AlarmQuartz { + + public static final Logger log = LoggerFactory.getLogger(AlarmQuartz.class); + + @Resource + private AlarmService alarmService; + + @Resource + private SourceService sourceService; + + /** + * 保存所有数据 + */ + @Async + @Scheduled(cron = "0 */1 * * * ? ") + public void savaData() { + // 获取token + String token = alarmService.getToken(); + // 查询所有id + List idList = findId(token); + // 查询数据条件 + AlarmRequest alarmRequest = new AlarmRequest(); + alarmRequest.setType("getValue"); + alarmRequest.setPageIndex(1); + alarmRequest.setPageSize(10); + // 定义成功条数 + int successNum = 0; + // 定义保存数据的集合 + List list = new ArrayList<>(); + if (CollUtil.isNotEmpty(idList)) { + try { + for (String x : idList) { + alarmRequest.setValue(x); + Alarm alarm = alarmService.findDataList(alarmRequest, token); + if (alarm != null) { + alarm.setSourceId(x); + list.add(alarm); + successNum++; + // 生成100到200的随机数 + Random random = new Random(); + int randomNumber = random.nextInt(101) + 100; + Thread.sleep(randomNumber); + } else { + return; + } + } + } catch (Exception e) { + log.info("==========================" + e.getMessage()); + } + } + alarmService.saveAll(list); + log.info("成功条数==========================" + successNum); + } + + /** + * 查询数据id + * + * @param token token + * @return token token + */ + private List findId(String token) { + // 定义变量存放 id + List idList = new ArrayList<>(); + if (StrUtil.isEmpty(token)) { + return idList; + } + // 获取数据库中最新的时间 + LocalDateTime nowTime = alarmService.findNowTime(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); + String yesterdayStr = nowTime.format(formatter) + "00"; + // 定义起始页 + int pageIndex = 1; + // 定义每页显示条数 + int pageSize = 500; + // 定义总数据条数 + int size = 0; + // 定义type + String type = "getId"; + // 查询id条件 + AlarmRequest req = new AlarmRequest(); + req.setType(type); + req.setValue(yesterdayStr); + req.setPageIndex(pageIndex); + req.setPageSize(pageSize); + while (true) { + List data = alarmService.findDataIdList(req, token); + if (data == null) { + return idList; + } + sourceService.addList(data); + idList.addAll(data); + size += data.size(); + if (data.size() == pageSize) { + req.setPageIndex(pageIndex++); + log.info("第" + pageIndex + "页==========================" + size + "条数据"); + } else { + break; + } + } + return idList; + } +} diff --git a/src/main/java/com/yingji/redis/RedisCache.java b/alarm/src/main/java/com/yingji/redis/RedisCache.java similarity index 100% rename from src/main/java/com/yingji/redis/RedisCache.java rename to alarm/src/main/java/com/yingji/redis/RedisCache.java diff --git a/alarm/src/main/java/com/yingji/service/AlarmService.java b/alarm/src/main/java/com/yingji/service/AlarmService.java new file mode 100644 index 0000000..8c9327f --- /dev/null +++ b/alarm/src/main/java/com/yingji/service/AlarmService.java @@ -0,0 +1,58 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Alarm; +import com.yingji.entity.dto.request.AlarmRequest; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 报警事件(Alarm)表服务接口 + * + * @author wu + * @since 2024-05-06 09:15:01 + */ +public interface AlarmService extends IService { + + + /** + * 查询数据Id + * + * @param req 查询条件 + * @param token token + * @return 数据IdList + */ + List findDataIdList(AlarmRequest req, String token); + + /** + * 查询数据 + * + * @param req 查询条件 + * @param token token + * @return 数据List + */ + Alarm findDataList(AlarmRequest req, String token); + + /** + * 获取110token + * + * @return token + */ + String getToken(); + + /** + * 获取最新一条数据的时间 + * + * @return 最新一条数据的时间 + */ + LocalDateTime findNowTime(); + + /** + * 批量插入数据 + * + * @param list 数据 + */ + void saveAll(List list); +} + diff --git a/alarm/src/main/java/com/yingji/service/SourceService.java b/alarm/src/main/java/com/yingji/service/SourceService.java new file mode 100644 index 0000000..df66a9b --- /dev/null +++ b/alarm/src/main/java/com/yingji/service/SourceService.java @@ -0,0 +1,24 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Source; + +import java.util.List; + +/** + * (Source)表服务接口 + * + * @author wu + * @since 2024-05-07 18:03:09 + */ +public interface SourceService extends IService { + + /** + * 保存任务源id + * + * @param list 任务源id + */ + void addList(List list); + +} + diff --git a/alarm/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java b/alarm/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java new file mode 100644 index 0000000..fe429e7 --- /dev/null +++ b/alarm/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java @@ -0,0 +1,165 @@ +package com.yingji.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.codec.Base64; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.Alarm; +import com.yingji.entity.dto.request.AlarmRequest; +import com.yingji.mapper.AlarmMapper; +import com.yingji.service.AlarmService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.util.List; + + +/** + * 报警事件(Alarm)表服务实现类 + * + * @author wu + * @since 2024-05-06 09:15:01 + */ +@Service("alarmService") +public class AlarmServiceImpl extends ServiceImpl implements AlarmService { + + public static final Logger log = LoggerFactory.getLogger(AlarmServiceImpl.class); + @Value("${clientId}") + private String clientId; + + @Value("${clientSecret}") + private String clientSecret; + + @Value("${getToken}") + private String getToken; + + @Value("${specificWarn}") + private String specificWarn; + + /** + * base64加密密钥 + * + * @return base64加密后的密钥 + */ + public String findBase() { + String str = clientId + ":" + clientSecret; + return Base64.encode(str); + } + + + /** + * 查询数据Id + * + * @param req 查询条件 + * @param token token + * @return 数据IdList + */ + @Override + public List findDataIdList(AlarmRequest req, String token) { + String bodyJson = JSONObject.toJSONString(req); + List records = null; + // 获取id + String body = HttpRequest.post(specificWarn).header("Authorization", "Basic " + token).body(bodyJson).execute().body(); + JSONObject json = JSONObject.parse(body); + Object response = json.get("response"); + if (BeanUtil.isNotEmpty(response)) { + String responseStr = JSONUtil.toJsonStr(response); + JSONObject res = JSONObject.parse(responseStr); + String recordsStr = JSONUtil.toJsonStr(res.get("records")); + if (StrUtil.isNotEmpty(recordsStr)) { + records = JSONUtil.toList(recordsStr, String.class); + } + } + return records; + } + + /** + * 查询数据 + * + * @param req 查询条件 + * @param token token + * @return 数据List + */ + @Override + public Alarm findDataList(AlarmRequest req, String token) { + String bodyJson = JSONObject.toJSONString(req); + Alarm records = null; + // 获取id + String body = HttpRequest.post(specificWarn).header("Authorization", "Basic " + token).header("Content-Type", "application/json").body(bodyJson).execute().body(); + log.info("==============================="); + log.info("body数据为:" + body); + try { + JSONObject json = JSONObject.parse(body); + Object response = json.get("response"); + if (BeanUtil.isNotEmpty(response)) { + String recordsStr = JSONUtil.toJsonStr(response); + records = JSONUtil.toBean(recordsStr, Alarm.class); + JSONObject recordsJson = JSONObject.parse(recordsStr); + Object bjdhsj = recordsJson.get("bjdhsj"); + String bjdhsjStr = JSONUtil.toJsonStr(bjdhsj); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss").withZone(ZoneId.systemDefault()); + LocalDateTime emergencyEventTime = LocalDateTime.parse(bjdhsjStr, formatter); + records.setEmergencyEventTime(emergencyEventTime); + records.setCreateTime(LocalDateTime.now()); + records.setUpdateTime(LocalDateTime.now()); + records.setDelFlag(0); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + return records; + } + + /** + * 获取110token + * + * @return token + */ + @Override + public String getToken() { + String accessToken = null; + String body = HttpRequest.get(getToken) + .header("Authorization", "Basic Qk5qUDlTOHAyRUpaeXQxVUYrRDZrQ3NLNlpWYXB5S3FpR3phckVkc1ozUW1JV29WZEI3WWtyWDJHQkFtQ0RPMTZ0US9hazg2cFpnUDVaUzNzNEVHZGNvPTpBTTRvTU9zSmowVUxBVU9PWGx6NXhIaklGNGtwOVc2M2FqWnJYeFRHTEhFbg==") + .header("Content-Type", "application/json") + .form("grant_type", "client_credentials").execute().body(); + JSONObject json = JSONObject.parse(body); + Object response = json.get("response"); + if (BeanUtil.isNotEmpty(response)) { + String recordsStr = JSONUtil.toJsonStr(response); + JSONObject res = JSONObject.parse(recordsStr); + accessToken = (String) res.get("access_token"); + } + log.info("======================================="); + log.info("token为:" + accessToken); + return accessToken; + } + + /** + * 获取最新一条数据的时间 + * + * @return 最新一条数据的时间 + */ + @Override + public LocalDateTime findNowTime() { + return baseMapper.findNowTime(); + } + + /** + * 批量插入数据 + * + * @param list 数据 + */ + @Override + public void saveAll(List list) { + baseMapper.saveAll(list); + } +} + diff --git a/alarm/src/main/java/com/yingji/service/impl/SourceServiceImpl.java b/alarm/src/main/java/com/yingji/service/impl/SourceServiceImpl.java new file mode 100644 index 0000000..86d8614 --- /dev/null +++ b/alarm/src/main/java/com/yingji/service/impl/SourceServiceImpl.java @@ -0,0 +1,31 @@ +package com.yingji.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.Source; +import com.yingji.mapper.SourceMapper; +import com.yingji.service.SourceService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * (Source)表服务实现类 + * + * @author wu + * @since 2024-05-07 18:03:09 + */ +@Service("sourceService") +public class SourceServiceImpl extends ServiceImpl implements SourceService { + + /** + * 保存任务源id + * + * @param list 任务源id + */ + @Override + public void addList(List list) { + baseMapper.addList(list); + } + +} + diff --git a/src/main/resources/application-dev.yml b/alarm/src/main/resources/application-dev.yml similarity index 100% rename from src/main/resources/application-dev.yml rename to alarm/src/main/resources/application-dev.yml diff --git a/alarm/src/main/resources/application.yml b/alarm/src/main/resources/application.yml new file mode 100644 index 0000000..4d52d0b --- /dev/null +++ b/alarm/src/main/resources/application.yml @@ -0,0 +1,40 @@ +server: + port: 9004 +spring: + profiles: + active: dev + + redis: + host: localhost + port: 6379 + password: + database: 1 + jedis: + pool: + max-active: 8 # 最大连接数 + max-wait: 1ms # 最大阻塞时间 + max-idle: 4 + min-idle: 0 +# 日志配置 +logging: + level: + com.yingji: info + org.springframework: info + +sa-token: + # token 名称(同时也是 cookie 名称) + token-name: token + # token 有效期(单位:秒) 默认30天,-1 代表永久有效 + timeout: 86400 + # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结 + active-timeout: -1 + # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token) + is-share: true + # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik) + token-style: uuid + # 是否输出操作日志 + is-log: true + + diff --git a/src/main/resources/logback.xml b/alarm/src/main/resources/logback.xml similarity index 97% rename from src/main/resources/logback.xml rename to alarm/src/main/resources/logback.xml index fdb5e11..d8ac6a7 100644 --- a/src/main/resources/logback.xml +++ b/alarm/src/main/resources/logback.xml @@ -1,7 +1,7 @@ - + diff --git a/alarm/src/main/resources/mapper/yingji/AlarmMapper.xml b/alarm/src/main/resources/mapper/yingji/AlarmMapper.xml new file mode 100644 index 0000000..786e4e2 --- /dev/null +++ b/alarm/src/main/resources/mapper/yingji/AlarmMapper.xml @@ -0,0 +1,38 @@ + + + + + + + INSERT IGNORE INTO `alarm`( + emergency_event_time, + emergency_event_desc, + emergency_event_address, + del_flag, + create_time, + update_time, + alarm_phone_number, + source_id) + VALUES + + (#{item.emergencyEventTime}, + #{item.emergencyEventDesc}, + #{item.emergencyEventAddress}, + #{item.delFlag}, + #{item.createTime}, + #{item.updateTime}, + #{item.alarmPhoneNumber}, + #{item.sourceId}) + + + + + + \ No newline at end of file diff --git a/alarm/src/main/resources/mapper/yingji/SourceMapper.xml b/alarm/src/main/resources/mapper/yingji/SourceMapper.xml new file mode 100644 index 0000000..2c49bc9 --- /dev/null +++ b/alarm/src/main/resources/mapper/yingji/SourceMapper.xml @@ -0,0 +1,16 @@ + + + + + + + insert into source + (source_id) values + + (#{id}) + + + + \ No newline at end of file diff --git a/page/pom.xml b/page/pom.xml new file mode 100644 index 0000000..6ad30eb --- /dev/null +++ b/page/pom.xml @@ -0,0 +1,51 @@ + + + 4.0.0 + + com.yingji + yingjiAlgorithms + 0.0.1-SNAPSHOT + + + page + + + 8 + 8 + UTF-8 + + + + page + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.yingji.PageApplication + + + + repackage + + repackage + + + + + + + \ No newline at end of file diff --git a/page/src/main/java/com/yingji/PageApplication.java b/page/src/main/java/com/yingji/PageApplication.java new file mode 100644 index 0000000..200581e --- /dev/null +++ b/page/src/main/java/com/yingji/PageApplication.java @@ -0,0 +1,23 @@ +package com.yingji; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author wu + * @since 2024/2/26 10:24 + */ + +@SpringBootApplication +@MapperScan("com.yingji.mapper") +@EnableAsync +@EnableScheduling +public class PageApplication { + public static void main(String[] args) { + SpringApplication.run(PageApplication.class, args); + + } +} \ No newline at end of file diff --git a/page/src/main/java/com/yingji/base/constant/HttpStatus.java b/page/src/main/java/com/yingji/base/constant/HttpStatus.java new file mode 100644 index 0000000..1d2ac09 --- /dev/null +++ b/page/src/main/java/com/yingji/base/constant/HttpStatus.java @@ -0,0 +1,93 @@ +package com.yingji.base.constant; + +/** + * 返回状态码 + * + * @author ruoyi + */ +public class HttpStatus { + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + public static final int WARN = 601; +} diff --git a/page/src/main/java/com/yingji/base/controller/BaseController.java b/page/src/main/java/com/yingji/base/controller/BaseController.java new file mode 100644 index 0000000..6af991b --- /dev/null +++ b/page/src/main/java/com/yingji/base/controller/BaseController.java @@ -0,0 +1,78 @@ +package com.yingji.base.controller; + +import com.yingji.base.domain.AjaxResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * web层通用数据处理 + * + * @author ruoyi + */ +public class BaseController { + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + + + /** + * 返回成功 + */ + public AjaxResult success() { + return AjaxResult.success(); + } + + /** + * 返回失败消息 + */ + public AjaxResult error() { + return AjaxResult.error(); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(String message) { + return AjaxResult.success(message); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(Object data) { + return AjaxResult.success(data); + } + + /** + * 返回失败消息 + */ + public AjaxResult error(String message) { + return AjaxResult.error(message); + } + + /** + * 返回警告消息 + */ + public AjaxResult warn(String message) { + return AjaxResult.warn(message); + } + + /** + * 响应返回结果 + * + * @param rows 影响行数 + * @return 操作结果 + */ + protected AjaxResult toAjax(int rows) { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 响应返回结果 + * + * @param result 结果 + * @return 操作结果 + */ + protected AjaxResult toAjax(boolean result) { + return result ? success() : error(); + } + +} diff --git a/page/src/main/java/com/yingji/base/domain/AjaxResult.java b/page/src/main/java/com/yingji/base/domain/AjaxResult.java new file mode 100644 index 0000000..06fb8a0 --- /dev/null +++ b/page/src/main/java/com/yingji/base/domain/AjaxResult.java @@ -0,0 +1,202 @@ +package com.yingji.base.domain; + + +import cn.hutool.core.bean.BeanUtil; +import com.yingji.base.constant.HttpStatus; + +import java.util.HashMap; +import java.util.Objects; + +/** + * 操作消息提醒 + * + * @author ruoyi + */ +public class AjaxResult extends HashMap { + /** + * 状态码 + */ + public static final String CODE_TAG = "code"; + /** + * 返回内容 + */ + public static final String MSG_TAG = "msg"; + /** + * 数据对象 + */ + public static final String DATA_TAG = "data"; + private static final long serialVersionUID = 1L; + + /** + * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 + */ + public AjaxResult() { + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + */ + public AjaxResult(int code, String msg) { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + * @param data 数据对象 + */ + public AjaxResult(int code, String msg, Object data) { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + if (BeanUtil.isNotEmpty(data)) { + super.put(DATA_TAG, data); + } + } + + /** + * 返回成功消息 + * + * @return 成功消息 + */ + public static AjaxResult success() { + return AjaxResult.success("操作成功"); + } + + /** + * 返回成功数据 + * + * @return 成功消息 + */ + public static AjaxResult success(Object data) { + return AjaxResult.success("操作成功", data); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @return 成功消息 + */ + public static AjaxResult success(String msg) { + return AjaxResult.success(msg, null); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 成功消息 + */ + public static AjaxResult success(String msg, Object data) { + return new AjaxResult(HttpStatus.SUCCESS, msg, data); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static AjaxResult warn(String msg) { + return AjaxResult.warn(msg, null); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static AjaxResult warn(String msg, Object data) { + return new AjaxResult(HttpStatus.WARN, msg, data); + } + + /** + * 返回错误消息 + * + * @return 错误消息 + */ + public static AjaxResult error() { + return AjaxResult.error("操作失败"); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(String msg) { + return AjaxResult.error(msg, null); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 错误消息 + */ + public static AjaxResult error(String msg, Object data) { + return new AjaxResult(HttpStatus.ERROR, msg, data); + } + + /** + * 返回错误消息 + * + * @param code 状态码 + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(int code, String msg) { + return new AjaxResult(code, msg, null); + } + + /** + * 是否为成功消息 + * + * @return 结果 + */ + public boolean isSuccess() { + return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); + } + + /** + * 是否为警告消息 + * + * @return 结果 + */ + public boolean isWarn() { + return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG)); + } + + /** + * 是否为错误消息 + * + * @return 结果 + */ + public boolean isError() { + return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG)); + } + + /** + * 方便链式调用 + * + * @param key 键 + * @param value 值 + * @return 数据对象 + */ + @Override + public AjaxResult put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/page/src/main/java/com/yingji/config/MybatisPlusConfig.java b/page/src/main/java/com/yingji/config/MybatisPlusConfig.java new file mode 100644 index 0000000..5943191 --- /dev/null +++ b/page/src/main/java/com/yingji/config/MybatisPlusConfig.java @@ -0,0 +1,26 @@ +package com.yingji.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author wu + * @since 2024/2/26 11:28 + */ +@Configuration +public class MybatisPlusConfig { + + /** + * 添加分页插件 + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));//如果配置多个插件,切记分页最后添加 + //interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 如果有多数据源可以不配具体类型 否则都建议配上具体的DbType + return interceptor; + } +} diff --git a/page/src/main/java/com/yingji/config/SwaggerConfig.java b/page/src/main/java/com/yingji/config/SwaggerConfig.java new file mode 100644 index 0000000..e33e2f6 --- /dev/null +++ b/page/src/main/java/com/yingji/config/SwaggerConfig.java @@ -0,0 +1,74 @@ +package com.yingji.config; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +/** + * Swagger2的接口配置 + * + * @author ruoyi + */ +@Configuration +@EnableSwagger2WebMvc +public class SwaggerConfig { + + + /** + * 是否开启swagger + */ + @Value("${knife4j.enable}") + private boolean enabled; + + /** + * 创建API + */ + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + // 是否启用Swagger + .enable(enabled) + //分组名称 + .groupName("应急算法") + // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) + .apiInfo(apiInfo()) + // 设置哪些接口暴露给Swagger展示 + .select() + // 扫描所有有注解的api,用这种方式更灵活 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 扫描指定包中的swagger注解 + // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) + // 扫描所有 .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() +// .pathMapping(pathMapping) + // 排除mybatis-plus的分页参数 + .ignoredParameterTypes(Page.class, IPage.class); + } + + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + // 设置标题 + .title("应急算法") + // 描述 + .description("描述:用于应急算法") + // 版本 + .version("版本号:" + 1) + .build(); + } +} diff --git a/src/main/java/com/yingji/controller/AlarmController.java b/page/src/main/java/com/yingji/controller/AlarmController.java similarity index 92% rename from src/main/java/com/yingji/controller/AlarmController.java rename to page/src/main/java/com/yingji/controller/AlarmController.java index 6a526a3..ead4160 100644 --- a/src/main/java/com/yingji/controller/AlarmController.java +++ b/page/src/main/java/com/yingji/controller/AlarmController.java @@ -55,23 +55,12 @@ public class AlarmController extends BaseController { @ApiOperation(value = "分页条件查询报警事件", response = Alarm.class) public AjaxResult page(Page page, AlarmFindRequest req) { StpUtil.checkLogin(); + if (page.getSize() > 500) { + page.setSize(500); + } return success(alarmService.page(page, req)); } - /** - * 条件查询所有报警事件 - * - * @param req 查询条件 - * @return 所有数据 - */ - @GetMapping("/findAll") - @ApiOperation(value = "条件查询所有报警事件", response = Alarm.class) - public AjaxResult findAll(AlarmFindRequest req) { - StpUtil.checkLogin(); -// StpUtil.renewTimeout(100); - return success(alarmService.findAll(req)); - } - /** * 通过主键查询单条数据 * diff --git a/page/src/main/java/com/yingji/controller/EventController.java b/page/src/main/java/com/yingji/controller/EventController.java new file mode 100644 index 0000000..a8298b9 --- /dev/null +++ b/page/src/main/java/com/yingji/controller/EventController.java @@ -0,0 +1,116 @@ +package com.yingji.controller; + + +import cn.dev33.satoken.stp.StpUtil; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.yingji.base.controller.BaseController; +import com.yingji.base.domain.AjaxResult; +import com.yingji.entity.Event; +import com.yingji.entity.dto.response.EventPageRequest; +import com.yingji.entity.dto.response.EventsFindResponse; +import com.yingji.service.EventService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.transaction.annotation.Transactional; +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 javax.annotation.Resource; +import java.io.Serializable; +import java.util.List; + +/** + * 事故(Event)表控制层 + * + * @author wu + * @since 2024-05-13 16:19:25 + */ +@RestController +@RequestMapping("algorithms/event") +@Api(tags = "事故") +@Transactional(rollbackFor = Exception.class) +public class EventController extends BaseController { + + /** + * 服务对象 + */ + @Resource + private EventService eventService; + + /** + * 分页条件查询所有数据 + * + * @param page 分页条件 + * @param event 查询条件 + * @return 所有数据 + */ + @GetMapping + @ApiOperation(value = "分页条件查询事故", response = Event.class) + public AjaxResult page(Page page, EventPageRequest event) { + StpUtil.checkLogin(); + if (page.getSize() > 500) { + page.setSize(500); + } + return success(eventService.page(page, event)); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + @ApiOperation(value = "通过主键查询单条事故", response = EventsFindResponse.class) + public AjaxResult findById(@PathVariable Serializable id) { + StpUtil.checkLogin(); + return success(eventService.findById(id)); + } + + /** + * 新增数据 + * + * @param event 实体对象 + * @return 新增结果 + */ + @PostMapping + @ApiOperation(value = "新增事故", response = Event.class) + public AjaxResult insert(@RequestBody Event event) { + StpUtil.checkLogin(); + return success(eventService.save(event)); + } + + /** + * 修改数据 + * + * @param event 实体对象 + * @return 修改结果 + */ + @PutMapping + @ApiOperation(value = "修改事故") + public AjaxResult update(@RequestBody Event event) { + StpUtil.checkLogin(); + return success(eventService.updateById(event)); + } + + /** + * 删除数据 + * + * @param idList 主键集合 + * @return 删除结果 + */ + @DeleteMapping + @ApiOperation(value = "删除事故") + public AjaxResult delete(@RequestParam("idList") List idList) { + StpUtil.checkLogin(); + return success(eventService.removeByIds(idList)); + } +} + diff --git a/src/main/java/com/yingji/entity/AcceptEvents.java b/page/src/main/java/com/yingji/entity/AcceptEvents.java similarity index 100% rename from src/main/java/com/yingji/entity/AcceptEvents.java rename to page/src/main/java/com/yingji/entity/AcceptEvents.java diff --git a/src/main/java/com/yingji/entity/Alarm.java b/page/src/main/java/com/yingji/entity/Alarm.java similarity index 100% rename from src/main/java/com/yingji/entity/Alarm.java rename to page/src/main/java/com/yingji/entity/Alarm.java diff --git a/src/main/java/com/yingji/entity/Amb.java b/page/src/main/java/com/yingji/entity/Amb.java similarity index 100% rename from src/main/java/com/yingji/entity/Amb.java rename to page/src/main/java/com/yingji/entity/Amb.java diff --git a/src/main/java/com/yingji/entity/Event.java b/page/src/main/java/com/yingji/entity/Event.java similarity index 100% rename from src/main/java/com/yingji/entity/Event.java rename to page/src/main/java/com/yingji/entity/Event.java diff --git a/page/src/main/java/com/yingji/entity/Source.java b/page/src/main/java/com/yingji/entity/Source.java new file mode 100644 index 0000000..515f536 --- /dev/null +++ b/page/src/main/java/com/yingji/entity/Source.java @@ -0,0 +1,35 @@ +package com.yingji.entity; + + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + + +/** + * (Source)表实体类 + * + * @author wu + * @since 2024-05-07 18:03:09 + */ +@Data +@ApiModel("实体类") +@TableName(value = "source") +public class Source implements Serializable { + + private static final long serialVersionUID = -80185849209851185L; + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + private Long id; + /** + * 任务id + */ + @ApiModelProperty(value = "任务id") + private String sourceId; +} + diff --git a/src/main/java/com/yingji/entity/Task.java b/page/src/main/java/com/yingji/entity/Task.java similarity index 100% rename from src/main/java/com/yingji/entity/Task.java rename to page/src/main/java/com/yingji/entity/Task.java diff --git a/page/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java b/page/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java new file mode 100644 index 0000000..09826f7 --- /dev/null +++ b/page/src/main/java/com/yingji/entity/dto/request/AlarmFindRequest.java @@ -0,0 +1,87 @@ +package com.yingji.entity.dto.request; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * Alarm查询请求类 + * + * @author wu + * @since 2024/4/30 下午3:59 + */ +@ApiModel(value = "Alarm查询请求类") +@Data +public class AlarmFindRequest implements Serializable { + + + private static final long serialVersionUID = 5773800327954649047L; + /** + * 开始时间 + */ + @ApiModelProperty("开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + /** + * 结束时间 + */ + @ApiModelProperty("结束时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + + /** + * 报警内容 + */ + @ApiModelProperty(value = "报警内容") + private String emergencyEventDesc; + + /** + * 报警地址 + */ + @ApiModelProperty(value = "报警地址") + private String emergencyEventAddress; + + /** + * 手机号 + */ + @ApiModelProperty(value = "报警电话") + private String alarmPhoneNumber; + + /** + * 预警大类 + */ + @ApiModelProperty(value = "预警大类") + private String aiClass; + + /** + * 预警小类 + */ + @ApiModelProperty(value = "预警小类") + private String aiClass2; + + /** + * 紧急程度 + */ + @ApiModelProperty(value = "紧急程度") + private String aiLevel; + + /** + * 紧急系数最小值 + */ + @ApiModelProperty(value = "紧急系数最小值") + private Double aiNumMin; + + /** + * 紧急系数最小值 + */ + @ApiModelProperty(value = "紧急系数最大值") + private Double aiNumMax; +} diff --git a/page/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java b/page/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java new file mode 100644 index 0000000..a48a234 --- /dev/null +++ b/page/src/main/java/com/yingji/entity/dto/request/AlarmRequest.java @@ -0,0 +1,44 @@ +package com.yingji.entity.dto.request; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 110报警请求类 + * + * @author wu + * @since 2024/4/30 下午3:59 + */ +@ApiModel(value = "110报警请求类") +@Data +public class AlarmRequest implements Serializable { + + private static final long serialVersionUID = 7661630897162054093L; + + /** + * 类型(getId / getValue) + */ + @ApiModelProperty(value = "类型(getId / getValue)", required = true) + private String type; + + /** + * 值(时间 / Id) + */ + @ApiModelProperty(value = "值(时间 / Id)", required = true) + private String value; + + /** + * 当前页 + */ + @ApiModelProperty(value = "当前页 默认1") + private Integer pageIndex; + + /** + * 每页显示条数 + */ + @ApiModelProperty(value = "每页显示条数 默认10") + private Integer pageSize; +} diff --git a/page/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java b/page/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java new file mode 100644 index 0000000..80864d9 --- /dev/null +++ b/page/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java @@ -0,0 +1,100 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 事故(Event)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Data +@ApiModel("事故分页查询请求类") +public class EventPageRequest implements Serializable { + + + private static final long serialVersionUID = -5290914853773569936L; + + /** + * 事件标题 + */ + @ApiModelProperty(value = "事件标题") + private String eventName; + /** + * 事件类型 + */ + @ApiModelProperty(value = "事件类型") + private String eventType; + /** + * 事件等级 + */ + @ApiModelProperty(value = "事件等级") + private String eventLevel; + + /** + * 事发开始时间 + */ + @ApiModelProperty(value = "事发开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + /** + * 事发结束时间 + */ + @ApiModelProperty(value = "事发开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + /** + * 事发地区(行政区划) + */ + @ApiModelProperty(value = "事发地区(行政区划)") + private String eventArea; + /** + * 详细位置 + */ + @ApiModelProperty(value = "详细位置") + private String eventAddress; + /** + * 出动次数(出动救护车次/辆数量) + */ + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + @Alias("SendAmbCount") + private Integer sendAmbCount; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @Alias("EventDescribe") + private String eventDescribe; + /** + * 报送单位 + */ + @ApiModelProperty(value = "报送单位") + @Alias("AlarmUnit") + private String alarmUnit; + /** + * 报送单位联系人 + */ + @ApiModelProperty(value = "报送单位联系人") + @Alias("AlarmUnitContactor") + private String alarmUnitContactor; + /** + * 报送单位联系电话 + */ + @ApiModelProperty(value = "报送单位联系电话") + @Alias("AlarmUnitTelephone") + private String alarmUnitTelephone; + +} + diff --git a/page/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java b/page/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java new file mode 100644 index 0000000..7a3882a --- /dev/null +++ b/page/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java @@ -0,0 +1,144 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yingji.entity.AcceptEvents; +import com.yingji.entity.Amb; +import com.yingji.entity.Task; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author wu + * @since 2024/4/30 下午4:24 + */ +@Data +@ApiModel(value = "响应类") +public class EventsFindResponse implements Serializable { + + private static final long serialVersionUID = -3894493286879970663L; + + /** + * 受理调度信息 + */ + @ApiModelProperty(value = "受理调度信息") + private List acceptEvents; + + /** + * 任务车辆 + */ + @ApiModelProperty(value = "任务车辆") + private List ambs; + + /** + * 任务信息 + */ + @ApiModelProperty(value = "任务信息") + private List tasks; + + /** + * 事件编码主键 + */ + @ApiModelProperty(value = "事件编码主键") + @Alias("EventId") + private String eventId; + /** + * 事件标题 + */ + @ApiModelProperty(value = "事件标题") + @Alias("EventName") + private String eventName; + /** + * 事件类型 + */ + @ApiModelProperty(value = "事件类型") + @Alias("EventType") + private String eventType; + /** + * 事件等级 + */ + @ApiModelProperty(value = "事件等级") + @Alias("EventLevel") + private String eventLevel; + /** + * 事发时间 + */ + @ApiModelProperty(value = "事发时间") + @Alias("EventDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime eventDateTime; + /** + * 事发地区(行政区划) + */ + @ApiModelProperty(value = "事发地区(行政区划)") + @Alias("EventArea") + private String eventArea; + /** + * 详细位置 + */ + @ApiModelProperty(value = "详细位置") + @Alias("EventAddress") + private String eventAddress; + /** + * 经度 + */ + @ApiModelProperty(value = "经度") + @Alias("EventLongitude") + private String eventLongitude; + /** + * 维度 + */ + @ApiModelProperty(value = "维度") + @Alias("EventLatitude") + private String eventLatitude; + /** + * 出动次数(出动救护车次/辆数量) + */ + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + @Alias("SendAmbCount") + private Integer sendAmbCount; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @Alias("EventDescribe") + private String eventDescribe; + /** + * 报送单位 + */ + @ApiModelProperty(value = "报送单位") + @Alias("AlarmUnit") + private String alarmUnit; + /** + * 报送单位联系人 + */ + @ApiModelProperty(value = "报送单位联系人") + @Alias("AlarmUnitContactor") + private String alarmUnitContactor; + /** + * 报送单位联系电话 + */ + @ApiModelProperty(value = "报送单位联系电话") + @Alias("AlarmUnitTelephone") + private String alarmUnitTelephone; + /** + * 附件资料 + */ + @ApiModelProperty(value = "附件资料") + @Alias("AttachmentInfo") + private String attachmentInfo; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @Alias("Remark") + private String remark; + +} diff --git a/src/main/java/com/yingji/entity/dto/response/EventsResponse.java b/page/src/main/java/com/yingji/entity/dto/response/EventsResponse.java similarity index 100% rename from src/main/java/com/yingji/entity/dto/response/EventsResponse.java rename to page/src/main/java/com/yingji/entity/dto/response/EventsResponse.java diff --git a/src/main/java/com/yingji/entity/dto/response/TaskInfos.java b/page/src/main/java/com/yingji/entity/dto/response/TaskInfos.java similarity index 100% rename from src/main/java/com/yingji/entity/dto/response/TaskInfos.java rename to page/src/main/java/com/yingji/entity/dto/response/TaskInfos.java diff --git a/page/src/main/java/com/yingji/exception/GlobalExceptionHandler.java b/page/src/main/java/com/yingji/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..59aa9d6 --- /dev/null +++ b/page/src/main/java/com/yingji/exception/GlobalExceptionHandler.java @@ -0,0 +1,94 @@ +package com.yingji.exception; + +import cn.dev33.satoken.exception.NotLoginException; +import com.yingji.base.domain.AjaxResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; + +/** + * 全局异常处理器 + * + * @author wu + */ +@RestControllerAdvice +public class GlobalExceptionHandler { + private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + + /** + * 请求方式不支持 + */ + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, + HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); + return AjaxResult.error(e.getMessage()); + } + + + /** + * 拦截未知的运行时异常 + */ + @ExceptionHandler(RuntimeException.class) + public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生未知异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 系统异常 + */ + @ExceptionHandler(Exception.class) + public AjaxResult handleException(Exception e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public AjaxResult handleBindException(BindException e) { + log.error(e.getMessage(), e); + String message = e.getAllErrors().get(0).getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 登录异常 + */ + @ExceptionHandler(NotLoginException.class) + public AjaxResult handleDemoModeException(NotLoginException e) { + return AjaxResult.error(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(ServiceException.class) + public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { + log.error(e.getMessage(), e); + Integer code = e.getCode(); + return code != null ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); + } +} diff --git a/page/src/main/java/com/yingji/exception/ServiceException.java b/page/src/main/java/com/yingji/exception/ServiceException.java new file mode 100644 index 0000000..4d1e94a --- /dev/null +++ b/page/src/main/java/com/yingji/exception/ServiceException.java @@ -0,0 +1,64 @@ +package com.yingji.exception; + +/** + * 业务异常 + * + * @author ruoyi + */ +public final class ServiceException extends RuntimeException { + private static final long serialVersionUID = 1L; + + /** + * 错误码 + */ + private Integer code; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + *

+ * 和 {@link CommonResult#getDetailMessage()} 一致的设计 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public ServiceException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public String getDetailMessage() { + return detailMessage; + } + + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/com/yingji/mapper/AcceptMapper.java b/page/src/main/java/com/yingji/mapper/AcceptMapper.java similarity index 100% rename from src/main/java/com/yingji/mapper/AcceptMapper.java rename to page/src/main/java/com/yingji/mapper/AcceptMapper.java diff --git a/src/main/java/com/yingji/mapper/AlarmMapper.java b/page/src/main/java/com/yingji/mapper/AlarmMapper.java similarity index 77% rename from src/main/java/com/yingji/mapper/AlarmMapper.java rename to page/src/main/java/com/yingji/mapper/AlarmMapper.java index f82c356..378e0ad 100644 --- a/src/main/java/com/yingji/mapper/AlarmMapper.java +++ b/page/src/main/java/com/yingji/mapper/AlarmMapper.java @@ -6,8 +6,6 @@ import com.yingji.entity.Alarm; import com.yingji.entity.dto.request.AlarmFindRequest; import org.apache.ibatis.annotations.Param; -import java.util.List; - /** * 报警事件(Alarm)表数据库访问层 * @@ -25,12 +23,5 @@ public interface AlarmMapper extends BaseMapper { */ Page page(Page page, @Param("req") AlarmFindRequest req); - /** - * 条件查询数据 - * - * @param req 查询条件 - * @return 数据 - */ - List findAll(@Param("req") AlarmFindRequest req); } diff --git a/src/main/java/com/yingji/mapper/AmbMapper.java b/page/src/main/java/com/yingji/mapper/AmbMapper.java similarity index 100% rename from src/main/java/com/yingji/mapper/AmbMapper.java rename to page/src/main/java/com/yingji/mapper/AmbMapper.java diff --git a/src/main/java/com/yingji/mapper/EventMapper.java b/page/src/main/java/com/yingji/mapper/EventMapper.java similarity index 100% rename from src/main/java/com/yingji/mapper/EventMapper.java rename to page/src/main/java/com/yingji/mapper/EventMapper.java diff --git a/src/main/java/com/yingji/mapper/SourceMapper.java b/page/src/main/java/com/yingji/mapper/SourceMapper.java similarity index 100% rename from src/main/java/com/yingji/mapper/SourceMapper.java rename to page/src/main/java/com/yingji/mapper/SourceMapper.java diff --git a/src/main/java/com/yingji/mapper/TaskMapper.java b/page/src/main/java/com/yingji/mapper/TaskMapper.java similarity index 100% rename from src/main/java/com/yingji/mapper/TaskMapper.java rename to page/src/main/java/com/yingji/mapper/TaskMapper.java diff --git a/page/src/main/java/com/yingji/redis/RedisCache.java b/page/src/main/java/com/yingji/redis/RedisCache.java new file mode 100644 index 0000000..faa2a01 --- /dev/null +++ b/page/src/main/java/com/yingji/redis/RedisCache.java @@ -0,0 +1,248 @@ +package com.yingji.redis; + +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * spring redis 工具类 + * + * @author wu + **/ +@SuppressWarnings(value = {"unchecked", "rawtypes"}) +@Component +public class RedisCache { + + @Resource + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setCacheObject(final String key, final T value) { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) { + redisTemplate.opsForValue().set(key, value, timeout, timeUnit); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout) { + return expire(key, timeout, TimeUnit.SECONDS); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @param unit 时间单位 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout, final TimeUnit unit) { + return redisTemplate.expire(key, timeout, unit); + } + + /** + * 获取有效时间 + * + * @param key Redis键 + * @return 有效时间 + */ + public long getExpire(final String key) { + return redisTemplate.getExpire(key); + } + + /** + * 判断 key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(final String key) { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public boolean deleteObject(final String key) { + return redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + * @return + */ + public boolean deleteObject(final Collection collection) { + return redisTemplate.delete(collection) > 0; + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public long setCacheList(final String key, final List dataList) { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + return count == null ? 0 : count; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(final String key) { + return redisTemplate.opsForList().range(key, 0, -1); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(final String key) { + return redisTemplate.opsForSet().members(key); + } + + /** + * 缓存Map + * + * @param key + * @param dataMap + */ + public void setCacheMap(final String key, final Map dataMap) { + if (dataMap != null) { + redisTemplate.opsForHash().putAll(key, dataMap); + } + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(final String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public void setCacheMapValue(final String key, final String hKey, final T value) { + redisTemplate.opsForHash().put(key, hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public T getCacheMapValue(final String key, final String hKey) { + HashOperations opsForHash = redisTemplate.opsForHash(); + return opsForHash.get(key, hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public List getMultiCacheMapValue(final String key, final Collection hKeys) { + return redisTemplate.opsForHash().multiGet(key, hKeys); + } + + /** + * 删除Hash中的某条数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return 是否成功 + */ + public boolean deleteCacheMapValue(final String key, final String hKey) { + return redisTemplate.opsForHash().delete(key, hKey) > 0; + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(final String pattern) { + return redisTemplate.keys(pattern); + } +} diff --git a/src/main/java/com/yingji/service/AcceptService.java b/page/src/main/java/com/yingji/service/AcceptService.java similarity index 100% rename from src/main/java/com/yingji/service/AcceptService.java rename to page/src/main/java/com/yingji/service/AcceptService.java diff --git a/src/main/java/com/yingji/service/AccidentService.java b/page/src/main/java/com/yingji/service/AccidentService.java similarity index 100% rename from src/main/java/com/yingji/service/AccidentService.java rename to page/src/main/java/com/yingji/service/AccidentService.java diff --git a/src/main/java/com/yingji/service/AlarmService.java b/page/src/main/java/com/yingji/service/AlarmService.java similarity index 89% rename from src/main/java/com/yingji/service/AlarmService.java rename to page/src/main/java/com/yingji/service/AlarmService.java index df06676..72cdde6 100644 --- a/src/main/java/com/yingji/service/AlarmService.java +++ b/page/src/main/java/com/yingji/service/AlarmService.java @@ -59,12 +59,5 @@ public interface AlarmService extends IService { */ Page page(Page page, AlarmFindRequest req); - /** - * 条件查询数据 - * - * @param req 查询条件 - * @return 数据 - */ - List findAll(AlarmFindRequest req); } diff --git a/src/main/java/com/yingji/service/AmbService.java b/page/src/main/java/com/yingji/service/AmbService.java similarity index 100% rename from src/main/java/com/yingji/service/AmbService.java rename to page/src/main/java/com/yingji/service/AmbService.java diff --git a/page/src/main/java/com/yingji/service/EventService.java b/page/src/main/java/com/yingji/service/EventService.java new file mode 100644 index 0000000..a21a4fe --- /dev/null +++ b/page/src/main/java/com/yingji/service/EventService.java @@ -0,0 +1,36 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Event; +import com.yingji.entity.dto.response.EventPageRequest; +import com.yingji.entity.dto.response.EventsFindResponse; + +import java.io.Serializable; + +/** + * 事故(Event)表服务接口 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +public interface EventService extends IService { + + /** + * 分页条件查询数据 + * + * @param page 分页条件 + * @param event 查询条件 + * @return 数据 + */ + Page page(Page page, EventPageRequest event); + + /** + * 根据id查询数据 + * + * @param id id + * @return 数据 + */ + EventsFindResponse findById(Serializable id); +} + diff --git a/src/main/java/com/yingji/service/SourceService.java b/page/src/main/java/com/yingji/service/SourceService.java similarity index 100% rename from src/main/java/com/yingji/service/SourceService.java rename to page/src/main/java/com/yingji/service/SourceService.java diff --git a/src/main/java/com/yingji/service/TaskService.java b/page/src/main/java/com/yingji/service/TaskService.java similarity index 100% rename from src/main/java/com/yingji/service/TaskService.java rename to page/src/main/java/com/yingji/service/TaskService.java diff --git a/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java b/page/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java similarity index 100% rename from src/main/java/com/yingji/service/impl/AcceptServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java diff --git a/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java b/page/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java similarity index 100% rename from src/main/java/com/yingji/service/impl/AccidentServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java diff --git a/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java b/page/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java similarity index 91% rename from src/main/java/com/yingji/service/impl/AlarmServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java index 2153d2d..beacc6a 100644 --- a/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java +++ b/page/src/main/java/com/yingji/service/impl/AlarmServiceImpl.java @@ -126,21 +126,6 @@ public class AlarmServiceImpl extends ServiceImpl implements } } - public static void main(String[] args) { - LocalDateTime dateTime1 = LocalDateTime.of(2022, 1, 1, 12, 0, 0); - LocalDateTime dateTime2 = LocalDateTime.of(2022, 1, 1, 14, 0, 0); - - int comparisonResult = dateTime1.compareTo(dateTime2); - - if (comparisonResult < 0) { - System.out.println("dateTime1 在 dateTime2 之前"); - } else if (comparisonResult > 0) { - System.out.println("dateTime1 在 dateTime2 之后"); - } else { - System.out.println("dateTime1 和 dateTime2 相等"); - } - } - /** * 查询数据Id * @@ -240,15 +225,6 @@ public class AlarmServiceImpl extends ServiceImpl implements return baseMapper.page(page, req); } - /** - * 条件查询数据 - * - * @param req 查询条件 - * @return 数据 - */ - @Override - public List findAll(AlarmFindRequest req) { - return baseMapper.findAll(req); - } + } diff --git a/src/main/java/com/yingji/service/impl/AmbServiceImpl.java b/page/src/main/java/com/yingji/service/impl/AmbServiceImpl.java similarity index 100% rename from src/main/java/com/yingji/service/impl/AmbServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/AmbServiceImpl.java diff --git a/page/src/main/java/com/yingji/service/impl/EventServiceImpl.java b/page/src/main/java/com/yingji/service/impl/EventServiceImpl.java new file mode 100644 index 0000000..d724799 --- /dev/null +++ b/page/src/main/java/com/yingji/service/impl/EventServiceImpl.java @@ -0,0 +1,108 @@ +package com.yingji.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.AcceptEvents; +import com.yingji.entity.Amb; +import com.yingji.entity.Event; +import com.yingji.entity.Task; +import com.yingji.entity.dto.response.EventPageRequest; +import com.yingji.entity.dto.response.EventsFindResponse; +import com.yingji.exception.ServiceException; +import com.yingji.mapper.EventMapper; +import com.yingji.service.AcceptService; +import com.yingji.service.AmbService; +import com.yingji.service.EventService; +import com.yingji.service.TaskService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 事故(Event)表服务实现类 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +@Service("eventService") +public class EventServiceImpl extends ServiceImpl implements EventService { + + @Resource + private TaskService taskService; + + @Resource + private AmbService ambService; + + @Resource + private AcceptService acceptService; + + /** + * 分页条件查询数据 + * + * @param page 分页条件 + * @param event 查询条件 + * @return 数据 + */ + @Override + public Page page(Page page, EventPageRequest event) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.ne("event_type", "转院") + .like(StrUtil.isNotEmpty(event.getEventName()), "event_name", event.getEventName()) + .eq(StrUtil.isNotEmpty(event.getEventType()), "event_type", event.getEventType()) + .eq(StrUtil.isNotEmpty(event.getEventLevel()), "event_level", event.getEventLevel()) + .ge(event.getStartTime() != null, "event_date_time", event.getStartTime()) + .le(event.getEndTime() != null, "event_date_time", event.getEndTime()) + .like(StrUtil.isNotEmpty(event.getEventArea()), "event_area", event.getEventArea()) + .like(StrUtil.isNotEmpty(event.getEventAddress()), "event_address", event.getEventAddress()) + .eq(event.getSendAmbCount() != null, "send_amb_count", event.getSendAmbCount()) + .like(StrUtil.isNotEmpty(event.getEventDescribe()), "event_describe", event.getEventDescribe()) + .like(StrUtil.isNotEmpty(event.getAlarmUnit()), "alarm_unit", event.getAlarmUnit()) + .like(StrUtil.isNotEmpty(event.getAlarmUnitContactor()), "alarm_unit_contactor", event.getAlarmUnitContactor()) + .like(StrUtil.isNotEmpty(event.getAlarmUnitTelephone()), "alarm_unit_telephone", event.getAlarmUnitTelephone()); + return this.page(page, wrapper); + } + + /** + * 根据id查询数据 + * + * @param id id + * @return 数据 + */ + @Override + public EventsFindResponse findById(Serializable id) { + Event event = this.getById(id); + if (BeanUtil.isEmpty(event)) { + throw new ServiceException("所选数据不存在"); + } + EventsFindResponse res = BeanUtil.copyProperties(event, EventsFindResponse.class); + // 查询任务信息 + QueryWrapper taskWrapper = new QueryWrapper<>(); + taskWrapper.eq("event_id", res.getEventId()); + List taskList = taskService.list(taskWrapper); + // 受理调度信息 + QueryWrapper acceptWrapper = new QueryWrapper<>(); + acceptWrapper.eq("event_id", res.getEventId()); + List acceptList = acceptService.list(acceptWrapper); + // 任务车辆 + List taskIdList = taskList.stream().map(Task::getTaskId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskIdList)) { + QueryWrapper ambWrapper = new QueryWrapper<>(); + ambWrapper.in("task_id", taskIdList); + List ambList = ambService.list(ambWrapper); + res.setAmbs(ambList); + } + res.setAcceptEvents(acceptList); + res.setTasks(taskList); + return res; + } + + +} + diff --git a/src/main/java/com/yingji/service/impl/SourceServiceImpl.java b/page/src/main/java/com/yingji/service/impl/SourceServiceImpl.java similarity index 100% rename from src/main/java/com/yingji/service/impl/SourceServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/SourceServiceImpl.java diff --git a/src/main/java/com/yingji/service/impl/TaskServiceImpl.java b/page/src/main/java/com/yingji/service/impl/TaskServiceImpl.java similarity index 100% rename from src/main/java/com/yingji/service/impl/TaskServiceImpl.java rename to page/src/main/java/com/yingji/service/impl/TaskServiceImpl.java diff --git a/page/src/main/resources/application-dev.yml b/page/src/main/resources/application-dev.yml new file mode 100644 index 0000000..287eb22 --- /dev/null +++ b/page/src/main/resources/application-dev.yml @@ -0,0 +1,50 @@ +# DataSource Config +spring: + datasource: + url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: 123456 + driverClassName: com.mysql.cj.jdbc.Driver + + + +# 日志配置 +logging: + level: + com.yingji: debug + org.springframework: warn + +# MyBatis配置 +mybatis-plus: + # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类 + typeAliasesPackage: com.yingji.entity + # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口 + mapperLocations: classpath*:mapper/yingji/*Mapper.xml + +knife4j: + enable: true +# openapi: +# group: +# test1: +# group-name: 应急算法 + +# 110获取token +getToken: http://2.46.4.198:8008/token + +# 110获取数据 +specificWarn: http://2.46.4.198:8008/rs/k4r3h/DataAnalysisService/sz/share/specificWarn + +# 110clientId +clientId: BNjP9S8p2EJZyt1UF+D6kCsK6ZVapyKqiGzarEdsZ3QmIWoVdB7YkrX2GBAmCDO16tQ/ak86pZgP5ZS3s4EGdco= + +# 110clientSecret +clientSecret: AM4oMOsJj0ULAUOOXlz5xHjIF4kp9W63ajZrXxTGLHEn + +# 120获取token授权码 +getAuthorizeValidateUrl: http://192.180.22.214:7015/api/Authorize/validate/v1 + +# 120获取token +getAuthorizeTokenUrl: http://192.180.22.214:7015/api/Authorize/token/get/v1 + +# 120获取数据 +getAccidentUrl: http://192.180.22.214:7015/api/Event/accident/list/get/v2 diff --git a/src/main/resources/application.yml b/page/src/main/resources/application.yml similarity index 100% rename from src/main/resources/application.yml rename to page/src/main/resources/application.yml diff --git a/page/src/main/resources/logback.xml b/page/src/main/resources/logback.xml new file mode 100644 index 0000000..675a6ba --- /dev/null +++ b/page/src/main/resources/logback.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/page/src/main/resources/mapper/yingji/AlarmMapper.xml b/page/src/main/resources/mapper/yingji/AlarmMapper.xml new file mode 100644 index 0000000..7224616 --- /dev/null +++ b/page/src/main/resources/mapper/yingji/AlarmMapper.xml @@ -0,0 +1,48 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/yingji/SourceMapper.xml b/page/src/main/resources/mapper/yingji/SourceMapper.xml similarity index 100% rename from src/main/resources/mapper/yingji/SourceMapper.xml rename to page/src/main/resources/mapper/yingji/SourceMapper.xml diff --git a/pom.xml b/pom.xml index 0350035..b3daa0e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,8 +5,14 @@ com.yingji yingjiAlgorithms 0.0.1-SNAPSHOT + pom yingjiAlgorithms 应急算法 + + alarm + rescue + page + 1.8 UTF-8 diff --git a/rescue/pom.xml b/rescue/pom.xml new file mode 100644 index 0000000..a5603e7 --- /dev/null +++ b/rescue/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + com.yingji + yingjiAlgorithms + 0.0.1-SNAPSHOT + + + rescue + + + 8 + 8 + UTF-8 + + + + + rescue + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + com.yingji.RescueApplication + + + + repackage + + repackage + + + + + + + \ No newline at end of file diff --git a/rescue/src/main/java/com/yingji/RescueApplication.java b/rescue/src/main/java/com/yingji/RescueApplication.java new file mode 100644 index 0000000..f599c33 --- /dev/null +++ b/rescue/src/main/java/com/yingji/RescueApplication.java @@ -0,0 +1,23 @@ +package com.yingji; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +/** + * @author wu + * @since 2024/2/26 10:24 + */ + +@SpringBootApplication +@MapperScan("com.yingji.mapper") +@EnableAsync +@EnableScheduling +public class RescueApplication { + public static void main(String[] args) { + SpringApplication.run(RescueApplication.class, args); + + } +} \ No newline at end of file diff --git a/rescue/src/main/java/com/yingji/base/constant/HttpStatus.java b/rescue/src/main/java/com/yingji/base/constant/HttpStatus.java new file mode 100644 index 0000000..1d2ac09 --- /dev/null +++ b/rescue/src/main/java/com/yingji/base/constant/HttpStatus.java @@ -0,0 +1,93 @@ +package com.yingji.base.constant; + +/** + * 返回状态码 + * + * @author ruoyi + */ +public class HttpStatus { + /** + * 操作成功 + */ + public static final int SUCCESS = 200; + + /** + * 对象创建成功 + */ + public static final int CREATED = 201; + + /** + * 请求已经被接受 + */ + public static final int ACCEPTED = 202; + + /** + * 操作已经执行成功,但是没有返回数据 + */ + public static final int NO_CONTENT = 204; + + /** + * 资源已被移除 + */ + public static final int MOVED_PERM = 301; + + /** + * 重定向 + */ + public static final int SEE_OTHER = 303; + + /** + * 资源没有被修改 + */ + public static final int NOT_MODIFIED = 304; + + /** + * 参数列表错误(缺少,格式不匹配) + */ + public static final int BAD_REQUEST = 400; + + /** + * 未授权 + */ + public static final int UNAUTHORIZED = 401; + + /** + * 访问受限,授权过期 + */ + public static final int FORBIDDEN = 403; + + /** + * 资源,服务未找到 + */ + public static final int NOT_FOUND = 404; + + /** + * 不允许的http方法 + */ + public static final int BAD_METHOD = 405; + + /** + * 资源冲突,或者资源被锁 + */ + public static final int CONFLICT = 409; + + /** + * 不支持的数据,媒体类型 + */ + public static final int UNSUPPORTED_TYPE = 415; + + /** + * 系统内部错误 + */ + public static final int ERROR = 500; + + /** + * 接口未实现 + */ + public static final int NOT_IMPLEMENTED = 501; + + /** + * 系统警告消息 + */ + public static final int WARN = 601; +} diff --git a/rescue/src/main/java/com/yingji/base/controller/BaseController.java b/rescue/src/main/java/com/yingji/base/controller/BaseController.java new file mode 100644 index 0000000..6af991b --- /dev/null +++ b/rescue/src/main/java/com/yingji/base/controller/BaseController.java @@ -0,0 +1,78 @@ +package com.yingji.base.controller; + +import com.yingji.base.domain.AjaxResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * web层通用数据处理 + * + * @author ruoyi + */ +public class BaseController { + protected final Logger logger = LoggerFactory.getLogger(this.getClass()); + + + /** + * 返回成功 + */ + public AjaxResult success() { + return AjaxResult.success(); + } + + /** + * 返回失败消息 + */ + public AjaxResult error() { + return AjaxResult.error(); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(String message) { + return AjaxResult.success(message); + } + + /** + * 返回成功消息 + */ + public AjaxResult success(Object data) { + return AjaxResult.success(data); + } + + /** + * 返回失败消息 + */ + public AjaxResult error(String message) { + return AjaxResult.error(message); + } + + /** + * 返回警告消息 + */ + public AjaxResult warn(String message) { + return AjaxResult.warn(message); + } + + /** + * 响应返回结果 + * + * @param rows 影响行数 + * @return 操作结果 + */ + protected AjaxResult toAjax(int rows) { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + + /** + * 响应返回结果 + * + * @param result 结果 + * @return 操作结果 + */ + protected AjaxResult toAjax(boolean result) { + return result ? success() : error(); + } + +} diff --git a/rescue/src/main/java/com/yingji/base/domain/AjaxResult.java b/rescue/src/main/java/com/yingji/base/domain/AjaxResult.java new file mode 100644 index 0000000..06fb8a0 --- /dev/null +++ b/rescue/src/main/java/com/yingji/base/domain/AjaxResult.java @@ -0,0 +1,202 @@ +package com.yingji.base.domain; + + +import cn.hutool.core.bean.BeanUtil; +import com.yingji.base.constant.HttpStatus; + +import java.util.HashMap; +import java.util.Objects; + +/** + * 操作消息提醒 + * + * @author ruoyi + */ +public class AjaxResult extends HashMap { + /** + * 状态码 + */ + public static final String CODE_TAG = "code"; + /** + * 返回内容 + */ + public static final String MSG_TAG = "msg"; + /** + * 数据对象 + */ + public static final String DATA_TAG = "data"; + private static final long serialVersionUID = 1L; + + /** + * 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。 + */ + public AjaxResult() { + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + */ + public AjaxResult(int code, String msg) { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + } + + /** + * 初始化一个新创建的 AjaxResult 对象 + * + * @param code 状态码 + * @param msg 返回内容 + * @param data 数据对象 + */ + public AjaxResult(int code, String msg, Object data) { + super.put(CODE_TAG, code); + super.put(MSG_TAG, msg); + if (BeanUtil.isNotEmpty(data)) { + super.put(DATA_TAG, data); + } + } + + /** + * 返回成功消息 + * + * @return 成功消息 + */ + public static AjaxResult success() { + return AjaxResult.success("操作成功"); + } + + /** + * 返回成功数据 + * + * @return 成功消息 + */ + public static AjaxResult success(Object data) { + return AjaxResult.success("操作成功", data); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @return 成功消息 + */ + public static AjaxResult success(String msg) { + return AjaxResult.success(msg, null); + } + + /** + * 返回成功消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 成功消息 + */ + public static AjaxResult success(String msg, Object data) { + return new AjaxResult(HttpStatus.SUCCESS, msg, data); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @return 警告消息 + */ + public static AjaxResult warn(String msg) { + return AjaxResult.warn(msg, null); + } + + /** + * 返回警告消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 警告消息 + */ + public static AjaxResult warn(String msg, Object data) { + return new AjaxResult(HttpStatus.WARN, msg, data); + } + + /** + * 返回错误消息 + * + * @return 错误消息 + */ + public static AjaxResult error() { + return AjaxResult.error("操作失败"); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(String msg) { + return AjaxResult.error(msg, null); + } + + /** + * 返回错误消息 + * + * @param msg 返回内容 + * @param data 数据对象 + * @return 错误消息 + */ + public static AjaxResult error(String msg, Object data) { + return new AjaxResult(HttpStatus.ERROR, msg, data); + } + + /** + * 返回错误消息 + * + * @param code 状态码 + * @param msg 返回内容 + * @return 错误消息 + */ + public static AjaxResult error(int code, String msg) { + return new AjaxResult(code, msg, null); + } + + /** + * 是否为成功消息 + * + * @return 结果 + */ + public boolean isSuccess() { + return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG)); + } + + /** + * 是否为警告消息 + * + * @return 结果 + */ + public boolean isWarn() { + return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG)); + } + + /** + * 是否为错误消息 + * + * @return 结果 + */ + public boolean isError() { + return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG)); + } + + /** + * 方便链式调用 + * + * @param key 键 + * @param value 值 + * @return 数据对象 + */ + @Override + public AjaxResult put(String key, Object value) { + super.put(key, value); + return this; + } +} diff --git a/rescue/src/main/java/com/yingji/config/MybatisPlusConfig.java b/rescue/src/main/java/com/yingji/config/MybatisPlusConfig.java new file mode 100644 index 0000000..5943191 --- /dev/null +++ b/rescue/src/main/java/com/yingji/config/MybatisPlusConfig.java @@ -0,0 +1,26 @@ +package com.yingji.config; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author wu + * @since 2024/2/26 11:28 + */ +@Configuration +public class MybatisPlusConfig { + + /** + * 添加分页插件 + */ + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));//如果配置多个插件,切记分页最后添加 + //interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 如果有多数据源可以不配具体类型 否则都建议配上具体的DbType + return interceptor; + } +} diff --git a/rescue/src/main/java/com/yingji/config/SwaggerConfig.java b/rescue/src/main/java/com/yingji/config/SwaggerConfig.java new file mode 100644 index 0000000..e33e2f6 --- /dev/null +++ b/rescue/src/main/java/com/yingji/config/SwaggerConfig.java @@ -0,0 +1,74 @@ +package com.yingji.config; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; + +/** + * Swagger2的接口配置 + * + * @author ruoyi + */ +@Configuration +@EnableSwagger2WebMvc +public class SwaggerConfig { + + + /** + * 是否开启swagger + */ + @Value("${knife4j.enable}") + private boolean enabled; + + /** + * 创建API + */ + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + // 是否启用Swagger + .enable(enabled) + //分组名称 + .groupName("应急算法") + // 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息) + .apiInfo(apiInfo()) + // 设置哪些接口暴露给Swagger展示 + .select() + // 扫描所有有注解的api,用这种方式更灵活 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + // 扫描指定包中的swagger注解 + // .apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger")) + // 扫描所有 .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build() +// .pathMapping(pathMapping) + // 排除mybatis-plus的分页参数 + .ignoredParameterTypes(Page.class, IPage.class); + } + + + /** + * 添加摘要信息 + */ + private ApiInfo apiInfo() { + // 用ApiInfoBuilder进行定制 + return new ApiInfoBuilder() + // 设置标题 + .title("应急算法") + // 描述 + .description("描述:用于应急算法") + // 版本 + .version("版本号:" + 1) + .build(); + } +} diff --git a/rescue/src/main/java/com/yingji/entity/AcceptEvents.java b/rescue/src/main/java/com/yingji/entity/AcceptEvents.java new file mode 100644 index 0000000..57ba52f --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/AcceptEvents.java @@ -0,0 +1,140 @@ +package com.yingji.entity; + +import cn.hutool.core.annotation.Alias; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 受理调度信息(Accept)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Data +@ApiModel("受理调度信息实体类") +@TableName(value = "accept") +public class AcceptEvents implements Serializable { + + private static final long serialVersionUID = 817570017991202657L; + /** + * 受理编码 主键 + */ + @ApiModelProperty(value = "受理编码 主键") + @Alias("AcceptId") + @TableId + private String acceptId; + /** + * 呼救电话 + */ + @ApiModelProperty(value = "呼救电话") + @Alias("AlarmTelephone") + private String alarmTelephone; + /** + * 病种判断 + */ + @ApiModelProperty(value = "病种判断") + @Alias("DiseaseJudge") + private String diseaseJudge; + /** + * 患者姓名 + */ + @ApiModelProperty(value = "患者姓名") + @Alias("PatientName") + private String patientName; + /** + * 患者性别 + */ + @ApiModelProperty(value = "患者性别") + @Alias("PatientSex") + private String patientSex; + /** + * 患者年龄 + */ + @ApiModelProperty(value = "患者年龄") + @Alias("PatientAge") + private String patientAge; + /** + * 受理类型 + */ + @ApiModelProperty(value = "受理类型") + @Alias("AcceptType") + private String acceptType; + /** + * 责任受理人 + */ + @ApiModelProperty(value = "责任受理人") + @Alias("ResponsibleRecipient") + private String responsibleRecipient; + /** + * 现场地址 + */ + @ApiModelProperty(value = "现场地址") + @Alias("EventAddress") + private String eventAddress; + /** + * 等车地点 + */ + @ApiModelProperty(value = "等车地点") + @Alias("WaitAddress") + private String waitAddress; + /** + * 送往地点 + */ + @ApiModelProperty(value = "送往地点") + @Alias("SendAddress") + private String sendAddress; + /** + * 电话振铃时刻 + */ + @ApiModelProperty(value = "电话振铃时刻") + @Alias("RingDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime ringDateTime; + /** + * 开始受理时刻 + */ + @ApiModelProperty(value = "开始受理时刻") + @Alias("StartAcceptDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startAcceptDateTime; + /** + * 结束受理时刻 + */ + @ApiModelProperty(value = "结束受理时刻") + @Alias("EndAcceptDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endAcceptDateTime; + /** + * 发送指令时刻 + */ + @ApiModelProperty(value = "发送指令时刻") + @Alias("SendOrderDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime sendOrderDateTime; + /** + * 事件编码 + */ + @ApiModelProperty(value = "事件编码") + @Alias("EventId") + private String eventId; + /** + * 受理序号 + */ + @ApiModelProperty(value = "受理序号") + @Alias("AcceptOrder") + private String acceptOrder; +} + diff --git a/rescue/src/main/java/com/yingji/entity/Amb.java b/rescue/src/main/java/com/yingji/entity/Amb.java new file mode 100644 index 0000000..8889f00 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/Amb.java @@ -0,0 +1,75 @@ +package com.yingji.entity; + + +import cn.hutool.core.annotation.Alias; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 任务车辆(Amb)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Data +@ApiModel("任务车辆实体类") +@TableName(value = "amb") +public class Amb implements Serializable { + + private static final long serialVersionUID = -69012811106234254L; + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + @TableId(type = IdType.AUTO) + private Long id; + /** + * 任务id + */ + @ApiModelProperty(value = "任务id") + private String taskId; + /** + * 车牌号码 + */ + @ApiModelProperty(value = "车牌号码") + @Alias("PlateNumber") + private String plateNumber; + /** + * 实际标识 + */ + @ApiModelProperty(value = "实际标识") + @Alias("RealSign") + private String realSign; + /** + * 车辆编码 + */ + @ApiModelProperty(value = "车辆编码") + @Alias("AmbCode") + private String ambCode; + /** + * 分站 + */ + @ApiModelProperty(value = "分站") + @Alias("StationName") + private String stationName; + /** + * 车辆类型 + */ + @ApiModelProperty(value = "车辆类型") + @Alias("AmbType") + private String ambType; + /** + * 随车电话 + */ + @ApiModelProperty(value = "随车电话") + @Alias("AmbPhone") + private String ambPhone; +} + diff --git a/rescue/src/main/java/com/yingji/entity/Event.java b/rescue/src/main/java/com/yingji/entity/Event.java new file mode 100644 index 0000000..73acd90 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/Event.java @@ -0,0 +1,128 @@ +package com.yingji.entity; + +import cn.hutool.core.annotation.Alias; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 事故(Event)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Data +@ApiModel("事故实体类") +@TableName(value = "event") +public class Event implements Serializable { + + private static final long serialVersionUID = -50765468921159766L; + /** + * 事件编码主键 + */ + @ApiModelProperty(value = "事件编码主键") + @Alias("EventId") + @TableId + private String eventId; + /** + * 事件标题 + */ + @ApiModelProperty(value = "事件标题") + @Alias("EventName") + private String eventName; + /** + * 事件类型 + */ + @ApiModelProperty(value = "事件类型") + @Alias("EventType") + private String eventType; + /** + * 事件等级 + */ + @ApiModelProperty(value = "事件等级") + @Alias("EventLevel") + private String eventLevel; + /** + * 事发时间 + */ + @ApiModelProperty(value = "事发时间") + @Alias("EventDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime eventDateTime; + /** + * 事发地区(行政区划) + */ + @ApiModelProperty(value = "事发地区(行政区划)") + @Alias("EventArea") + private String eventArea; + /** + * 详细位置 + */ + @ApiModelProperty(value = "详细位置") + @Alias("EventAddress") + private String eventAddress; + /** + * 经度 + */ + @ApiModelProperty(value = "经度") + @Alias("EventLongitude") + private String eventLongitude; + /** + * 维度 + */ + @ApiModelProperty(value = "维度") + @Alias("EventLatitude") + private String eventLatitude; + /** + * 出动次数(出动救护车次/辆数量) + */ + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + @Alias("SendAmbCount") + private Integer sendAmbCount; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @Alias("EventDescribe") + private String eventDescribe; + /** + * 报送单位 + */ + @ApiModelProperty(value = "报送单位") + @Alias("AlarmUnit") + private String alarmUnit; + /** + * 报送单位联系人 + */ + @ApiModelProperty(value = "报送单位联系人") + @Alias("AlarmUnitContactor") + private String alarmUnitContactor; + /** + * 报送单位联系电话 + */ + @ApiModelProperty(value = "报送单位联系电话") + @Alias("AlarmUnitTelephone") + private String alarmUnitTelephone; + /** + * 附件资料 + */ + @ApiModelProperty(value = "附件资料") + @Alias("AttachmentInfo") + private String attachmentInfo; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @Alias("Remark") + private String remark; +} + diff --git a/rescue/src/main/java/com/yingji/entity/Task.java b/rescue/src/main/java/com/yingji/entity/Task.java new file mode 100644 index 0000000..7d0d711 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/Task.java @@ -0,0 +1,172 @@ +package com.yingji.entity; + +import cn.hutool.core.annotation.Alias; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 任务信息(Task)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +@Data +@ApiModel("任务信息实体类") +@TableName(value = "task") +public class Task implements Serializable { + + private static final long serialVersionUID = 148870996673219596L; + /** + * 主键id + */ + @ApiModelProperty(value = "主键id") + @Alias("TaskId") + @TableId + private String taskId; + /** + * 是否结束 + */ + @ApiModelProperty(value = "是否结束") + @Alias("IsOver") + private Boolean isOver; + /** + * 送往地点 + */ + @ApiModelProperty(value = "送往地点") + @Alias("RealSendAddress") + private String realSendAddress; + /** + * 生成任务时刻 + */ + @ApiModelProperty(value = "生成任务时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("TaskCreatedDateTime") + private LocalDateTime taskCreatedDateTime; + /** + * 接受命令时刻 + */ + @ApiModelProperty(value = "接受命令时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("AcceptOrderDateTime") + private LocalDateTime acceptOrderDateTime; + /** + * 出车时间 + */ + @ApiModelProperty(value = "出车时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("OutAmbDateTime") + private LocalDateTime outAmbDateTime; + /** + * 到达现场时刻 + */ + @ApiModelProperty(value = "到达现场时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("ArriveSceneDateTime") + private LocalDateTime arriveSceneDateTime; + /** + * 离开现场时刻 + */ + @ApiModelProperty(value = "离开现场时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("LeaveSceneDateTime") + private LocalDateTime leaveSceneDateTime; + /** + * 到达医院时刻 + */ + @ApiModelProperty(value = "到达医院时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("ArriveHospitalDateTime") + private LocalDateTime arriveHospitalDateTime; + /** + * 完成任务时刻 + */ + @ApiModelProperty(value = "完成任务时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("ComplatedDateTime") + private LocalDateTime complatedDateTime; + /** + * 返回站中时刻 + */ + @ApiModelProperty(value = "返回站中时刻") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Alias("ReturnStationDateTime") + private LocalDateTime returnStationDateTime; + /** + * 是否正常结束 + */ + @ApiModelProperty(value = "是否正常结束") + @Alias("IsNormalOver") + private Boolean isNormalOver; + /** + * 异常原因 + */ + @ApiModelProperty(value = "异常原因") + @Alias("AbnormalReason") + private String abnormalReason; + /** + * 司机 + */ + @ApiModelProperty(value = "司机") + @Alias("Driver") + private String driver; + /** + * 医生 + */ + @ApiModelProperty(value = "医生") + @Alias("Doctor") + private String doctor; + /** + * 担架工 + */ + @ApiModelProperty(value = "担架工") + @Alias("Stretcher") + private String stretcher; + /** + * 担架工 + */ + @ApiModelProperty(value = "担架工") + @Alias("Nurse") + private String nurse; + /** + * 出车分站 + */ + @ApiModelProperty(value = "出车分站") + @Alias("StationName") + private String stationName; + /** + * 受理序号 + */ + @ApiModelProperty(value = "受理序号") + @Alias("AcceptOrder") + private String acceptOrder; + /** + * 受理编码 + */ + @ApiModelProperty(value = "受理编码") + @Alias("AcceptId") + private String acceptId; + /** + * 事件编码 + */ + @ApiModelProperty(value = "事件编码") + @Alias("EventId") + private String eventId; +} + diff --git a/rescue/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java b/rescue/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java new file mode 100644 index 0000000..80864d9 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/dto/response/EventPageRequest.java @@ -0,0 +1,100 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + + +/** + * 事故(Event)表实体类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Data +@ApiModel("事故分页查询请求类") +public class EventPageRequest implements Serializable { + + + private static final long serialVersionUID = -5290914853773569936L; + + /** + * 事件标题 + */ + @ApiModelProperty(value = "事件标题") + private String eventName; + /** + * 事件类型 + */ + @ApiModelProperty(value = "事件类型") + private String eventType; + /** + * 事件等级 + */ + @ApiModelProperty(value = "事件等级") + private String eventLevel; + + /** + * 事发开始时间 + */ + @ApiModelProperty(value = "事发开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; + + /** + * 事发结束时间 + */ + @ApiModelProperty(value = "事发开始时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; + /** + * 事发地区(行政区划) + */ + @ApiModelProperty(value = "事发地区(行政区划)") + private String eventArea; + /** + * 详细位置 + */ + @ApiModelProperty(value = "详细位置") + private String eventAddress; + /** + * 出动次数(出动救护车次/辆数量) + */ + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + @Alias("SendAmbCount") + private Integer sendAmbCount; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @Alias("EventDescribe") + private String eventDescribe; + /** + * 报送单位 + */ + @ApiModelProperty(value = "报送单位") + @Alias("AlarmUnit") + private String alarmUnit; + /** + * 报送单位联系人 + */ + @ApiModelProperty(value = "报送单位联系人") + @Alias("AlarmUnitContactor") + private String alarmUnitContactor; + /** + * 报送单位联系电话 + */ + @ApiModelProperty(value = "报送单位联系电话") + @Alias("AlarmUnitTelephone") + private String alarmUnitTelephone; + +} + diff --git a/rescue/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java b/rescue/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java new file mode 100644 index 0000000..7a3882a --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/dto/response/EventsFindResponse.java @@ -0,0 +1,144 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yingji.entity.AcceptEvents; +import com.yingji.entity.Amb; +import com.yingji.entity.Task; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author wu + * @since 2024/4/30 下午4:24 + */ +@Data +@ApiModel(value = "响应类") +public class EventsFindResponse implements Serializable { + + private static final long serialVersionUID = -3894493286879970663L; + + /** + * 受理调度信息 + */ + @ApiModelProperty(value = "受理调度信息") + private List acceptEvents; + + /** + * 任务车辆 + */ + @ApiModelProperty(value = "任务车辆") + private List ambs; + + /** + * 任务信息 + */ + @ApiModelProperty(value = "任务信息") + private List tasks; + + /** + * 事件编码主键 + */ + @ApiModelProperty(value = "事件编码主键") + @Alias("EventId") + private String eventId; + /** + * 事件标题 + */ + @ApiModelProperty(value = "事件标题") + @Alias("EventName") + private String eventName; + /** + * 事件类型 + */ + @ApiModelProperty(value = "事件类型") + @Alias("EventType") + private String eventType; + /** + * 事件等级 + */ + @ApiModelProperty(value = "事件等级") + @Alias("EventLevel") + private String eventLevel; + /** + * 事发时间 + */ + @ApiModelProperty(value = "事发时间") + @Alias("EventDateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime eventDateTime; + /** + * 事发地区(行政区划) + */ + @ApiModelProperty(value = "事发地区(行政区划)") + @Alias("EventArea") + private String eventArea; + /** + * 详细位置 + */ + @ApiModelProperty(value = "详细位置") + @Alias("EventAddress") + private String eventAddress; + /** + * 经度 + */ + @ApiModelProperty(value = "经度") + @Alias("EventLongitude") + private String eventLongitude; + /** + * 维度 + */ + @ApiModelProperty(value = "维度") + @Alias("EventLatitude") + private String eventLatitude; + /** + * 出动次数(出动救护车次/辆数量) + */ + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + @Alias("SendAmbCount") + private Integer sendAmbCount; + /** + * 事件描述 + */ + @ApiModelProperty(value = "事件描述") + @Alias("EventDescribe") + private String eventDescribe; + /** + * 报送单位 + */ + @ApiModelProperty(value = "报送单位") + @Alias("AlarmUnit") + private String alarmUnit; + /** + * 报送单位联系人 + */ + @ApiModelProperty(value = "报送单位联系人") + @Alias("AlarmUnitContactor") + private String alarmUnitContactor; + /** + * 报送单位联系电话 + */ + @ApiModelProperty(value = "报送单位联系电话") + @Alias("AlarmUnitTelephone") + private String alarmUnitTelephone; + /** + * 附件资料 + */ + @ApiModelProperty(value = "附件资料") + @Alias("AttachmentInfo") + private String attachmentInfo; + /** + * 备注 + */ + @ApiModelProperty(value = "备注") + @Alias("Remark") + private String remark; + +} diff --git a/rescue/src/main/java/com/yingji/entity/dto/response/EventsResponse.java b/rescue/src/main/java/com/yingji/entity/dto/response/EventsResponse.java new file mode 100644 index 0000000..95214a4 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/dto/response/EventsResponse.java @@ -0,0 +1,147 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.yingji.entity.AcceptEvents; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author wu + * @since 2024/4/30 下午4:24 + */ +@Data +public class EventsResponse implements Serializable { + + private static final long serialVersionUID = -3894493286879970663L; + + /** + * 受理调度信息 + */ + @Alias("AcceptEvents") + @ApiModelProperty(value = "受理调度信息") + private List acceptEvents; + + @Alias("TaskInfos") + private List taskInfos; + + /** + * 事件标题 + */ + @Alias("EventName") + @ApiModelProperty(value = "事件标题") + private String eventName; + + /** + * 事件类型 + */ + @Alias("EventType") + @ApiModelProperty(value = "事件类型") + private String eventType; + + /** + * 事件等级 + */ + @Alias("EventLevel") + @ApiModelProperty(value = "事件等级") + private String eventLevel; + + /** + * 事发时间 + */ + @Alias("EventDateTime") + @ApiModelProperty(value = "事发时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime eventDateTime; + + /** + * 事件描述 + */ + @Alias("EventDescribe") + @ApiModelProperty(value = "事件描述") + private String eventDescribe; + + /** + * 事发地区(行政区划) + */ + @Alias("EventArea") + @ApiModelProperty(value = "事发地区(行政区划)") + private String eventArea; + + /** + * 详细位置 + */ + @Alias("EventAddress") + @ApiModelProperty(value = "详细位置") + private String eventAddress; + + /** + * 经度 + */ + @Alias("EventLongitude") + @ApiModelProperty(value = "经度") + private String eventLongitude; + + /** + * 维度 + */ + @Alias("EventLatitude") + @ApiModelProperty(value = "维度") + private Double eventLatitude; + + /** + * 报送单位 + */ + @Alias("AlarmUnit") + @ApiModelProperty(value = "报送单位") + private String alarmUnit; + + /** + * 报送单位联系人 + */ + @Alias("AlarmUnitContactor") + @ApiModelProperty(value = "报送单位联系人") + private String alarmUnitContactor; + + /** + * 报送单位联系电话 + */ + @Alias("AlarmUnitTelephone") + @ApiModelProperty(value = "报送单位联系电话") + private String alarmUnitTelephone; + + /** + * 出动次数(出动救护车次/辆数量) + */ + @Alias("SendAmbCount") + @ApiModelProperty(value = "出动次数(出动救护车次/辆数量)") + private Integer sendAmbCount; + + /** + * 附件资料 + */ + @Alias("AttachmentInfo") + @ApiModelProperty(value = "附件资料") + private String attachmentInfo; + + /** + * 备注 + */ + @Alias("Remark") + @ApiModelProperty(value = "备注") + private String remark; + + /** + * 事件编码 主键 + */ + @Alias("EventId") + @ApiModelProperty(value = "事件编码 主键") + private String eventId; + +} diff --git a/rescue/src/main/java/com/yingji/entity/dto/response/TaskInfos.java b/rescue/src/main/java/com/yingji/entity/dto/response/TaskInfos.java new file mode 100644 index 0000000..1301062 --- /dev/null +++ b/rescue/src/main/java/com/yingji/entity/dto/response/TaskInfos.java @@ -0,0 +1,24 @@ +package com.yingji.entity.dto.response; + +import cn.hutool.core.annotation.Alias; +import com.yingji.entity.Amb; +import com.yingji.entity.Task; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author wu + * @since 2024/4/30 下午4:19 + */ +@Data +public class TaskInfos implements Serializable { + + private static final long serialVersionUID = 4118581272605160572L; + + @Alias("Amb") + private Amb amb; + + @Alias("Task") + private Task task; +} diff --git a/rescue/src/main/java/com/yingji/exception/GlobalExceptionHandler.java b/rescue/src/main/java/com/yingji/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..59aa9d6 --- /dev/null +++ b/rescue/src/main/java/com/yingji/exception/GlobalExceptionHandler.java @@ -0,0 +1,94 @@ +package com.yingji.exception; + +import cn.dev33.satoken.exception.NotLoginException; +import com.yingji.base.domain.AjaxResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.validation.BindException; +import org.springframework.web.HttpRequestMethodNotSupportedException; +import org.springframework.web.bind.MethodArgumentNotValidException; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import javax.servlet.http.HttpServletRequest; + +/** + * 全局异常处理器 + * + * @author wu + */ +@RestControllerAdvice +public class GlobalExceptionHandler { + private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class); + + + /** + * 请求方式不支持 + */ + @ExceptionHandler(HttpRequestMethodNotSupportedException.class) + public AjaxResult handleHttpRequestMethodNotSupported(HttpRequestMethodNotSupportedException e, + HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',不支持'{}'请求", requestURI, e.getMethod()); + return AjaxResult.error(e.getMessage()); + } + + + /** + * 拦截未知的运行时异常 + */ + @ExceptionHandler(RuntimeException.class) + public AjaxResult handleRuntimeException(RuntimeException e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生未知异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 系统异常 + */ + @ExceptionHandler(Exception.class) + public AjaxResult handleException(Exception e, HttpServletRequest request) { + String requestURI = request.getRequestURI(); + log.error("请求地址'{}',发生系统异常.", requestURI, e); + return AjaxResult.error(e.getMessage()); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(BindException.class) + public AjaxResult handleBindException(BindException e) { + log.error(e.getMessage(), e); + String message = e.getAllErrors().get(0).getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 自定义验证异常 + */ + @ExceptionHandler(MethodArgumentNotValidException.class) + public Object handleMethodArgumentNotValidException(MethodArgumentNotValidException e) { + log.error(e.getMessage(), e); + String message = e.getBindingResult().getFieldError().getDefaultMessage(); + return AjaxResult.error(message); + } + + /** + * 登录异常 + */ + @ExceptionHandler(NotLoginException.class) + public AjaxResult handleDemoModeException(NotLoginException e) { + return AjaxResult.error(e.getMessage()); + } + + /** + * 业务异常 + */ + @ExceptionHandler(ServiceException.class) + public AjaxResult handleServiceException(ServiceException e, HttpServletRequest request) { + log.error(e.getMessage(), e); + Integer code = e.getCode(); + return code != null ? AjaxResult.error(code, e.getMessage()) : AjaxResult.error(e.getMessage()); + } +} diff --git a/rescue/src/main/java/com/yingji/exception/ServiceException.java b/rescue/src/main/java/com/yingji/exception/ServiceException.java new file mode 100644 index 0000000..4d1e94a --- /dev/null +++ b/rescue/src/main/java/com/yingji/exception/ServiceException.java @@ -0,0 +1,64 @@ +package com.yingji.exception; + +/** + * 业务异常 + * + * @author ruoyi + */ +public final class ServiceException extends RuntimeException { + private static final long serialVersionUID = 1L; + + /** + * 错误码 + */ + private Integer code; + + /** + * 错误提示 + */ + private String message; + + /** + * 错误明细,内部调试错误 + *

+ * 和 {@link CommonResult#getDetailMessage()} 一致的设计 + */ + private String detailMessage; + + /** + * 空构造方法,避免反序列化问题 + */ + public ServiceException() { + } + + public ServiceException(String message) { + this.message = message; + } + + public ServiceException(String message, Integer code) { + this.message = message; + this.code = code; + } + + public String getDetailMessage() { + return detailMessage; + } + + public String getMessage() { + return message; + } + + public Integer getCode() { + return code; + } + + public ServiceException setMessage(String message) { + this.message = message; + return this; + } + + public ServiceException setDetailMessage(String detailMessage) { + this.detailMessage = detailMessage; + return this; + } +} \ No newline at end of file diff --git a/rescue/src/main/java/com/yingji/mapper/AcceptMapper.java b/rescue/src/main/java/com/yingji/mapper/AcceptMapper.java new file mode 100644 index 0000000..75575c9 --- /dev/null +++ b/rescue/src/main/java/com/yingji/mapper/AcceptMapper.java @@ -0,0 +1,15 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.AcceptEvents; + +/** + * 受理调度信息(Accept)表数据库访问层 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +public interface AcceptMapper extends BaseMapper { + +} + diff --git a/rescue/src/main/java/com/yingji/mapper/AmbMapper.java b/rescue/src/main/java/com/yingji/mapper/AmbMapper.java new file mode 100644 index 0000000..cc5761c --- /dev/null +++ b/rescue/src/main/java/com/yingji/mapper/AmbMapper.java @@ -0,0 +1,15 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Amb; + +/** + * 任务车辆(Amb)表数据库访问层 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +public interface AmbMapper extends BaseMapper { + +} + diff --git a/rescue/src/main/java/com/yingji/mapper/EventMapper.java b/rescue/src/main/java/com/yingji/mapper/EventMapper.java new file mode 100644 index 0000000..975d953 --- /dev/null +++ b/rescue/src/main/java/com/yingji/mapper/EventMapper.java @@ -0,0 +1,15 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Event; + +/** + * 事故(Event)表数据库访问层 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +public interface EventMapper extends BaseMapper { + +} + diff --git a/rescue/src/main/java/com/yingji/mapper/TaskMapper.java b/rescue/src/main/java/com/yingji/mapper/TaskMapper.java new file mode 100644 index 0000000..663f503 --- /dev/null +++ b/rescue/src/main/java/com/yingji/mapper/TaskMapper.java @@ -0,0 +1,15 @@ +package com.yingji.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yingji.entity.Task; + +/** + * 任务信息(Task)表数据库访问层 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +public interface TaskMapper extends BaseMapper { + +} + diff --git a/src/main/java/com/yingji/quartz/AccidentQuartz.java b/rescue/src/main/java/com/yingji/quartz/AccidentQuartz.java similarity index 64% rename from src/main/java/com/yingji/quartz/AccidentQuartz.java rename to rescue/src/main/java/com/yingji/quartz/AccidentQuartz.java index 939e28f..aee717a 100644 --- a/src/main/java/com/yingji/quartz/AccidentQuartz.java +++ b/rescue/src/main/java/com/yingji/quartz/AccidentQuartz.java @@ -3,6 +3,10 @@ package com.yingji.quartz; import com.yingji.service.AccidentService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Async; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; @@ -12,8 +16,8 @@ import javax.annotation.Resource; * @author wu * @since 2024/5/10 上午10:05 */ -//@Configuration -//@Transactional(rollbackFor = Exception.class) +@Configuration +@Transactional(rollbackFor = Exception.class) public class AccidentQuartz { public static final Logger log = LoggerFactory.getLogger(AccidentQuartz.class); @@ -21,10 +25,9 @@ public class AccidentQuartz { @Resource private AccidentService accidentService; -// @Async -// @Scheduled(cron = "*/10 * * * * ? ") + @Async + @Scheduled(cron = "*/10 * * * * ? ") public void savaData() { - accidentService.getAuthorizeValidate(); String accessToken = accidentService.getAuthorizeToken(); accidentService.getAccidentUrl(accessToken); log.info("=================120定时任务结束==============="); diff --git a/rescue/src/main/java/com/yingji/redis/RedisCache.java b/rescue/src/main/java/com/yingji/redis/RedisCache.java new file mode 100644 index 0000000..faa2a01 --- /dev/null +++ b/rescue/src/main/java/com/yingji/redis/RedisCache.java @@ -0,0 +1,248 @@ +package com.yingji.redis; + +import org.springframework.data.redis.core.BoundSetOperations; +import org.springframework.data.redis.core.HashOperations; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * spring redis 工具类 + * + * @author wu + **/ +@SuppressWarnings(value = {"unchecked", "rawtypes"}) +@Component +public class RedisCache { + + @Resource + public RedisTemplate redisTemplate; + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + */ + public void setCacheObject(final String key, final T value) { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 缓存基本的对象,Integer、String、实体类等 + * + * @param key 缓存的键值 + * @param value 缓存的值 + * @param timeout 时间 + * @param timeUnit 时间颗粒度 + */ + public void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit) { + redisTemplate.opsForValue().set(key, value, timeout, timeUnit); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout) { + return expire(key, timeout, TimeUnit.SECONDS); + } + + /** + * 设置有效时间 + * + * @param key Redis键 + * @param timeout 超时时间 + * @param unit 时间单位 + * @return true=设置成功;false=设置失败 + */ + public boolean expire(final String key, final long timeout, final TimeUnit unit) { + return redisTemplate.expire(key, timeout, unit); + } + + /** + * 获取有效时间 + * + * @param key Redis键 + * @return 有效时间 + */ + public long getExpire(final String key) { + return redisTemplate.getExpire(key); + } + + /** + * 判断 key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + + /** + * 获得缓存的基本对象。 + * + * @param key 缓存键值 + * @return 缓存键值对应的数据 + */ + public T getCacheObject(final String key) { + ValueOperations operation = redisTemplate.opsForValue(); + return operation.get(key); + } + + /** + * 删除单个对象 + * + * @param key + */ + public boolean deleteObject(final String key) { + return redisTemplate.delete(key); + } + + /** + * 删除集合对象 + * + * @param collection 多个对象 + * @return + */ + public boolean deleteObject(final Collection collection) { + return redisTemplate.delete(collection) > 0; + } + + /** + * 缓存List数据 + * + * @param key 缓存的键值 + * @param dataList 待缓存的List数据 + * @return 缓存的对象 + */ + public long setCacheList(final String key, final List dataList) { + Long count = redisTemplate.opsForList().rightPushAll(key, dataList); + return count == null ? 0 : count; + } + + /** + * 获得缓存的list对象 + * + * @param key 缓存的键值 + * @return 缓存键值对应的数据 + */ + public List getCacheList(final String key) { + return redisTemplate.opsForList().range(key, 0, -1); + } + + /** + * 缓存Set + * + * @param key 缓存键值 + * @param dataSet 缓存的数据 + * @return 缓存数据的对象 + */ + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { + BoundSetOperations setOperation = redisTemplate.boundSetOps(key); + Iterator it = dataSet.iterator(); + while (it.hasNext()) { + setOperation.add(it.next()); + } + return setOperation; + } + + /** + * 获得缓存的set + * + * @param key + * @return + */ + public Set getCacheSet(final String key) { + return redisTemplate.opsForSet().members(key); + } + + /** + * 缓存Map + * + * @param key + * @param dataMap + */ + public void setCacheMap(final String key, final Map dataMap) { + if (dataMap != null) { + redisTemplate.opsForHash().putAll(key, dataMap); + } + } + + /** + * 获得缓存的Map + * + * @param key + * @return + */ + public Map getCacheMap(final String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 往Hash中存入数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @param value 值 + */ + public void setCacheMapValue(final String key, final String hKey, final T value) { + redisTemplate.opsForHash().put(key, hKey, value); + } + + /** + * 获取Hash中的数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return Hash中的对象 + */ + public T getCacheMapValue(final String key, final String hKey) { + HashOperations opsForHash = redisTemplate.opsForHash(); + return opsForHash.get(key, hKey); + } + + /** + * 获取多个Hash中的数据 + * + * @param key Redis键 + * @param hKeys Hash键集合 + * @return Hash对象集合 + */ + public List getMultiCacheMapValue(final String key, final Collection hKeys) { + return redisTemplate.opsForHash().multiGet(key, hKeys); + } + + /** + * 删除Hash中的某条数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return 是否成功 + */ + public boolean deleteCacheMapValue(final String key, final String hKey) { + return redisTemplate.opsForHash().delete(key, hKey) > 0; + } + + /** + * 获得缓存的基本对象列表 + * + * @param pattern 字符串前缀 + * @return 对象列表 + */ + public Collection keys(final String pattern) { + return redisTemplate.keys(pattern); + } +} diff --git a/rescue/src/main/java/com/yingji/service/AcceptService.java b/rescue/src/main/java/com/yingji/service/AcceptService.java new file mode 100644 index 0000000..8527c4c --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/AcceptService.java @@ -0,0 +1,15 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.AcceptEvents; + +/** + * 受理调度信息(Accept)表服务接口 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +public interface AcceptService extends IService { + +} + diff --git a/rescue/src/main/java/com/yingji/service/AccidentService.java b/rescue/src/main/java/com/yingji/service/AccidentService.java new file mode 100644 index 0000000..2052f2f --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/AccidentService.java @@ -0,0 +1,30 @@ +package com.yingji.service; + +/** + * 120获取数据 + * + * @author wu + * @since 2024/5/10 上午10:38 + */ +public interface AccidentService { + + /** + * 获取token校验 + */ + String getAuthorizeValidate(); + + /** + * 获取token + */ + String getAuthorizeToken(); + + /** + * 保存数据 + * + * @param accessToken token + */ + void getAccidentUrl(String accessToken); + + + void text(); +} diff --git a/rescue/src/main/java/com/yingji/service/AmbService.java b/rescue/src/main/java/com/yingji/service/AmbService.java new file mode 100644 index 0000000..f3b42d0 --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/AmbService.java @@ -0,0 +1,15 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Amb; + +/** + * 任务车辆(Amb)表服务接口 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +public interface AmbService extends IService { + +} + diff --git a/rescue/src/main/java/com/yingji/service/EventService.java b/rescue/src/main/java/com/yingji/service/EventService.java new file mode 100644 index 0000000..a21a4fe --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/EventService.java @@ -0,0 +1,36 @@ +package com.yingji.service; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.yingji.entity.Event; +import com.yingji.entity.dto.response.EventPageRequest; +import com.yingji.entity.dto.response.EventsFindResponse; + +import java.io.Serializable; + +/** + * 事故(Event)表服务接口 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +public interface EventService extends IService { + + /** + * 分页条件查询数据 + * + * @param page 分页条件 + * @param event 查询条件 + * @return 数据 + */ + Page page(Page page, EventPageRequest event); + + /** + * 根据id查询数据 + * + * @param id id + * @return 数据 + */ + EventsFindResponse findById(Serializable id); +} + diff --git a/src/main/java/com/yingji/service/EventService.java b/rescue/src/main/java/com/yingji/service/TaskService.java similarity index 54% rename from src/main/java/com/yingji/service/EventService.java rename to rescue/src/main/java/com/yingji/service/TaskService.java index bad4b85..f5b7ac8 100644 --- a/src/main/java/com/yingji/service/EventService.java +++ b/rescue/src/main/java/com/yingji/service/TaskService.java @@ -1,15 +1,15 @@ package com.yingji.service; import com.baomidou.mybatisplus.extension.service.IService; -import com.yingji.entity.Event; +import com.yingji.entity.Task; /** - * 事故(Event)表服务接口 + * 任务信息(Task)表服务接口 * * @author wu * @since 2024-05-10 17:10:33 */ -public interface EventService extends IService { +public interface TaskService extends IService { } diff --git a/rescue/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java b/rescue/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java new file mode 100644 index 0000000..7f587d9 --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/impl/AcceptServiceImpl.java @@ -0,0 +1,19 @@ +package com.yingji.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.AcceptEvents; +import com.yingji.mapper.AcceptMapper; +import com.yingji.service.AcceptService; +import org.springframework.stereotype.Service; + +/** + * 受理调度信息(Accept)表服务实现类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Service("acceptService") +public class AcceptServiceImpl extends ServiceImpl implements AcceptService { + +} + diff --git a/rescue/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java b/rescue/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java new file mode 100644 index 0000000..07c6b9e --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/impl/AccidentServiceImpl.java @@ -0,0 +1,1394 @@ +package com.yingji.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.yingji.entity.AcceptEvents; +import com.yingji.entity.Amb; +import com.yingji.entity.Event; +import com.yingji.entity.Task; +import com.yingji.entity.dto.response.EventsResponse; +import com.yingji.entity.dto.response.TaskInfos; +import com.yingji.redis.RedisCache; +import com.yingji.service.AcceptService; +import com.yingji.service.AccidentService; +import com.yingji.service.AmbService; +import com.yingji.service.EventService; +import com.yingji.service.TaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +/** + * @author wu + * @since 2024/5/10 上午10:39 + */ +@Service("accidentService") +public class AccidentServiceImpl implements AccidentService { + + public static final Logger log = LoggerFactory.getLogger(AccidentServiceImpl.class); + + @Value("${getAuthorizeValidateUrl}") + private String getAuthorizeValidateUrl; + + @Value("${getAuthorizeTokenUrl}") + private String getAuthorizeTokenUrl; + + @Value("${getAccidentUrl}") + private String getAccidentUrl; + + @Resource + private RedisCache redisCache; + + @Resource + private EventService eventService; + + @Resource + private TaskService taskService; + + @Resource + private AmbService ambService; + + @Resource + private AcceptService acceptService; + +// public static void main(String[] args) { +// +// JSONObject json = JSONObject.parse(s); +// Object data = json.get("data"); +// String recordsStr = JSONUtil.toJsonStr(data); +// List list = JSONUtil.toList(recordsStr, EventsResponse.class); +// System.out.println(list); +// } + + /** + * 获取token校验 + */ + @Override + public String getAuthorizeValidate() { + String validate = redisCache.getCacheObject("validate"); + if (StrUtil.isEmpty(validate)) { + // 获取当前的时间 + LocalDateTime localDateTime = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + String accessDateTime = localDateTime.format(formatter); + Map map = new HashMap<>(); + map.put("AKey", "admin"); + map.put("ASecret", "anchor120."); + map.put("AccessDateTime", accessDateTime); + String parse = JSONUtil.toJsonStr(map); + String body = HttpRequest.post(getAuthorizeValidateUrl).body(parse).execute().body(); + JSONObject json = JSONObject.parse(body); + validate = (String) json.get("data"); + if (StrUtil.isNotEmpty(validate)) { + redisCache.setCacheObject("validate", validate, 40, TimeUnit.MINUTES); + } + } + log.info("======================================="); + log.info("120token校验为:" + validate); + return validate; + } + + /** + * 获取token + */ + @Override + public String getAuthorizeToken() { + String accessToken; + accessToken = redisCache.getCacheObject("accessToken"); + if (StrUtil.isEmpty(accessToken)) { + // 获取授权码 + String validate = getAuthorizeValidate(); + Map map = new HashMap<>(); + map.put("Data", validate); + String parse = JSONUtil.toJsonStr(map); + String body = HttpRequest.post(getAuthorizeTokenUrl).body(parse).execute().body(); + JSONObject json = JSONObject.parse(body); + Object data = json.get("data"); + if (BeanUtil.isNotEmpty(data)) { + String recordsStr = JSONUtil.toJsonStr(data); + JSONObject res = JSONObject.parse(recordsStr); + accessToken = (String) res.get("token"); + if (StrUtil.isNotEmpty(accessToken)) { + redisCache.setCacheObject("accessToken", accessToken, 40, TimeUnit.MINUTES); + } + } + log.info("======================================="); + log.info("120token为:" + accessToken); + } + return accessToken; + } + + /** + * 保存数据 + * + * @param accessToken token + */ + @Override + public void getAccidentUrl(String accessToken) { + // 获取今天的日期 + LocalDate today = LocalDate.now(); + // 获取明天的日期 + LocalDate tomorrow = today.plusDays(1); + // 定义日期格式化对象 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + // 格式化日期为字符串 + String todayStr = today.format(formatter) + " 00:00:00"; + String tomorrowStr = tomorrow.format(formatter) + " 00:00:00"; + Map map = new HashMap<>(); + map.put("StartDateTime", todayStr); + map.put("EndDateTime", tomorrowStr); + String parse = JSONUtil.toJsonStr(map); + String body = HttpRequest.post(getAccidentUrl) + .header("Authorization", "Bearer " + accessToken) + .body(parse).execute().body(); + JSONObject json = JSONObject.parse(body); + Object data = json.get("data"); + if (BeanUtil.isNotEmpty(data)) { + saveResponseData(data); + } else { + redisCache.deleteObject("validate"); + redisCache.deleteObject("accessToken"); + } + } + + /** + * 保存响应数据 + * + * @param data 响应数据 + */ + private void saveResponseData(Object data) { + List list; + String recordsStr = JSONUtil.toJsonStr(data); + log.error("120接收到的数据为=======================" + recordsStr); + if (StrUtil.isNotEmpty(recordsStr)) { + // json数据转换成实体类 + list = JSONUtil.toList(recordsStr, EventsResponse.class); + if (CollectionUtil.isNotEmpty(list)) { + // 获取事故数据保存 + List events = BeanUtil.copyToList(list, Event.class); + for (Event event : events) { + // 新增或编辑事故(Event) 表 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("event_id", event.getEventId()); + Event one = eventService.getOne(wrapper); + if (BeanUtil.isEmpty(one)) { + eventService.save(event); + } else { + eventService.updateById(event); + } + } + for (EventsResponse res : list) { + List acceptEvents = res.getAcceptEvents(); + // 保存或编辑受理调度信息 + for (AcceptEvents acceptEvent : acceptEvents) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("accept_id", acceptEvent.getAcceptId()); + AcceptEvents one = acceptService.getOne(wrapper); + if (BeanUtil.isEmpty(one)) { + acceptService.save(acceptEvent); + } else { + acceptService.updateById(acceptEvent); + } + } + List taskInfos = res.getTaskInfos(); + for (TaskInfos taskInfo : taskInfos) { + // 保存或编辑任务信息(Task) 表实体类 + Task task = taskInfo.getTask(); + if (BeanUtil.isNotEmpty(task)) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("task_id", task.getTaskId()); + Task one = taskService.getOne(wrapper); + if (BeanUtil.isEmpty(one)) { + taskService.save(task); + } else { + taskService.updateById(task); + } + Amb amb = taskInfo.getAmb(); + if (BeanUtil.isNotEmpty(amb)) { + amb.setTaskId(task.getTaskId()); + ambService.save(amb); + } + } + } + } + } + } + } + + @Override + public void text() { + String s = "{\n" + + " \"data\": [{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"13915517391\",\n" + + "\t\t\"DiseaseJudge\": \"29D02l,撞车/交通事故,严重事故(k到t),机动车撞自行车/机动车撞摩托车(急救车联动110)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"改派派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"杨宏涛\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-13T07:37:48\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-13T07:34:56\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-13T07:37:54\",\n" + + "\t\t\"EventAddress\": \"宝带西路和龙西路 国家电网门口\",\n" + + "\t\t\"AcceptId\": \"20240513073206060000000032050003\",\n" + + "\t\t\"EventId\": \"202405130732060600000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"13915517391\",\n" + + "\t\t\"DiseaseJudge\": \"29D02l,撞车/交通事故,严重事故(k到t),机动车撞自行车/机动车撞摩托车(急救车联动110)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"杨宏涛\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-13T07:51:38\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-13T07:48:43\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-13T07:51:41\",\n" + + "\t\t\"EventAddress\": \"宝带西路和龙西路 国家电网门口\",\n" + + "\t\t\"AcceptId\": \"20240513073206060000000032050004\",\n" + + "\t\t\"EventId\": \"202405130732060600000000320500\",\n" + + "\t\t\"AcceptOrder\": \"4\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"13915517391\",\n" + + "\t\t\"DiseaseJudge\": \"29D02l,撞车/交通事故,严重事故(k到t),机动车撞自行车/机动车撞摩托车(急救车联动110)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"钱卓彦\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-13T07:33:39\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-13T07:30:48\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-13T07:33:46\",\n" + + "\t\t\"EventAddress\": \"宝带西路和龙西路 国家电网门口\",\n" + + "\t\t\"AcceptId\": \"20240513073206060000000032050002\",\n" + + "\t\t\"EventId\": \"202405130732060600000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U H638Q\",\n" + + "\t\t\t\"RealSign\": \"H638Q\",\n" + + "\t\t\t\"AmbCode\": \"32050020197\",\n" + + "\t\t\t\"StationName\": \"中医医院\",\n" + + "\t\t\t\"AmbType\": \"现代\",\n" + + "\t\t\t\"AmbPhone\": \"1440737287210\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-13T07:37:54\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-13T07:37:56\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-13T07:39:34\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-13T07:45:59\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-13T07:49:17\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-13T08:04:36\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"王明杰\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"中医医院\",\n" + + "\t\t\t\"TaskId\": \"2024051307320606000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240513073206060000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405130732060600000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U Z956F\",\n" + + "\t\t\t\"RealSign\": \"Z956F\",\n" + + "\t\t\t\"AmbCode\": \"32050020235\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"AmbType\": \"富康\",\n" + + "\t\t\t\"AmbPhone\": \"13915428120\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-13T07:51:41\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-13T07:51:42\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-13T07:54:16\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-13T08:00:18\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-13T08:03:28\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"苏简华\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"TaskId\": \"2024051307320606000000003205000401\",\n" + + "\t\t\t\"AcceptOrder\": \"4\",\n" + + "\t\t\t\"AcceptId\": \"20240513073206060000000032050004\",\n" + + "\t\t\t\"EventId\": \"202405130732060600000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U Z956F\",\n" + + "\t\t\t\"RealSign\": \"Z956F\",\n" + + "\t\t\t\"AmbCode\": \"32050020235\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"AmbType\": \"富康\",\n" + + "\t\t\t\"AmbPhone\": \"13915428120\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": false,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-13T07:33:46\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-13T07:33:47\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-13T07:35:05\",\n" + + "\t\t\t\"ComplatedDateTime\": \"2024-05-13T07:37:54\",\n" + + "\t\t\t\"IsNormalOver\": false,\n" + + "\t\t\t\"Driver\": \"苏简华\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"TaskId\": \"2024051307320606000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240513073206060000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405130732060600000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"宝带西路和龙西路 国家电网门口——车祸\",\n" + + "\t\"EventType\": \"救治\",\n" + + "\t\"EventDateTime\": \"2024-05-13T07:32:06\",\n" + + "\t\"EventArea\": \"吴中区\",\n" + + "\t\"EventAddress\": \"宝带西路和龙西路 国家电网门口\",\n" + + "\t\"EventLongitude\": 120.613857231315,\n" + + "\t\"EventLatitude\": 31.2689514636758,\n" + + "\t\"SendAmbCount\": 3,\n" + + "\t\"EventId\": \"202405130732060600000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"潘丽安\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-13T04:45:07\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-13T04:43:45\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-13T04:45:20\",\n" + + "\t\t\"EventAddress\": \"星塘街莲香北区89幢1单元\",\n" + + "\t\t\"AcceptId\": \"20240513042806050000000032050003\",\n" + + "\t\t\"EventId\": \"202405130428060500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"潘丽安\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-13T04:28:53\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-13T04:26:29\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-13T04:28:58\",\n" + + "\t\t\"EventAddress\": \"星塘街莲香北区89幢1单元\",\n" + + "\t\t\"AcceptId\": \"20240513042806050000000032050002\",\n" + + "\t\t\"EventId\": \"202405130428060500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 1795X\",\n" + + "\t\t\t\"RealSign\": \"1795X\",\n" + + "\t\t\t\"AmbCode\": \"32050002202\",\n" + + "\t\t\t\"StationName\": \"禧华分站\",\n" + + "\t\t\t\"AmbType\": \"雪佛兰\",\n" + + "\t\t\t\"AmbPhone\": \"15850383051\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-13T04:45:20\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-13T04:47:36\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-13T04:47:38\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-13T05:03:49\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-13T05:04:25\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-13T05:12:31\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"张建华\",\n" + + "\t\t\t\"Doctor\": \"陈永明\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"臧千朋\",\n" + + "\t\t\t\"StationName\": \"禧华分站\",\n" + + "\t\t\t\"TaskId\": \"2024051304280605000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240513042806050000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405130428060500000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U Z920C\",\n" + + "\t\t\t\"RealSign\": \"Z920C\",\n" + + "\t\t\t\"AmbCode\": \"32050020220\",\n" + + "\t\t\t\"StationName\": \"星塘分站\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"17706213289\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-13T04:28:58\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-13T04:28:59\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-13T04:29:40\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-13T04:46:20\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-13T04:46:26\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-13T04:51:59\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"陆子亿\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"星塘分站\",\n" + + "\t\t\t\"TaskId\": \"2024051304280605000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240513042806050000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405130428060500000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"星塘街莲香北区89幢1单元——冒烟\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-13T04:28:06\",\n" + + "\t\"EventArea\": \"苏州工业园区\",\n" + + "\t\"EventAddress\": \"星塘街莲香北区89幢1单元\",\n" + + "\t\"EventLongitude\": 120.7383324628,\n" + + "\t\"EventLatitude\": 31.3023800964134,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405130428060500000000320500\"\n" + + "},{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"19962116073\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T00:35:01\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T00:32:07\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T00:35:03\",\n" + + "\t\t\"EventAddress\": \"吴中区碧波街吴中银座大厦门口\",\n" + + "\t\t\"AcceptId\": \"20240512002214030000000032050003\",\n" + + "\t\t\"EventId\": \"202405120022140300000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"19962116073\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T00:23:31\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T00:20:44\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T00:23:41\",\n" + + "\t\t\"EventAddress\": \"吴中区碧波街吴中银座大厦门口\",\n" + + "\t\t\"AcceptId\": \"20240512002214030000000032050002\",\n" + + "\t\t\"EventId\": \"202405120022140300000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U H638Q\",\n" + + "\t\t\t\"RealSign\": \"H638Q\",\n" + + "\t\t\t\"AmbCode\": \"32050020197\",\n" + + "\t\t\t\"StationName\": \"中医医院\",\n" + + "\t\t\t\"AmbType\": \"现代\",\n" + + "\t\t\t\"AmbPhone\": \"1440737287210\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T00:35:03\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T00:35:05\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"邵坚\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"中医医院\",\n" + + "\t\t\t\"TaskId\": \"2024051200221403000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512002214030000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405120022140300000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U Z956F\",\n" + + "\t\t\t\"RealSign\": \"Z956F\",\n" + + "\t\t\t\"AmbCode\": \"32050020235\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"AmbType\": \"富康\",\n" + + "\t\t\t\"AmbPhone\": \"13915428120\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T00:23:41\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T00:23:42\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T00:24:56\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T00:28:58\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"殷传峰\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"吴中医院\",\n" + + "\t\t\t\"TaskId\": \"2024051200221403000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512002214030000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405120022140300000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"吴中区碧波街吴中银座大厦门口——醉酒晕倒\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-12T00:22:14\",\n" + + "\t\"EventArea\": \"吴中区\",\n" + + "\t\"EventAddress\": \"吴中区碧波街吴中银座大厦门口\",\n" + + "\t\"EventLongitude\": 120.626024229052,\n" + + "\t\"EventLatitude\": 31.2585715103977,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405120022140300000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"18739256097\",\n" + + "\t\t\"DiseaseJudge\": \"37B02,转院转运,转运(急救车)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"尹山湖医院急诊\",\n" + + "\t\t\"SendAddress\": \"市立医院东区\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T21:43:35\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T21:40:53\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T21:43:50\",\n" + + "\t\t\"EventAddress\": \"尹山湖医院急诊\",\n" + + "\t\t\"AcceptId\": \"20240512214002050000000032050003\",\n" + + "\t\t\"EventId\": \"202405122140020500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"18739256097\",\n" + + "\t\t\"DiseaseJudge\": \"37B02,转院转运,转运(急救车)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"尹山湖医院急诊\",\n" + + "\t\t\"SendAddress\": \"市立医院东区\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T21:40:55\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T21:37:59\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T21:40:56\",\n" + + "\t\t\"EventAddress\": \"尹山湖医院急诊\",\n" + + "\t\t\"AcceptId\": \"20240512214002050000000032050002\",\n" + + "\t\t\"EventId\": \"202405122140020500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U X9107\",\n" + + "\t\t\t\"RealSign\": \"X9107\",\n" + + "\t\t\t\"AmbCode\": \"32050020213\",\n" + + "\t\t\t\"StationName\": \"星海分站\",\n" + + "\t\t\t\"AmbType\": \"凌特\",\n" + + "\t\t\t\"AmbPhone\": \"17715186010\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T21:43:50\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T21:43:52\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T21:44:17\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T21:59:10\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"张晓华\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"星海分站\",\n" + + "\t\t\t\"TaskId\": \"2024051221400205000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512214002050000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405122140020500000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 6WG50\",\n" + + "\t\t\t\"RealSign\": \"6WG50\",\n" + + "\t\t\t\"AmbCode\": \"32050002216\",\n" + + "\t\t\t\"StationName\": \"尹山湖医院\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"15250017322\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T21:40:56\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T21:40:58\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T21:41:41\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T21:47:16\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T21:47:54\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"何建华\",\n" + + "\t\t\t\"Doctor\": \"王福龙\",\n" + + "\t\t\t\"Stretcher\": \"居金福\",\n" + + "\t\t\t\"Nurse\": \"钱思忆\",\n" + + "\t\t\t\"StationName\": \"尹山湖医院\",\n" + + "\t\t\t\"TaskId\": \"2024051221400205000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512214002050000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405122140020500000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"尹山湖医院急诊——骨折\",\n" + + "\t\"EventType\": \"转院\",\n" + + "\t\"EventDateTime\": \"2024-05-12T21:40:02\",\n" + + "\t\"EventArea\": \"吴中区\",\n" + + "\t\"EventAddress\": \"尹山湖医院急诊\",\n" + + "\t\"EventLongitude\": 120.67612775656,\n" + + "\t\"EventLatitude\": 31.2514232332648,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405122140020500000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"13151160656\",\n" + + "\t\t\"DiseaseJudge\": \"29D02l,机动车撞摩托车,严重事故(k到t),机动车撞自行车/机动车撞摩托车(急救车联动110)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T19:06:10\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T19:04:23\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T19:07:21\",\n" + + "\t\t\"EventAddress\": \"尹中南路1318号 苏州希望纺织印染公司 苏EFH672\",\n" + + "\t\t\"AcceptId\": \"20240512185131020000000032050003\",\n" + + "\t\t\"EventId\": \"202405121851310200000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"13151160656\",\n" + + "\t\t\"DiseaseJudge\": \"29D02l,机动车撞摩托车,严重事故(k到t),机动车撞自行车/机动车撞摩托车(急救车联动110)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"不详\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"-东门 苏州市吴中区尹中南路1318号\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T18:52:20\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T18:49:23\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T18:52:21\",\n" + + "\t\t\"EventAddress\": \"尹中南路1318号 苏州希望纺织印染公司 苏EFH672\",\n" + + "\t\t\"AcceptId\": \"20240512185131020000000032050002\",\n" + + "\t\t\"EventId\": \"202405121851310200000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 27S5U\",\n" + + "\t\t\t\"RealSign\": \"93-27S5U\",\n" + + "\t\t\t\"AmbCode\": \"32050020156\",\n" + + "\t\t\t\"StationName\": \"运西分站\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"18261812038\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T19:07:21\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T19:07:24\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T19:08:08\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"崔金林\",\n" + + "\t\t\t\"Doctor\": \"施世强\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"周文静\",\n" + + "\t\t\t\"StationName\": \"运西分站\",\n" + + "\t\t\t\"TaskId\": \"2024051218513102000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512185131020000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405121851310200000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 6WG50\",\n" + + "\t\t\t\"RealSign\": \"6WG50\",\n" + + "\t\t\t\"AmbCode\": \"32050002216\",\n" + + "\t\t\t\"StationName\": \"尹山湖医院\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"15250017322\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T18:52:21\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T18:52:22\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T18:52:59\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T19:04:47\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T19:10:39\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-12T19:20:09\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"何建华\",\n" + + "\t\t\t\"Doctor\": \"王福龙\",\n" + + "\t\t\t\"Stretcher\": \"居金福\",\n" + + "\t\t\t\"Nurse\": \"钱思忆\",\n" + + "\t\t\t\"StationName\": \"尹山湖医院\",\n" + + "\t\t\t\"TaskId\": \"2024051218513102000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512185131020000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405121851310200000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"尹中南路1318号 苏州希望纺织印染公司 苏EFH672——车祸\",\n" + + "\t\"EventType\": \"救治\",\n" + + "\t\"EventDateTime\": \"2024-05-12T18:51:31\",\n" + + "\t\"EventArea\": \"吴中区\",\n" + + "\t\"EventAddress\": \"尹中南路1318号 苏州希望纺织印染公司 苏EFH672\",\n" + + "\t\"EventLongitude\": 120.662178583068,\n" + + "\t\"EventLatitude\": 31.2106246386407,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405121851310200000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"改派派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T17:15:28\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T17:12:38\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T17:15:35\",\n" + + "\t\t\"EventAddress\": \"渭塘镇湘渭路澄阳路到底右拐\",\n" + + "\t\t\"AcceptId\": \"20240512171005050000000032050003\",\n" + + "\t\t\"EventId\": \"202405121710050500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"吴亚\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T17:12:33\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T17:09:51\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T17:12:49\",\n" + + "\t\t\"EventAddress\": \"渭塘镇湘渭路澄阳路到底右拐\",\n" + + "\t\t\"AcceptId\": \"20240512171005050000000032050002\",\n" + + "\t\t\"EventId\": \"202405121710050500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 7Y359\",\n" + + "\t\t\t\"RealSign\": \"7Y359\",\n" + + "\t\t\t\"AmbCode\": \"32050020139\",\n" + + "\t\t\t\"StationName\": \"渭塘分站\",\n" + + "\t\t\t\"AmbType\": \"蒙迪欧\",\n" + + "\t\t\t\"AmbPhone\": \"15250476092\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T17:15:35\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T17:15:36\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T17:15:39\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T17:22:19\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T17:29:56\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-12T17:54:27\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"王振伟\",\n" + + "\t\t\t\"Doctor\": \"曹海波\",\n" + + "\t\t\t\"Stretcher\": \"李福根\",\n" + + "\t\t\t\"Nurse\": \"许嘉晨\",\n" + + "\t\t\t\"StationName\": \"渭塘分站\",\n" + + "\t\t\t\"TaskId\": \"2024051217100505000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512171005050000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405121710050500000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 0Z279\",\n" + + "\t\t\t\"RealSign\": \"0Z279\",\n" + + "\t\t\t\"AmbCode\": \"32050020145\",\n" + + "\t\t\t\"StationName\": \"阳澄湖分站\",\n" + + "\t\t\t\"AmbType\": \"雪佛兰\",\n" + + "\t\t\t\"AmbPhone\": \"13584851924\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T17:12:49\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T17:12:50\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T17:13:27\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"吴正华\",\n" + + "\t\t\t\"Doctor\": \"李雨晴\",\n" + + "\t\t\t\"Stretcher\": \"严银根\",\n" + + "\t\t\t\"Nurse\": \"闵书芹\",\n" + + "\t\t\t\"StationName\": \"阳澄湖分站\",\n" + + "\t\t\t\"TaskId\": \"2024051217100505000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512171005050000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405121710050500000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"渭塘镇湘渭路澄阳路到底右拐——两辆电动车事故\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-12T17:10:05\",\n" + + "\t\"EventArea\": \"相城区\",\n" + + "\t\"EventAddress\": \"渭塘镇湘渭路澄阳路到底右拐\",\n" + + "\t\"EventLongitude\": 120.671745190585,\n" + + "\t\"EventLatitude\": 31.4912853732818,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405121710050500000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"65433842\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"太平邻里中心1楼\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T03:40:08\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T03:37:20\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T03:40:10\",\n" + + "\t\t\"EventAddress\": \"太平邻里中心1楼\",\n" + + "\t\t\"AcceptId\": \"20240512031812060000000032050003\",\n" + + "\t\t\"EventId\": \"202405120318120600000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"65433842\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"太平邻里中心1楼\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T03:20:13\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T03:17:22\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T03:20:17\",\n" + + "\t\t\"EventAddress\": \"太平邻里中心1楼\",\n" + + "\t\t\"AcceptId\": \"20240512031812060000000032050002\",\n" + + "\t\t\"EventId\": \"202405120318120600000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 2B690\",\n" + + "\t\t\t\"RealSign\": \"2B690\",\n" + + "\t\t\t\"AmbCode\": \"32050002222\",\n" + + "\t\t\t\"StationName\": \"苏州五院\",\n" + + "\t\t\t\"AmbType\": \"蒙迪欧\",\n" + + "\t\t\t\"AmbPhone\": \"1440737287208\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T03:40:10\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T03:40:12\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T03:40:15\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T03:52:12\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T04:01:37\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"王建明\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"苏州五院\",\n" + + "\t\t\t\"TaskId\": \"2024051203181206000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512031812060000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405120318120600000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 0Z279\",\n" + + "\t\t\t\"RealSign\": \"0Z279\",\n" + + "\t\t\t\"AmbCode\": \"32050020145\",\n" + + "\t\t\t\"StationName\": \"阳澄湖分站\",\n" + + "\t\t\t\"AmbType\": \"雪佛兰\",\n" + + "\t\t\t\"AmbPhone\": \"13584851924\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T03:20:17\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T03:23:10\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T03:23:13\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T03:37:32\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T03:37:39\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-12T04:01:47\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"朱超\",\n" + + "\t\t\t\"Doctor\": \"潘龙虎\",\n" + + "\t\t\t\"Stretcher\": \"叶文卫\",\n" + + "\t\t\t\"Nurse\": \"姜佳利\",\n" + + "\t\t\t\"StationName\": \"阳澄湖分站\",\n" + + "\t\t\t\"TaskId\": \"2024051203181206000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512031812060000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405120318120600000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"太平邻里中心1楼——打架\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-12T03:18:12\",\n" + + "\t\"EventArea\": \"相城区\",\n" + + "\t\"EventAddress\": \"太平邻里中心1楼\",\n" + + "\t\"EventLongitude\": 120.696049694974,\n" + + "\t\"EventLatitude\": 31.4331932157755,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405120318120600000000320500\"\n" + + "},{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"62960110\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T01:21:52\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T01:19:00\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T01:21:57\",\n" + + "\t\t\"EventAddress\": \"亭南路唯胜路\",\n" + + "\t\t\"AcceptId\": \"20240512005415010000000032050003\",\n" + + "\t\t\"EventId\": \"202405120054150100000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"62960110\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"唯胜路/亭南路(路口) 苏州市苏州工业园区唯胜路\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T00:54:53\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T00:52:02\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T00:54:58\",\n" + + "\t\t\"EventAddress\": \"亭南路唯胜路\",\n" + + "\t\t\"AcceptId\": \"20240512005415010000000032050002\",\n" + + "\t\t\"EventId\": \"202405120054150100000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 37901\",\n" + + "\t\t\t\"RealSign\": \"37901\",\n" + + "\t\t\t\"AmbCode\": \"32050020151\",\n" + + "\t\t\t\"StationName\": \"星浦分站\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"18013100138\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T01:21:57\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T01:21:57\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T01:23:26\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T01:38:21\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T01:45:42\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"仲卫东\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"星浦分站\",\n" + + "\t\t\t\"TaskId\": \"2024051200541501000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512005415010000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405120054150100000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 1795X\",\n" + + "\t\t\t\"RealSign\": \"1795X\",\n" + + "\t\t\t\"AmbCode\": \"32050002202\",\n" + + "\t\t\t\"StationName\": \"禧华分站\",\n" + + "\t\t\t\"AmbType\": \"雪佛兰\",\n" + + "\t\t\t\"AmbPhone\": \"15850383051\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T00:54:58\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T00:54:59\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T00:56:15\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T01:13:46\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T01:23:49\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"金建青\",\n" + + "\t\t\t\"Doctor\": \"王园园\",\n" + + "\t\t\t\"Stretcher\": \"蒋保新\",\n" + + "\t\t\t\"Nurse\": \"潘国放\",\n" + + "\t\t\t\"StationName\": \"禧华分站\",\n" + + "\t\t\t\"TaskId\": \"2024051200541501000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512005415010000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405120054150100000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"亭南路唯胜路——醉酒2人\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-12T00:54:15\",\n" + + "\t\"EventArea\": \"苏州工业园区\",\n" + + "\t\"EventAddress\": \"亭南路唯胜路\",\n" + + "\t\"EventLongitude\": 120.798333662215,\n" + + "\t\"EventLatitude\": 31.3522368314446,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405120054150100000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"62749120\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"瑞华路瑞华四季公寓门口\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T00:19:37\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T00:16:43\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T00:19:39\",\n" + + "\t\t\"EventAddress\": \"瑞华路瑞华四季公寓门口\",\n" + + "\t\t\"AcceptId\": \"20240512001602030000000032050002\",\n" + + "\t\t\"EventId\": \"202405120016020300000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"62749120\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"改派派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"瑞华路瑞华四季公寓门口\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-12T00:25:31\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-12T00:22:38\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-12T00:25:33\",\n" + + "\t\t\"EventAddress\": \"瑞华路瑞华四季公寓门口\",\n" + + "\t\t\"AcceptId\": \"20240512001602030000000032050003\",\n" + + "\t\t\"EventId\": \"202405120016020300000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U Y826Y\",\n" + + "\t\t\t\"RealSign\": \"Y826Y\",\n" + + "\t\t\t\"AmbCode\": \"32050020269\",\n" + + "\t\t\t\"StationName\": \"疾控分站\",\n" + + "\t\t\t\"AmbType\": \"菲亚特\",\n" + + "\t\t\t\"AmbPhone\": \"15962144186\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T00:19:39\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T00:19:40\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T00:22:48\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"金佳\",\n" + + "\t\t\t\"Doctor\": \"\",\n" + + "\t\t\t\"Stretcher\": \"孙刚峰\",\n" + + "\t\t\t\"Nurse\": \"\",\n" + + "\t\t\t\"StationName\": \"疾控分站\",\n" + + "\t\t\t\"TaskId\": \"2024051200160203000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240512001602030000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405120016020300000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 3079M\",\n" + + "\t\t\t\"RealSign\": \"3079M\",\n" + + "\t\t\t\"AmbCode\": \"32050020166\",\n" + + "\t\t\t\"StationName\": \"星湖医院\",\n" + + "\t\t\t\"AmbType\": \"菲亚特\",\n" + + "\t\t\t\"AmbPhone\": \"13401433694\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-12T00:25:33\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-12T00:25:35\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-12T00:25:38\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-12T00:32:44\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-12T00:35:59\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-12T00:44:29\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"袁晓春\",\n" + + "\t\t\t\"Doctor\": \"孙仰庆\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"朱怡晨\",\n" + + "\t\t\t\"StationName\": \"星湖医院\",\n" + + "\t\t\t\"TaskId\": \"2024051200160203000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240512001602030000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405120016020300000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"瑞华路瑞华四季公寓门口——醉酒\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-12T00:16:02\",\n" + + "\t\"EventArea\": \"苏州工业园区\",\n" + + "\t\"EventAddress\": \"瑞华路瑞华四季公寓门口\",\n" + + "\t\"EventLongitude\": 120.699508132368,\n" + + "\t\"EventLatitude\": 31.3489828626144,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405120016020300000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"15755631279\",\n" + + "\t\t\"DiseaseJudge\": \"31D04,无意识/晕厥(接近),神志不清(急救车)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"男\",\n" + + "\t\t\"PatientAge\": \"49岁\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"松陵三里桥东5弄12号\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-10T21:30:15\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-10T21:27:32\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-10T21:30:25\",\n" + + "\t\t\"EventAddress\": \"松陵三里桥东5弄12号\",\n" + + "\t\t\"AcceptId\": \"20240510212730050000000032050002\",\n" + + "\t\t\"EventId\": \"202405102127300500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"15755631279\",\n" + + "\t\t\"DiseaseJudge\": \"31D04,无意识/晕厥(接近),神志不清(急救车)\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"男\",\n" + + "\t\t\"PatientAge\": \"49岁\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"松陵三里桥东5弄12号\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-10T21:47:07\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-10T21:44:16\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-10T21:47:10\",\n" + + "\t\t\"EventAddress\": \"松陵三里桥东5弄12号\",\n" + + "\t\t\"AcceptId\": \"20240510212730050000000032050003\",\n" + + "\t\t\"EventId\": \"202405102127300500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏E 27S5U\",\n" + + "\t\t\t\"RealSign\": \"93-27S5U\",\n" + + "\t\t\t\"AmbCode\": \"32050020156\",\n" + + "\t\t\t\"StationName\": \"运西分站\",\n" + + "\t\t\t\"AmbType\": \"金杯\",\n" + + "\t\t\t\"AmbPhone\": \"18261812038\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-10T21:30:25\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-10T21:30:26\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-10T21:31:07\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"黄邵峰\",\n" + + "\t\t\t\"Doctor\": \"林军\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"王嘉懿\",\n" + + "\t\t\t\"StationName\": \"运西分站\",\n" + + "\t\t\t\"TaskId\": \"2024051021273005000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240510212730050000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405102127300500000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 920B7\",\n" + + "\t\t\t\"RealSign\": \"920B7\",\n" + + "\t\t\t\"AmbCode\": \"32050020155\",\n" + + "\t\t\t\"StationName\": \"苏州九院流虹路分站\",\n" + + "\t\t\t\"AmbType\": \"雪佛兰\",\n" + + "\t\t\t\"AmbPhone\": \"19951328150\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-10T21:47:10\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-10T21:47:12\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-10T21:48:07\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-10T21:55:53\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-10T22:09:19\",\n" + + "\t\t\t\"ArriveHospitalDateTime\": \"2024-05-10T22:09:34\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"瞿顺军\",\n" + + "\t\t\t\"Doctor\": \"孟云鹏\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"俞思颜\",\n" + + "\t\t\t\"StationName\": \"苏州九院流虹路分站\",\n" + + "\t\t\t\"TaskId\": \"2024051021273005000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240510212730050000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405102127300500000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"松陵三里桥东5弄12号——喊不醒\",\n" + + "\t\"EventType\": \"救治\",\n" + + "\t\"EventDateTime\": \"2024-05-10T21:27:30\",\n" + + "\t\"EventArea\": \"吴江区\",\n" + + "\t\"EventAddress\": \"松陵三里桥东5弄12号\",\n" + + "\t\"EventLongitude\": 120.656996221998,\n" + + "\t\"EventLatitude\": 31.1690985641772,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405102127300500000000320500\"\n" + + "},\n" + + "{\n" + + "\t\"AcceptEvents\": [{\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"唤醒派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-10T18:50:22\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-10T18:47:33\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-10T18:50:24\",\n" + + "\t\t\"EventAddress\": \"西环路福马小区门口\",\n" + + "\t\t\"AcceptId\": \"20240510184936050000000032050002\",\n" + + "\t\t\"EventId\": \"202405101849360500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"2\"\n" + + "\t}, {\n" + + "\t\t\"AlarmTelephone\": \"\",\n" + + "\t\t\"DiseaseJudge\": \"\",\n" + + "\t\t\"PatientName\": \"\",\n" + + "\t\t\"PatientSex\": \"\",\n" + + "\t\t\"PatientAge\": \"不详\",\n" + + "\t\t\"AcceptType\": \"增援派车\",\n" + + "\t\t\"ResponsibleRecipient\": \"顾毅骏\",\n" + + "\t\t\"WaitAddress\": \"\",\n" + + "\t\t\"SendAddress\": \"\",\n" + + "\t\t\"StartAcceptDateTime\": \"2024-05-10T19:08:41\",\n" + + "\t\t\"EndAcceptDateTime\": \"2024-05-10T19:05:49\",\n" + + "\t\t\"SendOrderDateTime\": \"2024-05-10T19:08:43\",\n" + + "\t\t\"EventAddress\": \"西环路福马小区门口\",\n" + + "\t\t\"AcceptId\": \"20240510184936050000000032050003\",\n" + + "\t\t\"EventId\": \"202405101849360500000000320500\",\n" + + "\t\t\"AcceptOrder\": \"3\"\n" + + "\t}],\n" + + "\t\"TaskInfos\": [{\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 25W91\",\n" + + "\t\t\t\"RealSign\": \"25W91\",\n" + + "\t\t\t\"AmbCode\": \"32050002104\",\n" + + "\t\t\t\"StationName\": \"附二医院\",\n" + + "\t\t\t\"AmbType\": \"尼桑\",\n" + + "\t\t\t\"AmbPhone\": \"1440737287201\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-10T18:50:24\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-10T18:50:26\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-10T18:51:31\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-10T19:01:10\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-10T19:05:37\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"黄松鹤\",\n" + + "\t\t\t\"Doctor\": \"孟甦\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"范玲玲\",\n" + + "\t\t\t\"StationName\": \"附二医院\",\n" + + "\t\t\t\"TaskId\": \"2024051018493605000000003205000201\",\n" + + "\t\t\t\"AcceptOrder\": \"2\",\n" + + "\t\t\t\"AcceptId\": \"20240510184936050000000032050002\",\n" + + "\t\t\t\"EventId\": \"202405101849360500000000320500\"\n" + + "\t\t}\n" + + "\t}, {\n" + + "\t\t\"Amb\": {\n" + + "\t\t\t\"PlateNumber\": \"苏U 25W91\",\n" + + "\t\t\t\"RealSign\": \"25W91\",\n" + + "\t\t\t\"AmbCode\": \"32050002104\",\n" + + "\t\t\t\"StationName\": \"附二医院\",\n" + + "\t\t\t\"AmbType\": \"尼桑\",\n" + + "\t\t\t\"AmbPhone\": \"1440737287201\"\n" + + "\t\t},\n" + + "\t\t\"Task\": {\n" + + "\t\t\t\"IsOver\": true,\n" + + "\t\t\t\"TaskCreatedDateTime\": \"2024-05-10T19:08:43\",\n" + + "\t\t\t\"AcceptOrderDateTime\": \"2024-05-10T19:08:44\",\n" + + "\t\t\t\"OutAmbDateTime\": \"2024-05-10T19:08:46\",\n" + + "\t\t\t\"ArriveSceneDateTime\": \"2024-05-10T19:08:52\",\n" + + "\t\t\t\"LeaveSceneDateTime\": \"2024-05-10T19:12:40\",\n" + + "\t\t\t\"IsNormalOver\": true,\n" + + "\t\t\t\"Driver\": \"黄松鹤\",\n" + + "\t\t\t\"Doctor\": \"孟甦\",\n" + + "\t\t\t\"Stretcher\": \"\",\n" + + "\t\t\t\"Nurse\": \"范玲玲\",\n" + + "\t\t\t\"StationName\": \"附二医院\",\n" + + "\t\t\t\"TaskId\": \"2024051018493605000000003205000301\",\n" + + "\t\t\t\"AcceptOrder\": \"3\",\n" + + "\t\t\t\"AcceptId\": \"20240510184936050000000032050003\",\n" + + "\t\t\t\"EventId\": \"202405101849360500000000320500\"\n" + + "\t\t}\n" + + "\t}],\n" + + "\t\"EventName\": \"西环路福马小区门口——两电瓶车\",\n" + + "\t\"EventType\": \"110联动\",\n" + + "\t\"EventDateTime\": \"2024-05-10T18:49:36\",\n" + + "\t\"EventArea\": \"姑苏区\",\n" + + "\t\"EventAddress\": \"西环路福马小区门口\",\n" + + "\t\"EventLongitude\": 120.569326318179,\n" + + "\t\"EventLatitude\": 31.3161364062648,\n" + + "\t\"SendAmbCount\": 2,\n" + + "\t\"EventId\": \"202405101849360500000000320500\"\n" + + "}\n" + + "],\n" + + " \"msg\": null,\n" + + " \"code\": 200\n" + + "}"; + JSONObject json = JSONObject.parse(s); + Object data = json.get("data"); + List list; + if (BeanUtil.isNotEmpty(data)) { + saveResponseData(data); + } + } +} \ No newline at end of file diff --git a/rescue/src/main/java/com/yingji/service/impl/AmbServiceImpl.java b/rescue/src/main/java/com/yingji/service/impl/AmbServiceImpl.java new file mode 100644 index 0000000..b66043a --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/impl/AmbServiceImpl.java @@ -0,0 +1,19 @@ +package com.yingji.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.Amb; +import com.yingji.mapper.AmbMapper; +import com.yingji.service.AmbService; +import org.springframework.stereotype.Service; + +/** + * 任务车辆(Amb)表服务实现类 + * + * @author wu + * @since 2024-05-10 17:10:32 + */ +@Service("ambService") +public class AmbServiceImpl extends ServiceImpl implements AmbService { + +} + diff --git a/rescue/src/main/java/com/yingji/service/impl/EventServiceImpl.java b/rescue/src/main/java/com/yingji/service/impl/EventServiceImpl.java new file mode 100644 index 0000000..fa5339a --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/impl/EventServiceImpl.java @@ -0,0 +1,107 @@ +package com.yingji.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.AcceptEvents; +import com.yingji.entity.Amb; +import com.yingji.entity.Event; +import com.yingji.entity.Task; +import com.yingji.entity.dto.response.EventPageRequest; +import com.yingji.entity.dto.response.EventsFindResponse; +import com.yingji.exception.ServiceException; +import com.yingji.mapper.EventMapper; +import com.yingji.service.AcceptService; +import com.yingji.service.AmbService; +import com.yingji.service.EventService; +import com.yingji.service.TaskService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.io.Serializable; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 事故(Event)表服务实现类 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +@Service("eventService") +public class EventServiceImpl extends ServiceImpl implements EventService { + + @Resource + private TaskService taskService; + + @Resource + private AmbService ambService; + + @Resource + private AcceptService acceptService; + + /** + * 分页条件查询数据 + * + * @param page 分页条件 + * @param event 查询条件 + * @return 数据 + */ + @Override + public Page page(Page page, EventPageRequest event) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StrUtil.isNotEmpty(event.getEventName()), "event_name", event.getEventName()) + .eq(StrUtil.isNotEmpty(event.getEventType()), "event_type", event.getEventType()) + .eq(StrUtil.isNotEmpty(event.getEventLevel()), "event_level", event.getEventLevel()) + .ge(event.getStartTime() != null, "event_date_time", event.getStartTime()) + .le(event.getEndTime() != null, "event_date_time", event.getEndTime()) + .like(StrUtil.isNotEmpty(event.getEventArea()), "event_area", event.getEventArea()) + .like(StrUtil.isNotEmpty(event.getEventAddress()), "event_address", event.getEventAddress()) + .eq(event.getSendAmbCount() != null, "send_amb_count", event.getSendAmbCount()) + .like(StrUtil.isNotEmpty(event.getEventDescribe()), "event_describe", event.getEventDescribe()) + .like(StrUtil.isNotEmpty(event.getAlarmUnit()), "alarm_unit", event.getAlarmUnit()) + .like(StrUtil.isNotEmpty(event.getAlarmUnitContactor()), "alarm_unit_contactor", event.getAlarmUnitContactor()) + .like(StrUtil.isNotEmpty(event.getAlarmUnitTelephone()), "alarm_unit_telephone", event.getAlarmUnitTelephone()); + return this.page(page, wrapper); + } + + /** + * 根据id查询数据 + * + * @param id id + * @return 数据 + */ + @Override + public EventsFindResponse findById(Serializable id) { + Event event = this.getById(id); + if (BeanUtil.isEmpty(event)) { + throw new ServiceException("所选数据不存在"); + } + EventsFindResponse res = BeanUtil.copyProperties(event, EventsFindResponse.class); + // 查询任务信息 + QueryWrapper taskWrapper = new QueryWrapper<>(); + taskWrapper.eq("event_id", res.getEventId()); + List taskList = taskService.list(taskWrapper); + // 受理调度信息 + QueryWrapper acceptWrapper = new QueryWrapper<>(); + acceptWrapper.eq("event_id", res.getEventId()); + List acceptList = acceptService.list(acceptWrapper); + // 任务车辆 + List taskIdList = taskList.stream().map(Task::getTaskId).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(taskIdList)) { + QueryWrapper ambWrapper = new QueryWrapper<>(); + ambWrapper.in("task_id", taskIdList); + List ambList = ambService.list(ambWrapper); + res.setAmbs(ambList); + } + res.setAcceptEvents(acceptList); + res.setTasks(taskList); + return res; + } + + +} + diff --git a/rescue/src/main/java/com/yingji/service/impl/TaskServiceImpl.java b/rescue/src/main/java/com/yingji/service/impl/TaskServiceImpl.java new file mode 100644 index 0000000..7836bfa --- /dev/null +++ b/rescue/src/main/java/com/yingji/service/impl/TaskServiceImpl.java @@ -0,0 +1,19 @@ +package com.yingji.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yingji.entity.Task; +import com.yingji.mapper.TaskMapper; +import com.yingji.service.TaskService; +import org.springframework.stereotype.Service; + +/** + * 任务信息(Task)表服务实现类 + * + * @author wu + * @since 2024-05-10 17:10:33 + */ +@Service("taskService") +public class TaskServiceImpl extends ServiceImpl implements TaskService { + +} + diff --git a/rescue/src/main/resources/application-dev.yml b/rescue/src/main/resources/application-dev.yml new file mode 100644 index 0000000..287eb22 --- /dev/null +++ b/rescue/src/main/resources/application-dev.yml @@ -0,0 +1,50 @@ +# DataSource Config +spring: + datasource: + url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: 123456 + driverClassName: com.mysql.cj.jdbc.Driver + + + +# 日志配置 +logging: + level: + com.yingji: debug + org.springframework: warn + +# MyBatis配置 +mybatis-plus: + # 指定实体类所在包的路径,MyBatis-Plus 会自动扫描该路径下的实体类 + typeAliasesPackage: com.yingji.entity + # 指定 Mapper 接口所在包的路径,MyBatis-Plus 会自动扫描该路径下的 Mapper 接口 + mapperLocations: classpath*:mapper/yingji/*Mapper.xml + +knife4j: + enable: true +# openapi: +# group: +# test1: +# group-name: 应急算法 + +# 110获取token +getToken: http://2.46.4.198:8008/token + +# 110获取数据 +specificWarn: http://2.46.4.198:8008/rs/k4r3h/DataAnalysisService/sz/share/specificWarn + +# 110clientId +clientId: BNjP9S8p2EJZyt1UF+D6kCsK6ZVapyKqiGzarEdsZ3QmIWoVdB7YkrX2GBAmCDO16tQ/ak86pZgP5ZS3s4EGdco= + +# 110clientSecret +clientSecret: AM4oMOsJj0ULAUOOXlz5xHjIF4kp9W63ajZrXxTGLHEn + +# 120获取token授权码 +getAuthorizeValidateUrl: http://192.180.22.214:7015/api/Authorize/validate/v1 + +# 120获取token +getAuthorizeTokenUrl: http://192.180.22.214:7015/api/Authorize/token/get/v1 + +# 120获取数据 +getAccidentUrl: http://192.180.22.214:7015/api/Event/accident/list/get/v2 diff --git a/rescue/src/main/resources/application.yml b/rescue/src/main/resources/application.yml new file mode 100644 index 0000000..f4ee894 --- /dev/null +++ b/rescue/src/main/resources/application.yml @@ -0,0 +1,40 @@ +server: + port: 9003 +spring: + profiles: + active: dev + + redis: + host: localhost + port: 6379 + password: + database: 1 + jedis: + pool: + max-active: 8 # 最大连接数 + max-wait: 1ms # 最大阻塞时间 + max-idle: 4 + min-idle: 0 +# 日志配置 +logging: + level: + com.yingji: info + org.springframework: info + +sa-token: + # token 名称(同时也是 cookie 名称) + token-name: token + # token 有效期(单位:秒) 默认30天,-1 代表永久有效 + timeout: 86400 + # token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结 + active-timeout: -1 + # 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token) + is-share: true + # token 风格(默认可取值:uuid、simple-uuid、random-32、random-64、random-128、tik) + token-style: uuid + # 是否输出操作日志 + is-log: true + + diff --git a/rescue/src/main/resources/logback.xml b/rescue/src/main/resources/logback.xml new file mode 100644 index 0000000..9d84dc7 --- /dev/null +++ b/rescue/src/main/resources/logback.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/yingji/entity/dto/request/AccidentRequest.java b/src/main/java/com/yingji/entity/dto/request/AccidentRequest.java deleted file mode 100644 index 556e9aa..0000000 --- a/src/main/java/com/yingji/entity/dto/request/AccidentRequest.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.yingji.entity.dto.request; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - * 120获取事件请求类 - * - * @author wu - * @since 2024/4/30 下午4:09 - */ -@Data -@ApiModel(value = "120获取事件请求类") -public class AccidentRequest implements Serializable { - - private static final long serialVersionUID = -3450693580974529886L; - - /** - * 开始时间字符串 - */ - @ApiModelProperty(value = "开始时间字符串") - private String StartDateTime; - - /** - * 结束时间字符串 - */ - @ApiModelProperty(value = "结束时间字符串") - private String EndDateTime; -} diff --git a/src/main/java/com/yingji/entity/dto/request/TokenRequest.java b/src/main/java/com/yingji/entity/dto/request/TokenRequest.java deleted file mode 100644 index c9022fc..0000000 --- a/src/main/java/com/yingji/entity/dto/request/TokenRequest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.yingji.entity.dto.request; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -import java.io.Serializable; - -/** - * 120token请求类 - * - * @author wu - * @since 2024/4/30 下午4:05 - */ -@Data -@ApiModel(value = "120token请求类") -public class TokenRequest implements Serializable { - - private static final long serialVersionUID = -2538907503968466851L; - - /** - * key admin - */ - @ApiModelProperty(value = "key") - private String AKey; - - /** - * secret anchor120 - */ - @ApiModelProperty(value = "secret") - private String Asecret; - - /** - * 当前时间字符串 - */ - @ApiModelProperty(value = "当前时间字符串") - private String AccessDateTime; -} diff --git a/src/main/java/com/yingji/entity/dto/response/GeneralResponse.java b/src/main/java/com/yingji/entity/dto/response/GeneralResponse.java deleted file mode 100644 index bb629d9..0000000 --- a/src/main/java/com/yingji/entity/dto/response/GeneralResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.yingji.entity.dto.response; - -import lombok.Data; - -import java.io.Serializable; -import java.util.List; - -/** - * 通用响应类 - * - * @author wu - * @since 2024/4/30 下午4:16 - */ -@Data -public class GeneralResponse implements Serializable { - - private static final long serialVersionUID = 3346787118665022563L; - - private List data; - private String msg; - private int code; - -} diff --git a/src/main/java/com/yingji/quartz/AlarmQuartz.java b/src/main/java/com/yingji/quartz/AlarmQuartz.java deleted file mode 100644 index 2184d11..0000000 --- a/src/main/java/com/yingji/quartz/AlarmQuartz.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.yingji.quartz; - -import cn.hutool.core.util.StrUtil; -import com.yingji.entity.dto.request.AlarmRequest; -import com.yingji.redis.RedisCache; -import com.yingji.service.AlarmService; -import com.yingji.service.SourceService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; - -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.List; - -/** - * 110数据保存定时任务 - * - * @author wu - * @since 2024/05/06 10:18 - */ -@Configuration -public class AlarmQuartz { - - public static final Logger log = LoggerFactory.getLogger(AlarmQuartz.class); - - @Resource - private AlarmService alarmService; - - @Resource - private SourceService sourceService; - - @Resource - private RedisCache redisCache; - - /** - * 保存所有id - */ - @Async - @Scheduled(cron = "0 */5 * * * ? ") - public void savaData() { - // 获取token - String token = alarmService.getToken(); - if (StrUtil.isEmpty(token)) { - return; - } - String yesterdayStr; - String effectiveTimeStr = redisCache.getCacheObject("effectiveTimeStr"); - log.info("redis的缓存时间是==========================" + effectiveTimeStr); - if (StrUtil.isNotEmpty(effectiveTimeStr)) { - yesterdayStr = effectiveTimeStr; - } else { - // 获取五分钟前的时间 - LocalDateTime yesterday = LocalDateTime.now().minusMinutes(5); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); - yesterdayStr = yesterday.format(formatter) + "00"; - } - // 定义起始页 - int pageIndex = 1; - // 定义每页显示条数 - int pageSize = 5000; - // 定义总数据条数 - int size = 0; - // 定义type - String type = "getId"; - // 查询id条件 - AlarmRequest req = new AlarmRequest(); - req.setType(type); - req.setValue(yesterdayStr); - req.setPageIndex(pageIndex); - req.setPageSize(pageSize); - while (true) { - List data = alarmService.findDataIdList(req, token); - if (data == null) { - redisCache.setCacheObject("effectiveTimeStr", yesterdayStr); - return; - } - sourceService.addList(data); - size += data.size(); - if (data.size() == pageSize) { - req.setPageIndex(pageIndex++); - log.info("第" + pageIndex + "页==========================" + size + "条数据"); - } else { - redisCache.deleteObject("effectiveTimeStr"); - break; - } - } - } -} diff --git a/src/main/java/com/yingji/quartz/SaveAlarmQuartz.java b/src/main/java/com/yingji/quartz/SaveAlarmQuartz.java deleted file mode 100644 index e7d8fa4..0000000 --- a/src/main/java/com/yingji/quartz/SaveAlarmQuartz.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.yingji.quartz; - -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.util.StrUtil; -import com.yingji.entity.Alarm; -import com.yingji.entity.dto.request.AlarmRequest; -import com.yingji.service.AlarmService; -import com.yingji.service.SourceService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.annotation.Async; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -/** - * 110数据保存定时任务 - * - * @author wu - * @since 2024/05/06 10:18 - */ -@Configuration -@Transactional(rollbackFor = Exception.class) -public class SaveAlarmQuartz { - - public static final Logger log = LoggerFactory.getLogger(SaveAlarmQuartz.class); - - @Resource - private AlarmService alarmService; - - @Resource - private SourceService sourceService; - - @Async - @Scheduled(cron = "0 */1 * * * ? ") - public void savaData() { - // 查询所有id - List data = sourceService.findSourceAll(); - // 查询数据条件 - AlarmRequest alarmRequest = new AlarmRequest(); - alarmRequest.setType("getValue"); - alarmRequest.setPageIndex(1); - alarmRequest.setPageSize(10); - // 定义成功条数 - int successNum = 0; - List list = new ArrayList<>(); - if (data == null) { - return; - } - // 获取token - String token = alarmService.getToken(); - if (StrUtil.isEmpty(token)) { - return; - } - for (String x : data) { - try { - alarmRequest.setValue(x); - Alarm alarm = alarmService.findDataList(alarmRequest, token); - if (alarm != null) { - alarm.setSourceId(x); - // todo 暂时不做去重操作 - list.add(alarm); - sourceService.delBySourceId(x); - successNum++; - Thread.sleep(200); - } else { - return; - } - } catch (Exception e) { - log.info("==========================" + e.getMessage()); - } - } - if (CollectionUtil.isNotEmpty(list)) { - alarmService.saveBatch(list); - } - log.info("成功更新=========================" + successNum + "条数据"); - - } -} diff --git a/src/main/java/com/yingji/service/impl/EventServiceImpl.java b/src/main/java/com/yingji/service/impl/EventServiceImpl.java deleted file mode 100644 index 63666bf..0000000 --- a/src/main/java/com/yingji/service/impl/EventServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.yingji.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.yingji.entity.Event; -import com.yingji.mapper.EventMapper; -import com.yingji.service.EventService; -import org.springframework.stereotype.Service; - -/** - * 事故(Event)表服务实现类 - * - * @author wu - * @since 2024-05-10 17:10:33 - */ -@Service("eventService") -public class EventServiceImpl extends ServiceImpl implements EventService { - -} - diff --git a/src/main/resources/mapper/yingji/AlarmMapper.xml b/src/main/resources/mapper/yingji/AlarmMapper.xml deleted file mode 100644 index d557995..0000000 --- a/src/main/resources/mapper/yingji/AlarmMapper.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - \ No newline at end of file