Parcourir la source

旅客信息统计,图表分析

guohuhu il y a 4 mois
Parent
commit
f4cef09c3c
12 fichiers modifiés avec 405 ajouts et 0 suppressions
  1. 21 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/controller/PassengerStatisticsController.java
  2. 37 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/InspectionTime.java
  3. 40 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/OffshoreTourists.java
  4. 22 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/ResultsAndTourists.java
  5. 42 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/RiskTrends.java
  6. 22 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/TimeAndTourists.java
  7. 52 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/enums/PassengerStatisticsEnum.java
  8. 23 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/mapper/PassengerStatisticsMapper.java
  9. 6 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/mapper/mapping/PassengerStatisticsMapper.xml
  10. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/param/PassengerStatisticsParam.java
  11. 7 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/service/PassengerStatisticsService.java
  12. 108 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/service/impl/PassengerStatisticsServiceImpl.java

+ 21 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/controller/PassengerStatisticsController.java

@@ -1,8 +1,16 @@
 package vip.xiaonuo.biz.modular.passenger.controller;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
+import vip.xiaonuo.biz.modular.passenger.param.PassengerStatisticsParam;
+import vip.xiaonuo.biz.modular.passenger.service.PassengerStatisticsService;
+import vip.xiaonuo.common.pojo.CommonResult;
 
 /**
  * 旅客统计Controller
@@ -14,4 +22,17 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @Validated
 public class PassengerStatisticsController {
+
+    @Autowired
+    PassengerStatisticsService passengerStatisticsService;
+
+    /**
+     * 旅客信息统计图表统计
+     */
+    @Operation(summary = "旅客信息统计图表统计")
+    @SaCheckPermission("/biz/passenger/chart")
+    @PostMapping("/biz/passenger/chart")
+    public CommonResult<Object> queryChart(@RequestBody PassengerStatisticsParam param) {
+        return CommonResult.data(passengerStatisticsService.queryChart(param));
+    }
 }

+ 37 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/InspectionTime.java

@@ -0,0 +1,37 @@
+package vip.xiaonuo.biz.modular.passenger.entity;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 平均查验时间实体类
+ **/
+@Data
+@Builder
+public class InspectionTime {
+
+    /** 美兰机场 */
+    @Schema(description = "美兰机场")
+    private Integer mlInspectionTime;
+
+    /** 凤凰机场 */
+    @Schema(description = "凤凰机场")
+    private Integer fhInspectionTime;
+
+    /** 博鳌机场 */
+    @Schema(description = "博鳌机场")
+    private Integer baInspectionTime;
+
+    /** 新海港 */
+    @Schema(description = "新海港")
+    private Integer xhInspectionTime;
+
+    /** 新海港 */
+    @Schema(description = "秀英港")
+    private Integer xyInspectionTime;
+
+    /** 八所港 */
+    @Schema(description = "八所港")
+    private Integer bsInspectionTime;
+}

+ 40 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/OffshoreTourists.java

@@ -0,0 +1,40 @@
+package vip.xiaonuo.biz.modular.passenger.entity;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 离岛游客实体类
+ **/
+@Data
+@Builder
+public class OffshoreTourists{
+    /** 总计 */
+    @Schema(description = "总计")
+    private Long totalTourists;
+
+    /** 美兰机场旅客 */
+    @Schema(description = "美兰机场旅客")
+    private Long mlTourists;
+
+    /** 凤凰机场旅客 */
+    @Schema(description = "凤凰机场旅客")
+    private Long fhTourists;
+
+    /** 博鳌机场旅客 */
+    @Schema(description = "博鳌机场旅客")
+    private Long baTourists;
+
+    /** 新海港旅客 */
+    @Schema(description = "新海港旅客")
+    private Long xhTourists;
+
+    /** 新海港旅客 */
+    @Schema(description = "秀英港旅客")
+    private Long xyTourists;
+
+    /** 八所港旅客 */
+    @Schema(description = "八所港旅客")
+    private Long bsTourists;
+}

+ 22 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/ResultsAndTourists.java

