From faa4232667f87b22c207ffa590f4cbe22131a468 Mon Sep 17 00:00:00 2001 From: caojianbin <1910336823> Date: Thu, 28 Mar 2024 17:27:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=9B=BD=E9=99=85=E5=8C=96,?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=A8=A1=E5=9D=97=E9=83=A8=E5=88=86=E5=BC=80?= =?UTF-8?q?=E5=8F=913?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/api/ApiController.java | 46 +++++++ .../controller/api/ApiOutwardController.java | 137 +++++++++++++++++++++ .../system/entity/api/ApiLastLocationInfo.java | 7 ++ .../system/entity/api/ApiLocaltionDTO.java | 23 ++++ .../system/entity/api/ApiOutward.java | 67 ++++++++++ .../system/entity/api/dto/ApiOutwardPage.java | 24 ++++ .../system/entity/api/vo/ApiDeviceInfo.java | 47 +++++++ .../system/entity/api/vo/ApiDeviceStep.java | 34 +++++ .../system/entity/api/vo/ApiDeviceTemp.java | 34 +++++ .../system/mapper/api/ApiFirmMapper.java | 41 ++++++ .../system/mapper/api/ApiOutwardMapper.java | 16 +++ .../system/service/api/ApiFirmService.java | 32 +++++ .../system/service/api/ApiOutwardService.java | 16 +++ .../service/api/impl/ApiFirmServiceImpl.java | 131 ++++++++++++++++++++ .../system/mapper/api/ApiFirmMapper.xml | 28 +++++ .../system/mapper/api/ApiOutwardMapper.xml | 25 ++++ 16 files changed, 708 insertions(+) create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiOutwardController.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/ApiLastLocationInfo.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/ApiLocaltionDTO.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/ApiOutward.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/ApiOutwardPage.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceInfo.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceStep.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceTemp.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/api/ApiFirmMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/api/ApiOutwardMapper.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/api/ApiFirmService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/api/ApiOutwardService.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/service/api/impl/ApiFirmServiceImpl.java create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/api/ApiFirmMapper.xml create mode 100644 ecell-internationalize/ecell-internationalize-system/src/main/resources/com/ecell/internationalize/system/mapper/api/ApiOutwardMapper.xml diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiController.java new file mode 100644 index 0000000..e30734c --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiController.java @@ -0,0 +1,46 @@ +package com.ecell.internationalize.system.controller.api; +import com.ecell.internationalize.common.core.web.domain.R; +import com.ecell.internationalize.system.entity.api.LocationPO; +import com.ecell.internationalize.system.service.api.ApiFirmService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +@RestController +@RequestMapping("/api") +public class ApiController { + @Autowired + ApiFirmService apiFirmService; + + /** + * 根据imei查询设备信息 + * @param imei + * @return + */ + @GetMapping("/device/info/{imei}") + public R queryDeviceInfoByImei(@PathVariable(value = "imei") String imei){ + + return R.ok(apiFirmService.queryDeviceInfoByImei(imei),"操作成功"); + } + + + /** + * 根据条件查询设备轨迹信息 + * @param + * @return + */ + @PostMapping ("/device/locationList") + public R queryDeviceLocaltionList(@RequestBody LocationPO po){ + + return R.ok(apiFirmService.queryDeviceLocaltionList(po),"操作成功"); + } + + /** + * 下发刷新定位 + * @param imei + * @return + */ + @GetMapping ("/device/getLocation/{imei}") + public R getDeviceLocaltion(@PathVariable(value = "imei") String imei){ + + return R.ok(apiFirmService.getDeviceLocaltion(imei),"操作成功"); + } +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiOutwardController.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiOutwardController.java new file mode 100644 index 0000000..35d33a2 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/controller/api/ApiOutwardController.java @@ -0,0 +1,137 @@ +package com.ecell.internationalize.system.controller.api; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ecell.internationalize.common.core.context.SecurityContextHolder; +import com.ecell.internationalize.common.core.utils.locale.LocaleUtil; +import com.ecell.internationalize.common.core.utils.uuid.UUID; +import com.ecell.internationalize.common.core.web.domain.AjaxResult; +import com.ecell.internationalize.common.core.web.domain.R; +import com.ecell.internationalize.common.redis.service.RedisService; +import com.ecell.internationalize.common.system.annotation.SystemLog; +import com.ecell.internationalize.common.system.constant.FieldConstant; +import com.ecell.internationalize.system.entity.FirmManage; +import com.ecell.internationalize.system.entity.api.ApiOutward; +import com.ecell.internationalize.system.entity.api.dto.ApiOutwardPage; +import com.ecell.internationalize.system.service.FirmManageService; +import com.ecell.internationalize.system.service.api.ApiOutwardService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + *
+ * API对外开放接口 + *
+ * + * @author ${author} + * @since 2023-03-07 + */ +@RestController +@Api(value="API对外开放接口",tags={"API对外开放接口"}) +@RequestMapping("/api_outward") +public class ApiOutwardController { + @Autowired + private ApiOutwardService apiOutwardService; + @Autowired + private RedisService redisService; + @Autowired + private FirmManageService firmManageService; + /** + * 条件分页查询 + * @Author liy + * @Date 2022/7/14 16:38 + * @param apiOutwardPage 分页条件查询体 + * @Return AjaxResult + */ + @ApiOperation("APPID和APPKEY条件分页查询") + @PostMapping("api/list") + public R+ * API对外开放接口表 + *
+ * + * @author ${author} + * @since 2023-03-07 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="ApiOutward对象", description="API对外开放接口表") +public class ApiOutward implements Serializable { + +private static final long serialVersionUID=1L; + + @ApiModelProperty(example = "主键Id(新增不需要传)") + private String id; + + @ApiModelProperty(example = "APPID") + private Integer appId; + + @ApiModelProperty(example = "APPKEY") + private String appKey; + + @ApiModelProperty(example = "状态(0:禁用 , 1:启用)") + private String status; + + @ApiModelProperty(example = "厂商Id") + private String firmId; + + @ApiModelProperty(example = "标识(1:厂商:2:代理商)") + private String firmFlag; + + @ApiModelProperty(example = "代理商Id") + private String secondFirmId; + + @ApiModelProperty(example = "创建人(新增不需要传)") + private String createUser; + + @ApiModelProperty(example = "创建时间(新增不需要传)") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(example = "发起请求秒数(如一分钟多少次,单位为秒)") + private Integer second; + + @ApiModelProperty(example = "发起请求次数(如多少分钟100次)") + private Integer frequency; + + @ApiModelProperty(example = "厂商/代理商名称",hidden = true) + @TableField(exist = false) + private String firmName; +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/ApiOutwardPage.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/ApiOutwardPage.java new file mode 100644 index 0000000..b75b19e --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/dto/ApiOutwardPage.java @@ -0,0 +1,24 @@ +package com.ecell.internationalize.system.entity.api.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Title: ApiOutwardPage + * @Author: liy + * @Date: 2023/3/8 14:56 + * @Description: + * @Version:1.0 + */ +@Data +public class ApiOutwardPage { +// @ApiModelProperty(example = "厂商/代理商名称") +// private String firmName; + + @ApiModelProperty(example = "每页展示的条数") + private Integer pageSize; + + @ApiModelProperty(example = "当前的页码") + private Integer current; +} + diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceInfo.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceInfo.java new file mode 100644 index 0000000..52124f8 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceInfo.java @@ -0,0 +1,47 @@ +package com.ecell.internationalize.system.entity.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + *+ * 设备步数 + *
+ * + * @author liy + * @since 2022-07-11 + */ +@Data +public class ApiDeviceInfo { + +private static final long serialVersionUID=1L; + /** + * 日期 + */ + @ApiModelProperty(example = "日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date date; + + /** + * 手机号 + */ + @ApiModelProperty(example = "手机号") + private String phone; + + /** + * 姓名 + */ + @ApiModelProperty(example = "姓名") + private String name; + + + /** + * 手机号 + */ + @ApiModelProperty(example = "身份") + private String identity; + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceStep.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceStep.java new file mode 100644 index 0000000..6d1628d --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceStep.java @@ -0,0 +1,34 @@ +package com.ecell.internationalize.system.entity.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + *+ * 设备步数 + *
+ * + * @author liy + * @since 2022-07-11 + */ +@Data +public class ApiDeviceStep { + +private static final long serialVersionUID=1L; + /** + * 设备iMei + */ + @ApiModelProperty(example = "日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date date; + + /** + * 姓名 + */ + @ApiModelProperty(example = "步数") + private Integer num; + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceTemp.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceTemp.java new file mode 100644 index 0000000..f716240 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/entity/api/vo/ApiDeviceTemp.java @@ -0,0 +1,34 @@ +package com.ecell.internationalize.system.entity.api.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +/** + *+ * 设备步数 + *
+ * + * @author liy + * @since 2022-07-11 + */ +@Data +public class ApiDeviceTemp { + +private static final long serialVersionUID=1L; + /** + * 设备iMei + */ + @ApiModelProperty(example = "日期") + @JsonFormat(pattern = "yyyy-MM-dd") + private Date date; + + /** + * 姓名 + */ + @ApiModelProperty(example = "步数") + private String data; + +} diff --git a/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/api/ApiFirmMapper.java b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/api/ApiFirmMapper.java new file mode 100644 index 0000000..1da2e69 --- /dev/null +++ b/ecell-internationalize/ecell-internationalize-system/src/main/java/com/ecell/internationalize/system/mapper/api/ApiFirmMapper.java @@ -0,0 +1,41 @@ +package com.ecell.internationalize.system.mapper.api; +import com.ecell.internationalize.system.entity.api.ApiLastLocationInfo; +import com.ecell.internationalize.system.entity.api.ApiTrackInfo; +import com.ecell.internationalize.system.entity.api.FirmDeviceInfo; +import com.ecell.internationalize.system.entity.api.LocationPO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author borui + */ +public interface ApiFirmMapper { + /** + * 根据imei查询设备拥有者信息 + * @param imei + * @return + */ + FirmDeviceInfo queryDeviceOwnerByImei(@Param("imei") String imei); + + /** + * 根据imei查询最新位置信息 + * @param imei + * @return + */ + ApiLastLocationInfo queryLastLocationInfoByImei(@Param("imei")String imei); + + /** + * 查询轨迹总数 + * @param po + * @return + */ + Integer queryDeviceLocaltionCount( @Param("po") LocationPO po); + + /** + * 查询轨迹信息 + * @param po + * @return + */ + List+ * API对外开放接口表 Mapper 接口 + *
+ * + * @author ${author} + * @since 2023-03-07 + */ +public interface ApiOutwardMapper extends BaseMapper+ * API对外开放接口表 服务类 + *
+ * + * @author ${author} + * @since 2023-03-07 + */ +public interface ApiOutwardService extends IService