From 145b7e7a30245ec760be65bd7e472fecc3d4bcfd Mon Sep 17 00:00:00 2001
From: XinWei <2718030729@qq.com>
Date: Tue, 23 Jul 2024 16:34:44 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE=E7=A5=A8?=
=?UTF-8?q?=E5=8A=A1api?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/static/js/common.1.js | 7 +-
.../templates/common/common.macro.ftl | 8 +-
.../ludu-module-datacenter-api/pom.xml | 49 +++
.../module/datacenter/enums/ApiConstants.java | 23 ++
.../datacenter/enums/ErrorCodeConstants.java | 12 +
.../ludu-module-datacenter-biz/pom.xml | 8 +-
.../DatacenterServerApplication.java | 2 +-
.../controller/admin/asset/AssetApi.java | 40 ++
.../admin/asset/vo/AssetRespVO.java | 44 +++
.../admin/checkticket/CheckTicketApi.java | 37 ++
.../checkticket/vo/CheckTicketPageReqVO.java | 50 +++
.../checkticket/vo/CheckTicketRespVO.java | 53 +++
.../checkticket/vo/CheckTicketSaveReqVO.java | 40 ++
.../admin/saledata/SaleDataApi.java | 113 ++++++
.../controller/admin/saledata/vo/AgeVo.java | 16 +
.../admin/saledata/vo/AggregationVO.java | 10 +
.../admin/saledata/vo/SaleDataPageReqVO.java | 70 ++++
.../admin/saledata/vo/SaleDataRespVO.java | 79 ++++
.../admin/saledata/vo/SaleDataSaveReqVO.java | 61 +++
.../dal/dataobject/asset/Asset.java | 16 +
.../dataobject/checkticket/CheckTicket.java | 21 +
.../dal/dataobject/saledata/SaleData.java | 29 ++
.../dal/mongodb/asset/AssetRepository.java | 18 +
.../checkticket/CheckTicketRepository.java | 23 ++
.../mongodb/saledata/SaleDataRepository.java | 44 +++
.../rpc/config/RpcConfiguration.java | 5 +-
.../config/SecurityConfiguration.java | 2 +
.../service/asset/AssetService.java | 30 ++
.../service/asset/AssetServiceImpl.java | 81 ++++
.../checkticket/CheckTicketService.java | 28 ++
.../checkticket/CheckTicketServiceImpl.java | 59 +++
.../service/saledata/SaleDataService.java | 92 +++++
.../service/saledata/SaleDataServiceImpl.java | 360 ++++++++++++++++++
.../src/main/resources/application-local.yaml | 5 +
.../src/main/resources/application.yaml | 22 +-
.../resources/mapper/asset/AssetMapper.xml | 12 +
.../mapper/checkticket/CheckticketMapper.xml | 12 +
.../mapper/saledata/SaleDataMapper.xml | 12 +
ludu-module-datacenter/pom.xml | 1 +
.../src/main/resources/application-local.yaml | 5 +
.../src/main/resources/application.yaml | 1 -
.../src/main/resources/application.yaml | 10 +-
42 files changed, 1592 insertions(+), 18 deletions(-)
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-api/pom.xml
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ApiConstants.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ErrorCodeConstants.java
rename ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/{framework => }/DatacenterServerApplication.java (86%)
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/vo/AssetRespVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketPageReqVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketRespVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketSaveReqVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AgeVo.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AggregationVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataPageReqVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataRespVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataSaveReqVO.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/asset/Asset.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/checkticket/CheckTicket.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/saledata/SaleData.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/asset/AssetRepository.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/checkticket/CheckTicketRepository.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/saledata/SaleDataRepository.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/asset/AssetService.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/asset/AssetServiceImpl.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/checkticket/CheckTicketService.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/checkticket/CheckTicketServiceImpl.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataService.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/saledata/SaleDataServiceImpl.java
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/mapper/asset/AssetMapper.xml
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/mapper/checkticket/CheckticketMapper.xml
create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/resources/mapper/saledata/SaleDataMapper.xml
diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js
index 09c840da4..372ca0317 100644
--- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js
+++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/static/js/common.1.js
@@ -18,11 +18,12 @@ $(function(){
// 直接清理cookie,直接设置过期
document.cookie = "ACCESS_TOKEN=; max-age=0; path=/xxl-job-admin";
document.cookie = "REFRESH_TOKEN=; max-age=0; path=/xxl-job-admin";
- layer.open({
+ /*layer.open({
icon: '2',
title: I18n.system_tips,
- content: ('已退出登录请关闭当前会话框!' || I18n.logout_success)
- });
+ content: ('已退出登录!' || I18n.logout_success)
+ });*/
+ window.location.href = "http://127.0.0.1:80/logout"
/*$.post(base_url + "/logout", function(data, status) {
if (data.code == "200") {
layer.msg( I18n.logout_success );
diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl
index 47868778a..c02fe2e79 100644
--- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl
+++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/templates/common/common.macro.ftl
@@ -86,12 +86,12 @@
<#-- ${I18n.system_welcome} ${Request["XXL_JOB_LOGIN_IDENTITY"].username}-->
${I18n.system_welcome}
-<#-- -->
+
-<#--
diff --git a/ludu-module-datacenter/ludu-module-datacenter-api/pom.xml b/ludu-module-datacenter/ludu-module-datacenter-api/pom.xml
new file mode 100644
index 000000000..b9c4c58dc
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-api/pom.xml
@@ -0,0 +1,49 @@
+
+
+
+ ludu-module-datacenter
+ cn.iocoder.cloud
+ ${revision}
+
+ 4.0.0
+
+ ludu-module-datacenter-api
+
+ jar
+
+ ${project.artifactId}
+
+ 数据中心 模块 API,暴露给其它模块调用
+
+
+
+
+
+ cn.iocoder.cloud
+ yudao-common
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+ provided
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+ true
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+ true
+
+
+
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ApiConstants.java b/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ApiConstants.java
new file mode 100644
index 000000000..23beadc76
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ApiConstants.java
@@ -0,0 +1,23 @@
+package cn.iocoder.yudao.module.datacenter.enums;
+
+import cn.iocoder.yudao.framework.common.enums.RpcConstants;
+
+/**
+ * API 相关的枚举
+ *
+ * @author 芋道源码
+ */
+public class ApiConstants {
+
+ /**
+ * 服务名
+ *
+ * 注意,需要保证和 spring.application.name 保持一致
+ */
+ public static final String NAME = "datacenter-server";
+
+ public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/datacenter";
+
+ public static final String VERSION = "1.0.0";
+
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ErrorCodeConstants.java b/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ErrorCodeConstants.java
new file mode 100644
index 000000000..74f30000c
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-api/src/main/java/cn/iocoder/yudao/module/datacenter/enums/ErrorCodeConstants.java
@@ -0,0 +1,12 @@
+package cn.iocoder.yudao.module.datacenter.enums;
+
+import cn.iocoder.yudao.framework.common.exception.ErrorCode;
+
+/**
+ * @Description
+ */
+public interface ErrorCodeConstants {
+ ErrorCode ASSET_NOT_EXISTS = new ErrorCode(1_005_001_000, "设备不存在");
+ ErrorCode CHECK_TICKET_NOT_EXISTS = new ErrorCode(1_005_001_001, "检票不存在");
+ ErrorCode SALE_DATA_NOT_EXISTS = new ErrorCode(1_005_001_002, "售票不存在");
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml b/ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml
index de977303c..9381e01ed 100644
--- a/ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/pom.xml
@@ -12,12 +12,16 @@
ludu-module-datacenter-biz
-
cn.iocoder.cloud
- ludu-module-ticketing-api
+ ludu-module-datacenter-api
${revision}
+
+
+ org.springframework.boot
+ spring-boot-starter-data-mongodb
+
org.springframework.cloud
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/DatacenterServerApplication.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/DatacenterServerApplication.java
similarity index 86%
rename from ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/DatacenterServerApplication.java
rename to ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/DatacenterServerApplication.java
index 063e47240..3aa0aa9cd 100644
--- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/DatacenterServerApplication.java
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/DatacenterServerApplication.java
@@ -1,4 +1,4 @@
-package cn.iocoder.yudao.module.datacenter.framework;
+package cn.iocoder.yudao.module.datacenter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java
new file mode 100644
index 000000000..001e192c4
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java
@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.asset;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo.AssetRespVO;
+import cn.iocoder.yudao.module.datacenter.service.asset.AssetService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * @Description 设备
+ */
+@Tag(name = "管理后台 - 设备")
+@RestController
+@RequestMapping("/datacenter/asset")
+@Validated
+public class AssetApi {
+ @Resource
+ private AssetService assetService;
+ @GetMapping("/type")
+ @Operation(summary = "获得所有设备名称和数量")
+ public CommonResult>> countAsset() {
+ return success(assetService.countAsset());
+ }
+ @GetMapping("/name/{assettypename}")
+ @Operation(summary = "获取符合设备类型名的所有设备")
+ public CommonResult> nameAsset(@PathVariable("assettypename") String assettypename) {
+ return success(assetService.nameAsset(assettypename));
+ }
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/vo/AssetRespVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/vo/AssetRespVO.java
new file mode 100644
index 000000000..4e3481fff
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/vo/AssetRespVO.java
@@ -0,0 +1,44 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.asset.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;
+
+@Schema(description = "管理后台 - 设备 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class AssetRespVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30538")
+ @ExcelProperty("ID")
+ private Long id;
+
+ @Schema(description = "数据ID", example = "15059")
+ @ExcelProperty("数据ID")
+ private String dataId;
+
+ @Schema(description = "设备名称", example = "芋艿")
+ @ExcelProperty("设备名称")
+ private String assetname;
+
+ @Schema(description = "设备类型ID", example = "2")
+ @ExcelProperty("设备类型ID")
+ private String assettype;
+
+ @Schema(description = "设备类型名称", example = "芋艿")
+ @ExcelProperty("设备类型名称")
+ private String assettypename;
+
+ @Schema(description = "设备状态")
+ @ExcelProperty(value = "设备状态", converter = DictConvert.class)
+ @DictFormat("asset_status_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
+ private String isOnline;
+
+ @Schema(description = "最后一次反馈时间")
+ @ExcelProperty("最后一次反馈时间")
+ private Long lastfeedbacktime;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java
new file mode 100644
index 000000000..8ddde9839
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java
@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.datacenter.service.checkticket.CheckTicketService;
+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.*;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * @Description 检票
+ */
+@Tag(name = "管理后台 - 检票")
+@RestController
+@RequestMapping("/datacenter/checkticket")
+@Validated
+public class CheckTicketApi {
+ @Resource
+ private CheckTicketService checkTicketService;
+ @GetMapping("/{day}")
+ @Operation(summary = "获得日期当天的检票人数")
+ public CommonResult checkTicketTotal(@PathVariable("day") String day) {
+ return success(checkTicketService.checkTicketTotal(day));
+ }
+
+ @GetMapping("/qushi/{day}")
+ @Operation(summary = "获取日期当天各个时段的检票人数")
+ public CommonResult>> findbytimetemp(@PathVariable("day") String day) {
+ return success(checkTicketService.findbytimetemp(day));
+ }
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketPageReqVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketPageReqVO.java
new file mode 100644
index 000000000..4c468a9d1
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketPageReqVO.java
@@ -0,0 +1,50 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.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 CheckTicketPageReqVO extends PageParam {
+
+ @Schema(description = "ID", example = "16476")
+ private Long id;
+
+ @Schema(description = "数据ID", example = "15422")
+ private String dataId;
+
+ @Schema(description = "检票点ID")
+ private String checkstation;
+
+ @Schema(description = "检票点名称", example = "李四")
+ private String checkstationname;
+
+ @Schema(description = "检票日期")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private String[] checkticketdate;
+
+ @Schema(description = "检票时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private String[] checktickettime;
+
+ @Schema(description = "人数", example = "23164")
+ private Integer personcount;
+
+ @Schema(description = "订单明细ID")
+ private String sdshipping;
+
+ @Schema(description = "票ID")
+ private String ticket;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "张三")
+ private String salepropetyvaluename;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketRespVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketRespVO.java
new file mode 100644
index 000000000..0d4153932
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketRespVO.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 检票 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class CheckTicketRespVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
+ @ExcelProperty("ID")
+ private Long id;
+
+ @Schema(description = "数据ID", example = "15422")
+ @ExcelProperty("数据ID")
+ private String dataId;
+
+ @Schema(description = "检票点ID")
+ @ExcelProperty("检票点ID")
+ private String checkstation;
+
+ @Schema(description = "检票点名称", example = "李四")
+ @ExcelProperty("检票点名称")
+ private String checkstationname;
+
+ @Schema(description = "检票日期")
+ @ExcelProperty("检票日期")
+ private String checkticketdate;
+
+ @Schema(description = "检票时间")
+ @ExcelProperty("检票时间")
+ private String checktickettime;
+
+ @Schema(description = "人数", example = "23164")
+ @ExcelProperty("人数")
+ private Integer personcount;
+
+ @Schema(description = "订单明细ID")
+ @ExcelProperty("订单明细ID")
+ private String sdshipping;
+
+ @Schema(description = "票ID")
+ @ExcelProperty("票ID")
+ private String ticket;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "张三")
+ @ExcelProperty("销售特征名称(票种名称)")
+ private String salepropetyvaluename;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketSaveReqVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketSaveReqVO.java
new file mode 100644
index 000000000..1a9538e3a
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/vo/CheckTicketSaveReqVO.java
@@ -0,0 +1,40 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.checkticket.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 检票新增/修改 Request VO")
+@Data
+public class CheckTicketSaveReqVO {
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
+ private Long id;
+ @Schema(description = "数据ID", example = "15422")
+ private String dataId;
+
+ @Schema(description = "检票点ID")
+ private String checkstation;
+
+ @Schema(description = "检票点名称", example = "李四")
+ private String checkstationname;
+
+ @Schema(description = "检票日期")
+ private String checkticketdate;
+
+ @Schema(description = "检票时间")
+ private String checktickettime;
+
+ @Schema(description = "人数", example = "23164")
+ private Integer personcount;
+
+ @Schema(description = "订单明细ID")
+ private String sdshipping;
+
+ @Schema(description = "票ID")
+ private String ticket;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "张三")
+ private String salepropetyvaluename;
+
+ @Schema(description = "租户编号")
+ private Long tenant_id;
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java
new file mode 100644
index 000000000..51e06aeb3
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java
@@ -0,0 +1,113 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.datacenter.service.saledata.SaleDataService;
+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.*;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+/**
+ * @Description 售票
+ */
+@Tag(name = "管理后台 - 售票")
+@RestController
+@RequestMapping("/datacenter/saledata")
+@Validated
+public class SaleDataApi {
+ @Resource
+ private SaleDataService saleDataService;
+
+ @GetMapping("/{day}")
+ @Operation(summary = "获得输入日期的当天总售票数")
+ public CommonResult checkTicketTotal(@PathVariable("day") String day) {
+ return success(saleDataService.countBySddate(day));
+ }
+
+ @GetMapping("/thisyear/{startTime}")
+ @Operation(summary = "获得今年日期往前十天内的数据")
+ public CommonResult>> thisyearNum(@PathVariable("startTime") String startTime) {
+ return success(saleDataService.findCheckticketcountBytime(startTime));
+ }
+
+ @GetMapping("/lastyear/{startTime}")
+ @Operation(summary = "获得去年日期往前推十天的数据")
+ public CommonResult>> lastyearNum(@PathVariable("startTime") String startTime) {
+ return success(saleDataService.findCheckticketcountBytime(startTime));
+ }
+
+ @GetMapping("/gender")
+ @Operation(summary = "获得所有数据的男女数量")
+ public CommonResult>> findByGender() {
+ return success(saleDataService.findByGender());
+ }
+
+ @GetMapping("/age")
+ @Operation(summary = "获得所有数据的年龄分段和数量")
+ public CommonResult>> findByage() {
+ return success(saleDataService.findByAge());
+ }
+
+ @GetMapping("/lastyear/region")
+ @Operation(summary = "查询去年各个省份的人数")
+ public CommonResult>> lastyearfindByregion() {
+ return success(saleDataService.findByregion(saleDataService.findEventsLastYear()));
+ }
+
+ @GetMapping("/thisyear/region")
+ @Operation(summary = "查询今年各个省份的人数")
+ public CommonResult>> thisyearfindByregion() {
+ return success(saleDataService.findByregion(saleDataService.findEventsThisYear()));
+ }
+
+ @GetMapping("/salemethod")
+ @Operation(summary = "查询各个销售渠道的购票人数")
+ public CommonResult>> findBysaleMethod() {
+ return success(saleDataService.findBySaleMethod());
+ }
+
+ @GetMapping("/wuyi/{x}")
+ @Operation(summary = "查询最近前几年当年的五一期间的数据")
+ public CommonResult>> findByWuyi(@PathVariable("x") int x) {
+ return success(saleDataService.findWuyi(x));
+ }
+
+ @GetMapping("/guoqing/{x}")
+ @Operation(summary = "查询最近前几年当年的国庆期间的数据")
+ public CommonResult>> findByGuoqing(@PathVariable("x") int x) {
+ return success(saleDataService.findGuoqing(x));
+ }
+
+ @GetMapping("/rijunthisyear/{startTime}")
+ @Operation(summary = "查询今年对应日期的近三十天日均售票数量")
+ public CommonResult findThisyearRijun(@PathVariable("startTime") String startTime) {
+ return success(saleDataService.findrijun(startTime));
+ }
+
+ @GetMapping("/rijunlastyear/{startTime}")
+ @Operation(summary = "查询去年对应日期的近三十天日均售票数量")
+ public CommonResult findLastyearRijun(@PathVariable("startTime") String startTime) {
+ return success(saleDataService.findrijun(startTime));
+ }
+
+ // TODO 年度平均什么,并没有说清楚,原代码是直接计算一年的总金额
+ @GetMapping("/thisyear/nianjun")
+ @Operation(summary = "查询今年年度售票平均金额")
+ public CommonResult findmoneythisyear() {
+ return success(saleDataService.findyearJun(saleDataService.findEventsThisYear()));
+ }
+
+ @GetMapping("/lastyear/nianjun")
+ @Operation(summary = "查询去年年度售票平均金额")
+ public CommonResult findmoneylastyear() {
+ return success(saleDataService.findyearJun(saleDataService.findEventsLastYear()));
+ }
+
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AgeVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AgeVo.java
new file mode 100644
index 000000000..73bb4cc7e
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AgeVo.java
@@ -0,0 +1,16 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
+
+import lombok.Data;
+
+/**
+ * @Description 自定义年龄分段
+ */
+@Data
+public class AgeVo {
+ private String one;
+ private String two;
+ private String three;
+ private String four;
+ private String five;
+ private String six;
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AggregationVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AggregationVO.java
new file mode 100644
index 000000000..1ae0b8c3c
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/AggregationVO.java
@@ -0,0 +1,10 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
+
+import lombok.Data;
+
+@Data
+public class AggregationVO {
+ private long maleCount;
+ private long femaleCount;
+ private double maleRatio;
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataPageReqVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataPageReqVO.java
new file mode 100644
index 000000000..8a0e4f4e6
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataPageReqVO.java
@@ -0,0 +1,70 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.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.math.BigDecimal;
+
+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 SaleDataPageReqVO extends PageParam {
+
+ @Schema(description = "ID", example = "20492")
+ private Long id;
+
+ @Schema(description = "数据id", example = "32044")
+ private String dataId;
+
+ @Schema(description = "金额")
+ private BigDecimal amount;
+
+ @Schema(description = "证件号")
+ private String certificateno;
+
+ @Schema(description = "证件类别", example = "2")
+ private String certificatetype;
+
+ @Schema(description = "产品ID")
+ private String item;
+
+ @Schema(description = "产品名称", example = "张三")
+ private String itemname;
+
+ @Schema(description = "产品类型ID", example = "2")
+ private String itemtype;
+
+ @Schema(description = "产品类型名称", example = "张三")
+ private String itemtypename;
+
+ @Schema(description = "出游日期")
+ private String productbatchno;
+
+ @Schema(description = "数量")
+ private Integer quantity;
+
+ @Schema(description = "销售日期")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private String[] sddate;
+
+ @Schema(description = "订单号")
+ private String sdno;
+
+ @Schema(description = "销售时间")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private String[] sdtime;
+
+ @Schema(description = "交易类别(订单类型)")
+ private String transactiontypeno;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "赵六")
+ private String salepropetyvaluename;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataRespVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataRespVO.java
new file mode 100644
index 000000000..d83284e40
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataRespVO.java
@@ -0,0 +1,79 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.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.math.BigDecimal;
+
+@Schema(description = "管理后台 - 售票 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SaleDataRespVO {
+
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20492")
+ @ExcelProperty("ID")
+ private Long id;
+
+ @Schema(description = "数据id", example = "32044")
+ @ExcelProperty("数据id")
+ private String dataId;
+
+ @Schema(description = "金额")
+ @ExcelProperty("金额")
+ private BigDecimal amount;
+
+ @Schema(description = "证件号")
+ @ExcelProperty("证件号")
+ private String certificateno;
+
+ @Schema(description = "证件类别", example = "2")
+ @ExcelProperty("证件类别")
+ private String certificatetype;
+
+ @Schema(description = "产品ID")
+ @ExcelProperty("产品ID")
+ private String item;
+
+ @Schema(description = "产品名称", example = "张三")
+ @ExcelProperty("产品名称")
+ private String itemname;
+
+ @Schema(description = "产品类型ID", example = "2")
+ @ExcelProperty("产品类型ID")
+ private String itemtype;
+
+ @Schema(description = "产品类型名称", example = "张三")
+ @ExcelProperty("产品类型名称")
+ private String itemtypename;
+
+ @Schema(description = "出游日期")
+ @ExcelProperty("出游日期")
+ private String productbatchno;
+
+ @Schema(description = "数量")
+ @ExcelProperty("数量")
+ private Integer quantity;
+
+ @Schema(description = "销售日期")
+ @ExcelProperty("销售日期")
+ private String sddate;
+
+ @Schema(description = "订单号")
+ @ExcelProperty("订单号")
+ private String sdno;
+
+ @Schema(description = "销售时间")
+ @ExcelProperty("销售时间")
+ private String sdtime;
+
+ @Schema(description = "交易类别(订单类型)")
+ @ExcelProperty("交易类别(订单类型)")
+ private String transactiontypeno;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "赵六")
+ @ExcelProperty("销售特征名称(票种名称)")
+ private String salepropetyvaluename;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataSaveReqVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataSaveReqVO.java
new file mode 100644
index 000000000..06c4f9ed3
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/vo/SaleDataSaveReqVO.java
@@ -0,0 +1,61 @@
+package cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 售票新增/修改 Request VO")
+@Data
+public class SaleDataSaveReqVO {
+ @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16476")
+ private Long id;
+ @Schema(description = "数据id", example = "32044")
+ private String dataId;
+
+ @Schema(description = "金额")
+ private BigDecimal amount;
+
+ @Schema(description = "证件号")
+ private String certificateno;
+
+ @Schema(description = "证件类别", example = "2")
+ private String certificatetype;
+
+ @Schema(description = "产品ID")
+ private String item;
+
+ @Schema(description = "产品名称", example = "张三")
+ private String itemname;
+
+ @Schema(description = "产品类型ID", example = "2")
+ private String itemtype;
+
+ @Schema(description = "产品类型名称", example = "张三")
+ private String itemtypename;
+
+ @Schema(description = "出游日期")
+ private String productbatchno;
+
+ @Schema(description = "数量")
+ private Integer quantity;
+
+ @Schema(description = "销售日期")
+ private String sddate;
+
+ @Schema(description = "订单号")
+ private String sdno;
+
+ @Schema(description = "销售时间")
+ private String sdtime;
+
+ @Schema(description = "交易类别(订单类型)")
+ private String transactiontypeno;
+
+ @Schema(description = "销售特征名称(票种名称)", example = "赵六")
+ private String salepropetyvaluename;
+
+ @Schema(description = "租户编号")
+ private Long tenant_id;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/asset/Asset.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/asset/Asset.java
new file mode 100644
index 000000000..43b63ccb0
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/asset/Asset.java
@@ -0,0 +1,16 @@
+package cn.iocoder.yudao.module.datacenter.dal.dataobject.asset;
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+
+@Document("asset")
+@Data
+public class Asset {
+ private String id;
+ private String dataId;
+ private String assetname;
+ private String assettype;
+ private String assettypename;
+ private String isOnline;
+ private Long lastFeedbackTime;
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/checkticket/CheckTicket.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/checkticket/CheckTicket.java
new file mode 100644
index 000000000..ba82b053c
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/checkticket/CheckTicket.java
@@ -0,0 +1,21 @@
+package cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket;
+
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+@Document("checkticket")
+//@Document("checktickettest")
+@Data
+public class CheckTicket {
+ private String id;
+ private String dataId;
+ private String checkstation;
+ private String checkstationname;
+ private String ticket;
+ private String checkticketdate;
+ private String checktickettime;
+ private Integer personcount;
+ private String sdshipping;
+ private String salepropetyvaluename;
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/saledata/SaleData.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/saledata/SaleData.java
new file mode 100644
index 000000000..56ccc6708
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/saledata/SaleData.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata;
+
+import lombok.Data;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.math.BigDecimal;
+
+@Document("saledata")
+@Data
+public class SaleData {
+ private String id;
+ private String dataId;
+ private String sdno;
+ private String transactiontypeno;
+ private String sddate;
+ private String sdtime;
+ private BigDecimal amount;
+ private Integer quantity;
+ private String certificatetype;
+ private String certificateno;
+ private String itemtype;
+ private String itemtypename;
+ private String item;
+ private String itemname;
+ private String productbatchno;
+ private String salepropetyvaluename;
+
+
+}
\ No newline at end of file
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/asset/AssetRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/asset/AssetRepository.java
new file mode 100644
index 000000000..494c29400
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/asset/AssetRepository.java
@@ -0,0 +1,18 @@
+package cn.iocoder.yudao.module.datacenter.dal.mongodb.asset;
+
+import cn.iocoder.yudao.module.datacenter.dal.dataobject.asset.Asset;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Description TODO
+ */
+@Repository
+public interface AssetRepository extends MongoRepository {
+
+ List findAllByAssettypename(String assettypename);
+ Asset findByDataId(String dataId);
+ List findAllByIsOnline(String online);
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/checkticket/CheckTicketRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/checkticket/CheckTicketRepository.java
new file mode 100644
index 000000000..5cc6effca
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/checkticket/CheckTicketRepository.java
@@ -0,0 +1,23 @@
+package cn.iocoder.yudao.module.datacenter.dal.mongodb.checkticket;
+
+
+import cn.iocoder.yudao.module.datacenter.dal.dataobject.checkticket.CheckTicket;
+import org.springframework.data.domain.Page;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.mongodb.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+@Repository
+public interface CheckTicketRepository extends MongoRepository {
+ @Query("{'name': {'$regex': '?0', '$options': 'i'}}")
+ Page findByName(String q, PageRequest pageable);
+
+ int countByCheckticketdate(String day);
+
+ @Query("{'checktickettime':{'$gte': ?0, '$lt': ?1},'checkticketdate':{'$dt': ?2}}")
+ List findByTimestampBetweenAndCheckticketdate(String startTime, String endTime,String day);
+
+ ListfindByCheckticketdateAndChecktickettimeBetween(String day,String startTime, String endTime);
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/saledata/SaleDataRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/saledata/SaleDataRepository.java
new file mode 100644
index 000000000..44109e7ad
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/saledata/SaleDataRepository.java
@@ -0,0 +1,44 @@
+package cn.iocoder.yudao.module.datacenter.dal.mongodb.saledata;
+
+
+import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AgeVo;
+import cn.iocoder.yudao.module.datacenter.controller.admin.saledata.vo.AggregationVO;
+import cn.iocoder.yudao.module.datacenter.dal.dataobject.saledata.SaleData;
+import org.springframework.data.mongodb.repository.Aggregation;
+import org.springframework.data.mongodb.repository.MongoRepository;
+import org.springframework.data.mongodb.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+@Repository
+public interface SaleDataRepository extends MongoRepository {
+ /*@Query("{'name': {'$regex': '?0', '$options': 'i'}}")
+ Page findByName(String q, PageRequest pageable);*/
+ int countBySddate(String day);
+
+
+// @Query("{ 'sddate' : { $gte: ?0, $lte: ?1 } }")
+ @Query(value = "{ 'sddate': { $gte: ?0, $lte: ?1 } }", fields = "{ 'certificateno': 1, 'amount': 1}")
+ ListfindBySddateBetween(String begin,String end);
+
+ @Aggregation(pipeline = {
+ "{$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']}}}"
+ })
+ AggregationVO findAllByCertificateno();
+
+ @Aggregation(pipeline = {
+ "{$match: {certificateno: {$regex: '^.{18}$'}}}",
+ "{$project: {birthYear: {$toInt: {$substr: ['$certificateno', 6, 4]}}, currentYear: {$year: '$$NOW'}}}",
+ "{$addFields: {age: {$subtract: ['$currentYear', '$birthYear']}}}",
+ "{$group: {_id: null, one: {$sum: {$cond: [{$lte: ['$age', 20]}, 1, 0]}}, " +
+ "two: {$sum: {$cond: [{$and: [{$gt: ['$age', 20]}, {$lte: ['$age', 30]}]}, 1, 0]}}, " +
+ "three: {$sum: {$cond: [{$and: [{$gt: ['$age', 30]}, {$lte: ['$age', 40]}]}, 1, 0]}}, " +
+ "four: {$sum: {$cond: [{$and: [{$gt: ['$age', 40]}, {$lte: ['$age', 50]}]}, 1, 0]}}, " +
+ "five: {$sum: {$cond: [{$and: [{$gt: ['$age', 50]}, {$lte: ['$age', 60]}]}, 1, 0]}}, " +
+ "six: {$sum: {$cond: [{$gt: ['$age', 60]}, 1, 0]}}}}"
+ })
+ AgeVo findByAge();
+
+}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/rpc/config/RpcConfiguration.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/rpc/config/RpcConfiguration.java
index 9ff28853d..872e8e36e 100644
--- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/rpc/config/RpcConfiguration.java
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/rpc/config/RpcConfiguration.java
@@ -1,12 +1,9 @@
package cn.iocoder.yudao.module.datacenter.framework.rpc.config;
-import cn.iocoder.yudao.module.ticket.api.asset.TicketAssetApi;
-import cn.iocoder.yudao.module.ticket.api.checkticket.TicketCheckTicketApi;
-import cn.iocoder.yudao.module.ticket.api.saledata.TicketSaleDataApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
-@EnableFeignClients(clients = {TicketAssetApi.class, TicketCheckTicketApi.class, TicketSaleDataApi.class})
+@EnableFeignClients(clients = {})
public class RpcConfiguration {
}
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java
index 725273fb6..921644e67 100644
--- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java
@@ -18,6 +18,8 @@ public class SecurityConfiguration {
@Override
public void customize(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry registry) {
+ // TODO 暂时放行所有,用于测试
+ registry.antMatchers("/**").permitAll();
// Swagger 接口文档
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/asset/AssetService.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/asset/AssetService.java
new file mode 100644
index 000000000..719b998c4
--- /dev/null
+++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/service/asset/AssetService.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.datacenter.service.asset;
+
+import cn.iocoder.yudao.module.datacenter.controller.admin.asset.vo.AssetRespVO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 设备 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface AssetService {
+
+
+ /**
+ * 计算不同设备的数量
+ * @param
+ * @return 所有设备名称和数量
+ */
+ public List