@@ -0,0 +1,22 @@
+package vip.xiaonuo.biz.modular.passenger.entity;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 查验通过率与拦截成功率分析用类
+ */
+@Data
+@Builder
+public class ResultsAndTourists {
+
+    /** 通过/拦截成功 */
+    @Schema(description = "通过/拦截成功")
+    private String success;
+
+    /** 不通过/拦截失败 */
+    @Schema(description = "不通过/拦截失败")
+    private String failure;
+
+}

+ 42 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/RiskTrends.java

@@ -0,0 +1,42 @@
+package vip.xiaonuo.biz.modular.passenger.entity;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 风险趋势分析
+ **/
+@Data
+@Builder
+public class RiskTrends {
+
+    /** 携带违禁品 */
+    @Schema(description = "携带违禁品")
+    private String haveContraband;
+
+    /** 申报不实 */
+    @Schema(description = "申报不实")
+    private String falseDeclaration;
+
+    /** 身份信息不符 */
+    @Schema(description = "身份信息不符")
+    private String identityError;
+
+    /** 拒绝入境 */
+    @Schema(description = "拒绝入境")
+    private String RefusalOfEntry;
+
+    /** 禁止出境 */
+    @Schema(description = "禁止出境")
+    private String barredFromLeaving;
+
+    /** 有犯罪记录 */
+    @Schema(description = "有犯罪记录")
+    private String criminalRecord;
+
+    /** 行为可疑 */
+    @Schema(description = "行为可疑")
+    private String suspiciousBehavior;
+
+}

+ 22 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/entity/TimeAndTourists.java

@@ -0,0 +1,22 @@
+package vip.xiaonuo.biz.modular.passenger.entity;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * 日流量与月流量分析类
+ */
+@Data
+@Builder
+public class TimeAndTourists {
+
+    /** 月份或者日期 */
+    @Schema(description = "月份或者时间点")
+    private String time;
+
+    /** 游客数量 */
+    @Schema(description = "游客数量")
+    private Long number;
+
+}

+ 52 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/enums/PassengerStatisticsEnum.java

@@ -0,0 +1,52 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.passenger.enums;
+
+import lombok.Getter;
+
+/**
+ * 旅客统计枚举
+ *
+ * @author xuyuxiang
+ * @date 2022/4/21 19:56
+ **/
+@Getter
+public enum PassengerStatisticsEnum {
+
+    /** 离岛旅客总量统计 */
+    OFFSHORE_TOURISTS(1),
+
+    /** 旅客日流量分析 */
+    DAY_TOURISTS(2),
+
+    /** 旅客月流量分析 */
+    MONTH_TOURISTS(3),
+
+    /** 查验通过率分析 */
+    PASSING_RATE(4),
+
+    /** 平均查验时间分析 */
+    INSPECTION_TIME(5),
+
+    /**拦截成功率分析 */
+    INTERCEPTION_SUCCESS_RATE(6),
+
+    /** 风险趋势分析 */
+    RISK_TRENDS(7);
+
+    private final Integer value;
+
+    PassengerStatisticsEnum(Integer value) {
+        this.value = value;
+    }
+}

+ 23 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/mapper/PassengerStatisticsMapper.java

@@ -0,0 +1,23 @@
+/*
+ * Copyright [2022] [https://www.xiaonuo.vip]
+ *
+ * Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
+ *
+ * 1.请不要删除和修改根目录下的LICENSE文件。
+ * 2.请不要删除和修改Snowy源码头部的版权声明。
+ * 3.本项目代码可免费商业使用,商业使用请保留源码和相关描述文件的项目出处,作者声明等。
+ * 4.分发源码时候,请注明软件出处 https://www.xiaonuo.vip
+ * 5.不可二次分发开源参与同类竞品,如有想法可联系团队xiaonuobase@qq.com商议合作。
+ * 6.若您的项目无法满足以上几点,需要更多功能代码,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
+ */
+package vip.xiaonuo.biz.modular.passenger.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import vip.xiaonuo.biz.modular.position.entity.BizPosition;
+
+/**
+ * 旅客统计Mapper接口
+ *
+ **/
+public interface PassengerStatisticsMapper extends BaseMapper<BizPosition> {
+}

+ 6 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/mapper/mapping/PassengerStatisticsMapper.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="vip.xiaonuo.biz.modular.passenger.mapper.PassengerStatisticsMapper">
+
+
+</mapper>

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/param/PassengerStatisticsParam.java

