From c649b0c53a568bf771b6964134375ba305f0450b Mon Sep 17 00:00:00 2001 From: fengchunyu Date: Mon, 18 Dec 2023 14:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=BF=E6=B5=B7=E5=B9=B3=E5=8F=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=BF=AD=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BigScreenController.java | 79 ++++-- .../controller/PoachingController.java | 68 +++-- .../domain/vo/MetaRealEstateInfoVo.java | 95 +++++++ .../domain/vo/OverviewResourcesVo.java | 11 + .../domain/vo/PersonStatissticsVo.java | 56 +++++ .../vo/TransitHuntersUserModelRecordVo.java | 207 +++++++++++++++ ...ansitHuntersUserModelRecordController.java | 146 +++++++++++ .../TransitHuntersUserRecordController.java | 13 +- ...TransitHuntersVehicleRecordController.java | 19 +- .../TransitImpUserRecordController.java | 11 +- .../TransitImpVehicleRecordController.java | 10 +- .../TransitUserRecordController.java | 10 +- .../TransitVehicleRecordController.java | 10 +- .../database/domain/MetaFishingBoatInfo.java | 43 +++- .../database/domain/MetaHuntersInfo.java | 33 +-- .../ruoyi/database/domain/MetaWharfInfo.java | 17 +- .../domain/TransitHuntersUserModelRecord.java | 236 ++++++++++++++++++ .../database/domain/TransitImpUserRecord.java | 5 +- .../domain/TransitImpVehicleRecord.java | 5 +- .../mapper/MetaRealEstateInfoMapper.java | 4 +- .../TransitHuntersUserModelRecordMapper.java | 16 ++ .../TransitHuntersUserModelRecordService.java | 32 +++ ...nsitHuntersUserModelRecordServiceImpl.java | 54 ++++ .../interceptor/DictionaryInterceptor.java | 4 +- 24 files changed, 1073 insertions(+), 111 deletions(-) create mode 100644 gather-app/src/main/java/com/ruoyi/business/domain/vo/MetaRealEstateInfoVo.java create mode 100644 gather-app/src/main/java/com/ruoyi/business/domain/vo/PersonStatissticsVo.java create mode 100644 gather-app/src/main/java/com/ruoyi/business/domain/vo/TransitHuntersUserModelRecordVo.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/mapper/TransitHuntersUserModelRecordMapper.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/service/TransitHuntersUserModelRecordService.java create mode 100644 gather-app/src/main/java/com/ruoyi/database/service/impl/TransitHuntersUserModelRecordServiceImpl.java diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index 096f91c..c5ec1db 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -6,18 +6,24 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.ruoyi.business.domain.vo.*; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.utils.NumKit; import com.ruoyi.common.utils.StringKit; +import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.database.domain.*; import com.ruoyi.database.service.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -68,7 +74,18 @@ public class BigScreenController extends BaseController { //实有单位总数 int countSydw = actualUnitInfoService.count(); + // 常驻人员查询 +// QueryWrapper queryCzryWrapper = new QueryWrapper<>(); +// queryCzryWrapper.ne("actual_user_type", 102); +// int actualUserCzryCount = actualUserInfoService.count(queryCzryWrapper); + int actualUserCzryCount = actualUserSyrkCount - actualUserLdrkCount; + + //重点人员 + int zdryCount = impUserInfoService.count(); + OverviewResourcesVo bean = new OverviewResourcesVo(); + bean.setCountCzry(StringKit.toString(actualUserCzryCount)); + bean.setCountZdry(StringKit.toString(zdryCount)); bean.setActualUserLdrkCount(StringKit.toString(actualUserLdrkCount)); bean.setActualUserSyrkCount(StringKit.toString(actualUserSyrkCount)); bean.setCountSyfw(StringKit.toString(countSyfw)); @@ -81,6 +98,20 @@ public class BigScreenController extends BaseController { } } + + @GetMapping + @ApiOperation("常驻人员列表") + public TableDataInfo list(MetaActualUserInfo metaActualUserInfo) { + startPage(); +// List list = metaActualUserInfoService.list(new QueryWrapper<>(metaActualUserInfo)); + // 常驻人员查询 + QueryWrapper queryCzryWrapper = new QueryWrapper<>(); + queryCzryWrapper.ne("actual_user_type", 102); + List list = actualUserInfoService.list(queryCzryWrapper); + return getDataTable(list); + } + + @PostMapping("/keyPersonnel") @ApiOperation("重点人员") public AjaxResult keyPersonnel() { @@ -249,9 +280,13 @@ public class BigScreenController extends BaseController { @PostMapping("/realTimeAlarmSituation") @ApiOperation("实时警情") - public AjaxResult realTimeAlarmSituation() { + public AjaxResult realTimeAlarmSituation(@ApiParam @Param("时间") String time) { try { - Date thirtyMinutesAgo = DateUtil.offsetMinute(new Date(), -30); + if (0 == NumKit.checkInt(time)) { + time = "30"; + } + + Date thirtyMinutesAgo = DateUtil.offsetMinute(new Date(), -NumKit.checkInt(time)); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.gt("alarm_response_time", DateUtil.format(thirtyMinutesAgo, "yyyyMMddHHmmss")); List metaAlarmInfos = alarmInfoService.list(queryWrapper); @@ -397,17 +432,16 @@ public class BigScreenController extends BaseController { queryWrapper.like("real_estate_address", para); queryWrapper.eq("unit_name", unit); List estateInfoList = realEstateInfoService.list(queryWrapper); - // 提取规则:如果home_name 是3位则取第一位当map中的键, - // 如果home_name是4位则取第二位当map中的键,如果低于3位或者大于4位则不取 -// Map> resultMap = estateInfoList.stream() -// .filter(info -> info.getHomeName().length() >= 3 && info.getHomeName().length() <= 4) -// .collect(Collectors.groupingBy( -// info -> info.getHomeName().length() == 3 ? String.valueOf(info.getHomeName().charAt(0)) : -// String.valueOf(info.getHomeName().charAt(1)), -// Collectors.mapping(MetaRealEstateInfo::getHomeName, Collectors.toList()) -// )); - - Map> resultMap = estateInfoList.stream() + + List modifiedEstateInfoList = estateInfoList.stream() + .map(info -> { + MetaRealEstateInfoVo modifiedInfo = new MetaRealEstateInfoVo(); + BeanUtils.copyProperties(info, modifiedInfo); + modifiedInfo.setHomeNameCn(modifiedInfo.getHomeName()); + return modifiedInfo; + }) + .collect(Collectors.toList()); + Map>> resultMap = modifiedEstateInfoList.stream() .filter(info -> info.getHomeName().length() >= 3 && info.getHomeName().length() <= 4) .collect(Collectors.groupingBy( info -> { @@ -415,9 +449,18 @@ public class BigScreenController extends BaseController { return homeName.length() == 3 ? String.valueOf(homeName.charAt(0)) : homeName.length() == 4 ? homeName.substring(0, 2) : null; }, - Collectors.mapping(MetaRealEstateInfo::getHomeName, Collectors.toList()) + Collectors.mapping( + info -> { + Map entryMap = new HashMap<>(); + entryMap.put("homeName", info.getHomeName()); + entryMap.put("address", info.getRealEstateAddress()); + return entryMap; + }, + Collectors.toList() + ) )); + return AjaxResult.success(resultMap); } catch (Exception e) { logger.info(StringKit.toString(e)); @@ -472,10 +515,10 @@ public class BigScreenController extends BaseController { buildUserInformationVo.setActualUserInfo(actHzUserInfos.get(0)); } - List syrkUserInfos = actualUserInfos.stream() - .filter(userInfo -> "101".equals(StringKit.toString(userInfo.getActualUserType()))) - .collect(Collectors.toList()); - buildUserInformationVo.setUserInfos(syrkUserInfos); +// List syrkUserInfos = actualUserInfos.stream() +// .filter(userInfo -> "101".equals(StringKit.toString(userInfo.getActualUserType()))) +// .collect(Collectors.toList()); + buildUserInformationVo.setUserInfos(actualUserInfos); } diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java index 4addc84..eae5768 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/PoachingController.java @@ -1,10 +1,13 @@ package com.ruoyi.business.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.business.domain.vo.PersonStatissticsVo; import com.ruoyi.business.domain.vo.PoachingVo; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.StringKit; +import com.ruoyi.database.domain.MetaHuntersInfo; import com.ruoyi.database.service.DevopsDeviceInfoService; import com.ruoyi.database.service.MetaHuntersInfoService; import io.swagger.annotations.Api; @@ -36,9 +39,7 @@ public class PoachingController extends BaseController { @ApiOperation("资源概况") public AjaxResult overviewResources() { try { - // 流口查询 int deviceCount = deviceInfoService.count(); - //实有房屋总数 todo 等表创建好了之后 int personCuont = huntersInfoService.count(); PoachingVo bean = new PoachingVo(); @@ -55,30 +56,47 @@ public class PoachingController extends BaseController { @ApiOperation("人员统计") public AjaxResult personnelStatistics() { try { + //非法狩猎人员总数 + int count = huntersInfoService.count(); + + //非法捕捞水产品案 + int ffblscCount = huntersInfoService.count(new QueryWrapper().eq("hunters_user_type", 1)); + //非法狩猎案 + int ffslaCount = huntersInfoService.count(new QueryWrapper().eq("hunters_user_type", 2)); + //非法猎捕杀害珍贵、濒危野生动物案 + int ffslbsCount = huntersInfoService.count(new QueryWrapper().eq("hunters_user_type", 3)); + + double ffblscPerce = (double) ffblscCount / count * 100; + ffblscPerce = Double.isNaN(ffblscPerce) ? 0 : ffblscPerce; + String ffblscPerceStr = String.format("%.0f%%", ffblscPerce); + + double ffslaPerce = (double) ffslaCount / count * 100; + ffslaPerce = Double.isNaN(ffslaPerce) ? 0 : ffslaPerce; + String ffslaPerceStr = String.format("%.0f%%", ffslaPerce); + + double ffslbsPerce = (double) ffslbsCount / count * 100; + ffslbsPerce = Double.isNaN(ffslbsPerce) ? 0 : ffslbsPerce; + String ffslbsPerceStr = String.format("%.0f%%", ffslbsPerce); + + PersonStatissticsVo bean = new PersonStatissticsVo(); + bean.setCount(count); + Map ffblscMap = new HashMap(); + ffblscMap.put("name","非法捕捞水产品案"); + ffblscMap.put("value",ffblscCount); + ffblscMap.put("percentage",ffblscPerceStr); + bean.setFfblsc(ffblscMap); + Map ffslaMap = new HashMap(); + ffslaMap.put("name","非法狩猎案"); + ffslaMap.put("value",ffslaCount); + ffslaMap.put("percentage",ffslaPerceStr); + bean.setFfsla(ffslaMap); + Map ffslbsMap = new HashMap(); + ffslbsMap.put("name","非法猎捕杀害珍贵、濒危野生动物案"); + ffslbsMap.put("value",ffslbsCount); + ffslbsMap.put("percentage",ffslbsPerceStr); + bean.setFfslbs(ffslbsMap); - Map parMap = new HashMap(); - parMap.put("ffslryCount","7644"); - Map map1 = new HashMap(); - map1.put("XX人员","34%"); - parMap.put("xx1",map1); - - Map map2 = new HashMap(); - map2.put("XX人员","23%"); - parMap.put("xx2",map2); - - Map map3 = new HashMap(); - map3.put("XX人员","17%"); - parMap.put("xx3",map3); - - Map map4 = new HashMap(); - map4.put("XX人员","12%"); - parMap.put("xx4",map4); - - Map map5 = new HashMap(); - map5.put("XX人员","14%"); - parMap.put("xx5",map5); - - return AjaxResult.success(parMap); + return AjaxResult.success(bean); } catch (Exception e) { logger.info(StringKit.toString(e)); return AjaxResult.error("请求失败,请联系管理员"); diff --git a/gather-app/src/main/java/com/ruoyi/business/domain/vo/MetaRealEstateInfoVo.java b/gather-app/src/main/java/com/ruoyi/business/domain/vo/MetaRealEstateInfoVo.java new file mode 100644 index 0000000..f7a396c --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/business/domain/vo/MetaRealEstateInfoVo.java @@ -0,0 +1,95 @@ +package com.ruoyi.business.domain.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 实有房屋信息表(MetaRealEstateInfo)Domain + * + * @author makejava + * @since 2023-12-06 15:01:30 + */ +@Data +@ApiModel(value = "MetaRealEstateInfo", description = "实有房屋信息表Vo") +public class MetaRealEstateInfoVo extends BaseEntity { + + /** + * 主键 + */ + @ApiModelProperty("主键") + private Long id; + + /** + * 房屋ID + */ + @ApiModelProperty("房屋ID") + private String homeId; + + /** + * 派出所代码 + */ + @ApiModelProperty("派出所代码") + private String policeStationCode; + + /** + * 警务区编码 + */ + @ApiModelProperty("警务区编码") + private String policeDistrictCode; + + /** + * 实有房屋地址简称 + */ + @ApiModelProperty("实有房屋地址简称") + private String realEstateBriefAddress; + + /** + * 实有房屋地址 + */ + @ApiModelProperty("实有房屋地址") + private String realEstateAddress; + + /** + * 单元名称 + */ + @ApiModelProperty("单元名称") + private String unitName; + + /** + * 楼栋名称 + */ + @ApiModelProperty("楼栋名称") + private String buildingName; + + /** + * 房屋名称 + */ + @ApiModelProperty("房屋名称") + private String homeName; + + /** + * 房屋名称 + */ + @ApiModelProperty("房屋名称") + private String homeNameCn; + + /** + * 经度 + */ + @ApiModelProperty("经度") + private Double longitude; + + /** + * 纬度 + */ + @ApiModelProperty("纬度") + private Double latitude; + +} diff --git a/gather-app/src/main/java/com/ruoyi/business/domain/vo/OverviewResourcesVo.java b/gather-app/src/main/java/com/ruoyi/business/domain/vo/OverviewResourcesVo.java index 922a41e..b5684f0 100644 --- a/gather-app/src/main/java/com/ruoyi/business/domain/vo/OverviewResourcesVo.java +++ b/gather-app/src/main/java/com/ruoyi/business/domain/vo/OverviewResourcesVo.java @@ -39,5 +39,16 @@ public class OverviewResourcesVo { @ApiModelProperty("实有单位总数") private String countSydw; + /** + * 常驻人员总数 + */ + @ApiModelProperty("常驻人员总数") + private String countCzry; + /** + * 重点人员总数 + */ + @ApiModelProperty("重点人员总数") + private String countZdry; + } diff --git a/gather-app/src/main/java/com/ruoyi/business/domain/vo/PersonStatissticsVo.java b/gather-app/src/main/java/com/ruoyi/business/domain/vo/PersonStatissticsVo.java new file mode 100644 index 0000000..4d9eb3c --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/business/domain/vo/PersonStatissticsVo.java @@ -0,0 +1,56 @@ +package com.ruoyi.business.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @Auther: cyFeng + * @Date: 2023/12/13 16:23 + * @Description: + */ +@Data +public class PersonStatissticsVo { + + /** + * 总数 + */ + @ApiModelProperty("总数") + private Integer count; + + /** + * 非法捕捞水产品案总数 + */ + @ApiModelProperty("非法捕捞水产品案总数") + private Map ffblsc; +// /** +// * 非法捕捞水产品案百分比 +// */ +// @ApiModelProperty("非法捕捞水产品案百分比") +// private String ffblscbfb; + + /** + * 非法狩猎案总数 + */ + @ApiModelProperty("非法狩猎案总数") + private Map ffsla; +// /** +// * 非法狩猎案百分比 +// */ +// @ApiModelProperty("非法狩猎案百分比") +// private String ffslabfb; + + /** + * 非法猎捕杀害珍贵、濒危野生动物案总数 + */ + @ApiModelProperty("非法猎捕杀害珍贵、濒危野生动物案总数") + private Map ffslbs; +// /** +// * 非法猎捕杀害珍贵、濒危野生动物案百分比 +// */ +// @ApiModelProperty("非法猎捕杀害珍贵、濒危野生动物案百分比") +// private String ffslbsbfb; + + +} diff --git a/gather-app/src/main/java/com/ruoyi/business/domain/vo/TransitHuntersUserModelRecordVo.java b/gather-app/src/main/java/com/ruoyi/business/domain/vo/TransitHuntersUserModelRecordVo.java new file mode 100644 index 0000000..4119b31 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/business/domain/vo/TransitHuntersUserModelRecordVo.java @@ -0,0 +1,207 @@ +package com.ruoyi.business.domain.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)Domain + * + * @author makejava + * @since 2023-12-14 13:59:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "TransitHuntersUserModelRecord", description = "非法狩猎人员模型记录表Vo") +public class TransitHuntersUserModelRecordVo extends BaseEntity { + + /** + * 主键 + */ + @ApiModelProperty("主键") + private Long id; + + /** + * 车主姓名 + */ + @ApiModelProperty("车主姓名") + private String huntersUserName; + + /** + * 证件号码 + */ + @ApiModelProperty("证件号码") + private String huntersUserIdCard; + + /** + * 狩猎人员类别 + */ + @ApiModelProperty("狩猎人员类别") + private Integer huntersUserType; + private String huntersUserTypeCn; + + /** + * 预警类型 + */ + @ApiModelProperty("预警类型") + private Integer warningType; + private String warningTypeCn; + + /** + * 预警级别 + */ + @ApiModelProperty("预警级别") + private Integer warningLevel; + private String warningLevelCn; + + /** + * 预警时间 + */ + @ApiModelProperty("预警时间") + private String warningTime; + + /** + * 预警内容 + */ + @ApiModelProperty("预警内容") + private String warningContent; + + /** + * 首次抓拍全景图 + */ + @ApiModelProperty("首次抓拍全景图") + private String firstGlobalPic; + + /** + * 首次抓拍人脸图 + */ + @ApiModelProperty("首次抓拍人脸图") + private String firstUserPic; + + /** + * 首次经过时间 + */ + @ApiModelProperty("首次经过时间") + private Long firstPassTime; + private String firstPassTimeCn; + + /** + * 首次抓拍点位编码 + */ + @ApiModelProperty("首次抓拍点位编码") + private String firstDeviceCode; + + /** + * 首次抓拍经过位置 + */ + @ApiModelProperty("首次抓拍经过位置") + private String firstDeviceAddress; + + /** + * 首次抓拍点位经度 + */ + @ApiModelProperty("首次抓拍点位经度") + private Double firstLongitude; + + /** + * 首次抓拍点位纬度 + */ + @ApiModelProperty("首次抓拍点位纬度") + private Double firstLatitude; + + /** + * 末次抓拍全景图 + */ + @ApiModelProperty("末次抓拍全景图") + private String endGlobalPic; + + /** + * 末次经过时间 + */ + @ApiModelProperty("末次经过时间") + private Long endPassTime; + private String endPassTimeCn; + + /** + * 末次抓拍人脸图 + */ + @ApiModelProperty("末次抓拍人脸图") + private String endUserPic; + + /** + * 末次抓拍点位编码 + */ + @ApiModelProperty("末次抓拍点位编码") + private String endDeviceCode; + + /** + * 末次抓拍经过位置 + */ + @ApiModelProperty("末次抓拍经过位置") + private String endDeviceAddress; + + /** + * 末次抓拍点位经度 + */ + @ApiModelProperty("末次抓拍点位经度") + private Double endLongitude; + + /** + * 末次抓拍点位纬度 + */ + @ApiModelProperty("末次抓拍点位纬度") + private Double endLatitude; + + /** + * 抓拍次数 + */ + @ApiModelProperty("抓拍次数") + private Integer captureFrequency; + private String captureFrequencyCn; + + /** + * 户籍地派出所编码 + */ + @ApiModelProperty("户籍地派出所编码") + private String houseHoldPoliceStationCode; + + /** + * 户籍地派出所名称 + */ + @ApiModelProperty("户籍地派出所名称") + private String houseHoldPoliceStationName; + + /** + * 现住地派出所编码 + */ + @ApiModelProperty("现住地派出所编码") + private String habitationPoliceStationCode; + + /** + * 现住地派出所名称 + */ + @ApiModelProperty("现住地派出所名称") + private String habitationPoliceStationName; + + /** + * 预警时间(分区) + */ + @ApiModelProperty("预警时间(分区)") + private Date partitionField; + + /** + * 滞留时间 + */ + @ApiModelProperty("滞留时间") + private String residenceTime; + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java new file mode 100644 index 0000000..e55070d --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserModelRecordController.java @@ -0,0 +1,146 @@ +package com.ruoyi.database.controller; + + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.business.domain.vo.TransitHuntersUserModelRecordVo; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.NumKit; +import com.ruoyi.common.utils.StringKit; +import com.ruoyi.common.utils.bean.BeanUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitHuntersUserModelRecord; +import com.ruoyi.database.domain.TransitHuntersUserRecord; +import com.ruoyi.database.domain.TransitVehicleRecord; +import com.ruoyi.database.service.TransitHuntersUserModelRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)Controller + * + * @author makejava + * @since 2023-12-14 13:59:04 + */ +@Api(tags = "非法狩猎人员模型记录表") +@RestController +@RequiredArgsConstructor +@RequestMapping("/base/transitHuntersUserModelRecord") +public class TransitHuntersUserModelRecordController extends BaseController { + + private final TransitHuntersUserModelRecordService transitHuntersUserModelRecordService; + + @GetMapping + @ApiOperation("查询非法狩猎人员模型记录表") + public TableDataInfo list(TransitHuntersUserModelRecord transitHuntersUserModelRecord) { + startPage(); + + QueryWrapper queryWrapper = new QueryWrapper<>(transitHuntersUserModelRecord); + + if (transitHuntersUserModelRecord.getFirstTime() != null && transitHuntersUserModelRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitHuntersUserModelRecord.getFirstTime(), transitHuntersUserModelRecord.getEndTime()); + } + List list = transitHuntersUserModelRecordService.list(queryWrapper); + List listVo = list.stream() + .map(record -> { + TransitHuntersUserModelRecordVo modelRecordVo = new TransitHuntersUserModelRecordVo(); + BeanUtils.copyProperties(record,modelRecordVo); + Long firstTime = modelRecordVo.getFirstPassTime(); + Long endTime = modelRecordVo.getEndPassTime(); + if( !"".equals(StringKit.toString(firstTime)) && !"".equals(StringKit.toString(endTime)) ){ +// int firstTimeI = NumKit.checkInt(firstTime); +// int endTimeI = NumKit.checkInt(endTime); + Long difference = endTime - firstTime; + java.time.Duration duration = java.time.Duration.ofSeconds(difference); + String formattedDuration = DateUtil.formatBetween(duration.toMillis()); + modelRecordVo.setResidenceTime(formattedDuration); + } + return modelRecordVo; + }) + .collect(Collectors.toList()); + + + return getDataTable(listVo); + } + + @PostMapping + @ApiOperation("新增非法狩猎人员模型记录表") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.INSERT) + public AjaxResult insert(@RequestBody TransitHuntersUserModelRecord transitHuntersUserModelRecord) { + return toAjax(transitHuntersUserModelRecordService.save(transitHuntersUserModelRecord)); + } + + @PutMapping + @ApiOperation("修改非法狩猎人员模型记录表") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.UPDATE) + public AjaxResult update(@RequestBody TransitHuntersUserModelRecord transitHuntersUserModelRecord) { + return toAjax(transitHuntersUserModelRecordService.updateById(transitHuntersUserModelRecord)); + } + + @DeleteMapping + @ApiOperation("删除非法狩猎人员模型记录表") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.DELETE) + public AjaxResult delete(@RequestParam("idList") List idList) { + return toAjax(transitHuntersUserModelRecordService.removeByIds(idList)); + } + + @PostMapping("/export") + @ApiOperation("导出非法狩猎人员模型记录表") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.EXPORT) + public void export(HttpServletResponse response, TransitHuntersUserModelRecord transitHuntersUserModelRecord) { + List list = transitHuntersUserModelRecordService.list(new QueryWrapper<>(transitHuntersUserModelRecord)); + ExcelUtil util = new ExcelUtil<>(TransitHuntersUserModelRecord.class); + util.exportExcel(response, list, "非法狩猎人员模型记录表"); + } + + @PostMapping("/importTemplate") + @ApiOperation("导入非法狩猎人员模型记录表模板") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.IMPORT) + public void importTemplate(HttpServletResponse response) { + ExcelUtil util = new ExcelUtil<>(TransitHuntersUserModelRecord.class); + util.importTemplateExcel(response, "场所基础信息模板"); + } + + @PostMapping("/importData") + @ApiOperation("导入非法狩猎人员模型记录表") + @Log(title = "非法狩猎人员模型记录表", businessType = BusinessType.IMPORT) + public AjaxResult importData(HttpServletResponse response, MultipartFile file) throws Exception { + ExcelUtil util = new ExcelUtil<>(TransitHuntersUserModelRecord.class); + List list = util.importExcel(file.getInputStream()); + Object result = transitHuntersUserModelRecordService.importData(list); + if (result instanceof List) { + util.exportExcel(response, (List) result, "非法狩猎人员模型记录表错误数据"); + return null; + } + return AjaxResult.success(result); + } + + public static void main(String[] args) { + + int firstTimeI = NumKit.checkInt("1699663702"); + int endTimeI = NumKit.checkInt("1699663703"); + int difference = endTimeI - firstTimeI; + +// Convert seconds to Duration + java.time.Duration duration = java.time.Duration.ofSeconds(difference); + +// Format the duration using Hutool + String formattedDuration = DateUtil.formatBetween(duration.toMillis()); + + System.out.println("Formatted Duration: " + formattedDuration); + + } + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserRecordController.java index 3d0080c..5fac8df 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersUserRecordController.java @@ -40,15 +40,14 @@ public class TransitHuntersUserRecordController extends BaseController { public TableDataInfo list(TransitHuntersUserRecord transitHuntersUserRecord) { startPage(); - List list = new ArrayList<>(); - if(transitHuntersUserRecord.getFirstTime() != null && transitHuntersUserRecord.getEndTime() != null){ - list = transitHuntersUserRecordService.list(new QueryWrapper<>(transitHuntersUserRecord) - .between("partition_field", transitHuntersUserRecord.getFirstTime(), transitHuntersUserRecord.getEndTime()) - ); - }else { - list = transitHuntersUserRecordService.list(new QueryWrapper<>(transitHuntersUserRecord)); + QueryWrapper queryWrapper = new QueryWrapper<>(transitHuntersUserRecord); + + if (transitHuntersUserRecord.getFirstTime() != null && transitHuntersUserRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitHuntersUserRecord.getFirstTime(), transitHuntersUserRecord.getEndTime()); } + List list = transitHuntersUserRecordService.list(queryWrapper); + return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersVehicleRecordController.java index 7665989..1496e34 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitHuntersVehicleRecordController.java @@ -2,15 +2,14 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.database.domain.TransitHuntersUserRecord; -import com.ruoyi.database.domain.TransitHuntersVehicleRecord; -import com.ruoyi.database.service.TransitHuntersVehicleRecordService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitHuntersVehicleRecord; +import com.ruoyi.database.service.TransitHuntersVehicleRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -18,7 +17,6 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; -import java.util.ArrayList; import java.util.List; /** @@ -39,17 +37,14 @@ public class TransitHuntersVehicleRecordController extends BaseController { @ApiOperation("查询非法狩猎人员车辆记录表") public TableDataInfo list(TransitHuntersVehicleRecord transitHuntersVehicleRecord) { startPage(); -// List list = transitHuntersVehicleRecordService.list(new QueryWrapper<>(transitHuntersVehicleRecord)); - List list = new ArrayList<>(); - if(transitHuntersVehicleRecord.getFirstTime() != null && transitHuntersVehicleRecord.getEndTime() != null){ - list = transitHuntersVehicleRecordService.list(new QueryWrapper<>(transitHuntersVehicleRecord) - .between("partition_field", transitHuntersVehicleRecord.getFirstTime(), transitHuntersVehicleRecord.getEndTime()) - ); - }else { - list = transitHuntersVehicleRecordService.list(new QueryWrapper<>(transitHuntersVehicleRecord)); + QueryWrapper queryWrapper = new QueryWrapper<>(transitHuntersVehicleRecord); + if (transitHuntersVehicleRecord.getFirstTime() != null && transitHuntersVehicleRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitHuntersVehicleRecord.getFirstTime(), transitHuntersVehicleRecord.getEndTime()); } + List list = transitHuntersVehicleRecordService.list(queryWrapper); + return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpUserRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpUserRecordController.java index d15250a..06ee644 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpUserRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpUserRecordController.java @@ -2,14 +2,14 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.database.domain.TransitImpUserRecord; -import com.ruoyi.database.service.TransitImpUserRecordService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitImpUserRecord; +import com.ruoyi.database.service.TransitImpUserRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -37,7 +37,12 @@ public class TransitImpUserRecordController extends BaseController { @ApiOperation("查询涉稳列管人员人脸抓拍记录表") public TableDataInfo list(TransitImpUserRecord transitImpUserRecord) { startPage(); - List list = transitImpUserRecordService.list(new QueryWrapper<>(transitImpUserRecord)); + + QueryWrapper queryWrapper = new QueryWrapper<>(transitImpUserRecord); + if (transitImpUserRecord.getFirstTime() != null && transitImpUserRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitImpUserRecord.getFirstTime(), transitImpUserRecord.getEndTime()); + } + List list = transitImpUserRecordService.list(queryWrapper); return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpVehicleRecordController.java index ea09c21..3cfc656 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitImpVehicleRecordController.java @@ -2,14 +2,14 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.database.domain.TransitImpVehicleRecord; -import com.ruoyi.database.service.TransitImpVehicleRecordService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitImpVehicleRecord; +import com.ruoyi.database.service.TransitImpVehicleRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -37,7 +37,11 @@ public class TransitImpVehicleRecordController extends BaseController { @ApiOperation("查询重点人车辆记录表") public TableDataInfo list(TransitImpVehicleRecord transitImpVehicleRecord) { startPage(); - List list = transitImpVehicleRecordService.list(new QueryWrapper<>(transitImpVehicleRecord)); + QueryWrapper queryWrapper = new QueryWrapper<>(transitImpVehicleRecord); + if (transitImpVehicleRecord.getFirstTime() != null && transitImpVehicleRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitImpVehicleRecord.getFirstTime(), transitImpVehicleRecord.getEndTime()); + } + List list = transitImpVehicleRecordService.list(queryWrapper); return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java index e1d3749..254953a 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitUserRecordController.java @@ -2,14 +2,14 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.database.domain.TransitUserRecord; -import com.ruoyi.database.service.TransitUserRecordService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitUserRecord; +import com.ruoyi.database.service.TransitUserRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -37,7 +37,11 @@ public class TransitUserRecordController extends BaseController { @ApiOperation("查询人脸记录表") public TableDataInfo list(TransitUserRecord transitUserRecord) { startPage(); - List list = transitUserRecordService.list(new QueryWrapper<>(transitUserRecord)); + QueryWrapper queryWrapper = new QueryWrapper<>(transitUserRecord); + if (transitUserRecord.getFirstTime() != null && transitUserRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitUserRecord.getFirstTime(), transitUserRecord.getEndTime()); + } + List list = transitUserRecordService.list(queryWrapper); return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java index d9d7e94..d769c10 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/TransitVehicleRecordController.java @@ -2,14 +2,14 @@ package com.ruoyi.database.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.ruoyi.database.domain.TransitVehicleRecord; -import com.ruoyi.database.service.TransitVehicleRecordService; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.database.domain.TransitVehicleRecord; +import com.ruoyi.database.service.TransitVehicleRecordService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -37,7 +37,11 @@ public class TransitVehicleRecordController extends BaseController { @ApiOperation("查询车辆记录表") public TableDataInfo list(TransitVehicleRecord transitVehicleRecord) { startPage(); - List list = transitVehicleRecordService.list(new QueryWrapper<>(transitVehicleRecord)); + QueryWrapper queryWrapper = new QueryWrapper<>(transitVehicleRecord); + if (transitVehicleRecord.getFirstTime() != null && transitVehicleRecord.getEndTime() != null) { + queryWrapper.between("partition_field", transitVehicleRecord.getFirstTime(), transitVehicleRecord.getEndTime()); + } + List list = transitVehicleRecordService.list(queryWrapper); return getDataTable(list); } diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/MetaFishingBoatInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/MetaFishingBoatInfo.java index 500e662..b9644c1 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/MetaFishingBoatInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/MetaFishingBoatInfo.java @@ -16,7 +16,7 @@ import lombok.EqualsAndHashCode; * 渔船信息表(MetaFishingBoatInfo)Domain * * @author makejava - * @since 2023-12-02 11:30:28 + * @since 2023-12-15 15:23:37 */ @Data @EqualsAndHashCode(callSuper = false) @@ -32,10 +32,24 @@ public class MetaFishingBoatInfo extends BaseEntity { private Long id; /** - * 渔船类型 + * 码头编码 */ - @ApiModelProperty("渔船类型") - @Excel(name = "渔船类型") + @ApiModelProperty("码头编码") + @Excel(name = "码头编码") + private String wharfCode; + + /** + * 码头名称 + */ + @ApiModelProperty("码头名称") + @Excel(name = "码头名称") + private String wharfName; + + /** + * 船舶类型 + */ + @ApiModelProperty("船舶类型") + @Excel(name = "船舶类型") private String fishingBoatTypeName; /** @@ -87,6 +101,20 @@ public class MetaFishingBoatInfo extends BaseEntity { @Excel(name = "船主姓名") private String crewName; + /** + * 船主证件号码 + */ + @ApiModelProperty("船主证件号码") + @Excel(name = "船主证件号码") + private String crewIdCard; + + /** + * 船主联系方式 + */ + @ApiModelProperty("船主联系方式") + @Excel(name = "船主联系方式") + private String crewPhone; + /** * 报备时间 */ @@ -101,4 +129,11 @@ public class MetaFishingBoatInfo extends BaseEntity { @Excel(name = "派出所名称") private String policeStationName; + /** + * 船舶地段名称 + */ + @ApiModelProperty("船舶地段名称") + @Excel(name = "船舶地段名称") + private String fishingBoatLocationName; + } diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/MetaHuntersInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/MetaHuntersInfo.java index 9b739f2..640617f 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/MetaHuntersInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/MetaHuntersInfo.java @@ -1,8 +1,9 @@ package com.ruoyi.database.domain; -import java.util.Date; - -import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; @@ -14,7 +15,7 @@ import lombok.EqualsAndHashCode; * 非法狩猎人员信息表(MetaHuntersInfo)Domain * * @author makejava - * @since 2023-12-09 17:22:06 + * @since 2023-12-14 13:57:52 */ @Data @EqualsAndHashCode(callSuper = false) @@ -29,21 +30,20 @@ public class MetaHuntersInfo extends BaseEntity { @TableId(value = "id", type = IdType.AUTO) private Long id; + /** + * 照片 + */ + @ApiModelProperty("照片") + @Excel(name = "照片") + private String userPic; + /** * 姓名 */ @ApiModelProperty("姓名") @Excel(name = "姓名") - @TableField(condition = SqlCondition.LIKE_RIGHT) private String hunterName; - /** - * 图片 - */ - @ApiModelProperty("图片") - @Excel(name = "图片") - private String userPic; - /** * 性别 */ @@ -58,7 +58,6 @@ public class MetaHuntersInfo extends BaseEntity { */ @ApiModelProperty("联系方式") @Excel(name = "联系方式") - @TableField(condition = SqlCondition.LIKE_RIGHT) private String phone; /** @@ -66,7 +65,6 @@ public class MetaHuntersInfo extends BaseEntity { */ @ApiModelProperty("证件号码") @Excel(name = "证件号码") - @TableField(condition = SqlCondition.LIKE_RIGHT) private String idCard; /** @@ -81,7 +79,6 @@ public class MetaHuntersInfo extends BaseEntity { */ @ApiModelProperty("户籍地址详情") @Excel(name = "户籍地址详情") - @TableField(condition = SqlCondition.LIKE_RIGHT) private String houseHoldAddress; /** @@ -89,7 +86,6 @@ public class MetaHuntersInfo extends BaseEntity { */ @ApiModelProperty("现住地详址") @Excel(name = "现住地详址") - @TableField(condition = SqlCondition.LIKE_RIGHT) private String habitationAddress; /** @@ -131,4 +127,9 @@ public class MetaHuntersInfo extends BaseEntity { @Excel(name = "登记时间") private String registrationTime; + @ApiModelProperty("人员类别") + @Excel(name = "人员类别") + private Integer huntersUserType; + @TableField(exist = false) + private String huntersUserTypeCn; } diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/MetaWharfInfo.java b/gather-app/src/main/java/com/ruoyi/database/domain/MetaWharfInfo.java index d417f16..b20f1c3 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/MetaWharfInfo.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/MetaWharfInfo.java @@ -16,7 +16,7 @@ import lombok.EqualsAndHashCode; * 码头信息表(MetaWharfInfo)Domain * * @author makejava - * @since 2023-12-12 09:01:15 + * @since 2023-12-15 15:23:37 */ @Data @EqualsAndHashCode(callSuper = false) @@ -74,14 +74,17 @@ public class MetaWharfInfo extends BaseEntity { private String wharfOwnerIdCard; /** - * 经度 + * 纬度 */ - @ApiModelProperty("经度") - private String longitude; + @ApiModelProperty("纬度") + @Excel(name = "纬度") + private Double latitude; /** - * 纬度 + * 经度 */ - @ApiModelProperty("纬度") - private String latitude; + @ApiModelProperty("经度") + @Excel(name = "经度") + private Double longitude; + } diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java b/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java new file mode 100644 index 0000000..7d8658d --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/domain/TransitHuntersUserModelRecord.java @@ -0,0 +1,236 @@ +package com.ruoyi.database.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)Domain + * + * @author makejava + * @since 2023-12-14 13:59:05 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName(value = "transit_hunters_user_model_record") +@ApiModel(value = "TransitHuntersUserModelRecord", description = "非法狩猎人员模型记录表") +public class TransitHuntersUserModelRecord extends BaseEntity { + + /** + * 主键 + */ + @ApiModelProperty("主键") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 车主姓名 + */ + @ApiModelProperty("车主姓名") + @Excel(name = "车主姓名") + private String huntersUserName; + + /** + * 证件号码 + */ + @ApiModelProperty("证件号码") + @Excel(name = "证件号码") + private String huntersUserIdCard; + + /** + * 狩猎人员类别 + */ + @ApiModelProperty("狩猎人员类别") + @Excel(name = "狩猎人员类别") + private Integer huntersUserType; + @TableField(exist = false) + private String huntersUserTypeCn; + + /** + * 预警类型 + */ + @ApiModelProperty("预警类型") + @Excel(name = "预警类型") + private Integer warningType; + @TableField(exist = false) + private String warningTypeCn; + + /** + * 预警级别 + */ + @ApiModelProperty("预警级别") + @Excel(name = "预警级别") + private Integer warningLevel; + @TableField(exist = false) + private String warningLevelCn; + + /** + * 预警时间 + */ + @ApiModelProperty("预警时间") + @Excel(name = "预警时间") + private String warningTime; + + /** + * 预警内容 + */ + @ApiModelProperty("预警内容") + @Excel(name = "预警内容") + private String warningContent; + + /** + * 首次抓拍全景图 + */ + @ApiModelProperty("首次抓拍全景图") + @Excel(name = "首次抓拍全景图") + private String firstGlobalPic; + + /** + * 首次抓拍人脸图 + */ + @ApiModelProperty("首次抓拍人脸图") + @Excel(name = "首次抓拍人脸图") + private String firstUserPic; + + /** + * 首次经过时间 + */ + @ApiModelProperty("首次经过时间") + @Excel(name = "首次经过时间") + private Long firstPassTime; + @TableField(exist = false) + private String firstPassTimeCn; + + /** + * 首次抓拍点位编码 + */ + @ApiModelProperty("首次抓拍点位编码") + @Excel(name = "首次抓拍点位编码") + private String firstDeviceCode; + + /** + * 首次抓拍经过位置 + */ + @ApiModelProperty("首次抓拍经过位置") + @Excel(name = "首次抓拍经过位置") + private String firstDeviceAddress; + + /** + * 首次抓拍点位经度 + */ + @ApiModelProperty("首次抓拍点位经度") + @Excel(name = "首次抓拍点位经度") + private Double firstLongitude; + + /** + * 首次抓拍点位纬度 + */ + @ApiModelProperty("首次抓拍点位纬度") + @Excel(name = "首次抓拍点位纬度") + private Double firstLatitude; + + /** + * 末次抓拍全景图 + */ + @ApiModelProperty("末次抓拍全景图") + @Excel(name = "末次抓拍全景图") + private String endGlobalPic; + + /** + * 末次经过时间 + */ + @ApiModelProperty("末次经过时间") + @Excel(name = "末次经过时间") + private Long endPassTime; + @TableField(exist = false) + private String endPassTimeCn; + + /** + * 末次抓拍人脸图 + */ + @ApiModelProperty("末次抓拍人脸图") + @Excel(name = "末次抓拍人脸图") + private String endUserPic; + + /** + * 末次抓拍点位编码 + */ + @ApiModelProperty("末次抓拍点位编码") + @Excel(name = "末次抓拍点位编码") + private String endDeviceCode; + + /** + * 末次抓拍经过位置 + */ + @ApiModelProperty("末次抓拍经过位置") + @Excel(name = "末次抓拍经过位置") + private String endDeviceAddress; + + /** + * 末次抓拍点位经度 + */ + @ApiModelProperty("末次抓拍点位经度") + @Excel(name = "末次抓拍点位经度") + private Double endLongitude; + + /** + * 末次抓拍点位纬度 + */ + @ApiModelProperty("末次抓拍点位纬度") + @Excel(name = "末次抓拍点位纬度") + private Double endLatitude; + + /** + * 抓拍次数 + */ + @ApiModelProperty("抓拍次数") + @Excel(name = "抓拍次数") + private Integer captureFrequency; + @TableField(exist = false) + private String captureFrequencyCn; + + /** + * 户籍地派出所编码 + */ + @ApiModelProperty("户籍地派出所编码") + @Excel(name = "户籍地派出所编码") + private String houseHoldPoliceStationCode; + + /** + * 户籍地派出所名称 + */ + @ApiModelProperty("户籍地派出所名称") + @Excel(name = "户籍地派出所名称") + private String houseHoldPoliceStationName; + + /** + * 现住地派出所编码 + */ + @ApiModelProperty("现住地派出所编码") + @Excel(name = "现住地派出所编码") + private String habitationPoliceStationCode; + + /** + * 现住地派出所名称 + */ + @ApiModelProperty("现住地派出所名称") + @Excel(name = "现住地派出所名称") + private String habitationPoliceStationName; + + /** + * 预警时间(分区) + */ + @ApiModelProperty("预警时间(分区)") + @Excel(name = "预警时间(分区)") + private Date partitionField; + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpUserRecord.java b/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpUserRecord.java index b86fb37..353e2cc 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpUserRecord.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpUserRecord.java @@ -2,9 +2,7 @@ package com.ruoyi.database.domain; import java.util.Date; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; @@ -36,6 +34,7 @@ public class TransitImpUserRecord extends BaseEntity { */ @ApiModelProperty("设备编码") @Excel(name = "设备编码") + @TableField(condition = SqlCondition.LIKE) private String deviceCode; /** diff --git a/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpVehicleRecord.java b/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpVehicleRecord.java index 9b8deab..c98dfc7 100644 --- a/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpVehicleRecord.java +++ b/gather-app/src/main/java/com/ruoyi/database/domain/TransitImpVehicleRecord.java @@ -2,9 +2,7 @@ package com.ruoyi.database.domain; import java.util.Date; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; @@ -37,6 +35,7 @@ public class TransitImpVehicleRecord extends BaseEntity { */ @ApiModelProperty("设备编码") @Excel(name = "设备编码") + @TableField(condition = SqlCondition.LIKE) private String deviceCode; /** diff --git a/gather-app/src/main/java/com/ruoyi/database/mapper/MetaRealEstateInfoMapper.java b/gather-app/src/main/java/com/ruoyi/database/mapper/MetaRealEstateInfoMapper.java index 81baa22..89e742e 100644 --- a/gather-app/src/main/java/com/ruoyi/database/mapper/MetaRealEstateInfoMapper.java +++ b/gather-app/src/main/java/com/ruoyi/database/mapper/MetaRealEstateInfoMapper.java @@ -30,14 +30,14 @@ public interface MetaRealEstateInfoMapper extends BaseMapper ")") int countRentalHousing(@Param("bean") MetaRealEstateInfo bean); - @Select("select * from ( " + + @Select("select *,count(1) count from ( " + "SELECT " + " CASE " + " WHEN CONCAT(real_estate_brief_address, building_name) REGEXP '[0-9]$' THEN CONCAT(real_estate_brief_address, building_name, '幢') " + " ELSE CONCAT(real_estate_brief_address, building_name) " + " END AS real_estate_brief_address, " + " longitude, " + - " latitude,count(1) count " + + " latitude " + "FROM meta_real_estate_info where real_estate_brief_address !='' and longitude!=0 " + ") a group by a.real_estate_brief_address") List buildLocationStatistics(); diff --git a/gather-app/src/main/java/com/ruoyi/database/mapper/TransitHuntersUserModelRecordMapper.java b/gather-app/src/main/java/com/ruoyi/database/mapper/TransitHuntersUserModelRecordMapper.java new file mode 100644 index 0000000..691a8e7 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/mapper/TransitHuntersUserModelRecordMapper.java @@ -0,0 +1,16 @@ +package com.ruoyi.database.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.database.domain.TransitHuntersUserModelRecord; +import org.apache.ibatis.annotations.Mapper; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)Mapper + * + * @author makejava + * @since 2023-12-14 13:59:05 + */ +@Mapper +public interface TransitHuntersUserModelRecordMapper extends BaseMapper { + +} diff --git a/gather-app/src/main/java/com/ruoyi/database/service/TransitHuntersUserModelRecordService.java b/gather-app/src/main/java/com/ruoyi/database/service/TransitHuntersUserModelRecordService.java new file mode 100644 index 0000000..9067d6e --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/service/TransitHuntersUserModelRecordService.java @@ -0,0 +1,32 @@ +package com.ruoyi.database.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.database.domain.TransitHuntersUserModelRecord; + +import java.util.List; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)Service + * + * @author makejava + * @since 2023-12-14 13:59:04 + */ +public interface TransitHuntersUserModelRecordService extends IService { + + /** + * 新增或者更新非法狩猎人员模型记录表 + * + * @param transitHuntersUserModelRecord 非法狩猎人员模型记录表对象 + * @return 结果 + */ + boolean insertOrUpdate(TransitHuntersUserModelRecord transitHuntersUserModelRecord); + + /** + * 导入非法狩猎人员模型记录表 + * + * @param list 非法狩猎人员模型记录表列表 + * @return 结果 + */ + Object importData(List list); +} diff --git a/gather-app/src/main/java/com/ruoyi/database/service/impl/TransitHuntersUserModelRecordServiceImpl.java b/gather-app/src/main/java/com/ruoyi/database/service/impl/TransitHuntersUserModelRecordServiceImpl.java new file mode 100644 index 0000000..72ffd18 --- /dev/null +++ b/gather-app/src/main/java/com/ruoyi/database/service/impl/TransitHuntersUserModelRecordServiceImpl.java @@ -0,0 +1,54 @@ +package com.ruoyi.database.service.impl; + + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.database.domain.TransitHuntersUserModelRecord; +import com.ruoyi.database.mapper.TransitHuntersUserModelRecordMapper; +import com.ruoyi.database.service.TransitHuntersUserModelRecordService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 非法狩猎人员模型记录表(TransitHuntersUserModelRecord)ServiceImpl + * + * @author makejava + * @since 2023-12-14 13:59:04 + */ +@Service +public class TransitHuntersUserModelRecordServiceImpl extends ServiceImpl implements TransitHuntersUserModelRecordService { + + @Override + public boolean insertOrUpdate(TransitHuntersUserModelRecord transitHuntersUserModelRecord) { + return false; + } + + @Override + public Object importData(List list) { + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + + for (TransitHuntersUserModelRecord transitHuntersUserModelRecord : list) { + try { + insertOrUpdate(transitHuntersUserModelRecord); + successNum++; + successMsg.append(StrUtil.format("
{}、待替换 {} 导入成功", successNum, "待替换")); + } catch (Exception e) { + failureNum++; + failureMsg.append(StrUtil.format("
{}、待替换 {} 导入失败:{}", failureNum, "待替换", e.getMessage())); + } + } + + if (failureNum > 0) { + failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:"); + return successMsg.toString(); + } + } +} diff --git a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java index 7362283..cdb213a 100644 --- a/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java +++ b/gather-app/src/main/java/com/ruoyi/interceptor/DictionaryInterceptor.java @@ -52,14 +52,14 @@ public class DictionaryInterceptor implements Interceptor { } // 判断字段名是否为passTime - if (StrUtil.equals(field.getName(), "passTime")) { + if (StrUtil.equals(field.getName(), "passTime") || StrUtil.equals(field.getName(), "firstPassTime") + || StrUtil.equals(field.getName(), "endPassTime") ) { field.setAccessible(true); Long passTime = (Long) field.get(obj); try { ReflectUtil.setFieldValue(obj, field.getName() + "Cn", DateUtil.format(DateUtil.date(passTime * 1000), DatePattern.NORM_DATETIME_PATTERN)); } catch (Exception ignored) { } - } if (field.getName().equals("structuredCameraType")) {