feat:消费机日志
This commit is contained in:
1 parent
45162e43be
commit
5ed9ac14f9
38 files changed
+784
-65
No files matched your search
+48
-22
@@ -1,5 +1,5 @@
|
||||
create
|
||||
database `pjcloudx_hardware` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
database `pjcloudx_hardware` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_manager
|
||||
@@ -84,8 +84,7 @@ CREATE TABLE hard_door_cabinet
|
||||
door_status int NOT NULL COMMENT '门状态1:门关;2:门开',
|
||||
sale_status int NOT NULL COMMENT '货柜售卖状态1:在售;2:停售',
|
||||
qr_code varchar(256) DEFAULT NULL COMMENT '二维码',
|
||||
# 其他字段
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
# 其他字段 create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
@@ -110,37 +109,28 @@ CREATE TABLE hard_door_flow
|
||||
cabinet_no int DEFAULT NULL COMMENT '货柜编号',
|
||||
order_id bigint DEFAULT NULL COMMENT '订单编号',
|
||||
auth_id bigint DEFAULT NULL COMMENT '授权编号',
|
||||
# 请求开门
|
||||
request_open_dto text DEFAULT NULL COMMENT '请求开门参数',
|
||||
# 请求开门 request_open_dto text DEFAULT NULL COMMENT '请求开门参数',
|
||||
request_open_vo text DEFAULT NULL COMMENT '请求开门返回',
|
||||
request_open_time datetime DEFAULT NULL COMMENT '请求开门时间',
|
||||
# 请求开门回调
|
||||
is_open varchar(32) DEFAULT NULL COMMENT '是否开门',
|
||||
# 请求开门回调 is_open varchar(32) DEFAULT NULL COMMENT '是否开门',
|
||||
open_callback_time datetime DEFAULT NULL COMMENT '开门回调时间',
|
||||
open_callback_vo text DEFAULT NULL COMMENT '开门回调结果',
|
||||
# 视频回调
|
||||
video_callback_vo text DEFAULT NULL COMMENT '视频回调结果',
|
||||
# 视频回调 video_callback_vo text DEFAULT NULL COMMENT '视频回调结果',
|
||||
video_callback_time datetime DEFAULT NULL COMMENT '视频回调时间',
|
||||
# sku识别
|
||||
sku_submit_dto text DEFAULT NULL COMMENT 'sku识别提交参数',
|
||||
# sku识别 sku_submit_dto text DEFAULT NULL COMMENT 'sku识别提交参数',
|
||||
sku_submit_vo text DEFAULT NULL COMMENT 'sku识别提交结果',
|
||||
sku_submit_recog_id varchar(32) DEFAULT NULL COMMENT 'sku识别提交id(用于查询)',
|
||||
sku_submit_time datetime DEFAULT NULL COMMENT 'sku识别提交时间',
|
||||
# sku识别回调
|
||||
sku_callback_vo text DEFAULT NULL COMMENT 'sku识别回调结果',
|
||||
# sku识别回调 sku_callback_vo text DEFAULT NULL COMMENT 'sku识别回调结果',
|
||||
sku_callback_time datetime DEFAULT NULL COMMENT 'sku识别回调时间',
|
||||
# sku主动获取
|
||||
sku_driving_dto text DEFAULT NULL COMMENT 'sku识别主动获取参数',
|
||||
# sku主动获取 sku_driving_dto text DEFAULT NULL COMMENT 'sku识别主动获取参数',
|
||||
sku_driving_vo text DEFAULT NULL COMMENT 'sku识别主动获取结果',
|
||||
sku_driving_time datetime DEFAULT NULL COMMENT 'sku识别主动获取时间',
|
||||
# 流程相关
|
||||
flow_status varchar(32) DEFAULT NULL COMMENT '流程状态',
|
||||
# 流程相关 flow_status varchar(32) DEFAULT NULL COMMENT '流程状态',
|
||||
error text DEFAULT NULL COMMENT '流程错误信息',
|
||||
error_desc varchar(64) DEFAULT NULL COMMENT '流程错误描述(展示)',
|
||||
# 购买成功
|
||||
pay_time datetime DEFAULT NULL COMMENT '购买成功时间',
|
||||
# 其他字段
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
# 购买成功 pay_time datetime DEFAULT NULL COMMENT '购买成功时间',
|
||||
# 其他字段 create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
@@ -599,4 +589,40 @@ CREATE TABLE hard_third_mi_order
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='硬件商品免密订单';
|
||||
) ENGINE = InnoDB COMMENT ='硬件商品免密订单';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_xfj_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS hard_xfj_log;
|
||||
CREATE TABLE hard_xfj_log
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
unique_code varchar(64) NOT NULL COMMENT '设备唯一编号',
|
||||
hard_type varchar(32) NOT NULL COMMENT '设备类型',
|
||||
title varchar(64) NOT NULL COMMENT '用户id',
|
||||
headers varchar(2048) COMMENT 'headers',
|
||||
res varchar(2048) COMMENT 'res',
|
||||
req varchar(2048) COMMENT 'req',
|
||||
start_time datetime DEFAULT NULL COMMENT '开始时间',
|
||||
end_time datetime DEFAULT NULL COMMENT '结束时间',
|
||||
cost int DEFAULT NULL COMMENT '耗时(秒)',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
update_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
|
||||
update_time datetime DEFAULT NULL COMMENT '修改时间',
|
||||
del_flag char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除标记',
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='消费机日志';
|
||||
ALTER TABLE hard_xfj_log
|
||||
ADD UNIQUE INDEX idx_unique_code (unique_code);
|
||||
ALTER TABLE hard_xfj_log
|
||||
ADD INDEX idx_hard_type (hard_type);
|
||||
ALTER TABLE hard_xfj_log
|
||||
ADD INDEX idx_title (title);
|
||||
ALTER TABLE hard_xfj_log
|
||||
ADD INDEX idx_start_time (start_time);
|
||||
ALTER TABLE hard_xfj_log
|
||||
ADD INDEX idx_end_time (end_time);
|
||||
|
||||
+1
@@ -23,6 +23,7 @@ public enum HardTypeEnum {
|
||||
OTHER("6", "其他支付方式(第三方接口对接)"),
|
||||
MERCHANT_ACT("7", "商户活动"),
|
||||
FARMER("8", "共富商城(助农)"),
|
||||
YUN_XFJ("9", "云版消费机"),
|
||||
;
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class HardXfjLogDto extends HardXfjLogEntity {
|
||||
|
||||
private LocalDateTime[] createTimeList;
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.xfj;
|
||||
package com.bsd.pjcloud.hard.api.dto.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
package com.bsd.pjcloud.hard.api.entity.xfj;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 消费机日志
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_xfj_log")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消费机日志")
|
||||
public class HardXfjLogEntity extends Model<HardXfjLogEntity> {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
@Schema(description = "设备唯一编号")
|
||||
private String uniqueCode;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Schema(description = "设备类型")
|
||||
private String hardType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* headers
|
||||
*/
|
||||
@Schema(description = "headers")
|
||||
private String headers;
|
||||
|
||||
/**
|
||||
* res
|
||||
*/
|
||||
@Schema(description = "res")
|
||||
private String res;
|
||||
|
||||
/**
|
||||
* req
|
||||
*/
|
||||
@Schema(description = "req")
|
||||
private String req;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@Schema(description = "开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Schema(description = "结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 耗时(秒)
|
||||
*/
|
||||
@Schema(description = "耗时(秒)")
|
||||
private Integer cost;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardXfjLogVo extends HardXfjLogEntity {
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.xfj;
|
||||
package com.bsd.pjcloud.hard.api.vo.xfj;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.bsd.pjcloud.hard.controller.xfj;
|
||||
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.hard.service.HardXfjService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.websocket.server.PathParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 设备预约管理
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hxz")
|
||||
@Tag(description = "hxz", name = "消费机接口")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardXfjController {
|
||||
|
||||
private final HardXfjService hardXfjService;
|
||||
|
||||
@Operation(summary = "获取服务器时间接口")
|
||||
@PostMapping("/v1/ServerTime")
|
||||
@Inner(value = false)
|
||||
public Object serverTime(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.serverTime(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "用户刷卡综合接口")
|
||||
@PostMapping("/v1/ConsumTransactions")
|
||||
@Inner(value = false)
|
||||
public Object consumTransactions(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.consumTransactions(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "用户刷卡消费结果查询接口")
|
||||
@PostMapping("/v1/orderQuery")
|
||||
@Inner(value = false)
|
||||
public Object orderQuery(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.orderQuery(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "终端查询日统计接口")
|
||||
@PostMapping("/v1/Counts")
|
||||
@Inner(value = false)
|
||||
public Object counts(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.counts(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "终端设备待查状态,按上翻/下翻键向服务器请求,服务器返回一条消费明细(或者退款接口)")
|
||||
@PostMapping("/v1/transaction")
|
||||
@Inner(value = false)
|
||||
public Object transaction(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.transaction(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "KeepAlive")
|
||||
@PostMapping("/v1/KeepAlive")
|
||||
@Inner(value = false)
|
||||
public Object keepAlive(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.keepAlive(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "ConCode")
|
||||
@PostMapping("/v1/ConCode/:deviceCode/:price")
|
||||
@Inner(value = false)
|
||||
public Object conCode(@PathParam("deviceCode") String deviceCode, @PathParam("price") String price, HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.conCode(deviceCode, price, httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "付款码(二维码)支付接口")
|
||||
@PostMapping("/v1/QRCodeTransaction")
|
||||
@Inner(value = false)
|
||||
public Object qrCodeTransaction(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.qrCodeTransaction(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "二维码支付结果查询接口")
|
||||
@PostMapping("/v1/TransactionInquiry")
|
||||
@Inner(value = false)
|
||||
public Object transactionInquiry(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.transactionInquiry(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "菜品查询接口")
|
||||
@PostMapping("/v1/menus")
|
||||
@Inner(value = false)
|
||||
public Object menus(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.menus(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "记账扣费流水上传接口")
|
||||
@PostMapping("/v1/OffLines")
|
||||
@Inner(value = false)
|
||||
public Object offLines(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.offLines(httpEntity.getBody(), headers);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取白名单接口")
|
||||
@PostMapping("/v1/WhiteList")
|
||||
@Inner(value = false)
|
||||
public Object whiteList(HttpEntity<String> httpEntity, @RequestHeader Map<String, String> headers) {
|
||||
return hardXfjService.whiteList(httpEntity.getBody(), headers);
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.bsd.pjcloud.hard.controller.xfj;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.hard.api.dto.xfj.HardXfjLogDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardXfjLogService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 消费机日志
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/xfj-log" )
|
||||
@Tag(description = "xfj-log" , name = "消费机日志管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardXfjLogController {
|
||||
|
||||
private final HardXfjLogService hardXfjLogService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardXfjLog_view')" )
|
||||
public R getHardXfjLogPage(@ParameterObject Page page, @ParameterObject HardXfjLogDto dto) {
|
||||
return R.ok(hardXfjLogService.pageList(page, dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询消费机日志
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardXfjLog_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(hardXfjLogService.getById(id));
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.hard.mapper.xfj;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.dto.xfj.HardXfjLogDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.xfj.HardXfjLogVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface HardXfjLogMapper extends PjcloudBaseMapper<HardXfjLogEntity> {
|
||||
|
||||
Page<HardXfjLogVo> pageList(Page page, @Param("dto") HardXfjLogDto dto);
|
||||
|
||||
}
|
||||
+2
@@ -25,6 +25,8 @@ public interface HardManagerService extends IService<HardManagerEntity> {
|
||||
|
||||
HardManagerVo getByHardId(Long hardId);
|
||||
|
||||
HardManagerVo getByUniqueCode(String uniqueCode);
|
||||
|
||||
/**
|
||||
* 判断当前用户是否有食堂或者超市管理元权限
|
||||
*/
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.dto.xfj.HardXfjLogDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.xfj.HardXfjLogVo;
|
||||
|
||||
public interface HardXfjLogService extends IService<HardXfjLogEntity> {
|
||||
|
||||
Page<HardXfjLogVo> pageList(Page page, HardXfjLogDto dto);
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
|
||||
import com.bsd.pjcloud.hard.api.vo.xfj.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface HardXfjService {
|
||||
|
||||
/**
|
||||
* 获取服务器时间接口
|
||||
*/
|
||||
XfjServerTimeVo serverTime(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 用户刷卡综合接口
|
||||
*/
|
||||
XfjConsumTransactionsVo consumTransactions(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 用户刷卡消费结果查询接口
|
||||
*/
|
||||
XfjOrderQueryVo orderQuery(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 终端查询日统计接口
|
||||
*/
|
||||
XfjCountsVo counts(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 终端设备待查状态,按上翻/下翻键向服务器请求,服务器返回一条消费明细(或者退款接口)
|
||||
*/
|
||||
XfjTransactionVo transaction(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* KeepAlive
|
||||
*/
|
||||
XfjKeepAliveVo keepAlive(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* ConCode
|
||||
*/
|
||||
XfjKeepAliveVo conCode(String deviceCode, String price, String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 付款码(二维码)支付接口
|
||||
*/
|
||||
XfjQRCodeTransactionVo qrCodeTransaction(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 二维码支付结果查询接口
|
||||
*/
|
||||
XfjTransactionInquiryVo transactionInquiry(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 菜品查询接口
|
||||
*/
|
||||
XfjMenusVo menus(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 记账扣费流水上传接口
|
||||
*/
|
||||
XfjOffLinesVo offLines(String body, Map<String, String> headers);
|
||||
|
||||
/**
|
||||
* 获取白名单接口
|
||||
*/
|
||||
XfjWhiteListVo whiteList(String body, Map<String, String> headers);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.hard.service.impl.xfj;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.dto.xfj.HardXfjLogDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.xfj.HardXfjLogEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.xfj.HardXfjLogVo;
|
||||
import com.bsd.pjcloud.hard.mapper.xfj.HardXfjLogMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardXfjLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* 消费机日志
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class HardXfjLogServiceImpl extends ServiceImpl<HardXfjLogMapper, HardXfjLogEntity> implements HardXfjLogService {
|
||||
|
||||
@Override
|
||||
public Page<HardXfjLogVo> pageList(Page page, HardXfjLogDto dto) {
|
||||
return baseMapper.pageList(page, dto);
|
||||
}
|
||||
|
||||
}
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
package com.bsd.pjcloud.hard.service.impl.xfj;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.hard.api.entity.manager.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.vo.xfj.*;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import com.bsd.pjcloud.hard.service.HardXfjService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class HardXfjServiceImpl implements HardXfjService {
|
||||
|
||||
private final HardManagerService hardManagerService;
|
||||
|
||||
/**
|
||||
* 检查设备并返回配置
|
||||
*/
|
||||
public HardManagerEntity checkSignAndReturnConfig(String body, Map<String, String> headers) {
|
||||
Map<String, String> transitionHeader = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
transitionHeader.put(entry.getKey().toUpperCase(), entry.getValue());
|
||||
}
|
||||
String deviceId = transitionHeader.get("DEVICE-ID");
|
||||
if(ObjectUtil.isEmpty(deviceId)){
|
||||
throw new RuntimeException("|检查设备并返回配置|错误,deviceId不存在");
|
||||
}
|
||||
hardManagerService.getByHardId()
|
||||
// 验签
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务器时间接口
|
||||
*/
|
||||
@Override
|
||||
public XfjServerTimeVo serverTime(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|获取服务器时间接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户刷卡综合接口
|
||||
*/
|
||||
@Override
|
||||
public XfjConsumTransactionsVo consumTransactions(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|用户刷卡综合接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户刷卡消费结果查询接口
|
||||
*/
|
||||
@Override
|
||||
public XfjOrderQueryVo orderQuery(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|用户刷卡消费结果查询接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端查询日统计接口
|
||||
*/
|
||||
@Override
|
||||
public XfjCountsVo counts(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|终端查询日统计接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* KeepAlive
|
||||
*/
|
||||
@Override
|
||||
public XfjKeepAliveVo keepAlive(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|KeepAlive|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ConCode
|
||||
*/
|
||||
@Override
|
||||
public XfjKeepAliveVo conCode(String deviceCode, String price, String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|ConCode|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 终端设备待查状态,按上翻/下翻键向服务器请求,服务器返回一条消费明细(或者退款接口)
|
||||
*/
|
||||
@Override
|
||||
public XfjTransactionVo transaction(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|终端设备待查状态,按上翻/下翻键向服务器请求,服务器返回一条消费明细(或者退款接口)|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 付款码(二维码)支付接口
|
||||
*/
|
||||
@Override
|
||||
public XfjQRCodeTransactionVo qrCodeTransaction(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|付款码(二维码)支付接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维码支付结果查询接口
|
||||
*/
|
||||
@Override
|
||||
public XfjTransactionInquiryVo transactionInquiry(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|二维码支付结果查询接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜品查询接口
|
||||
*/
|
||||
@Override
|
||||
public XfjMenusVo menus(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|菜品查询接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 记账扣费流水上传接口
|
||||
*/
|
||||
@Override
|
||||
public XfjOffLinesVo offLines(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|记账扣费流水上传接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取白名单接口
|
||||
*/
|
||||
@Override
|
||||
public XfjWhiteListVo whiteList(String body, Map<String, String> headers) {
|
||||
HardManagerEntity entity = checkSignAndReturnConfig(body, headers);
|
||||
try {
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|获取白名单接口|意外的错误error:{}", e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.bsd.pjcloud.hard.mapper.xfj.HardXfjLogMapper">
|
||||
<sql id="selectA">
|
||||
select a.id,
|
||||
a.unique_code,
|
||||
a.hard_type,
|
||||
a.title,
|
||||
a.headers,
|
||||
a.res,
|
||||
a.req,
|
||||
a.start_time,
|
||||
a.end_time,
|
||||
a.cost,
|
||||
a.create_by,
|
||||
a.create_time,
|
||||
a.update_by,
|
||||
a.update_time,
|
||||
a.del_flag,
|
||||
a.tenant_id
|
||||
</sql>
|
||||
|
||||
<sql id="whereA">
|
||||
a.del_flag = '0'
|
||||
<if test="dto.uniqueCode != null and dto.uniqueCode != '' ">
|
||||
and a.unique_code = #{dto.uniqueCode}
|
||||
</if>
|
||||
<if test="dto.hardType != null and dto.hardType != '' ">
|
||||
and a.hard_type = #{dto.hardType}
|
||||
</if>
|
||||
<if test="dto.title != null and dto.title != '' ">
|
||||
and a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||
</if>
|
||||
<if test="dto.createTimeList != null and dto.createTimeList.length == 2">
|
||||
and a.create_time between #{dto.createTimeList[0]} and #{dto.createTimeList[1]}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="pageList" resultType="com.bsd.pjcloud.hard.api.vo.xfj.HardXfjLogVo">
|
||||
<include refid="selectA" />
|
||||
from hard_xfj_log a
|
||||
<where>
|
||||
<include refid="whereA" />
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.bsd.pjcloud.thirdparty.controller.xfj;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 消费机api接口
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/third-xfj")
|
||||
@Tag(description = "third-xfj", name = "消费机接口")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class ThirdXfjController {
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user