create:跨单位、外来人员代码生成
This commit is contained in:
1 parent
d4a2df19e9
commit
54e3a20095
29 files changed
+856
-12
No files matched your search
@@ -153,7 +153,10 @@ CREATE TABLE wallet_transaction
|
||||
CREATE INDEX idx_dept_id ON wallet_transaction (wallet_id);
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_user_face
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS sys_user_face;
|
||||
CREATE TABLE `sys_user_face`
|
||||
(
|
||||
id bigint AUTO_INCREMENT NOT NULL COMMENT '编号',
|
||||
@@ -171,6 +174,10 @@ CREATE TABLE `sys_user_face`
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='人脸样本表';
|
||||
CREATE INDEX idx_dept_id ON sys_user_face (user_id);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_recharge_apply
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_recharge_apply;
|
||||
CREATE TABLE wallet_recharge_apply
|
||||
(
|
||||
id bigint NOT NULL COMMENT '主键ID',
|
||||
@@ -192,6 +199,9 @@ CREATE TABLE wallet_recharge_apply
|
||||
COLLATE = utf8mb4_general_ci COMMENT ='充值申请表';
|
||||
CREATE INDEX idx_dept_id ON wallet_recharge_apply (user_id);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_recharge_import
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_recharge_import;
|
||||
CREATE TABLE wallet_recharge_import
|
||||
(
|
||||
@@ -208,4 +218,74 @@ CREATE TABLE wallet_recharge_import
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) COMMENT ='充值导入表';
|
||||
CREATE INDEX idx_dept_id ON wallet_recharge_import (user_id);
|
||||
CREATE INDEX idx_dept_id ON wallet_recharge_import (user_id);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_stride_dept
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_stride;
|
||||
CREATE TABLE wallet_stride
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
count int NOT NULL COMMENT '申请数量',
|
||||
use_count int NOT NULL COMMENT '使用数量',
|
||||
user_id bigint NOT NULL COMMENT '申请人id',
|
||||
remark varchar(1024) 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 COMMENT ='跨单位就餐';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_recharge_import
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_foreign;
|
||||
CREATE TABLE wallet_foreign
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
apply_start_time date NULL COMMENT '申请使用开始时间',
|
||||
apply_end_time date NULL COMMENT '申请使用结束时间',
|
||||
count int NOT NULL COMMENT '申请数量',
|
||||
use_count int NOT NULL COMMENT '使用数量',
|
||||
remark VARCHAR(1024) 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 COMMENT ='外来人员电子餐券表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_code_use
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_code_use;
|
||||
CREATE TABLE wallet_code_use
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
biz_type tinytext NOT NULL COMMENT '类型',
|
||||
biz_id bigint NOT NULL COMMENT '类型关联id',
|
||||
status char(1) DEFAULT '0' NOT NULL COMMENT '是否使用',
|
||||
code varchar(1024) DEFAULT NULL COMMENT '二维码',
|
||||
code_content varchar(1024) DEFAULT NULL COMMENT '二维码内容',
|
||||
use_time timestamp 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 COMMENT ='二维码使用表';
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletCodeUseDto extends WalletCodeUseEntity {
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletFreezeDto extends WalletFreezeEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private String cardNumber;
|
||||
|
||||
}
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletFreezeEntityDto extends WalletFreezeEntity {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletStrideDto extends WalletStrideEntity {
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.bsd.pjcloud.wallet.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-02 16:26:10
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_code_use")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "二维码使用表")
|
||||
public class WalletCodeUseEntity extends Model<WalletCodeUseEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description="用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description="类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 类型关联id
|
||||
*/
|
||||
@Schema(description="类型关联id")
|
||||
private Long bizId;
|
||||
|
||||
/**
|
||||
* 是否使用
|
||||
*/
|
||||
@Schema(description="是否使用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 二维码
|
||||
*/
|
||||
@Schema(description="二维码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 二维码内容
|
||||
*/
|
||||
@Schema(description="二维码内容")
|
||||
private String codeContent;
|
||||
|
||||
/**
|
||||
* 使用时间
|
||||
*/
|
||||
@Schema(description="使用时间")
|
||||
private LocalDateTime useTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.bsd.pjcloud.wallet.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.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 外来人员电子餐券表
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:48
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_foreign")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "外来人员电子餐券表")
|
||||
public class WalletForeignEntity extends Model<WalletForeignEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description="用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 申请使用开始时间
|
||||
*/
|
||||
@Schema(description="申请使用开始时间")
|
||||
private LocalDate applyStartTime;
|
||||
|
||||
/**
|
||||
* 申请使用结束时间
|
||||
*/
|
||||
@Schema(description="申请使用结束时间")
|
||||
private LocalDate applyEndTime;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description="申请数量")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description="使用数量")
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 申请备注
|
||||
*/
|
||||
@Schema(description="申请备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package com.bsd.pjcloud.wallet.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 pjcloud
|
||||
* @date 2025-01-02 16:27:26
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_stride")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "跨单位就餐")
|
||||
public class WalletStrideEntity extends Model<WalletStrideEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description="申请数量")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description="使用数量")
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@Schema(description="申请人id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletCodeUseVo extends WalletCodeUseEntity {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletForeignVo extends WalletForeignEntity {
|
||||
|
||||
}
|
||||
+20
-1
@@ -1,8 +1,27 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseDeptInterface;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletFreezeVo extends WalletFreezeEntity {
|
||||
public class WalletFreezeVo extends WalletFreezeEntity implements BaseUserInterface, BaseDeptInterface {
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
private String deptName;
|
||||
|
||||
private String cardNumber;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletStrideVo extends WalletStrideEntity {
|
||||
|
||||
}
|
||||
+14
@@ -7,6 +7,7 @@ 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.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletFreezeService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -50,6 +51,19 @@ public class WalletFreezeController {
|
||||
return R.ok(walletFreezeService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页复杂查询
|
||||
* @param page 分页复杂查询
|
||||
* @param dto 分页复杂查询
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页复杂查询" , description = "分页复杂查询" )
|
||||
@GetMapping("/page-join" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')" )
|
||||
public R getWalletFreezePage(@ParameterObject Page page, @ParameterObject WalletFreezeDto dto) {
|
||||
return R.ok(walletFreezeService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询饭卡冻结记录表
|
||||
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package com.bsd.pjcloud.wallet.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.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletStrideService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 跨单位就餐
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-02 16:27:26
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/walletStride" )
|
||||
@Tag(description = "walletStride" , name = "跨单位就餐管理" )
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletStrideController {
|
||||
|
||||
private final WalletStrideService walletStrideService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param walletStride 跨单位就餐
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_view')" )
|
||||
public R getWalletStridePage(@ParameterObject Page page, @ParameterObject WalletStrideEntity walletStride) {
|
||||
LambdaQueryWrapper<WalletStrideEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(walletStrideService.page(page, wrapper));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询跨单位就餐
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
return R.ok(walletStrideService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增跨单位就餐
|
||||
* @param walletStride 跨单位就餐
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增跨单位就餐" , description = "新增跨单位就餐" )
|
||||
@SysLog("新增跨单位就餐" )
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_add')" )
|
||||
public R save(@RequestBody WalletStrideEntity walletStride) {
|
||||
return R.ok(walletStrideService.save(walletStride));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改跨单位就餐
|
||||
* @param walletStride 跨单位就餐
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改跨单位就餐" , description = "修改跨单位就餐" )
|
||||
@SysLog("修改跨单位就餐" )
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_edit')" )
|
||||
public R updateById(@RequestBody WalletStrideEntity walletStride) {
|
||||
return R.ok(walletStrideService.updateById(walletStride));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除跨单位就餐
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除跨单位就餐" , description = "通过id删除跨单位就餐" )
|
||||
@SysLog("通过id删除跨单位就餐" )
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_del')" )
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletStrideService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param walletStride 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_export')" )
|
||||
public List<WalletStrideEntity> export(WalletStrideEntity walletStride,Long[] ids) {
|
||||
return walletStrideService.list(Wrappers.lambdaQuery(walletStride).in(ArrayUtil.isNotEmpty(ids), WalletStrideEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletCodeUseMapper extends PjcloudBaseMapper<WalletCodeUseEntity> {
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletForeignMapper extends PjcloudBaseMapper<WalletForeignEntity> {
|
||||
|
||||
}
|
||||
+18
-1
@@ -1,11 +1,28 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletActiveEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletActiveVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
import com.github.yulichang.query.MPJLambdaQueryWrapper;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletFreezeMapper extends PjcloudBaseMapper<WalletFreezeEntity> {
|
||||
|
||||
|
||||
default Page<WalletFreezeVo> pageJoin(Page page, WalletFreezeDto dto) {
|
||||
MPJLambdaWrapper<WalletFreezeEntity> wrapper = new MPJLambdaWrapper<WalletFreezeEntity>()
|
||||
.selectAll(WalletFreezeEntity.class)
|
||||
.selectAs(WalletManageEntity::getCardNumber, WalletFreezeDto::getCardNumber)
|
||||
.leftJoin(WalletManageEntity.class, WalletManageEntity::getId, WalletFreezeEntity::getWalletId)
|
||||
.eqIfExists(WalletManageEntity::getCardNumber, dto.getCardNumber())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletFreezeEntity::getId, dto.getUserIds());
|
||||
return selectJoinPage(page, WalletActiveVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.admin.entity.WalletStrideEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletStrideMapper extends PjcloudBaseMapper<WalletStrideEntity> {
|
||||
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
|
||||
public interface WalletCodeUseService extends IService<WalletCodeUseEntity> {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
|
||||
public interface WalletForeignService extends IService<WalletForeignEntity> {
|
||||
|
||||
}
|
||||
+4
@@ -1,8 +1,12 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
|
||||
public interface WalletFreezeService extends IService<WalletFreezeEntity> {
|
||||
|
||||
Page<WalletFreezeVo> pageJoin(Page page, WalletFreezeDto dto);
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
|
||||
public interface WalletStrideService extends IService<WalletStrideEntity> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletCodeUseMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 二维码使用表
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:10
|
||||
*/
|
||||
@Service
|
||||
public class WalletCodeUseServiceImpl extends ServiceImpl<WalletCodeUseMapper, WalletCodeUseEntity> implements WalletCodeUseService {
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletForeignMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletForeignService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 外来人员电子餐券表
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:48
|
||||
*/
|
||||
@Service
|
||||
public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, WalletForeignEntity> implements WalletForeignService {
|
||||
|
||||
}
|
||||
+40
@@ -1,7 +1,19 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysDept;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletActiveVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletFreezeMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletFreezeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -9,6 +21,10 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 饭卡冻结记录表
|
||||
*
|
||||
@@ -20,4 +36,28 @@ import org.springframework.validation.annotation.Validated;
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WalletFreezeServiceImpl extends ServiceImpl<WalletFreezeMapper, WalletFreezeEntity> implements WalletFreezeService {
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
|
||||
@Override
|
||||
public Page<WalletFreezeVo> pageJoin(Page page, WalletFreezeDto dto) {
|
||||
Page<WalletFreezeVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletFreezeVo::getUserId).distinct().toList();
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(page.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletFreezeVo::getDeptId).distinct().toList();
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(page.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletStrideMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletStrideService;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 跨单位就餐
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-02 16:27:26
|
||||
*/
|
||||
@Service
|
||||
public class WalletStrideServiceImpl extends ServiceImpl<WalletStrideMapper, WalletStrideEntity> implements WalletStrideService {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?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.wallet.mapper.WalletCodeUseMapper">
|
||||
|
||||
<resultMap id="walletCodeUseMap" type="com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="bizId" column="biz_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="code" column="code"/>
|
||||
<result property="codeContent" column="code_content"/>
|
||||
<result property="useTime" column="use_time"/>
|
||||
<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,21 @@
|
||||
<?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.wallet.mapper.WalletForeignMapper">
|
||||
<resultMap id="walletForeignMap" type="com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="applyStartTime" column="apply_start_time"/>
|
||||
<result property="applyEndTime" column="apply_end_time"/>
|
||||
<result property="count" column="count"/>
|
||||
<result property="useCount" column="use_count"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<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,19 @@
|
||||
<?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.wallet.mapper.WalletStrideMapper">
|
||||
<resultMap id="walletStrideMap" type="com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="deptId" column="dept_id"/>
|
||||
<result property="count" column="count"/>
|
||||
<result property="useCount" column="use_count"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<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>
|
||||
Reference in new issue
Block a user