feat:第三方免密支付记录表
This commit is contained in:
1 parent
0a2ec15518
commit
d84bf561ac
8 files changed
+339
-1
No files matched your search
@@ -571,4 +571,32 @@ CREATE TABLE hard_spu_repertory
|
||||
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_third_mi_order
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS hard_third_mi_order;
|
||||
CREATE TABLE hard_third_mi_order
|
||||
(
|
||||
id bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
|
||||
biz_type tinytext NOT NULL COMMENT '上架类型',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
auth_id bigint COMMENT '授权id',
|
||||
flow_id bigint COMMENT '流程id',
|
||||
order_id bigint COMMENT '订单id',
|
||||
out_order_no varchar(128) COMMENT '外部订单号',
|
||||
third_order_no varchar(128) COMMENT '第三方订单号',
|
||||
create_order_time datetime DEFAULT NULL COMMENT '创建订单时间',
|
||||
pay_order_time datetime DEFAULT NULL COMMENT '支付时间',
|
||||
refund_order_time datetime DEFAULT NULL COMMENT '退款时间',
|
||||
order_status tinyint COMMENT '订单状态',
|
||||
org_json text COMMENT '原始json数据',
|
||||
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 ='硬件商品免密订单';
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.bsd.pjcloud.hard.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方面密类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardThirdMiTypeEnum {
|
||||
|
||||
MI_WECHAT("10", "微信免密支付"),
|
||||
MI_ALIPAY("20", "支付宝-芝麻先享"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static HardThirdMiTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
package com.bsd.pjcloud.hard.api.entity;
|
||||
|
||||
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_third_mi_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "硬件商品免密订单")
|
||||
public class HardThirdMiOrderEntity extends Model<HardThirdMiOrderEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 上架类型
|
||||
*/
|
||||
@Schema(description = "上架类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 授权id
|
||||
*/
|
||||
@Schema(description = "授权id")
|
||||
private Long authId;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private Long flowId;
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
@Schema(description = "订单id")
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 外部订单号
|
||||
*/
|
||||
@Schema(description = "外部订单号")
|
||||
private String outOrderNo;
|
||||
|
||||
/**
|
||||
* 第三方订单号
|
||||
*/
|
||||
@Schema(description = "第三方订单号")
|
||||
private String thirdOrderNo;
|
||||
|
||||
/**
|
||||
* 创建订单时间
|
||||
*/
|
||||
@Schema(description = "创建订单时间")
|
||||
private LocalDateTime createOrderTime;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime payOrderTime;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@Schema(description = "退款时间")
|
||||
private LocalDateTime refundOrderTime;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
*/
|
||||
@Schema(description = "订单状态")
|
||||
private Integer orderStatus;
|
||||
|
||||
/**
|
||||
* 原始json数据
|
||||
*/
|
||||
@Schema(description = "原始json数据")
|
||||
private String orgJson;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
package com.bsd.pjcloud.hard.controller;
|
||||
|
||||
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.entity.HardThirdMiOrderEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardThirdMiOrderService;
|
||||
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("/hardThirdMiOrder")
|
||||
@Tag(description = "hardThirdMiOrder", name = "硬件商品免密订单管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardThirdMiOrderController {
|
||||
|
||||
private final HardThirdMiOrderService hardThirdMiOrderService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_view')")
|
||||
public R getHardThirdMiOrderPage(@ParameterObject Page page, @ParameterObject HardThirdMiOrderEntity hardThirdMiOrder) {
|
||||
LambdaQueryWrapper<HardThirdMiOrderEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(hardThirdMiOrderService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(hardThirdMiOrderService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "新增硬件商品免密订单", description = "新增硬件商品免密订单")
|
||||
@SysLog("新增硬件商品免密订单")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_add')")
|
||||
public R save(@RequestBody HardThirdMiOrderEntity hardThirdMiOrder) {
|
||||
return R.ok(hardThirdMiOrderService.save(hardThirdMiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "修改硬件商品免密订单", description = "修改硬件商品免密订单")
|
||||
@SysLog("修改硬件商品免密订单")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_edit')")
|
||||
public R updateById(@RequestBody HardThirdMiOrderEntity hardThirdMiOrder) {
|
||||
return R.ok(hardThirdMiOrderService.updateById(hardThirdMiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除硬件商品免密订单
|
||||
*/
|
||||
@Operation(summary = "通过id删除硬件商品免密订单", description = "通过id删除硬件商品免密订单")
|
||||
@SysLog("通过id删除硬件商品免密订单")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardThirdMiOrderService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('thirdmi_hardThirdMiOrder_export')")
|
||||
public List<HardThirdMiOrderEntity> export(HardThirdMiOrderEntity hardThirdMiOrder, Long[] ids) {
|
||||
return hardThirdMiOrderService.list(Wrappers.lambdaQuery(hardThirdMiOrder).in(ArrayUtil.isNotEmpty(ids), HardThirdMiOrderEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardThirdMiOrderMapper extends PjcloudBaseMapper<HardThirdMiOrderEntity> {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
|
||||
public interface HardThirdMiOrderService extends IService<HardThirdMiOrderEntity> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardThirdMiOrderEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.HardThirdMiOrderMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardThirdMiOrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 硬件商品免密订单
|
||||
*/
|
||||
@Service
|
||||
public class HardThirdMiOrderServiceImpl extends ServiceImpl<HardThirdMiOrderMapper, HardThirdMiOrderEntity> implements HardThirdMiOrderService {
|
||||
|
||||
}
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
<?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.HardThirdMiOrderMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user