@@ -0,0 +1,25 @@
+package vip.xiaonuo.biz.modular.passenger.param;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 旅客信息统计参数
+ **/
+@Getter
+@Setter
+public class PassengerStatisticsParam {
+
+    @Schema(description = "查询类型")
+    private Integer type;
+
+    @Schema(description = "开始时间")
+    private Date startTime;
+
+    @Schema(description = "结束时间")
+    private Date endTime;
+
+}

+ 7 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/service/PassengerStatisticsService.java

@@ -1,7 +1,14 @@
 package vip.xiaonuo.biz.modular.passenger.service;
 
+import vip.xiaonuo.biz.modular.passenger.param.PassengerStatisticsParam;
+
 /**
  * 旅客统计分析Service接口
  */
 public interface PassengerStatisticsService {
+    /**
+     * [获取图表数据]
+     * @return java.lang.Object
+     */
+    Object queryChart(PassengerStatisticsParam param);
 }

+ 108 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/passenger/service/impl/PassengerStatisticsServiceImpl.java

@@ -1,7 +1,14 @@
 package vip.xiaonuo.biz.modular.passenger.service.impl;
 
 import org.springframework.stereotype.Service;
+import vip.xiaonuo.biz.modular.passenger.entity.*;
+import vip.xiaonuo.biz.modular.passenger.enums.PassengerStatisticsEnum;
+import vip.xiaonuo.biz.modular.passenger.param.PassengerStatisticsParam;
 import vip.xiaonuo.biz.modular.passenger.service.PassengerStatisticsService;
