'售票按性别统计数量 增加身份证为空的处理' 添加海康接口 优化票务接口
'售票按性别统计数量 增加身份证为空的处理' 添加海康接口 优化票务接口
This commit is contained in:
commit
fb038b16d0
@ -122,6 +122,12 @@
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.hikvision.ga</groupId>
|
||||
<artifactId>artemis-http-client</artifactId>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
|
@ -0,0 +1,138 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraPageReqVO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.RegionCameraListDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.region.vo.RegionDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.service.camera.CameraService;
|
||||
import cn.iocoder.yudao.module.datacenter.service.region.RegionService;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "大屏服务 - 监控点")
|
||||
@RestController
|
||||
@RequestMapping("/camera")
|
||||
@Validated
|
||||
public class CameraApi {
|
||||
@Resource
|
||||
private CameraService cameraService;
|
||||
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
@GetMapping("/selectCameraByPageAndCondition")
|
||||
@Operation(summary = "分页条件查询监控点信息")
|
||||
@DS("hiking")
|
||||
public Map<String, Object> selectCameraByPageAndCondition(@Valid CameraPageReqVO pageReqVO) {
|
||||
// System.out.println(name);
|
||||
// CameraPageReqVO cameraPageReqVO = new CameraPageReqVO();
|
||||
// cameraPageReqVO.setName(name);
|
||||
PageResult<CameraDO> cameraPage = cameraService.getCameraPage(pageReqVO);
|
||||
List<CameraDTO> cameraDTOList = new ArrayList<>();
|
||||
cameraPage.getList().forEach(cameraDO -> {
|
||||
CameraDTO cameraDTO = new CameraDTO();
|
||||
cameraDTO.setCameraType(cameraDO.getCameraType());
|
||||
cameraDTO.setCameraName(cameraDO.getCameraName());
|
||||
cameraDTO.setId(cameraDO.getId());
|
||||
cameraDTO.setStatus(cameraDO.getStatus());
|
||||
cameraDTOList.add(cameraDTO);
|
||||
});
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("cameraDTOList", cameraDTOList);
|
||||
result.put("total", cameraPage.getTotal());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/selectPreviewUrlByCameraIndexCode")
|
||||
@Operation(summary = "获取监控点预览流URL")
|
||||
public Map<String, Object> selectPreviewUrlByCameraIndexCode(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
// String previewUrl = cameraService.getPreviewUrl(cameraIndexCode, streamType, protocol, transmode, expand, streamform);
|
||||
// result.put("previewUrl", previewUrl);
|
||||
result.put("previewUrl", "");
|
||||
result.put("传入的参数", "cameraIndexCode:" + cameraIndexCode + " streamType:" + streamType + " protocol:" + protocol + " transmode:" + transmode + " expand:" + expand + " streamform:" + streamform);
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/selectPlayBackUrlByCameraIndexCode")
|
||||
@Operation(summary = "获取监控点回放流URL")
|
||||
public Map<String, Object> selectPlayBackUrlByCameraIndexCode(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
// String playBack = cameraService.getPlayBackUrl(cameraIndexCode,recordLocation, protocol, transmode, beginTime, endTime, uuid, expand, streamform,lockType);
|
||||
// result.put("previewUrl", playBack);
|
||||
// result.put("playBackUrl", "");
|
||||
result.put("传入的参数", "cameraIndexCode:" + cameraIndexCode + " recordLocation:" + recordLocation + " protocol:" + protocol + " transmode:" + transmode + " beginTime:" + beginTime + " endTime:" + endTime + " uuid:" + uuid + " expand:" + expand + " streamform:" + streamform + " lockType:" + lockType);
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/selZoom")
|
||||
@Operation(summary = "监控点3D缩放")
|
||||
public Map<String, Object> selZoom(String cameraIndexCode, Integer startX, Integer startY, Integer endX, Integer endY) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String selZoomResult = cameraService.selZoom(cameraIndexCode, startX, startY, endX, endY);
|
||||
result.put("selZoomResult", selZoomResult);
|
||||
// result.put("selZoomResult", "");
|
||||
result.put("传入的参数", "cameraIndexCode:" + cameraIndexCode + " startX:" + startX + " startY:" + startY + " endX:" + endX + " endY:" + endY);
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/controlling")
|
||||
@Operation(summary = "云台控制")
|
||||
public Map<String, Object> controlling(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
// String controllingResult = cameraService.controlling(cameraIndexCode,action, command, speed, presetIndex);
|
||||
// result.put("selZoomResult", controllingResult);
|
||||
result.put("controllingResult", "");
|
||||
result.put("传入的参数", "cameraIndexCode:" + cameraIndexCode + " action:" + action + " command:" + command + " speed:" + speed + " presetIndex:" + presetIndex);
|
||||
result.put("status", "success");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/selectCameraByRegionIndexCode")
|
||||
@Operation(summary = "根据区域编码获取监控点信息")
|
||||
@DS("hiking")
|
||||
public Map<String, Object> selectCameraByRegionIndexCode(String regionIndexCode) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<CameraDTO> cameraDTOS = cameraService.selectCameraByRegionIndexCode(regionIndexCode);
|
||||
result.put("cameraDTOS", cameraDTOS);
|
||||
System.out.println(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/rtspTest")
|
||||
@Operation(summary = "rtsp推流测试")
|
||||
public Map<String, Object> rtspTest() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("rtsp_url", "rtsp://192.168.1.7/stream");
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/selectCameraIndexCodeByCameraName")
|
||||
@Operation(summary = "根据监控点名称获取监控点编码")
|
||||
@DS("hiking")
|
||||
public Map<String, Object> selectCameraIndexCodeByCameraName(String cameraName) {
|
||||
System.out.println(cameraName);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
String cameraIndexCode = cameraService.selectCameraIndexCodeByCameraName(cameraName);
|
||||
result.put("cameraIndexCode", cameraIndexCode);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller;
|
||||
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.RegionCameraListDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.region.vo.RegionDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.service.camera.CameraService;
|
||||
import cn.iocoder.yudao.module.datacenter.service.region.RegionService;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "大屏服务 - 区域")
|
||||
@RestController
|
||||
@RequestMapping("/region")
|
||||
@Validated
|
||||
public class RegionApi {
|
||||
@Resource
|
||||
private RegionService regionService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@DS("hiking")
|
||||
public List<RegionCameraListDTO> list() {
|
||||
return regionService.getRegionList();
|
||||
}
|
||||
}
|
@ -0,0 +1,234 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 资源 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("hiking_camera")
|
||||
@KeySequence("hiking_camera_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CameraDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 监控点唯一标识
|
||||
*/
|
||||
private String cameraIndexCode;
|
||||
/**
|
||||
* 海拔
|
||||
*/
|
||||
private String altitude;
|
||||
/**
|
||||
* 监控点类型
|
||||
*
|
||||
* 枚举 {@link TODO camera_type 对应的类}
|
||||
*/
|
||||
private Integer cameraType;
|
||||
/**
|
||||
* 监控点类型说明
|
||||
*/
|
||||
private String cameraTypeName;
|
||||
/**
|
||||
* 资源类型
|
||||
*/
|
||||
private String resourceType;
|
||||
/**
|
||||
* 设备能力集
|
||||
*/
|
||||
private String capabilitySet;
|
||||
/**
|
||||
* 能力集说明
|
||||
*/
|
||||
private String capabilitySetName;
|
||||
/**
|
||||
* 智能分析能力集
|
||||
*/
|
||||
private String intelligentSet;
|
||||
/**
|
||||
* 智能分析能力集说明
|
||||
*/
|
||||
private String intelligentSetName;
|
||||
/**
|
||||
* 通道编号
|
||||
*/
|
||||
private String channelNo;
|
||||
/**
|
||||
* 通道类型说明
|
||||
*/
|
||||
private String channelTypeName;
|
||||
/**
|
||||
* 所属编码设备唯一标识
|
||||
*/
|
||||
private String encodeDevIndexCode;
|
||||
/**
|
||||
* 所属设备类型
|
||||
*/
|
||||
private String encodeDevResourceType;
|
||||
/**
|
||||
* 所属设备类型说明
|
||||
*/
|
||||
private String encodeDevResourceTypeName;
|
||||
/**
|
||||
* 监控点国标编号
|
||||
*/
|
||||
private String gbIndexCode;
|
||||
/**
|
||||
* 键盘控制码
|
||||
*/
|
||||
private String keyBoardCode;
|
||||
/**
|
||||
* 摄像机像素
|
||||
*/
|
||||
private String pixel;
|
||||
/**
|
||||
* 云镜类型
|
||||
*/
|
||||
private String ptz;
|
||||
/**
|
||||
* 云镜类型说明
|
||||
*/
|
||||
private String ptzName;
|
||||
/**
|
||||
* 云台控制
|
||||
*/
|
||||
private String ptzController;
|
||||
/**
|
||||
* 云台控制说明
|
||||
*/
|
||||
private String ptzControllerName;
|
||||
/**
|
||||
* 录像存储位置说明
|
||||
*/
|
||||
private String recordLocationName;
|
||||
/**
|
||||
* 在线状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 在线状态说明
|
||||
*/
|
||||
private String statusName;
|
||||
/**
|
||||
* 传输协议
|
||||
*/
|
||||
private Integer transType;
|
||||
/**
|
||||
* 传输协议说明
|
||||
*/
|
||||
private String transTypeName;
|
||||
/**
|
||||
* 接入协议
|
||||
*/
|
||||
private String treatyType;
|
||||
/**
|
||||
* 接入协议说明
|
||||
*/
|
||||
private String treatyTypeName;
|
||||
/**
|
||||
* 可视域相关
|
||||
*/
|
||||
private String viewshed;
|
||||
/**
|
||||
* 唯一编码
|
||||
*/
|
||||
private String indexCode;
|
||||
/**
|
||||
* 监控点国标编号
|
||||
*/
|
||||
private String externalIndexCode;
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
private String cameraName;
|
||||
/**
|
||||
* 通道号
|
||||
*/
|
||||
private Integer chanNum;
|
||||
/**
|
||||
* 级联编号
|
||||
*/
|
||||
private String cascadeCode;
|
||||
/**
|
||||
* 父级资源编号
|
||||
*/
|
||||
private String parentIndexCode;
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal longitude;
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal latitude;
|
||||
/**
|
||||
* 海拔高度
|
||||
*/
|
||||
private String elevation;
|
||||
/**
|
||||
* 能力集
|
||||
*/
|
||||
private String capability;
|
||||
/**
|
||||
* 录像存储位置
|
||||
*/
|
||||
private String recordLocation;
|
||||
/**
|
||||
* 通道子类型
|
||||
*/
|
||||
private String channelType;
|
||||
/**
|
||||
* 所属区域
|
||||
*/
|
||||
private String regionIndexCode;
|
||||
/**
|
||||
* 所属区域路径
|
||||
*/
|
||||
private String regionPath;
|
||||
/**
|
||||
* 安装位置
|
||||
*/
|
||||
private String installLocation;
|
||||
/**
|
||||
* 数据在界面上的显示顺序
|
||||
*/
|
||||
private Integer disOrder;
|
||||
/**
|
||||
* 资源唯一编码
|
||||
*/
|
||||
private String resourceIndexCode;
|
||||
/**
|
||||
* 解码模式
|
||||
*/
|
||||
private String decodeTag;
|
||||
/**
|
||||
* 监控点关联对讲唯一标志
|
||||
*/
|
||||
private String cameraRelateTalk;
|
||||
/**
|
||||
* 所属区域路径
|
||||
*/
|
||||
private String regionName;
|
||||
/**
|
||||
* 区域路径名称
|
||||
*/
|
||||
private String regionPathName;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "监控点 Response DTO")
|
||||
@Data
|
||||
public class CameraDTO {
|
||||
@Schema(description = "监控点ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "监控点名称")
|
||||
private String cameraName;
|
||||
|
||||
@Schema(description = "监控点类型")
|
||||
private Integer cameraType;
|
||||
|
||||
@Schema(description = "监控点状态")
|
||||
private String status;
|
||||
|
||||
private Integer leaf = 1;
|
||||
// @Schema(description = "预览URL")
|
||||
// private String previewUrl;
|
||||
//
|
||||
// @Schema(description = "回放URL")
|
||||
// private String playBackUrl;
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 资源分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CameraPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "监控点类型说明")
|
||||
private String cameraTypeName;
|
||||
|
||||
@Schema(description = "资源类型")
|
||||
private String resourceType;
|
||||
|
||||
@Schema(description = "通道类型说明")
|
||||
private String channelTypeName;
|
||||
|
||||
@Schema(description = "传输协议说明")
|
||||
private String transTypeName;
|
||||
|
||||
@Schema(description = "接入协议说明")
|
||||
private String treatyTypeName;
|
||||
|
||||
@Schema(description = "资源名称")
|
||||
private String cameraName;
|
||||
|
||||
@Schema(description = "安装位置")
|
||||
private String installLocation;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] updateTime;
|
||||
|
||||
}
|
@ -0,0 +1,174 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 资源 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CameraRespVO {
|
||||
|
||||
@Schema(description = "监控点唯一标识")
|
||||
@ExcelProperty("监控点唯一标识")
|
||||
private String cameraIndexCode;
|
||||
|
||||
@Schema(description = "海拔")
|
||||
@ExcelProperty("海拔")
|
||||
private String altitude;
|
||||
|
||||
@Schema(description = "监控点类型")
|
||||
@ExcelProperty(value = "监控点类型", converter = DictConvert.class)
|
||||
@DictFormat("camera_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer cameraType;
|
||||
|
||||
@Schema(description = "监控点类型说明")
|
||||
@ExcelProperty("监控点类型说明")
|
||||
private String cameraTypeName;
|
||||
|
||||
@Schema(description = "资源类型")
|
||||
@ExcelProperty("资源类型")
|
||||
private String resourceType;
|
||||
|
||||
@Schema(description = "设备能力集")
|
||||
@ExcelProperty("设备能力集")
|
||||
private String capabilitySet;
|
||||
|
||||
@Schema(description = "能力集说明")
|
||||
@ExcelProperty("能力集说明")
|
||||
private String capabilitySetName;
|
||||
|
||||
@Schema(description = "通道编号")
|
||||
@ExcelProperty("通道编号")
|
||||
private String channelNo;
|
||||
|
||||
@Schema(description = "通道类型说明")
|
||||
@ExcelProperty("通道类型说明")
|
||||
private String channelTypeName;
|
||||
|
||||
@Schema(description = "所属编码设备唯一标识")
|
||||
@ExcelProperty("所属编码设备唯一标识")
|
||||
private String encodeDevIndexCode;
|
||||
|
||||
@Schema(description = "监控点国标编号")
|
||||
@ExcelProperty("监控点国标编号")
|
||||
private String gbIndexCode;
|
||||
|
||||
@Schema(description = "键盘控制码")
|
||||
@ExcelProperty("键盘控制码")
|
||||
private String keyBoardCode;
|
||||
|
||||
@Schema(description = "录像存储位置说明")
|
||||
@ExcelProperty("录像存储位置说明")
|
||||
private String recordLocationName;
|
||||
|
||||
@Schema(description = "传输协议")
|
||||
@ExcelProperty("传输协议")
|
||||
private Integer transType;
|
||||
|
||||
@Schema(description = "传输协议说明")
|
||||
@ExcelProperty("传输协议说明")
|
||||
private String transTypeName;
|
||||
|
||||
@Schema(description = "接入协议")
|
||||
@ExcelProperty("接入协议")
|
||||
private String treatyType;
|
||||
|
||||
@Schema(description = "接入协议说明")
|
||||
@ExcelProperty("接入协议说明")
|
||||
private String treatyTypeName;
|
||||
|
||||
@Schema(description = "唯一编码")
|
||||
@ExcelProperty("唯一编码")
|
||||
private String indexCode;
|
||||
|
||||
@Schema(description = "监控点国标编号")
|
||||
@ExcelProperty("监控点国标编号")
|
||||
private String externalIndexCode;
|
||||
|
||||
@Schema(description = "资源名称")
|
||||
@ExcelProperty("资源名称")
|
||||
private String cameraName;
|
||||
|
||||
@Schema(description = "通道号")
|
||||
@ExcelProperty("通道号")
|
||||
private Integer chanNum;
|
||||
|
||||
@Schema(description = "级联编号")
|
||||
@ExcelProperty("级联编号")
|
||||
private String cascadeCode;
|
||||
|
||||
@Schema(description = "父级资源编号")
|
||||
@ExcelProperty("父级资源编号")
|
||||
private String parentIndexCode;
|
||||
|
||||
@Schema(description = "经度")
|
||||
@ExcelProperty("经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
@ExcelProperty("纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@Schema(description = "海拔高度")
|
||||
@ExcelProperty("海拔高度")
|
||||
private String elevation;
|
||||
|
||||
@Schema(description = "能力集")
|
||||
@ExcelProperty("能力集")
|
||||
private String capability;
|
||||
|
||||
@Schema(description = "录像存储位置")
|
||||
@ExcelProperty("录像存储位置")
|
||||
private String recordLocation;
|
||||
|
||||
@Schema(description = "通道子类型")
|
||||
@ExcelProperty("通道子类型")
|
||||
private String channelType;
|
||||
|
||||
@Schema(description = "所属区域")
|
||||
@ExcelProperty("所属区域")
|
||||
private String regionIndexCode;
|
||||
|
||||
@Schema(description = "所属区域路径")
|
||||
@ExcelProperty("所属区域路径")
|
||||
private String regionPath;
|
||||
|
||||
@Schema(description = "安装位置")
|
||||
@ExcelProperty("安装位置")
|
||||
private String installLocation;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private String createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private String updateTime;
|
||||
|
||||
@Schema(description = "资源唯一编码")
|
||||
@ExcelProperty("资源唯一编码")
|
||||
private String resourceIndexCode;
|
||||
|
||||
@Schema(description = "解码模式")
|
||||
@ExcelProperty("解码模式")
|
||||
private String decodeTag;
|
||||
|
||||
@Schema(description = "监控点关联对讲唯一标志")
|
||||
@ExcelProperty("监控点关联对讲唯一标志")
|
||||
private String cameraRelateTalk;
|
||||
|
||||
@Schema(description = "所属区域路径")
|
||||
@ExcelProperty("所属区域路径")
|
||||
private String regionName;
|
||||
|
||||
@Schema(description = "区域路径名称")
|
||||
@ExcelProperty("区域路径名称")
|
||||
private String regionPathName;
|
||||
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 资源新增/修改 Request VO")
|
||||
@Data
|
||||
public class CameraSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "监控点唯一标识")
|
||||
private String cameraIndexCode;
|
||||
|
||||
@Schema(description = "海拔")
|
||||
private String altitude;
|
||||
|
||||
@Schema(description = "监控点类型")
|
||||
private Integer cameraType;
|
||||
|
||||
@Schema(description = "监控点类型说明")
|
||||
private String cameraTypeName;
|
||||
|
||||
@Schema(description = "资源类型")
|
||||
private String resourceType;
|
||||
|
||||
@Schema(description = "设备能力集")
|
||||
private String capabilitySet;
|
||||
|
||||
@Schema(description = "能力集说明")
|
||||
private String capabilitySetName;
|
||||
|
||||
@Schema(description = "通道编号")
|
||||
private String channelNo;
|
||||
|
||||
@Schema(description = "通道类型说明")
|
||||
private String channelTypeName;
|
||||
|
||||
@Schema(description = "所属编码设备唯一标识")
|
||||
private String encodeDevIndexCode;
|
||||
|
||||
@Schema(description = "监控点国标编号")
|
||||
private String gbIndexCode;
|
||||
|
||||
@Schema(description = "键盘控制码")
|
||||
private String keyBoardCode;
|
||||
|
||||
@Schema(description = "录像存储位置说明")
|
||||
private String recordLocationName;
|
||||
|
||||
@Schema(description = "传输协议")
|
||||
private Integer transType;
|
||||
|
||||
@Schema(description = "传输协议说明")
|
||||
private String transTypeName;
|
||||
|
||||
@Schema(description = "接入协议")
|
||||
private String treatyType;
|
||||
|
||||
@Schema(description = "接入协议说明")
|
||||
private String treatyTypeName;
|
||||
|
||||
@Schema(description = "唯一编码")
|
||||
private String indexCode;
|
||||
|
||||
@Schema(description = "监控点国标编号")
|
||||
private String externalIndexCode;
|
||||
|
||||
@Schema(description = "资源名称")
|
||||
private String cameraName;
|
||||
|
||||
@Schema(description = "通道号")
|
||||
private Integer chanNum;
|
||||
|
||||
@Schema(description = "级联编号")
|
||||
private String cascadeCode;
|
||||
|
||||
@Schema(description = "父级资源编号")
|
||||
private String parentIndexCode;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private BigDecimal longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private BigDecimal latitude;
|
||||
|
||||
@Schema(description = "海拔高度")
|
||||
private String elevation;
|
||||
|
||||
@Schema(description = "能力集")
|
||||
private String capability;
|
||||
|
||||
@Schema(description = "录像存储位置")
|
||||
private String recordLocation;
|
||||
|
||||
@Schema(description = "通道子类型")
|
||||
private String channelType;
|
||||
|
||||
@Schema(description = "所属区域")
|
||||
private String regionIndexCode;
|
||||
|
||||
@Schema(description = "所属区域路径")
|
||||
private String regionPath;
|
||||
|
||||
@Schema(description = "安装位置")
|
||||
private String installLocation;
|
||||
|
||||
@Schema(description = "数据在界面上的显示顺序")
|
||||
private Integer disOrder;
|
||||
|
||||
@Schema(description = "资源唯一编码")
|
||||
private String resourceIndexCode;
|
||||
|
||||
@Schema(description = "解码模式")
|
||||
private String decodeTag;
|
||||
|
||||
@Schema(description = "监控点关联对讲唯一标志")
|
||||
private String cameraRelateTalk;
|
||||
|
||||
@Schema(description = "所属区域路径")
|
||||
private String regionName;
|
||||
|
||||
@Schema(description = "区域路径名称")
|
||||
private String regionPathName;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.camera.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "区域 Response DTO")
|
||||
@Data
|
||||
public class RegionCameraListDTO {
|
||||
@Schema(description = "区域唯一编码")
|
||||
private String regionIndexCode;
|
||||
@Schema(description = "区域名称")
|
||||
private String regionName;
|
||||
@Schema(description = "父区域唯一编码")
|
||||
private String parentIndexCode;
|
||||
@Schema(description = "是否为叶子节点")
|
||||
private Integer leaf;
|
||||
@Schema(description = "子区域")
|
||||
private List<RegionCameraListDTO> children = new ArrayList<>();
|
||||
@Schema(description = "摄像头列表")
|
||||
private List<CameraDTO> cameraList = new ArrayList<>();
|
||||
}
|
@ -26,12 +26,20 @@ public class CheckTicketApi {
|
||||
@Resource
|
||||
private LoginClient loginClient;
|
||||
|
||||
// @GetMapping()
|
||||
// @Operation(summary = "获得日期当天的检票人数")
|
||||
// public Long checkTicketTotal(String starTime, String endTime, String checkStationName) {
|
||||
// String replace = starTime.replace("-", "");
|
||||
// String replace1 = endTime.replace("-", "");
|
||||
// return checkTicketService.checkTicketTotal(replace,replace1, checkStationName);
|
||||
// }
|
||||
|
||||
@GetMapping()
|
||||
@Operation(summary = "获得日期当天的检票人数")
|
||||
public Long checkTicketTotal(String starTime, String endTime) {
|
||||
@Operation(summary = "获得日期当天某检查点的检票人数")
|
||||
public Long checkTicketTotal(String starTime, String endTime, String checkStationName) {
|
||||
String replace = starTime.replace("-", "");
|
||||
String replace1 = endTime.replace("-", "");
|
||||
return checkTicketService.checkTicketTotal(replace,replace1);
|
||||
return checkTicketService.checkTicketTotal(replace,replace1, checkStationName);
|
||||
}
|
||||
|
||||
@GetMapping("/qushi")
|
||||
|
@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.region.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 区域 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("hiking_region")
|
||||
@KeySequence("hiking_region_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RegionDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 区域唯一标识码
|
||||
*/
|
||||
private String indexCode;
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 父级区域唯一标识码
|
||||
*/
|
||||
private String parentIndexCode;
|
||||
/**
|
||||
* 树编号
|
||||
*/
|
||||
private String treeCode;
|
||||
/**
|
||||
* 区域类型
|
||||
*/
|
||||
private Integer regionType;
|
||||
/**
|
||||
* 区域完整路径
|
||||
*/
|
||||
private String regionPath;
|
||||
/**
|
||||
* 是否为叶子节点
|
||||
*/
|
||||
private Integer leaf;
|
||||
/**
|
||||
* 级联平台标识
|
||||
*/
|
||||
private String cascadeCode;
|
||||
/**
|
||||
* 区域标识
|
||||
*/
|
||||
private Integer cascadeType;
|
||||
/**
|
||||
* 区域类型
|
||||
*/
|
||||
private Integer catalogType;
|
||||
/**
|
||||
* 权限码
|
||||
*/
|
||||
private String authCodes;
|
||||
/**
|
||||
* 外码
|
||||
*/
|
||||
private String externalIndexCode;
|
||||
/**
|
||||
* 父外码
|
||||
*/
|
||||
private String parentExternalIndexCode;
|
||||
/**
|
||||
* 同级区域顺序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 资源状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.region.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "区域 Response DTO")
|
||||
@Data
|
||||
public class RegionDTO {
|
||||
@Schema(description = "区域唯一编码")
|
||||
private String regionIndexCode;
|
||||
@Schema(description = "区域名称")
|
||||
private String regionName;
|
||||
@Schema(description = "父区域唯一编码")
|
||||
private String parentIndexCode;
|
||||
@Schema(description = "是否为叶子节点")
|
||||
private Integer leaf;
|
||||
@Schema(description = "子区域")
|
||||
private List<RegionDTO> children = new ArrayList<>();
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.region.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 区域分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class RegionPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "区域唯一标识码")
|
||||
private String indexCode;
|
||||
|
||||
@Schema(description = "区域名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
private Integer regionType;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
private Integer catalogType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] updateTime;
|
||||
|
||||
@Schema(description = "资源状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.region.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 区域 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RegionRespVO {
|
||||
|
||||
@Schema(description = "区域唯一标识码")
|
||||
@ExcelProperty("区域唯一标识码")
|
||||
private String indexCode;
|
||||
|
||||
@Schema(description = "区域名称")
|
||||
@ExcelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
@ExcelProperty("区域类型")
|
||||
private Integer regionType;
|
||||
|
||||
@Schema(description = "区域完整路径")
|
||||
@ExcelProperty("区域完整路径")
|
||||
private String regionPath;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
@ExcelProperty("区域类型")
|
||||
private Integer catalogType;
|
||||
|
||||
@Schema(description = "权限码")
|
||||
@ExcelProperty("权限码")
|
||||
private String authCodes;
|
||||
|
||||
@Schema(description = "外码")
|
||||
@ExcelProperty("外码")
|
||||
private String externalIndexCode;
|
||||
|
||||
@Schema(description = "父外码")
|
||||
@ExcelProperty("父外码")
|
||||
private String parentExternalIndexCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "资源状态")
|
||||
@ExcelProperty("资源状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.datacenter.controller.app.region.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 区域新增/修改 Request VO")
|
||||
@Data
|
||||
public class RegionSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "区域唯一标识码")
|
||||
private String indexCode;
|
||||
|
||||
@Schema(description = "区域名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "父级区域唯一标识码")
|
||||
private String parentIndexCode;
|
||||
|
||||
@Schema(description = "树编号")
|
||||
private String treeCode;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
private Integer regionType;
|
||||
|
||||
@Schema(description = "区域完整路径")
|
||||
private String regionPath;
|
||||
|
||||
@Schema(description = "是否为叶子节点")
|
||||
private Integer leaf;
|
||||
|
||||
@Schema(description = "级联平台标识")
|
||||
private String cascadeCode;
|
||||
|
||||
@Schema(description = "区域标识")
|
||||
private Integer cascadeType;
|
||||
|
||||
@Schema(description = "区域类型")
|
||||
private Integer catalogType;
|
||||
|
||||
@Schema(description = "权限码")
|
||||
private String authCodes;
|
||||
|
||||
@Schema(description = "外码")
|
||||
private String externalIndexCode;
|
||||
|
||||
@Schema(description = "父外码")
|
||||
private String parentExternalIndexCode;
|
||||
|
||||
@Schema(description = "同级区域顺序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "资源状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -27,6 +27,7 @@ public class SaleDataApi {
|
||||
@GetMapping()
|
||||
@Operation(summary = "获得输入日期的当天总售票数")
|
||||
public Long checkTicketTotal(String starTime, String endTime) {
|
||||
System.out.println("checkTicketTotal");
|
||||
String replace = starTime.replace("-", "");
|
||||
String replace1 = endTime.replace("-", "");
|
||||
return saleDataService.countBySddate(replace, replace1);
|
||||
@ -135,6 +136,13 @@ public class SaleDataApi {
|
||||
return saleDataService.findyearJun(saleDataService.findEventsLastYear());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/thisyear/nianjunCount")
|
||||
@Operation(summary = "查询某年年度售票数量")
|
||||
public Integer findCountthisyear(Integer year) {
|
||||
System.out.println(saleDataService.findEventsByYear(year));
|
||||
return saleDataService.findEventsByYear(year).size();
|
||||
}
|
||||
// @GetMapping("/test")
|
||||
// public void testMethod(){
|
||||
//
|
||||
|
@ -14,8 +14,8 @@ public interface CheckTicketRepository extends MongoRepository<CheckTicket,Strin
|
||||
@Query("{'name': {'$regex': '?0', '$options': 'i'}}")
|
||||
Page<CheckTicket> findByName(String q, PageRequest pageable);
|
||||
|
||||
@Query("{'checkticketdate':{'$gte': ?0, '$lt': ?1}}")
|
||||
List<CheckTicket> countByCheckticketdateBetween(String starTime, String endTime);
|
||||
@Query("{'checkticketdate':{'$gte': ?0, '$lt': ?1}, 'checkstationname': {'$regex': ?2, '$options': 'i'}}")
|
||||
List<CheckTicket> countByCheckticketdateBetween(String starTime, String endTime, String checkStationName);
|
||||
|
||||
@Query("{'checktickettime':{'$gte': ?0, '$lt': ?1},'checkticketdate':{'$dt': ?2}}")
|
||||
List<CheckTicket> findByTimestampBetweenAndCheckticketdate(String startTime, String endTime,String day);
|
||||
|
@ -36,12 +36,43 @@ public interface SaleDataTodayRepository extends MongoRepository<SaleDataToday,S
|
||||
|
||||
@Aggregation(pipeline = {
|
||||
"{$match: {sddate: { $gte: ?0, $lte: ?1 }}}",
|
||||
"{$project: {certLength: {$strLenCP: '$certificateno'}, secondLastChar: {$substrCP: ['$certificateno', {$subtract: [{$strLenCP: '$certificateno'}, 2]}, 1]}}}",
|
||||
"{$group: {_id: null, maleCount: {$sum: {$cond: {if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 1]}, then: 1, else: 0}}}, femaleCount: {$sum: {$cond: {if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 0]}, then: 1, else: 0}}}, totalCount: {$sum: 1}}}",
|
||||
"{$project: {_id: 0, maleCount: 1, femaleCount: 1, maleRatio: {$divide: ['$maleCount', '$totalCount']}}}"
|
||||
"{$project: {" +
|
||||
// 使用 $ifNull 处理 certficateno 为 null 或空字符串的情况
|
||||
" certLength: {$strLenCP: {$ifNull: ['$certificateno', '']}}, " +
|
||||
// 获取倒数第二个字符,并处理 certficateno 为 null 或长度小于 2 的情况
|
||||
" secondLastChar: {$cond: {" +
|
||||
" if: {$gte: [{$strLenCP: {$ifNull: ['$certificateno', '']}}, 2]}," +
|
||||
" then: {$substrCP: [" +
|
||||
" {$ifNull: ['$certificateno', '']}," +
|
||||
" {$subtract: [{$strLenCP: {$ifNull: ['$certificateno', '']}}, 2]}, 1" +
|
||||
" ]}, " +
|
||||
" else: '0'" + // 如果 certficateno 长度小于 2,返回 '0'
|
||||
" }}" +
|
||||
"}}",
|
||||
"{$group: {" +
|
||||
" _id: null," +
|
||||
// 统计男性人数,倒数第二个字符是奇数
|
||||
" maleCount: {$sum: {$cond: {" +
|
||||
" if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 1]}," +
|
||||
" then: 1, else: 0" +
|
||||
" }}}," +
|
||||
// 统计女性人数,倒数第二个字符是偶数
|
||||
" femaleCount: {$sum: {$cond: {" +
|
||||
" if: {$eq: [{$mod: [{$toInt: '$secondLastChar'}, 2]}, 0]}," +
|
||||
" then: 1, else: 0" +
|
||||
" }}}," +
|
||||
" totalCount: {$sum: 1}" + // 总数
|
||||
"}}",
|
||||
"{$project: {" +
|
||||
" _id: 0," +
|
||||
" maleCount: 1," +
|
||||
" femaleCount: 1," +
|
||||
" maleRatio: {$divide: ['$maleCount', '$totalCount']}" + // 计算男性比例
|
||||
"}}"
|
||||
})
|
||||
AggregationVO findAllByCertificatenoSDTime(String starTime, String endTime);
|
||||
|
||||
|
||||
@Aggregation(pipeline = {
|
||||
"{$match: {sddate: { $gte: ?0, $lte: ?1 }}}",
|
||||
"{$match: {certificateno: {$regex: '^.{18}$'}}}",
|
||||
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.datacenter.dal.mysql.camera;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface CameraMapper extends BaseMapperX<CameraDO> {
|
||||
|
||||
default PageResult<CameraDO> selectPage(CameraPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CameraDO>()
|
||||
.likeIfPresent(CameraDO::getCameraTypeName, reqVO.getCameraTypeName())
|
||||
.eqIfPresent(CameraDO::getResourceType, reqVO.getResourceType())
|
||||
.likeIfPresent(CameraDO::getChannelTypeName, reqVO.getChannelTypeName())
|
||||
.likeIfPresent(CameraDO::getTransTypeName, reqVO.getTransTypeName())
|
||||
.likeIfPresent(CameraDO::getTreatyTypeName, reqVO.getTreatyTypeName())
|
||||
.likeIfPresent(CameraDO::getCameraName, reqVO.getCameraName())
|
||||
.eqIfPresent(CameraDO::getInstallLocation, reqVO.getInstallLocation())
|
||||
.betweenIfPresent(CameraDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(CameraDO::getUpdateTime, reqVO.getUpdateTime())
|
||||
.orderByDesc(CameraDO::getId));
|
||||
}
|
||||
|
||||
default List<CameraDO> selectCameraByRegionIndexCode(String regionIndexCode) {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDO>().eq(CameraDO::getRegionIndexCode, regionIndexCode));
|
||||
}
|
||||
|
||||
default String selectCameraIndexCodeByCameraName(String cameraName) {
|
||||
return selectOne(new LambdaQueryWrapperX<CameraDO>().eq(CameraDO::getCameraName, cameraName)).getCameraIndexCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.camera;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraPageReqVO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraSaveReqVO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 资源 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface CameraService {
|
||||
|
||||
/**
|
||||
* 创建资源
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCamera(@Valid CameraSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新资源
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCamera(@Valid CameraSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCamera(Long id);
|
||||
|
||||
/**
|
||||
* 获得资源
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 资源
|
||||
*/
|
||||
CameraDO getCamera(Long id);
|
||||
|
||||
/**
|
||||
* 获得资源分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 资源分页
|
||||
*/
|
||||
PageResult<CameraDO> getCameraPage(CameraPageReqVO pageReqVO);
|
||||
|
||||
String getPreviewUrl(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform);
|
||||
String getPlayBackUrl(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType);
|
||||
|
||||
String selZoom(String cameraIndexCode,int startX,int startY,int endX,int endY);
|
||||
String controlling(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex);
|
||||
|
||||
List<CameraDTO> selectCameraByRegionIndexCode(String regionIndexCode);
|
||||
|
||||
String selectCameraIndexCodeByCameraName(String cameraName);
|
||||
}
|
@ -0,0 +1,164 @@
|
||||
package cn.iocoder.yudao.module.datacenter.service.camera;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraDTO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraPageReqVO;
|
||||
import cn.iocoder.yudao.module.datacenter.controller.app.camera.vo.CameraSaveReqVO;
|
||||
import cn.iocoder.yudao.module.datacenter.dal.mysql.camera.CameraMapper;
|
||||
import cn.iocoder.yudao.module.datacenter.utlis.IntegrationURL;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
|
||||
/**
|
||||
* 资源 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CameraServiceImpl implements CameraService {
|
||||
|
||||
@Resource
|
||||
private CameraMapper cameraMapper;
|
||||
private ObjectMapper objectMapper;
|
||||
@Resource
|
||||
private RedisTemplate redisTemplate;
|
||||
private static final String ACCESS_TOKEN_KEY = "hikingAPI:access_token";
|
||||
|
||||
|
||||
public String getAccessToken() {
|
||||
// 检查 Redis 中是否有 access_token
|
||||
String accessToken = (String) redisTemplate.opsForValue().get(ACCESS_TOKEN_KEY);
|
||||
if (!StringUtils.isEmpty(accessToken)) {
|
||||
System.out.println("使用缓存的token:" + accessToken);
|
||||
return accessToken; // 如果存在则直接返回
|
||||
}
|
||||
|
||||
// 如果没有,调用 API 获取并存入 Redis
|
||||
System.out.println("获取新的token");
|
||||
String accessTokenUrlResp = IntegrationURL.getAccessTokenURL();
|
||||
try {
|
||||
|
||||
JsonNode jsonNode = objectMapper.readTree(accessTokenUrlResp);
|
||||
accessToken = jsonNode.get("access_token").asText();
|
||||
|
||||
// 将 access_token 存入 Redis,设置过期时间为 11 小时(有效期12小时)
|
||||
redisTemplate.opsForValue().set(ACCESS_TOKEN_KEY, accessToken, 11, TimeUnit.HOURS);
|
||||
} catch (Exception e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
public void deleteAccessToken() {
|
||||
redisTemplate.delete(ACCESS_TOKEN_KEY);
|
||||
}
|
||||
|
||||
|
||||
public Boolean checkToken(String result) {
|
||||
try {
|
||||
|
||||
JsonNode jsonNode = objectMapper.readTree(result);
|
||||
String code = jsonNode.path("code").asText();
|
||||
if ("0x02401007".equals(code)) {
|
||||
System.out.println("token失效,重新获取");
|
||||
deleteAccessToken();
|
||||
return false;
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createCamera(CameraSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CameraDO camera = BeanUtils.toBean(createReqVO, CameraDO.class);
|
||||
cameraMapper.insert(camera);
|
||||
// 返回
|
||||
return camera.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCamera(CameraSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCameraExists(updateReqVO.getId());
|
||||
// 更新
|
||||
CameraDO updateObj = BeanUtils.toBean(updateReqVO, CameraDO.class);
|
||||
cameraMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCamera(Long id) {
|
||||
// 校验存在
|
||||
validateCameraExists(id);
|
||||
// 删除
|
||||
cameraMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateCameraExists(Long id) {
|
||||
if (cameraMapper.selectById(id) == null) {
|
||||
throw exception(new ErrorCode(88888, "监控不存在"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CameraDO getCamera(Long id) {
|
||||
return cameraMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CameraDO> getCameraPage(CameraPageReqVO pageReqVO) {
|
||||
return cameraMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreviewUrl(String cameraIndexCode, Integer streamType, String protocol, Integer transmode, String expand, String streamform) {
|
||||
return IntegrationURL.getPreviewURL(cameraIndexCode, streamType, protocol, transmode, expand, streamform, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlayBackUrl(String cameraIndexCode, Integer recordLocation, String protocol, Integer transmode, String beginTime, String endTime, String uuid, String expand, String streamform, Integer lockType) {
|
||||
return IntegrationURL.getPlaybackURL(cameraIndexCode,recordLocation, protocol, transmode, beginTime, endTime, uuid, expand, streamform,lockType, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selZoom(String cameraIndexCode,int startX,int startY,int endX,int endY) {
|
||||
return IntegrationURL.getControlURL(cameraIndexCode, startX, startY, endX, endY, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String controlling(String cameraIndexCode, Integer action, String command, Integer speed, Integer presetIndex) {
|
||||
return IntegrationURL.getYunTaiOperationURL(cameraIndexCode, action, command, speed, presetIndex, getAccessToken());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CameraDTO> selectCameraByRegionIndexCode(String regionIndexCode) {
|
||||
List<CameraDO> cameraDOS = cameraMapper.selectCameraByRegionIndexCode(regionIndexCode);
|
||||
return BeanUtil.copyToList(cameraDOS, CameraDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectCameraIndexCodeByCameraName(String cameraName) {
|
||||
return cameraMapper.selectCameraIndexCodeByCameraName(cameraName);
|
||||
}
|
||||
}
|
@ -24,5 +24,5 @@ public interface CheckTicketService {
|
||||
* @param starTime 日期
|
||||
* @return long 检票人数
|
||||
*/
|
||||
public long checkTicketTotal(String starTime, String endTime);
|
||||
public long checkTicketTotal(String starTime, String endTime, String checkStationName);
|
||||
}
|
@ -92,7 +92,7 @@ public class CheckTicketServiceImpl implements CheckTicketService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public long checkTicketTotal(String starTime, String endTime) {
|
||||
public long checkTicketTotal(String starTime, String endTime, String checkStationName) {
|
||||
// 创建 DateTimeFormatter 实例以解析指定日期的格式
|
||||
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
// 解析指定日期字符串为 LocalDate 对象
|
||||
@ -102,7 +102,7 @@ public class CheckTicketServiceImpl implements CheckTicketService {
|
||||
// 格式化指定日期和下一天
|
||||
DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
String formattedNextDay = nextDay.format(outputFormatter);
|
||||
return checkTicketRepository.countByCheckticketdateBetween(starTime,formattedNextDay).size();
|
||||
return checkTicketRepository.countByCheckticketdateBetween(starTime,formattedNextDay, checkStationName).size();
|
||||
}
|
||||
|
||||
public String publicMethod(String endTime){
|
||||
|
@ -44,6 +44,7 @@ public interface SaleDataService {
|
||||
* @return
|
||||
*/
|
||||
public List<SaleData> findEventsLastYear();
|
||||
public List<SaleData> findEventsByYear(int year);
|
||||
public List<SaleData> findEventsLastYear(String starTime, String endTime);
|
||||
/**
|
||||
* 查询今年1月1日到12月31日的全部数据
|
||||
|
@ -97,6 +97,7 @@ public class SaleDataServiceImpl implements SaleDataService {
|
||||
@Override
|
||||
public List<Map<String, String>> findByAge(String starTime, String endTime) {
|
||||
AgeVo byAge = saleDataRepository.findByAge(starTime,this.publicMethod(endTime));
|
||||
System.out.println("byAge = " + byAge);
|
||||
List<Map<String,String>>map=new ArrayList<>();
|
||||
Map<String,String>map1=new LinkedHashMap<>();
|
||||
Map<String,String>map2=new LinkedHashMap<>();
|
||||
@ -136,6 +137,24 @@ public class SaleDataServiceImpl implements SaleDataService {
|
||||
String end = date.format(endOfYear);
|
||||
return saleDataRepository.findBySddateBetween(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SaleData> findEventsByYear(int year) {
|
||||
// 定义日期格式:数据库使用yyyyMMdd,传入的日期使用yyyy-MM-dd
|
||||
DateTimeFormatter outputDateFormatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
|
||||
// 获取指定年份的开始日期和结束日期
|
||||
LocalDate startOfYear = LocalDate.of(year, 1, 1);
|
||||
LocalDate endOfYear = LocalDate.of(year, 12, 31);
|
||||
|
||||
// 转换为yyyyMMdd格式的字符串
|
||||
String start = outputDateFormatter.format(startOfYear);
|
||||
String end = outputDateFormatter.format(endOfYear);
|
||||
|
||||
// 调用仓库方法查询指定年份范围内的数据
|
||||
return saleDataRepository.findBySddateBetween(start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SaleData> findEventsLastYear(String starTime, String endTime) {
|
||||
// DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
@ -156,6 +175,8 @@ public class SaleDataServiceImpl implements SaleDataService {
|
||||
String end = date.format(endOfYear);
|
||||
return saleDataRepository.findBySddateBetween(start,end);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SaleData> findEventsThisYear(String starTime, String endTime) {
|
||||
// DateTimeFormatter date = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
@ -403,7 +424,7 @@ public class SaleDataServiceImpl implements SaleDataService {
|
||||
assert date1 != null;
|
||||
calendar.setTime(date1);
|
||||
calendar.add(Calendar.DAY_OF_YEAR, -29);
|
||||
Map<String,String>map = new LinkedHashMap<>();
|
||||
Map<String,String> map = new LinkedHashMap<>();
|
||||
int count = 0;
|
||||
while (!calendar.getTime().after(date1)){
|
||||
String date = inputFormat.format(calendar.getTime());
|
||||
|
Loading…
x
Reference in New Issue
Block a user