feat:发票管理、设备列表代码生成
This commit is contained in:
1 parent
7b55aa0f1c
commit
bfa0b50aac
29 files changed
+794
-36
No files matched your search
@@ -0,0 +1,124 @@
|
||||
create
|
||||
database `pjcloudx_hardware` default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_manager
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_manager`;
|
||||
CREATE TABLE hard_manager
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
merchant_id bigint COMMENT '商户id',
|
||||
dept_id bigint COMMENT '商家部门id',
|
||||
name varchar(128) NOT NULL COMMENT '设备名',
|
||||
type char(10) NOT NULL COMMENT '设备类型',
|
||||
mq_client_id varchar(256) COMMENT 'mq连接id',
|
||||
unique_code varchar(128) COMMENT '设备唯一编号',
|
||||
main_topic varchar(128) COMMENT '当前设备的topic',
|
||||
mq_socket_address varchar(128) COMMENT 'mq地址',
|
||||
mq_socket_port varchar(128) COMMENT 'mq端口',
|
||||
mq_username varchar(128) COMMENT 'mq用户名',
|
||||
mq_password varchar(128) COMMENT 'mq密码',
|
||||
is_take_food char(1) DEFAULT '0' COMMENT '是否为当前商户的取餐机器',
|
||||
face_app_id varchar(256) COMMENT '人脸appid',
|
||||
face_sdk_key varchar(256) COMMENT '人脸sdkKey',
|
||||
face_active_key varchar(256) COMMENT '人脸activeKey',
|
||||
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
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='设备管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_invoice
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_invoice`;
|
||||
CREATE TABLE hard_invoice
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
hard_id bigint NOT NULL COMMENT '设备id',
|
||||
hard_order_id bigint NOT NULL COMMENT '硬件订单id',
|
||||
status char(10) NOT NULL COMMENT '状态',
|
||||
pic varchar(256) NOT 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
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='发票记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_car
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_car`;
|
||||
CREATE TABLE hard_car
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
parent_car_id bigint NOT NULL COMMENT '父购物车id',
|
||||
product_id bigint NOT NULL COMMENT '商品id',
|
||||
product_name varchar(128) NOT NULL COMMENT '商品名',
|
||||
product_pic varchar(256) NOT NULL COMMENT '商品图片',
|
||||
product_price bigint NOT NULL COMMENT '商品价格',
|
||||
product_count int NOT NULL COMMENT '数量',
|
||||
product_weight decimal(10, 2) COMMENT '重量',
|
||||
total_price bigint COMMENT '总价(分)',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='购物车表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for hard_parent_car
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `hard_parent_car`;
|
||||
CREATE TABLE hard_parent_car
|
||||
(
|
||||
id bigint NOT NULL COMMENT '标号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
merchant_id bigint NOT NULL COMMENT '商户id',
|
||||
order_status char(10) NOT NULL COMMENT '订单状态',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='父订单表';
|
||||
|
||||
CREATE TABLE hardware_order
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
merchant_id bigint COMMENT '商户id',
|
||||
hard_id bigint COMMENT '设备id',
|
||||
dept_id bigint COMMENT '部门id',
|
||||
wallet_id bigint COMMENT '钱包id',
|
||||
parent_car_id bigint NOT NULL COMMENT '购物车父id',
|
||||
order_source_type_id bigint COMMENT '订单类型渠道id',
|
||||
order_type char(10) NOT NULL COMMENT '订单类型',
|
||||
order_status char(10) NOT NULL COMMENT '订单状态',
|
||||
pay_type char(10) NOT NULL COMMENT '支付方式',
|
||||
hour_type char(10) COMMENT '用餐类型',
|
||||
sys_type char(10) COMMENT '订单设备类型',
|
||||
total_price int NOT NULL COMMENT '总价(分)',
|
||||
extra_price int DEFAULT 0 NOT NULL COMMENT '额外价格(分)',
|
||||
pay_price int DEFAULT 0 COMMENT '支付金额(分)',
|
||||
pay_time timestamp COMMENT '支付时间',
|
||||
pay_refund_id bigint COMMENT '支付退款单号',
|
||||
refund_price int COMMENT '退款金额,单位:分',
|
||||
refund_time timestamp COMMENT '退款完成时间',
|
||||
refund_status char(10) COMMENT '退款状态',
|
||||
apply_cancel_time timestamp COMMENT '订单取消时间',
|
||||
android_order_code varchar(128) COMMENT '设备上的唯一订单号',
|
||||
is_offline_order char(1) DEFAULT 0 NOT NULL COMMENT '是否为离线订单',
|
||||
product_desc varchar(256) DEFAULT '' NOT NULL COMMENT '商品描述',
|
||||
offline_pay_success char(1) COMMENT '离线自动支付是否成功',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB COMMENT ='订单表';
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package hardware.constant;
|
||||
package com.bsd.pjcloud.hard.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package hardware.constant;
|
||||
package com.bsd.pjcloud.hard.api.constant;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceDto extends HardInvoiceEntity {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardManagerDto extends HardManagerEntity {
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package hardware.dto.code;
|
||||
package com.bsd.pjcloud.hard.api.dto.code;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 发票记录
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:17:32
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_invoice")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "发票记录")
|
||||
public class HardInvoiceEntity extends Model<HardInvoiceEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@Schema(description="设备id")
|
||||
private Long hardId;
|
||||
|
||||
/**
|
||||
* 硬件订单id
|
||||
*/
|
||||
@Schema(description="硬件订单id")
|
||||
private Long hardOrderId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description="状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 发票图片
|
||||
*/
|
||||
@Schema(description="发票图片")
|
||||
private String pic;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 设备管理
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:16:52
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("hard_manager")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "设备管理")
|
||||
public class HardManagerEntity extends Model<HardManagerEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Schema(description="商户id")
|
||||
private Long merchantId;
|
||||
|
||||
/**
|
||||
* 商家部门id
|
||||
*/
|
||||
@Schema(description="商家部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 设备名
|
||||
*/
|
||||
@Schema(description="设备名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
@Schema(description="设备类型")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* mq连接id
|
||||
*/
|
||||
@Schema(description="mq连接id")
|
||||
private String mqClientId;
|
||||
|
||||
/**
|
||||
* 设备唯一编号
|
||||
*/
|
||||
@Schema(description="设备唯一编号")
|
||||
private String uniqueCode;
|
||||
|
||||
/**
|
||||
* 当前设备的topic
|
||||
*/
|
||||
@Schema(description="当前设备的topic")
|
||||
private String mainTopic;
|
||||
|
||||
/**
|
||||
* mq地址
|
||||
*/
|
||||
@Schema(description="mq地址")
|
||||
private String mqSocketAddress;
|
||||
|
||||
/**
|
||||
* mq端口
|
||||
*/
|
||||
@Schema(description="mq端口")
|
||||
private String mqSocketPort;
|
||||
|
||||
/**
|
||||
* mq用户名
|
||||
*/
|
||||
@Schema(description="mq用户名")
|
||||
private String mqUsername;
|
||||
|
||||
/**
|
||||
* mq密码
|
||||
*/
|
||||
@Schema(description="mq密码")
|
||||
private String mqPassword;
|
||||
|
||||
/**
|
||||
* 是否为当前商户的取餐机器
|
||||
*/
|
||||
@Schema(description="是否为当前商户的取餐机器")
|
||||
private String isTakeFood;
|
||||
|
||||
/**
|
||||
* 人脸appid
|
||||
*/
|
||||
@Schema(description="人脸appid")
|
||||
private String faceAppId;
|
||||
|
||||
/**
|
||||
* 人脸sdkKey
|
||||
*/
|
||||
@Schema(description="人脸sdkKey")
|
||||
private String faceSdkKey;
|
||||
|
||||
/**
|
||||
* 人脸activeKey
|
||||
*/
|
||||
@Schema(description="人脸activeKey")
|
||||
private String faceActiveKey;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+1
-1
@@ -3,4 +3,4 @@
|
||||
* <p>
|
||||
* feign client 存放目录,注意 @EnablePigxFeignClients 的扫描范围
|
||||
*/
|
||||
package hardware.api.feign;
|
||||
package com.bsd.pjcloud.hard.api.feign;
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package hardware.utils;
|
||||
package com.bsd.pjcloud.hard.api.utils;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import hardware.dto.code.QRCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeDto;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
@UtilityClass
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardInvoiceVo extends HardInvoiceEntity {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.hard.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HardManagerVo extends HardManagerEntity {
|
||||
}
|
||||
Whitespace-only changes.
+3
-3
@@ -1,4 +1,4 @@
|
||||
package hardware;
|
||||
package com.bsd.pjcloud.hard;
|
||||
|
||||
import com.bsd.pjcloud.common.feign.annotation.EnablePjcloudFeignClients;
|
||||
import com.bsd.pjcloud.common.security.annotation.EnablePjcloudResourceServer;
|
||||
@@ -17,8 +17,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
@EnableDiscoveryClient
|
||||
@EnablePjcloudResourceServer
|
||||
@SpringBootApplication
|
||||
public class App {
|
||||
public class HardApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(App.class, args);
|
||||
SpringApplication.run(HardApp.class, args);
|
||||
}
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
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.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardInvoiceService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 发票记录
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:17:32
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hard-invoice" )
|
||||
@Tag(description = "hard-invoice" , name = "发票记录管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardInvoiceController {
|
||||
|
||||
private final HardInvoiceService hardInvoiceService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param hardInvoice 发票记录
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')" )
|
||||
public R getHardInvoicePage(@ParameterObject Page page, @ParameterObject HardInvoiceEntity hardInvoice) {
|
||||
LambdaQueryWrapper<HardInvoiceEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(hardInvoiceService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询发票记录
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(hardInvoiceService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增发票记录
|
||||
* @param hardInvoice 发票记录
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增发票记录" , description = "新增发票记录" )
|
||||
@SysLog("新增发票记录" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_add')" )
|
||||
public R save(@RequestBody HardInvoiceEntity hardInvoice) {
|
||||
return R.ok(hardInvoiceService.save(hardInvoice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改发票记录
|
||||
* @param hardInvoice 发票记录
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改发票记录" , description = "修改发票记录" )
|
||||
@SysLog("修改发票记录" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_edit')" )
|
||||
public R updateById(@RequestBody HardInvoiceEntity hardInvoice) {
|
||||
return R.ok(hardInvoiceService.updateById(hardInvoice));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除发票记录
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除发票记录" , description = "通过id删除发票记录" )
|
||||
@SysLog("通过id删除发票记录" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardInvoiceService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param hardInvoice 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_export')" )
|
||||
public List<HardInvoiceEntity> export(HardInvoiceEntity hardInvoice,Long[] ids) {
|
||||
return hardInvoiceService.list(Wrappers.lambdaQuery(hardInvoice).in(ArrayUtil.isNotEmpty(ids), HardInvoiceEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
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.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 设备管理
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:16:52
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/hard-manager" )
|
||||
@Tag(description = "hard-manager" , name = "设备管理管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class HardManagerController {
|
||||
|
||||
private final HardManagerService hardManagerService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param hardManager 设备管理
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_view')" )
|
||||
public R getHardManagerPage(@ParameterObject Page page, @ParameterObject HardManagerEntity hardManager) {
|
||||
LambdaQueryWrapper<HardManagerEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(hardManagerService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询设备管理
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(hardManagerService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备管理
|
||||
* @param hardManager 设备管理
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增设备管理" , description = "新增设备管理" )
|
||||
@SysLog("新增设备管理" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_add')" )
|
||||
public R save(@RequestBody HardManagerEntity hardManager) {
|
||||
return R.ok(hardManagerService.save(hardManager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备管理
|
||||
* @param hardManager 设备管理
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改设备管理" , description = "修改设备管理" )
|
||||
@SysLog("修改设备管理" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_edit')" )
|
||||
public R updateById(@RequestBody HardManagerEntity hardManager) {
|
||||
return R.ok(hardManagerService.updateById(hardManager));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除设备管理
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除设备管理" , description = "通过id删除设备管理" )
|
||||
@SysLog("通过id删除设备管理" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardManagerService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param hardManager 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_export')" )
|
||||
public List<HardManagerEntity> export(HardManagerEntity hardManager,Long[] ids) {
|
||||
return hardManagerService.list(Wrappers.lambdaQuery(hardManager).in(ArrayUtil.isNotEmpty(ids), HardManagerEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardInvoiceMapper extends PjcloudBaseMapper<HardInvoiceEntity> {
|
||||
|
||||
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.hard.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface HardManagerMapper extends PjcloudBaseMapper<HardManagerEntity> {
|
||||
|
||||
|
||||
}
|
||||
+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.HardInvoiceEntity;
|
||||
|
||||
public interface HardInvoiceService extends IService<HardInvoiceEntity> {
|
||||
|
||||
}
|
||||
+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.HardManagerEntity;
|
||||
|
||||
public interface HardManagerService extends IService<HardManagerEntity> {
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.HardInvoiceMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardInvoiceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 发票记录
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:17:32
|
||||
*/
|
||||
@Service
|
||||
public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardInvoiceEntity> implements HardInvoiceService {
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.bsd.pjcloud.hard.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.mapper.HardManagerMapper;
|
||||
import com.bsd.pjcloud.hard.service.HardManagerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 设备管理
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-05 14:16:52
|
||||
*/
|
||||
@Service
|
||||
public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardManagerEntity> implements HardManagerService {
|
||||
}
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
*/
|
||||
package hardware.controller;
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* Mybatis Mapper 存放目录
|
||||
*/
|
||||
package hardware.mapper;
|
||||
@@ -1,4 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
*/
|
||||
package hardware.service;
|
||||
@@ -9,17 +9,10 @@ spring:
|
||||
username: @nacos.username@
|
||||
password: @nacos.password@
|
||||
discovery:
|
||||
server-addr: pjcloud-register:8848
|
||||
server-addr: ${NACOS_HOST:pjcloud-register}:${NACOS_PORT:8848}
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr}
|
||||
config:
|
||||
import:
|
||||
- optional:nacos:application-@profiles.active@.yml
|
||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
username: root
|
||||
password: root
|
||||
url: jdbc:mysql://pjcloud-mysql:3306/pjcloudx_demo?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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.HardInvoiceMapper">
|
||||
|
||||
<resultMap id="hardInvoiceMap" type="com.bsd.pjcloud.hard.api.entity.HardInvoiceEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="hardId" column="hard_id"/>
|
||||
<result property="hardOrderId" column="hard_order_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="pic" column="pic"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?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.HardManagerMapper">
|
||||
<resultMap id="hardManagerMap" type="com.bsd.pjcloud.hard.api.entity.HardManagerEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="merchantId" column="merchant_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="mqClientId" column="mq_client_id"/>
|
||||
<result property="uniqueCode" column="unique_code"/>
|
||||
<result property="mainTopic" column="main_topic"/>
|
||||
<result property="mqSocketAddress" column="mq_socket_address"/>
|
||||
<result property="mqSocketPort" column="mq_socket_port"/>
|
||||
<result property="mqUsername" column="mq_username"/>
|
||||
<result property="mqPassword" column="mq_password"/>
|
||||
<result property="isTakeFood" column="is_take_food"/>
|
||||
<result property="faceAppId" column="face_app_id"/>
|
||||
<result property="faceSdkKey" column="face_sdk_key"/>
|
||||
<result property="faceActiveKey" column="face_active_key"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+4
-5
@@ -16,13 +16,12 @@ import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletCodeUseDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletCodeUseVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletCodeUseMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import hardware.constant.HardOrderTypeEnum;
|
||||
import hardware.constant.HardPayTypeEnum;
|
||||
import hardware.dto.code.QRCodeDto;
|
||||
import hardware.utils.HardUtil;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardOrderTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardPayTypeEnum;
|
||||
import com.bsd.pjcloud.hard.api.dto.code.QRCodeDto;
|
||||
import com.bsd.pjcloud.hard.api.utils.HardUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
|
||||
Reference in new issue
Block a user