+
+import java.util.ArrayList;
+import java.util.List;
+
 @Service
 /**
  * 旅客统计分析Service接口实现类
@@ -11,4 +18,105 @@ import vip.xiaonuo.biz.modular.passenger.service.PassengerStatisticsService;
  **/
 public class PassengerStatisticsServiceImpl implements PassengerStatisticsService {
 
+    @Override
+    public Object queryChart(PassengerStatisticsParam param) {
+        Integer type = param.getType();
+        if (PassengerStatisticsEnum.OFFSHORE_TOURISTS.getValue().equals(type)){
+            OffshoreTourists offshoreTourists = OffshoreTourists.builder()
+                    .totalTourists(100092L)
+                    .mlTourists(33743L)
+                    .fhTourists(12778L)
+                    .baTourists(18744L)
+                    .xhTourists(5277L)
+                    .xyTourists(18050L)
+                    .bsTourists(11500L)
+                    .build();
+            return  offshoreTourists;
+        }else if (PassengerStatisticsEnum.DAY_TOURISTS.getValue().equals(type)){
+            List<TimeAndTourists> list = new ArrayList<>();
+            list.add(TimeAndTourists.builder().time("1").number(2923L).build());
+            list.add(TimeAndTourists.builder().time("2").number(2581L).build());
+            list.add(TimeAndTourists.builder().time("3").number(2029L).build());
+            list.add(TimeAndTourists.builder().time("4").number(3977L).build());
+            list.add(TimeAndTourists.builder().time("5").number(4119L).build());
+            list.add(TimeAndTourists.builder().time("6").number(4165L).build());
+            list.add(TimeAndTourists.builder().time("7").number(3874L).build());
+            list.add(TimeAndTourists.builder().time("8").number(4212L).build());
+            list.add(TimeAndTourists.builder().time("9").number(3825L).build());
+            list.add(TimeAndTourists.builder().time("10").number(4023L).build());
+            list.add(TimeAndTourists.builder().time("11").number(3970L).build());
+            list.add(TimeAndTourists.builder().time("12").number(4065L).build());
+            list.add(TimeAndTourists.builder().time("13").number(4776L).build());
+            list.add(TimeAndTourists.builder().time("14").number(5659L).build());
+            list.add(TimeAndTourists.builder().time("15").number(5921L).build());
+            list.add(TimeAndTourists.builder().time("16").number(4017L).build());
+            list.add(TimeAndTourists.builder().time("17").number(3869L).build());
+            list.add(TimeAndTourists.builder().time("18").number(4114L).build());
+            list.add(TimeAndTourists.builder().time("19").number(3823L).build());
+            list.add(TimeAndTourists.builder().time("20").number(4062L).build());
+            list.add(TimeAndTourists.builder().time("21").number(3968L).build());
+            list.add(TimeAndTourists.builder().time("22").number(4016L).build());
+            list.add(TimeAndTourists.builder().time("23").number(3915L).build());
+            list.add(TimeAndTourists.builder().time("24").number(3773L).build());
+            return list;
+        }else if (PassengerStatisticsEnum.MONTH_TOURISTS.getValue().equals(type)){
+            List<TimeAndTourists> list = new ArrayList<>();
+            list.add(TimeAndTourists.builder().time("1").number(16234L).build());
+            list.add(TimeAndTourists.builder().time("2").number(17546L).build());
+            list.add(TimeAndTourists.builder().time("3").number(19876L).build());
+            list.add(TimeAndTourists.builder().time("4").number(15632L).build());
+            list.add(TimeAndTourists.builder().time("5").number(18459L).build());
+            list.add(TimeAndTourists.builder().time("6").number(17021L).build());
+            list.add(TimeAndTourists.builder().time("7").number(20123L).build());
+            list.add(TimeAndTourists.builder().time("8").number(21098L).build());
+            list.add(TimeAndTourists.builder().time("9").number(14987L).build());
+            list.add(TimeAndTourists.builder().time("10").number(13201L).build());
+            list.add(TimeAndTourists.builder().time("11").number(19765L).build());
+            list.add(TimeAndTourists.builder().time("12").number(16354L).build());
+            list.add(TimeAndTourists.builder().time("13").number(15987L).build());
+            list.add(TimeAndTourists.builder().time("14").number(16745L).build());
+            list.add(TimeAndTourists.builder().time("15").number(18231L).build());
+            list.add(TimeAndTourists.builder().time("16").number(14876L).build());
+            list.add(TimeAndTourists.builder().time("17").number(19324L).build());
+            list.add(TimeAndTourists.builder().time("18").number(17658L).build());
+            list.add(TimeAndTourists.builder().time("19").number(13492L).build());
+            list.add(TimeAndTourists.builder().time("20").number(20567L).build());
+            list.add(TimeAndTourists.builder().time("21").number(12879L).build());
+            list.add(TimeAndTourists.builder().time("22").number(19123L).build());
+            list.add(TimeAndTourists.builder().time("23").number(16045L).build());
+            list.add(TimeAndTourists.builder().time("24").number(18765L).build());
+            list.add(TimeAndTourists.builder().time("25").number(15321L).build());
+            list.add(TimeAndTourists.builder().time("26").number(17984L).build());
+            list.add(TimeAndTourists.builder().time("27").number(14678L).build());
+            list.add(TimeAndTourists.builder().time("28").number(19543L).build());
+            list.add(TimeAndTourists.builder().time("29").number(16457L).build());
+            return list;
+        }else if (PassengerStatisticsEnum.PASSING_RATE.getValue().equals(type)){
+            return ResultsAndTourists.builder().success("95.5%").failure("4.5%").build();
+        }else if (PassengerStatisticsEnum.INSPECTION_TIME.getValue().equals(type)){
+            InspectionTime inspectionTime = InspectionTime.builder()
+                    .mlInspectionTime(15)
+                    .fhInspectionTime(19)
+                    .baInspectionTime(14)
+                    .xhInspectionTime(17)
+                    .xyInspectionTime(13)
+                    .bsInspectionTime(18)
+                    .build();
+            return  inspectionTime;
+        }else if (PassengerStatisticsEnum.INTERCEPTION_SUCCESS_RATE.getValue().equals(type)){
+            return ResultsAndTourists.builder().success("98.4%").failure("1.6%").build();
+        }else if (PassengerStatisticsEnum.RISK_TRENDS.getValue().equals(type)){
+            RiskTrends riskTrends = RiskTrends.builder()
+                    .haveContraband("34%")
+                    .falseDeclaration("30.9%")
+                    .identityError("20.2%")
+                    .RefusalOfEntry("5.4%")
+                    .barredFromLeaving("3.1%")
+                    .criminalRecord("1.3%")
+                    .suspiciousBehavior("5.1%")
+                    .build();
+            return  riskTrends;
+        }
+        return null;
+    }
 }