Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4ce3b64754
82 files changed
+2288
-554
No files matched your search
+93
-33
@@ -113,17 +113,20 @@ CREATE INDEX idx_dept_id ON wallet_active (user_id);
|
||||
DROP TABLE IF EXISTS wallet_freeze;
|
||||
CREATE TABLE wallet_freeze
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
wallet_id bigint NOT NULL COMMENT '钱包id',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
free_status tinytext 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',
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
process_id varchar(256) COMMENT '流程id',
|
||||
process_status varchar(10) NOT NULL COMMENT '审核状体',
|
||||
wallet_id bigint NOT NULL COMMENT '钱包id',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
free_status tinytext 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 ='饭卡冻结记录表';
|
||||
@@ -221,40 +224,44 @@ CREATE TABLE wallet_recharge_import
|
||||
CREATE INDEX idx_dept_id ON wallet_recharge_import (user_id);
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_stride_dept
|
||||
-- Table structure for wallet_stride
|
||||
-- ----------------------------
|
||||
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',
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
process_id varchar(256) COMMENT '流程id',
|
||||
process_status varchar(10) NOT NULL COMMENT '审核状体',
|
||||
dept_id bigint NOT NULL COMMENT '部门id',
|
||||
count int NOT NULL COMMENT '申请数量',
|
||||
use_count int DEFAULT 0 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
|
||||
-- Table structure for wallet_foreign
|
||||
-- ----------------------------
|
||||
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 '使用数量',
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
user_id bigint NOT NULL COMMENT '用户id',
|
||||
process_id varchar(256) COMMENT '流程id',
|
||||
process_status varchar(10) NOT NULL COMMENT '审核状体',
|
||||
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 DEFAULT 0 COMMENT '使用数量',
|
||||
remark VARCHAR(1024) COMMENT '申请备注',
|
||||
create_by varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
|
||||
create_time datetime DEFAULT NULL COMMENT '创建时间',
|
||||
@@ -288,4 +295,57 @@ CREATE TABLE wallet_code_use
|
||||
tenant_id bigint DEFAULT NULL COMMENT '租户ID',
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='二维码使用表';
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='二维码使用表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_recharge_package
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_recharge_package;
|
||||
create table wallet_recharge_package
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
name varchar(64) NOT NULL COMMENT '套餐名',
|
||||
pay_price int NOT NULL COMMENT '支付金额',
|
||||
bonus_price int NOT NULL COMMENT '赠送金额',
|
||||
status tinyint 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 COMMENT ='充值套餐表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for wallet_recharge
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS wallet_recharge;
|
||||
create table wallet_recharge
|
||||
(
|
||||
id bigint NOT NULL COMMENT '编号',
|
||||
wallet_id bigint NOT NULL COMMENT '会员钱包 id',
|
||||
total_price int NOT NULL COMMENT '用户实际到账余额,例如充 100 送 20,则该值是 120',
|
||||
pay_price int NOT NULL COMMENT '实际支付金额',
|
||||
bonus_price int NOT NULL COMMENT '钱包赠送金额',
|
||||
package_id bigint NULL COMMENT '充值套餐编号',
|
||||
pay_status bit default b'0' NOT NULL COMMENT '是否已支付:[0:未支付 1:已经支付过]',
|
||||
pay_order_id bigint NULL COMMENT '支付订单编号',
|
||||
pay_channel_code varchar(16) NULL COMMENT '支付成功的支付渠道',
|
||||
pay_time datetime NULL COMMENT '订单支付时间',
|
||||
pay_refund_id bigint NULL COMMENT '支付退款单编号',
|
||||
refund_total_price int default 0 NOT NULL COMMENT '退款金额,包含赠送金额',
|
||||
refund_pay_price int default 0 NOT NULL COMMENT '退款支付金额',
|
||||
refund_bonus_price int default 0 NOT NULL COMMENT '退款钱包赠送金额',
|
||||
refund_time datetime NULL COMMENT '退款时间',
|
||||
refund_status int default 0 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 COMMENT ='会员钱包充值';
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.flow.task.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum TaskCheckStatusEnum {
|
||||
|
||||
PADDING("1", "审核中"),
|
||||
RESULT("2", "审核通过"),
|
||||
REJECT("3", "审核拒绝"),
|
||||
;
|
||||
private final String code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static TaskCheckStatusEnum descOf(String description) {
|
||||
return Arrays.stream(TaskCheckStatusEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getDesc(), description))
|
||||
.findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -19,7 +19,7 @@ public class ProcessController {
|
||||
* @param flowId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getDetail")
|
||||
@GetMapping("/getDetail")
|
||||
public R<ProcessVO> getDetail(String flowId) {
|
||||
return processService.getDetail(flowId);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class ProcessController {
|
||||
* @param process
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("create")
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody Process process) {
|
||||
return processService.create(process);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class ProcessController {
|
||||
* @param type 类型 stop using delete
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PutMapping("update/{flowId}")
|
||||
@PutMapping("/update/{flowId}")
|
||||
public R update(@PathVariable String flowId, @RequestParam String type,
|
||||
@RequestParam(required = false) Long groupId) {
|
||||
return processService.update(flowId, type, groupId);
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ public class ProcessInstanceController {
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("startProcessInstance")
|
||||
@PostMapping("/startProcessInstance")
|
||||
public R startProcessInstance(@RequestBody ProcessInstanceParamDto processInstanceParamDto) {
|
||||
return processInstanceService.startProcessInstance(processInstanceParamDto);
|
||||
}
|
||||
|
||||
+2
@@ -5,6 +5,8 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import com.bsd.pjcloud.flow.task.vo.ProcessVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
|
||||
+2
@@ -259,4 +259,6 @@ public class ProcessServiceImpl extends ServiceImpl<ProcessMapper, Process> impl
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package hardware.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 硬件订单类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardOrderTypeEnum {
|
||||
BELOW(1, "线下购买"),
|
||||
RESERVE(2, "线上订餐"),
|
||||
FOREIGN_TICKET(3, "外来人员"),
|
||||
STRIDE_DEPT(4, "跨单位"),
|
||||
;
|
||||
private final Integer type;
|
||||
private final String description;
|
||||
|
||||
public static HardOrderTypeEnum valueOfByType(Integer type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package hardware.constant;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 硬件订单支付方式
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum HardPayTypeEnum {
|
||||
WALLET_DEFAULT(1, "普通钱包支付"),
|
||||
WALLET_QR_CODE(2, "钱包二维码支付"),
|
||||
WALLET_CARD(3, "钱包饭卡支付"),
|
||||
FACE(4, "人脸识别支付"),
|
||||
STRIDE_DEPT_QR_CODE(5, "跨单位二维码支付"),
|
||||
FOREIGN_TICKET_QR_CODE(6, "外来人员二维码支付"),
|
||||
RESERVE_QR_CODE(7, "线上订餐二维码支付"),
|
||||
CASH(8, "现金支付"),
|
||||
;
|
||||
private final Integer type;
|
||||
private final String description;
|
||||
|
||||
public static HardPayTypeEnum valueOfByType(Integer type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 常量和枚举定义
|
||||
*/
|
||||
package hardware.constant;
|
||||
Whitespace-only changes.
@@ -0,0 +1,39 @@
|
||||
package hardware.dto.code;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class QRCodeDto {
|
||||
// 总id
|
||||
private Long id;
|
||||
|
||||
// 子id
|
||||
private Long itemId;
|
||||
|
||||
// 类型id 比如钱包类型
|
||||
private Long typeId;
|
||||
|
||||
// 用户id
|
||||
private Long userId;
|
||||
|
||||
// 订单类型
|
||||
private Integer orderType;
|
||||
|
||||
// 支付类型
|
||||
private Integer payType;
|
||||
|
||||
// 过期时间 -1 代表没有限制
|
||||
private Long exceedTime;
|
||||
|
||||
/**
|
||||
* 额外的用户信息json
|
||||
* @see QRCodeExtraDto
|
||||
*/
|
||||
private String extra;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* DTO 存放目录
|
||||
*/
|
||||
package hardware.dto;
|
||||
@@ -1,6 +0,0 @@
|
||||
/*
|
||||
* @author pigx archetype
|
||||
* <p>
|
||||
* 实体 存放目录
|
||||
*/
|
||||
package hardware.entity;
|
||||
@@ -0,0 +1,44 @@
|
||||
package hardware.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 lombok.experimental.UtilityClass;
|
||||
|
||||
@UtilityClass
|
||||
public class HardUtil {
|
||||
|
||||
public Pair<String, String> generate(QRCodeDto dto) {
|
||||
String fileName = "qrcode";
|
||||
if (ObjectUtil.isEmpty(dto.getId())) {
|
||||
fileName += "_unknown";
|
||||
} else {
|
||||
fileName += "_" + dto.getId().toString();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(dto.getItemId())) {
|
||||
fileName += "_unknown";
|
||||
} else {
|
||||
fileName += "_" + dto.getItemId().toString();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(dto.getUserId())) {
|
||||
fileName += "_unknown";
|
||||
} else {
|
||||
fileName += "_" + dto.getUserId().toString();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(dto.getOrderType())) {
|
||||
fileName += "_unknown";
|
||||
} else {
|
||||
fileName += "_" + dto.getOrderType().toString();
|
||||
}
|
||||
if (ObjectUtil.isEmpty(dto.getPayType())) {
|
||||
fileName += "_unknown";
|
||||
} else {
|
||||
fileName += "_" + dto.getPayType().toString();
|
||||
}
|
||||
String coeContent = Base64.encode(JSONUtil.toJsonStr(dto));
|
||||
return new Pair<>(fileName, coeContent);
|
||||
}
|
||||
|
||||
}
|
||||
+9
-1
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.admin.api.feign;
|
||||
|
||||
import com.bsd.pjcloud.common.core.constant.ServiceNameConstants;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.feign.annotation.NoToken;
|
||||
import feign.Response;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.http.MediaType;
|
||||
@@ -24,9 +25,16 @@ public interface RemoteFileService {
|
||||
Response getFile(@RequestParam String fileName);
|
||||
|
||||
|
||||
@PostMapping(value = "/sys-file/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@PostMapping(value = "/sys-file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
R upload(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "dir", required = false) String dir,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type);
|
||||
|
||||
@NoToken
|
||||
@PostMapping(value = "/sys-file/inner-upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
R innerUpload(@RequestPart("file") MultipartFile file,
|
||||
@RequestParam(value = "dir", required = false) String dir,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type);
|
||||
}
|
||||
+137
-115
@@ -57,131 +57,153 @@ import java.util.Objects;
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class SysFileController {
|
||||
|
||||
private final SysFileService sysFileService;
|
||||
private final SysFileService sysFileService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param sysFile 文件管理
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysFilePage(@ParameterObject Page page, @ParameterObject SysFile sysFile) {
|
||||
LambdaQueryWrapper<SysFile> wrapper = Wrappers.<SysFile>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(sysFile.getType()), SysFile::getType, sysFile.getType())
|
||||
.eq(Objects.nonNull(sysFile.getGroupId()), SysFile::getGroupId, sysFile.getGroupId())
|
||||
.like(StrUtil.isNotBlank(sysFile.getOriginal()), SysFile::getOriginal, sysFile.getOriginal());
|
||||
return R.ok(sysFileService.page(page, wrapper));
|
||||
}
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
|
||||
/**
|
||||
* 通过id删除文件管理
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文件管理", description = "通过id删除文件管理")
|
||||
@SysLog("删除文件管理")
|
||||
@DeleteMapping
|
||||
@HasPermission("sys_file_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
sysFileService.deleteFile(id);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
@Inner
|
||||
@PostMapping(value = "/inner-upload")
|
||||
public R innerUpload(@RequestPart("file") MultipartFile file, @RequestParam(value = "dir", required = false) String dir,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type) {
|
||||
return sysFileService.innerUpload(file, dir, groupId, type);
|
||||
}
|
||||
|
||||
@PutMapping("/rename")
|
||||
public R rename(@RequestBody SysFile sysFile) {
|
||||
return R.ok(sysFileService.updateById(sysFile));
|
||||
}
|
||||
/* ************************************* start 远程调用 start ************************************* */
|
||||
|
||||
/**
|
||||
* 上传文件 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
|
||||
* @param file 资源
|
||||
* @param dir 文件夹
|
||||
* @return R(/ admin / bucketName / filename)
|
||||
*/
|
||||
@PostMapping(value = "/upload")
|
||||
public R upload(@RequestPart("file") MultipartFile file, @RequestParam(value = "dir", required = false) String dir,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type) {
|
||||
return sysFileService.uploadFile(file, dir, groupId, type);
|
||||
}
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param sysFile 文件管理
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public R getSysFilePage(@ParameterObject Page page, @ParameterObject SysFile sysFile) {
|
||||
LambdaQueryWrapper<SysFile> wrapper = Wrappers.<SysFile>lambdaQuery()
|
||||
.eq(StrUtil.isNotBlank(sysFile.getType()), SysFile::getType, sysFile.getType())
|
||||
.eq(Objects.nonNull(sysFile.getGroupId()), SysFile::getGroupId, sysFile.getGroupId())
|
||||
.like(StrUtil.isNotBlank(sysFile.getOriginal()), SysFile::getOriginal, sysFile.getOriginal());
|
||||
return R.ok(sysFileService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件
|
||||
* @param fileName 文件空间/名称
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@Inner(false)
|
||||
@GetMapping("/oss/file")
|
||||
public void file(String fileName, HttpServletResponse response) {
|
||||
sysFileService.getFile(fileName, response);
|
||||
}
|
||||
/**
|
||||
* 通过id删除文件管理
|
||||
*
|
||||
* @param ids id 列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除文件管理", description = "通过id删除文件管理")
|
||||
@SysLog("删除文件管理")
|
||||
@DeleteMapping
|
||||
@HasPermission("sys_file_del")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
sysFileService.deleteFile(id);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地(resources)文件
|
||||
* @param fileName 文件名称
|
||||
* @param response 本地文件
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/local/file/{fileName}")
|
||||
public void localFile(@PathVariable String fileName, HttpServletResponse response) {
|
||||
ClassPathResource resource = new ClassPathResource("file/" + fileName);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IoUtil.copy(resource.getInputStream(), response.getOutputStream());
|
||||
}
|
||||
@PutMapping("/rename")
|
||||
public R rename(@RequestBody SysFile sysFile) {
|
||||
return R.ok(sysFileService.updateById(sysFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询文件组列表
|
||||
* @param fileGroup SysFileGroup对象,用于筛选条件
|
||||
* @return 包含文件组列表的R对象
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public R listGroup(SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.listFileGroup(fileGroup));
|
||||
}
|
||||
/**
|
||||
* 上传文件 文件名采用uuid,避免原始文件名中带"-"符号导致下载的时候解析出现异常
|
||||
*
|
||||
* @param file 资源
|
||||
* @param dir 文件夹
|
||||
* @return R(/ admin / bucketName / filename)
|
||||
*/
|
||||
@PostMapping(value = "/upload")
|
||||
public R upload(@RequestPart("file") MultipartFile file, @RequestParam(value = "dir", required = false) String dir,
|
||||
@RequestParam(value = "groupId", required = false) Long groupId,
|
||||
@RequestParam(value = "type", required = false) String type) {
|
||||
return sysFileService.uploadFile(file, dir, groupId, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加文件组
|
||||
* @param fileGroup SysFileGroup对象,要添加的文件组信息
|
||||
* @return 包含添加结果的R对象
|
||||
*/
|
||||
@PostMapping("/group/add")
|
||||
public R addGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
/**
|
||||
* 获取文件
|
||||
*
|
||||
* @param fileName 文件空间/名称
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@Inner(false)
|
||||
@GetMapping("/oss/file")
|
||||
public void file(String fileName, HttpServletResponse response) {
|
||||
sysFileService.getFile(fileName, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文件组
|
||||
* @param fileGroup SysFileGroup对象,要更新的文件组信息
|
||||
* @return 包含更新结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/update")
|
||||
public R updateGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
/**
|
||||
* 获取本地(resources)文件
|
||||
*
|
||||
* @param fileName 文件名称
|
||||
* @param response 本地文件
|
||||
*/
|
||||
@SneakyThrows
|
||||
@GetMapping("/local/file/{fileName}")
|
||||
public void localFile(@PathVariable String fileName, HttpServletResponse response) {
|
||||
ClassPathResource resource = new ClassPathResource("file/" + fileName);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
IoUtil.copy(resource.getInputStream(), response.getOutputStream());
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件组
|
||||
* @param id 待删除文件组的ID
|
||||
* @return 包含删除结果的R对象
|
||||
*/
|
||||
@DeleteMapping("/group/delete/{id}")
|
||||
public R updateGroup(@PathVariable Long id) {
|
||||
return R.ok(sysFileService.deleteGroup(id));
|
||||
}
|
||||
/**
|
||||
* 查询文件组列表
|
||||
*
|
||||
* @param fileGroup SysFileGroup对象,用于筛选条件
|
||||
* @return 包含文件组列表的R对象
|
||||
*/
|
||||
@GetMapping("/group/list")
|
||||
public R listGroup(SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.listFileGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动文件组
|
||||
* @param fileGroupDTO SysFileGroupDTO对象,要移动的文件组信息
|
||||
* @return 包含移动结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/move")
|
||||
public R moveFileGroup(@RequestBody SysFileGroupDTO fileGroupDTO) {
|
||||
return R.ok(sysFileService.moveFileGroup(fileGroupDTO));
|
||||
}
|
||||
/**
|
||||
* 添加文件组
|
||||
*
|
||||
* @param fileGroup SysFileGroup对象,要添加的文件组信息
|
||||
* @return 包含添加结果的R对象
|
||||
*/
|
||||
@PostMapping("/group/add")
|
||||
public R addGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新文件组
|
||||
*
|
||||
* @param fileGroup SysFileGroup对象,要更新的文件组信息
|
||||
* @return 包含更新结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/update")
|
||||
public R updateGroup(@RequestBody SysFileGroup fileGroup) {
|
||||
return R.ok(sysFileService.saveOrUpdateGroup(fileGroup));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件组
|
||||
*
|
||||
* @param id 待删除文件组的ID
|
||||
* @return 包含删除结果的R对象
|
||||
*/
|
||||
@DeleteMapping("/group/delete/{id}")
|
||||
public R updateGroup(@PathVariable Long id) {
|
||||
return R.ok(sysFileService.deleteGroup(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 移动文件组
|
||||
*
|
||||
* @param fileGroupDTO SysFileGroupDTO对象,要移动的文件组信息
|
||||
* @return 包含移动结果的R对象
|
||||
*/
|
||||
@PutMapping("/group/move")
|
||||
public R moveFileGroup(@RequestBody SysFileGroupDTO fileGroupDTO) {
|
||||
return R.ok(sysFileService.moveFileGroup(fileGroupDTO));
|
||||
}
|
||||
|
||||
}
|
||||
+2
-1
@@ -46,6 +46,8 @@ public interface SysFileService extends IService<SysFile> {
|
||||
*/
|
||||
R uploadFile(MultipartFile file, String dir, Long groupId, String type);
|
||||
|
||||
R innerUpload(MultipartFile file, String dir, Long groupId, String type);
|
||||
|
||||
/**
|
||||
* 读取文件
|
||||
* @param fileName 文件名称
|
||||
@@ -87,5 +89,4 @@ public interface SysFileService extends IService<SysFile> {
|
||||
* @return 移动成功返回true,否则返回false
|
||||
*/
|
||||
Boolean moveFileGroup(SysFileGroupDTO fileGroupDTO);
|
||||
|
||||
}
|
||||
+15
@@ -99,6 +99,21 @@ public class SysFileServiceImpl extends ServiceImpl<SysFileMapper, SysFile> impl
|
||||
return R.ok(resultMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R innerUpload(MultipartFile file, String dir, Long groupId, String type) {
|
||||
String fileName = IdUtil.simpleUUID() + StrUtil.DOT + FileUtil.extName(file.getOriginalFilename());
|
||||
Map<String, String> resultMap = new HashMap<>(4);
|
||||
resultMap.put("bucketName", properties.getBucketName());
|
||||
resultMap.put("fileName", fileName);
|
||||
resultMap.put("url", String.format("/admin/sys-file/oss/file?fileName=%s", fileName));
|
||||
try (InputStream inputStream = file.getInputStream()) {
|
||||
fileTemplate.putObject(properties.getBucketName(), dir, fileName, inputStream, file.getContentType());
|
||||
} catch (Exception e) {
|
||||
return R.failed(e.getLocalizedMessage());
|
||||
}
|
||||
return R.ok(resultMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件
|
||||
*
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.bsd.pjcloud.wallet.api.constant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum WalletCodeBizEnum {
|
||||
STRIDE("1", "跨单位"),
|
||||
FOREIGN("2", "外来人员"),
|
||||
;
|
||||
private final String code;
|
||||
|
||||
private final String desc;
|
||||
|
||||
public static WalletCodeBizEnum descOf(String description) {
|
||||
return Arrays.stream(WalletCodeBizEnum.values())
|
||||
.filter(v -> ObjectUtil.equal(v.getDesc(), description))
|
||||
.findFirst().get();
|
||||
}
|
||||
}
|
||||
+5
@@ -3,6 +3,11 @@ package com.bsd.pjcloud.wallet.api.dto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletCodeUseDto extends WalletCodeUseEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
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.WalletForeignEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletForeignDto extends WalletForeignEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
|
||||
}
|
||||
+3
-1
@@ -8,8 +8,10 @@ import java.util.List;
|
||||
@Data
|
||||
public class WalletFreezeDto extends WalletFreezeEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
private Long walletTypeId;
|
||||
|
||||
private String cardNumber;
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargeImportDto extends WalletRechargeImportEntity {
|
||||
|
||||
}
|
||||
+7
@@ -3,6 +3,13 @@ package com.bsd.pjcloud.wallet.api.dto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletStrideDto extends WalletStrideEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
}
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
package com.bsd.pjcloud.wallet.api.dto.recharge;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
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
|
||||
public class WalletRechargeDto extends WalletRechargeEntity {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargeImportDto extends WalletRechargeImportEntity {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargePackageDto extends WalletRechargePackageEntity {
|
||||
|
||||
}
|
||||
+4
-2
@@ -3,8 +3,7 @@ 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 lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -14,6 +13,9 @@ import java.time.LocalDateTime;
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:10
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_code_use")
|
||||
|
||||
+78
-63
@@ -3,9 +3,9 @@ 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 lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -15,6 +15,9 @@ import java.time.LocalDateTime;
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:48
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_foreign")
|
||||
@@ -23,94 +26,106 @@ import java.time.LocalDateTime;
|
||||
public class WalletForeignEntity extends Model<WalletForeignEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description="用户id")
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private String processId;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@Schema(description = "流程状态")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 申请使用开始时间
|
||||
*/
|
||||
@Schema(description="申请使用开始时间")
|
||||
/**
|
||||
* 申请使用开始时间
|
||||
*/
|
||||
@Schema(description = "申请使用开始时间")
|
||||
private LocalDate applyStartTime;
|
||||
|
||||
/**
|
||||
* 申请使用结束时间
|
||||
*/
|
||||
@Schema(description="申请使用结束时间")
|
||||
/**
|
||||
* 申请使用结束时间
|
||||
*/
|
||||
@Schema(description = "申请使用结束时间")
|
||||
private LocalDate applyEndTime;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description="申请数量")
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description = "申请数量")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description="使用数量")
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description = "使用数量")
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 申请备注
|
||||
*/
|
||||
@Schema(description="申请备注")
|
||||
/**
|
||||
* 申请备注
|
||||
*/
|
||||
@Schema(description = "申请备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+22
-2
@@ -3,8 +3,7 @@ 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 lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -14,6 +13,9 @@ import java.time.LocalDateTime;
|
||||
* @author dzc
|
||||
* @date 2024-12-31 18:54:43
|
||||
*/
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_freeze")
|
||||
@@ -29,6 +31,18 @@ public class WalletFreezeEntity extends Model<WalletFreezeEntity> {
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private String processId;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@Schema(description = "流程状态")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 钱包id
|
||||
*/
|
||||
@@ -41,6 +55,12 @@ public class WalletFreezeEntity extends Model<WalletFreezeEntity> {
|
||||
@Schema(description="用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 冻结状态
|
||||
*/
|
||||
|
||||
+70
-55
@@ -3,9 +3,9 @@ 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 lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -14,6 +14,9 @@ import java.time.LocalDateTime;
|
||||
* @author pjcloud
|
||||
* @date 2025-01-02 16:27:26
|
||||
*/
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_stride")
|
||||
@@ -22,82 +25,94 @@ import java.time.LocalDateTime;
|
||||
public class WalletStrideEntity extends Model<WalletStrideEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description="部门id")
|
||||
/**
|
||||
* 流程id
|
||||
*/
|
||||
@Schema(description = "流程id")
|
||||
private String processId;
|
||||
|
||||
/**
|
||||
* 流程状态
|
||||
*/
|
||||
@Schema(description = "流程状态")
|
||||
private String processStatus;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description="申请数量")
|
||||
/**
|
||||
* 申请数量
|
||||
*/
|
||||
@Schema(description = "申请数量")
|
||||
private Integer count;
|
||||
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description="使用数量")
|
||||
/**
|
||||
* 使用数量
|
||||
*/
|
||||
@Schema(description = "使用数量")
|
||||
private Integer useCount;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@Schema(description="申请人id")
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
@Schema(description = "申请人id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description="备注")
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改人")
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity;
|
||||
package com.bsd.pjcloud.wallet.api.entity.recharge;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
@@ -8,7 +8,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_recharge")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "会员钱包充值")
|
||||
public class WalletRechargeEntity extends Model<WalletRechargeEntity> {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 会员钱包 id
|
||||
*/
|
||||
@Schema(description = "会员钱包 id")
|
||||
private Long walletId;
|
||||
|
||||
/**
|
||||
* 用户实际到账余额,例如充 100 送 20,则该值是 120
|
||||
*/
|
||||
@Schema(description = "用户实际到账余额,例如充 100 送 20,则该值是 120")
|
||||
private Integer totalPrice;
|
||||
|
||||
/**
|
||||
* 实际支付金额
|
||||
*/
|
||||
@Schema(description = "实际支付金额")
|
||||
private Integer payPrice;
|
||||
|
||||
/**
|
||||
* 钱包赠送金额
|
||||
*/
|
||||
@Schema(description = "钱包赠送金额")
|
||||
private Integer bonusPrice;
|
||||
|
||||
/**
|
||||
* 充值套餐编号
|
||||
*/
|
||||
@Schema(description = "充值套餐编号")
|
||||
private Long packageId;
|
||||
|
||||
/**
|
||||
* 是否已支付:[0:未支付 1:已经支付过]
|
||||
*/
|
||||
@Schema(description = "是否已支付:[0:未支付 1:已经支付过]")
|
||||
private Boolean payStatus;
|
||||
|
||||
/**
|
||||
* 支付订单编号
|
||||
*/
|
||||
@Schema(description = "支付订单编号")
|
||||
private Long payOrderId;
|
||||
|
||||
/**
|
||||
* 支付成功的支付渠道
|
||||
*/
|
||||
@Schema(description = "支付成功的支付渠道")
|
||||
private String payChannelCode;
|
||||
|
||||
/**
|
||||
* 订单支付时间
|
||||
*/
|
||||
@Schema(description = "订单支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/**
|
||||
* 支付退款单编号
|
||||
*/
|
||||
@Schema(description = "支付退款单编号")
|
||||
private Long payRefundId;
|
||||
|
||||
/**
|
||||
* 退款金额,包含赠送金额
|
||||
*/
|
||||
@Schema(description = "退款金额,包含赠送金额")
|
||||
private Integer refundTotalPrice;
|
||||
|
||||
/**
|
||||
* 退款支付金额
|
||||
*/
|
||||
@Schema(description = "退款支付金额")
|
||||
private Integer refundPayPrice;
|
||||
|
||||
/**
|
||||
* 退款钱包赠送金额
|
||||
*/
|
||||
@Schema(description = "退款钱包赠送金额")
|
||||
private Integer refundBonusPrice;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@Schema(description = "退款时间")
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
*/
|
||||
@Schema(description = "退款状态")
|
||||
private Integer refundStatus;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity;
|
||||
package com.bsd.pjcloud.wallet.api.entity.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.bsd.pjcloud.wallet.api.entity.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_recharge_package")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "充值套餐表")
|
||||
public class WalletRechargePackageEntity extends Model<WalletRechargePackageEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description="编号")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 套餐名
|
||||
*/
|
||||
@Schema(description="套餐名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@Schema(description="支付金额")
|
||||
private Integer payPrice;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
@Schema(description="赠送金额")
|
||||
private Integer bonusPrice;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Schema(description="状态")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@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;
|
||||
}
|
||||
+12
-1
@@ -1,8 +1,19 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletCodeUseVo extends WalletCodeUseEntity {
|
||||
public class WalletCodeUseVo extends WalletCodeUseEntity implements BaseUserInterface {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
}
|
||||
+17
-1
@@ -1,9 +1,25 @@
|
||||
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.WalletForeignEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletForeignVo extends WalletForeignEntity {
|
||||
public class WalletForeignVo extends WalletForeignEntity implements BaseUserInterface, BaseDeptInterface {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargeImportVo extends WalletRechargeImportEntity {
|
||||
|
||||
}
|
||||
+16
-1
@@ -1,9 +1,24 @@
|
||||
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.WalletStrideEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletStrideVo extends WalletStrideEntity {
|
||||
public class WalletStrideVo extends WalletStrideEntity implements BaseUserInterface, BaseDeptInterface {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
*/
|
||||
private String username;
|
||||
|
||||
private String userMobile;
|
||||
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 部门相关
|
||||
*/
|
||||
private String deptName;
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo;
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
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.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargeImportVo extends WalletRechargeImportEntity {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WalletRechargePackageVo extends WalletRechargePackageEntity {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.recharge;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class WalletRechargeVo extends WalletRechargeEntity {
|
||||
}
|
||||
@@ -98,6 +98,16 @@
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-common-idempotent</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-flow-task-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bsd</groupId>
|
||||
<artifactId>pjcloud-hardware-api</artifactId>
|
||||
<version>5.7.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<profiles>
|
||||
<profile>
|
||||
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
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.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletCodeUseDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletForeignService;
|
||||
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-02 16:26:48
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wallet-foreign")
|
||||
@Tag(description = "wallet-foreign", name = "外来人员电子餐券表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletForeignController {
|
||||
|
||||
private final WalletForeignService walletForeignService;
|
||||
private final WalletCodeUseService walletCodeUseService;
|
||||
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@Inner(value = false)
|
||||
@PostMapping("/apply-callback")
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto) {
|
||||
walletForeignService.applyCallback(dto);
|
||||
}
|
||||
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_view')")
|
||||
public R getWalletForeignPage(@ParameterObject Page page, @ParameterObject WalletForeignEntity walletForeign) {
|
||||
LambdaQueryWrapper<WalletForeignEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(walletForeignService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_view')")
|
||||
public R getWalletForeignPageJoin(@ParameterObject Page page, @ParameterObject WalletForeignDto dto) {
|
||||
return R.ok(walletForeignService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "二维码列表", description = "二维码列表")
|
||||
@GetMapping("/code-list")
|
||||
public R codeList(@ParameterObject Page page, @ParameterObject WalletCodeUseDto dto) {
|
||||
dto.setBizType(WalletCodeBizEnum.FOREIGN.getCode());
|
||||
return R.ok(walletCodeUseService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app二维码列表", description = "app二维码列表")
|
||||
@GetMapping("/app/code-list")
|
||||
public R appCodeList(@ParameterObject Page page, @ParameterObject WalletCodeUseDto dto) {
|
||||
PjcloudUser loginUser = SecurityUtils.getUser();
|
||||
dto.setUserId(loginUser.getId());
|
||||
dto.setBizType(WalletCodeBizEnum.FOREIGN.getCode());
|
||||
return R.ok(walletCodeUseService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(walletForeignService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增外来人员电子餐券表", description = "新增外来人员电子餐券表")
|
||||
@SysLog("新增外来人员电子餐券表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_add')")
|
||||
public R save(@RequestBody WalletForeignDto dto) {
|
||||
return R.ok(walletForeignService.create(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "App新增外来人员电子餐券表", description = "App新增外来人员电子餐券表")
|
||||
@SysLog("App新增外来人员电子餐券表")
|
||||
@PostMapping("/app")
|
||||
public R appSave(@RequestBody WalletForeignDto dto) {
|
||||
PjcloudUser loginUser = SecurityUtils.getUser();
|
||||
dto.setUserId(loginUser.getId());
|
||||
return R.ok(walletForeignService.create(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改外来人员电子餐券表", description = "修改外来人员电子餐券表")
|
||||
@SysLog("修改外来人员电子餐券表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_edit')")
|
||||
public R updateById(@RequestBody WalletForeignEntity walletForeign) {
|
||||
return R.ok(walletForeignService.updateById(walletForeign));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除外来人员电子餐券表
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除外来人员电子餐券表", description = "通过id删除外来人员电子餐券表")
|
||||
@SysLog("通过id删除外来人员电子餐券表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletForeignService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletForeign_export')")
|
||||
public List<WalletForeignEntity> export(WalletForeignEntity walletForeign, Long[] ids) {
|
||||
return walletForeignService.list(Wrappers.lambdaQuery(walletForeign).in(ArrayUtil.isNotEmpty(ids), WalletForeignEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+51
-66
@@ -7,6 +7,10 @@ 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.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletFreezeService;
|
||||
@@ -30,103 +34,84 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wallet-freeze" )
|
||||
@Tag(description = "wallet-freeze" , name = "饭卡冻结记录表管理" )
|
||||
@RequestMapping("/wallet-freeze")
|
||||
@Tag(description = "wallet-freeze", name = "饭卡冻结记录表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletFreezeController {
|
||||
|
||||
private final WalletFreezeService walletFreezeService;
|
||||
private final WalletFreezeService walletFreezeService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param walletFreeze 饭卡冻结记录表
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')" )
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@Inner(value = false)
|
||||
@PostMapping("/apply-callback")
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto) {
|
||||
walletFreezeService.applyCallback(dto);
|
||||
}
|
||||
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')")
|
||||
public R getWalletFreezePage(@ParameterObject Page page, @ParameterObject WalletFreezeEntity walletFreeze) {
|
||||
LambdaQueryWrapper<WalletFreezeEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(walletFreezeService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页复杂查询
|
||||
* @param page 分页复杂查询
|
||||
* @param dto 分页复杂查询
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页复杂查询" , description = "分页复杂查询" )
|
||||
@GetMapping("/page-join" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')" )
|
||||
@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查询饭卡冻结记录表
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询" , description = "通过id查询" )
|
||||
@GetMapping("/{id}" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')" )
|
||||
public R getById(@PathVariable("id" ) Long id) {
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(walletFreezeService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增饭卡冻结记录表
|
||||
* @param walletFreeze 饭卡冻结记录表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增饭卡冻结记录表" , description = "新增饭卡冻结记录表" )
|
||||
@SysLog("新增饭卡冻结记录表" )
|
||||
@Operation(summary = "新增饭卡冻结记录表", description = "新增饭卡冻结记录表")
|
||||
@SysLog("新增饭卡冻结记录表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_add')" )
|
||||
public R save(@RequestBody WalletFreezeEntity walletFreeze) {
|
||||
return R.ok(walletFreezeService.save(walletFreeze));
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_add')")
|
||||
public R save(@RequestBody WalletFreezeDto dto) {
|
||||
return R.ok(walletFreezeService.create(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改饭卡冻结记录表
|
||||
* @param walletFreeze 饭卡冻结记录表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改饭卡冻结记录表" , description = "修改饭卡冻结记录表" )
|
||||
@SysLog("修改饭卡冻结记录表" )
|
||||
@Operation(summary = "新增饭卡冻结记录表", description = "新增饭卡冻结记录表")
|
||||
@SysLog("新增饭卡冻结记录表")
|
||||
@PostMapping("/app")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_add')")
|
||||
public R appSave(@RequestBody WalletFreezeDto dto) {
|
||||
PjcloudUser loginUser = SecurityUtils.getUser();
|
||||
dto.setUserId(loginUser.getId());
|
||||
return R.ok(walletFreezeService.create(dto));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "修改饭卡冻结记录表", description = "修改饭卡冻结记录表")
|
||||
@SysLog("修改饭卡冻结记录表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_edit')" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_edit')")
|
||||
public R updateById(@RequestBody WalletFreezeEntity walletFreeze) {
|
||||
return R.ok(walletFreezeService.updateById(walletFreeze));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除饭卡冻结记录表
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除饭卡冻结记录表" , description = "通过id删除饭卡冻结记录表" )
|
||||
@SysLog("通过id删除饭卡冻结记录表" )
|
||||
@Operation(summary = "通过id删除饭卡冻结记录表", description = "通过id删除饭卡冻结记录表")
|
||||
@SysLog("通过id删除饭卡冻结记录表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_del')" )
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletFreezeService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
* @param walletFreeze 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_export')" )
|
||||
public List<WalletFreezeEntity> export(WalletFreezeEntity walletFreeze,Long[] ids) {
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletFreeze_export')")
|
||||
public List<WalletFreezeEntity> export(WalletFreezeEntity walletFreeze, Long[] ids) {
|
||||
return walletFreezeService.list(Wrappers.lambdaQuery(walletFreeze).in(ArrayUtil.isNotEmpty(ids), WalletFreezeEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+90
-56
@@ -6,8 +6,18 @@ 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.feign.annotation.NoToken;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletCodeUseDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletStrideDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletCodeUseService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletStrideService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -20,7 +30,6 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 跨单位就餐
|
||||
@@ -30,90 +39,115 @@ import java.util.Objects;
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/walletStride" )
|
||||
@Tag(description = "walletStride" , name = "跨单位就餐管理" )
|
||||
@RequestMapping("/wallet-stride")
|
||||
@Tag(description = "wallet-stride", name = "跨单位就餐管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletStrideController {
|
||||
|
||||
private final WalletStrideService walletStrideService;
|
||||
private final WalletCodeUseService walletCodeUseService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
* @param walletStride 跨单位就餐
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询" , description = "分页查询" )
|
||||
@GetMapping("/page" )
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_view')" )
|
||||
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@Inner(value = false)
|
||||
@PostMapping("/apply-callback")
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto) {
|
||||
walletStrideService.applyCallback(dto);
|
||||
}
|
||||
|
||||
/* ************************************* start flow callback start ************************************* */
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_view')")
|
||||
public R getWalletStrideJoin(@ParameterObject Page page, @ParameterObject WalletStrideDto dto) {
|
||||
return R.ok(walletStrideService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过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) {
|
||||
@Operation(summary = "二维码列表", description = "二维码列表")
|
||||
@GetMapping("/code-list")
|
||||
public R codeList(@ParameterObject Page page, @ParameterObject WalletCodeUseDto dto) {
|
||||
dto.setBizType(WalletCodeBizEnum.STRIDE.getCode());
|
||||
return R.ok(walletCodeUseService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "app二维码列表", description = "app二维码列表")
|
||||
@GetMapping("/app/code-list")
|
||||
public R appCodeList(@ParameterObject Page page, @ParameterObject WalletCodeUseDto dto) {
|
||||
PjcloudUser loginUser = SecurityUtils.getUser();
|
||||
dto.setUserId(loginUser.getId());
|
||||
dto.setBizType(WalletCodeBizEnum.STRIDE.getCode());
|
||||
return R.ok(walletCodeUseService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@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("新增跨单位就餐" )
|
||||
@Operation(summary = "新增跨单位就餐", description = "新增跨单位就餐")
|
||||
@SysLog("新增跨单位就餐")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_add')" )
|
||||
public R save(@RequestBody WalletStrideEntity walletStride) {
|
||||
return R.ok(walletStrideService.save(walletStride));
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_add')")
|
||||
public R save(@RequestBody WalletStrideDto dto) {
|
||||
return R.ok(walletStrideService.create(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改跨单位就餐
|
||||
* @param walletStride 跨单位就餐
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改跨单位就餐" , description = "修改跨单位就餐" )
|
||||
@SysLog("修改跨单位就餐" )
|
||||
@Operation(summary = "新增跨单位就餐", description = "新增跨单位就餐")
|
||||
@SysLog("新增跨单位就餐")
|
||||
@PostMapping("/app")
|
||||
public R appSave(@RequestBody WalletStrideDto dto) {
|
||||
PjcloudUser loginUser = SecurityUtils.getUser();
|
||||
dto.setUserId(loginUser.getId());
|
||||
return R.ok(walletStrideService.create(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增跨单位就餐", description = "新增跨单位就餐")
|
||||
@SysLog("admin申请")
|
||||
@PostMapping("/apply")
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_apply')")
|
||||
public R apply(@RequestBody WalletStrideDto dto) {
|
||||
return R.ok(walletStrideService.apply(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增跨单位就餐", description = "新增跨单位就餐")
|
||||
@SysLog("app申请")
|
||||
@PostMapping("/app-apply")
|
||||
public R appApply(@RequestBody WalletStrideDto dto) {
|
||||
return R.ok(walletStrideService.apply(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改跨单位就餐", description = "修改跨单位就餐")
|
||||
@SysLog("修改跨单位就餐")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_edit')" )
|
||||
@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删除跨单位就餐" )
|
||||
@Operation(summary = "通过id删除跨单位就餐", description = "通过id删除跨单位就餐")
|
||||
@SysLog("通过id删除跨单位就餐")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('admin_walletStride_del')" )
|
||||
@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) {
|
||||
@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));
|
||||
}
|
||||
}
|
||||
+6
-74
@@ -1,4 +1,4 @@
|
||||
package com.bsd.pjcloud.wallet.controller;
|
||||
package com.bsd.pjcloud.wallet.controller.recharge;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
@@ -8,9 +8,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.excel.annotation.RequestExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.excel.WalletRechargeExcelDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
@@ -22,14 +22,9 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值/扣款申请
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2024-12-31 14:23:57
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wallet-recharge-apply")
|
||||
@@ -39,12 +34,6 @@ public class WalletRechargeApplyController {
|
||||
|
||||
private final WalletRechargeApplyService walletRechargeApplyService;
|
||||
|
||||
|
||||
/**
|
||||
* 提交申请
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "提交申请", description = "提交申请")
|
||||
@SysLog("提交申请")
|
||||
@PostMapping("/apply")
|
||||
@@ -54,11 +43,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消申请
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "取消申请", description = "取消申请")
|
||||
@SysLog("取消申请")
|
||||
@PostMapping("/cancel-apply")
|
||||
@@ -68,13 +52,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param walletRechargeApply 充值/扣款申请
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
|
||||
@@ -83,13 +60,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(walletRechargeApplyService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param dto 充值/扣款申请
|
||||
* @return
|
||||
*/
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
|
||||
@@ -97,13 +67,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(walletRechargeApplyService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询充值/扣款申请
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_view')")
|
||||
@@ -111,12 +74,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(walletRechargeApplyService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增充值/扣款申请
|
||||
*
|
||||
* @param dto 充值/扣款申请
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "新增充值/扣款申请", description = "新增充值/扣款申请")
|
||||
@SysLog("新增充值/扣款申请")
|
||||
@PostMapping
|
||||
@@ -126,12 +83,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改充值/扣款申请
|
||||
*
|
||||
* @param walletRechargeApply 充值/扣款申请
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "修改充值/扣款申请", description = "修改充值/扣款申请")
|
||||
@SysLog("修改充值/扣款申请")
|
||||
@PutMapping
|
||||
@@ -140,12 +91,6 @@ public class WalletRechargeApplyController {
|
||||
return R.ok(walletRechargeApplyService.updateById(walletRechargeApply));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除充值/扣款申请
|
||||
*
|
||||
* @param ids id列表
|
||||
* @return R
|
||||
*/
|
||||
@Operation(summary = "通过id删除充值/扣款申请", description = "通过id删除充值/扣款申请")
|
||||
@SysLog("通过id删除充值/扣款申请")
|
||||
@DeleteMapping
|
||||
@@ -157,13 +102,6 @@ public class WalletRechargeApplyController {
|
||||
|
||||
/* ************************************* start excel start ************************************* */
|
||||
|
||||
/**
|
||||
* 导出excel 表格
|
||||
*
|
||||
* @param walletRechargeApply 查询条件
|
||||
* @param ids 导出指定ID
|
||||
* @return excel 文件流
|
||||
*/
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_export')")
|
||||
@@ -171,16 +109,10 @@ public class WalletRechargeApplyController {
|
||||
return walletRechargeApplyService.list(Wrappers.lambdaQuery(walletRechargeApply).in(ArrayUtil.isNotEmpty(ids), WalletRechargeApplyEntity::getId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取excel内容
|
||||
* @param excelVOList
|
||||
* @param bindingResult
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/read-excel")
|
||||
public R readExcel(@RequestExcel List<WalletRechargeExcelDto> excelVOList, BindingResult bindingResult) {
|
||||
return walletRechargeApplyService.readExcel(excelVOList, bindingResult);
|
||||
return walletRechargeApplyService.readExcel(excelVOList, bindingResult);
|
||||
}
|
||||
/* ************************************* start excel start ************************************* */
|
||||
|
||||
/* ************************************* start excel start ************************************* */
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.bsd.pjcloud.wallet.controller.recharge;
|
||||
|
||||
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.dto.recharge.WalletRechargeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeService;
|
||||
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-03 18:36:02
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wallet-recharge")
|
||||
@Tag(description = "wallet-recharge", name = "会员钱包充值管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletRechargeController {
|
||||
|
||||
private final WalletRechargeService walletRechargeService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_view')")
|
||||
public R getWalletRechargePage(@ParameterObject Page page, @ParameterObject WalletRechargeDto dto) {
|
||||
LambdaQueryWrapper<WalletRechargeEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(walletRechargeService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject WalletRechargeDto dto) {
|
||||
return R.ok(walletRechargeService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(walletRechargeService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增会员钱包充值", description = "新增会员钱包充值")
|
||||
@SysLog("新增会员钱包充值")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_add')")
|
||||
public R save(@RequestBody WalletRechargeEntity walletRecharge) {
|
||||
return R.ok(walletRechargeService.save(walletRecharge));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改会员钱包充值", description = "修改会员钱包充值")
|
||||
@SysLog("修改会员钱包充值")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_edit')")
|
||||
public R updateById(@RequestBody WalletRechargeEntity walletRecharge) {
|
||||
return R.ok(walletRechargeService.updateById(walletRecharge));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除会员钱包充值", description = "通过id删除会员钱包充值")
|
||||
@SysLog("通过id删除会员钱包充值")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletRechargeService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRecharge_export')")
|
||||
public List<WalletRechargeEntity> export(WalletRechargeEntity walletRecharge, Long[] ids) {
|
||||
return walletRechargeService.list(Wrappers.lambdaQuery(walletRecharge).in(ArrayUtil.isNotEmpty(ids), WalletRechargeEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
package com.bsd.pjcloud.wallet.controller.recharge;
|
||||
|
||||
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.dto.recharge.WalletRechargePackageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargePackageService;
|
||||
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-03 18:33:55
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/wallet-recharge-package")
|
||||
@Tag(description = "walletRechargePackage", name = "充值套餐表管理")
|
||||
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
|
||||
public class WalletRechargePackageController {
|
||||
|
||||
private final WalletRechargePackageService walletRechargePackageService;
|
||||
|
||||
@Operation(summary = "分页查询", description = "分页查询")
|
||||
@GetMapping("/page")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_view')")
|
||||
public R getWalletRechargePackagePage(@ParameterObject Page page, @ParameterObject WalletRechargePackageEntity walletRechargePackage) {
|
||||
LambdaQueryWrapper<WalletRechargePackageEntity> wrapper = Wrappers.lambdaQuery();
|
||||
return R.ok(walletRechargePackageService.page(page, wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_view')")
|
||||
public R PageJoin(@ParameterObject Page page, @ParameterObject WalletRechargePackageDto dto) {
|
||||
return R.ok(walletRechargePackageService.pageJoin(page, dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id查询", description = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_view')")
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(walletRechargePackageService.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增充值套餐表", description = "新增充值套餐表")
|
||||
@SysLog("新增充值套餐表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_add')")
|
||||
public R save(@RequestBody WalletRechargePackageEntity walletRechargePackage) {
|
||||
return R.ok(walletRechargePackageService.save(walletRechargePackage));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改充值套餐表", description = "修改充值套餐表")
|
||||
@SysLog("修改充值套餐表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_edit')")
|
||||
public R updateById(@RequestBody WalletRechargePackageEntity walletRechargePackage) {
|
||||
return R.ok(walletRechargePackageService.updateById(walletRechargePackage));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除充值套餐表", description = "通过id删除充值套餐表")
|
||||
@SysLog("通过id删除充值套餐表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(walletRechargePackageService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@ResponseExcel
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('wallet_walletRechargePackage_export')")
|
||||
public List<WalletRechargePackageEntity> export(WalletRechargePackageEntity walletRechargePackage, Long[] ids) {
|
||||
return walletRechargePackageService.list(Wrappers.lambdaQuery(walletRechargePackage).in(ArrayUtil.isNotEmpty(ids), WalletRechargePackageEntity::getId, ids));
|
||||
}
|
||||
}
|
||||
+18
@@ -1,11 +1,29 @@
|
||||
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.WalletCodeUseDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletCodeUseVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletManageVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletCodeUseMapper extends PjcloudBaseMapper<WalletCodeUseEntity> {
|
||||
|
||||
|
||||
default Page<WalletCodeUseVo> pageJoin(Page page, WalletCodeUseDto dto) {
|
||||
MPJLambdaWrapper<WalletCodeUseEntity> wrapper = new MPJLambdaWrapper<WalletCodeUseEntity>()
|
||||
.selectAll(WalletCodeUseEntity.class)
|
||||
.eqIfExists(WalletCodeUseEntity::getUserId, dto.getUserId())
|
||||
.eqIfExists(WalletCodeUseEntity::getBizId, dto.getBizId())
|
||||
.eqIfExists(WalletCodeUseEntity::getBizType, dto.getBizType())
|
||||
.eqIfExists(WalletCodeUseEntity::getStatus, dto.getStatus())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletCodeUseEntity::getUserId, dto.getUserIds());
|
||||
return selectJoinPage(page, WalletCodeUseVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+13
-1
@@ -1,10 +1,22 @@
|
||||
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.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletForeignVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletForeignMapper extends PjcloudBaseMapper<WalletForeignEntity> {
|
||||
|
||||
|
||||
default Page<WalletForeignVo> pageJoin(Page page, WalletForeignDto dto) {
|
||||
MPJLambdaWrapper<WalletForeignEntity> wrapper = new MPJLambdaWrapper<WalletForeignEntity>()
|
||||
.selectAll(WalletForeignEntity.class)
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletForeignEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletForeignEntity::getUserId, dto.getUserIds());
|
||||
return selectJoinPage(page, WalletForeignVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,6 +23,6 @@ public interface WalletFreezeMapper extends PjcloudBaseMapper<WalletFreezeEntity
|
||||
.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);
|
||||
return selectJoinPage(page, WalletFreezeVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -1,12 +1,23 @@
|
||||
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.WalletStrideDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletStrideVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletStrideMapper extends PjcloudBaseMapper<WalletStrideEntity> {
|
||||
|
||||
default Page<WalletStrideVo> pageJoin(Page page, WalletStrideDto dto) {
|
||||
MPJLambdaWrapper<WalletStrideEntity> wrapper = new MPJLambdaWrapper<WalletStrideEntity>()
|
||||
.selectAll(WalletStrideEntity.class)
|
||||
.in(ObjectUtil.isNotEmpty(dto.getDeptIds()), WalletStrideEntity::getDeptId, dto.getDeptIds())
|
||||
.in(ObjectUtil.isNotEmpty(dto.getUserIds()), WalletStrideEntity::getUserId, dto.getUserIds());
|
||||
return selectJoinPage(page, WalletStrideVo.class, wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,13 +1,13 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
package com.bsd.pjcloud.wallet.mapper.recharge;
|
||||
|
||||
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.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletRechargeApplyVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.bsd.pjcloud.wallet.mapper;
|
||||
package com.bsd.pjcloud.wallet.mapper.recharge;
|
||||
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletRechargeMapper extends PjcloudBaseMapper<WalletRechargeEntity> {
|
||||
|
||||
default Page<WalletRechargeVo> pageJoin(Page page, WalletRechargeDto dto) {
|
||||
MPJLambdaWrapper<WalletRechargeEntity> wrapper = new MPJLambdaWrapper<WalletRechargeEntity>();
|
||||
return selectJoinPage(page, WalletRechargeVo.class, wrapper);
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.wallet.mapper.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargePackageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargePackageVo;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface WalletRechargePackageMapper extends PjcloudBaseMapper<WalletRechargePackageEntity> {
|
||||
|
||||
|
||||
default Page<WalletRechargePackageVo> pageJoin(Page page, WalletRechargePackageDto dto) {
|
||||
MPJLambdaWrapper<WalletRechargePackageEntity> wrapper = new MPJLambdaWrapper<WalletRechargePackageEntity>();
|
||||
return selectJoinPage(page, WalletRechargePackageEntity.class, wrapper);
|
||||
}
|
||||
}
|
||||
+8
@@ -1,8 +1,16 @@
|
||||
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.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 jakarta.validation.constraints.NotNull;
|
||||
|
||||
public interface WalletCodeUseService extends IService<WalletCodeUseEntity> {
|
||||
|
||||
void generate(@NotNull Long id, @NotNull Long userId, @NotNull WalletCodeBizEnum walletCodeBizEnum, @NotNull Integer count);
|
||||
|
||||
Page<WalletCodeUseVo> pageJoin(Page page, WalletCodeUseDto dto);
|
||||
}
|
||||
+9
@@ -1,8 +1,17 @@
|
||||
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.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletForeignVo;
|
||||
|
||||
public interface WalletForeignService extends IService<WalletForeignEntity> {
|
||||
|
||||
Long create(WalletForeignDto dto);
|
||||
|
||||
Page<WalletForeignVo> pageJoin(Page page, WalletForeignDto dto);
|
||||
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto);
|
||||
}
|
||||
+5
@@ -2,6 +2,7 @@ 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.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
@@ -9,4 +10,8 @@ import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
public interface WalletFreezeService extends IService<WalletFreezeEntity> {
|
||||
|
||||
Page<WalletFreezeVo> pageJoin(Page page, WalletFreezeDto dto);
|
||||
|
||||
Long create(WalletFreezeDto dto);
|
||||
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto);
|
||||
}
|
||||
+11
-1
@@ -36,7 +36,7 @@ public interface WalletManageService extends IService<WalletManageEntity> {
|
||||
WalletManageEntity getOrCreateWallet(@NotNull Long userId, @NotNull WalletTypeCodeEnum walletTypeCode);
|
||||
|
||||
/**
|
||||
* 获取钱包(有缓存)
|
||||
* 获取钱包(没有缓存)
|
||||
*
|
||||
* @param userId
|
||||
* @param walletTypeCode
|
||||
@@ -44,6 +44,16 @@ public interface WalletManageService extends IService<WalletManageEntity> {
|
||||
*/
|
||||
WalletManageEntity getWallet(@NotNull Long userId, @NotNull WalletTypeCodeEnum walletTypeCode);
|
||||
|
||||
|
||||
/**
|
||||
* 获取钱包(没有缓存)
|
||||
*
|
||||
* @param userId
|
||||
* @param walletTypeId
|
||||
* @return
|
||||
*/
|
||||
WalletManageEntity getWallet(@NotNull Long userId, @NotNull Long walletTypeId);
|
||||
|
||||
/**
|
||||
* 获取钱包(有缓存)
|
||||
*
|
||||
|
||||
+3
-3
@@ -3,10 +3,10 @@ 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.common.core.util.R;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.excel.WalletRechargeExcelDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletRechargeApplyVo;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import org.springframework.validation.BindingResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.bsd.pjcloud.wallet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
|
||||
public interface WalletRechargeImportService extends IService<WalletRechargeImportEntity> {
|
||||
|
||||
|
||||
+12
@@ -0,0 +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.recharge.WalletRechargePackageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargePackageVo;
|
||||
|
||||
public interface WalletRechargePackageService extends IService<WalletRechargePackageEntity> {
|
||||
|
||||
Page<WalletRechargePackageVo> pageJoin(Page page, WalletRechargePackageDto dto);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
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.recharge.WalletRechargeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeVo;
|
||||
|
||||
public interface WalletRechargeService extends IService<WalletRechargeEntity> {
|
||||
|
||||
Page<WalletRechargeVo> pageJoin(Page page, WalletRechargeDto dto);
|
||||
|
||||
}
|
||||
+14
@@ -1,8 +1,22 @@
|
||||
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.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletStrideDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletStrideVo;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
public interface WalletStrideService extends IService<WalletStrideEntity> {
|
||||
|
||||
Boolean apply(WalletStrideDto dto);
|
||||
|
||||
Long create(WalletStrideDto dto);
|
||||
|
||||
Page<WalletStrideVo> pageJoin(Page page, WalletStrideDto dto);
|
||||
|
||||
WalletStrideVo detail(@NotNull Long id);
|
||||
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto);
|
||||
}
|
||||
+86
@@ -1,16 +1,102 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteFileService;
|
||||
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.QRCodeImageGenerator;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 二维码使用表
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:10
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WalletCodeUseServiceImpl extends ServiceImpl<WalletCodeUseMapper, WalletCodeUseEntity> implements WalletCodeUseService {
|
||||
|
||||
static private final String TAG = "二维码使用管理";
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteFileService remoteFileService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void generate(Long id, Long userId, WalletCodeBizEnum biz, Integer count) {
|
||||
if (count == 0) return;
|
||||
HardOrderTypeEnum orderType = HardOrderTypeEnum.FOREIGN_TICKET;
|
||||
HardPayTypeEnum payType = HardPayTypeEnum.FOREIGN_TICKET_QR_CODE;
|
||||
if (biz == WalletCodeBizEnum.STRIDE) {
|
||||
orderType = HardOrderTypeEnum.STRIDE_DEPT;
|
||||
payType = HardPayTypeEnum.STRIDE_DEPT_QR_CODE;
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
WalletCodeUseEntity item = WalletCodeUseEntity.builder().bizId(id).userId(userId).bizType(biz.getCode()).build();
|
||||
int insert = baseMapper.insert(item);
|
||||
if (insert > 0) {
|
||||
QRCodeDto dto = QRCodeDto.builder().id(id).itemId(item.getId()).userId(item.getUserId()).orderType(orderType.getType()).payType(payType.getType()).exceedTime(-1L).build();
|
||||
try {
|
||||
Pair<String, String> code = HardUtil.generate(dto);
|
||||
byte[] bytes = QRCodeImageGenerator.generateQrCodeImage(code.getValue(), 1024);
|
||||
MultipartFile multipartFile = new MockMultipartFile("file", code.getKey() + ".png", "image/png", new ByteArrayInputStream(bytes));
|
||||
R upload = remoteFileService.innerUpload(multipartFile, null, null, null);
|
||||
Map data = (Map) upload.getData();
|
||||
String url = (String) data.get("url");
|
||||
// 更新
|
||||
WalletCodeUseEntity updateObj = WalletCodeUseEntity.builder().code(url).codeContent(code.getValue()).build();
|
||||
baseMapper.updateById(updateObj);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|生成使用二维码,生成收款码错误dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletCodeUseVo> pageJoin(Page page, WalletCodeUseDto dto) {
|
||||
Page<WalletCodeUseVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletCodeUseVo::getUserId).distinct().toList();
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
+110
-1
@@ -1,10 +1,37 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
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.flow.task.constant.NodeStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletForeignDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletForeignVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletForeignMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletForeignService;
|
||||
import com.bsd.pjcloud.wallet.utils.FlowUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 外来人员电子餐券表
|
||||
@@ -12,7 +39,89 @@ import org.springframework.stereotype.Service;
|
||||
* @author dzc
|
||||
* @date 2025-01-02 16:26:48
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, WalletForeignEntity> implements WalletForeignService {
|
||||
|
||||
|
||||
static private final String TAG = "外来人员电子餐券表";
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
|
||||
private final WalletCodeUseServiceImpl walletCodeUseService;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@Override
|
||||
public Long create(WalletForeignDto dto) {
|
||||
// 查询发起人
|
||||
R<UserInfo> userData = userService.getByUserId(dto.getUserId());
|
||||
if (ObjectUtil.isEmpty(userData.getData())) {
|
||||
throw new RuntimeException("发起人不存在");
|
||||
}
|
||||
// 判断之前有没有在审核的
|
||||
if (isCheckData(dto.getUserId())) {
|
||||
throw new RuntimeException("已提交申请,请勿重复提交");
|
||||
}
|
||||
dto.setDeptId(userData.getData().getSysUser().getDeptId());
|
||||
dto.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
baseMapper.insert(dto);
|
||||
// 发起审批
|
||||
String processId = flowUtil.startFlow("TASK_FOREIGN_FLOW", userData.getData().getSysUser(), dto.getId());
|
||||
baseMapper.updateById(WalletForeignEntity.builder().id(dto.getId()).processId(processId).build());
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletForeignVo> pageJoin(Page page, WalletForeignDto dto) {
|
||||
Page<WalletForeignVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletForeignVo::getUserId).distinct().toList();
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletForeignVo::getDeptId).distinct().toList();
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
if (!flowUtil.checkCallback(dto)) return;
|
||||
String processId = dto.getProcessInstanceId();
|
||||
WalletForeignEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletForeignEntity>()
|
||||
.eq(WalletForeignEntity::getProcessId, processId)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(WalletForeignEntity.builder().id(detail.getId()).processStatus(processStatus).build());
|
||||
// 创建券
|
||||
if (isConsent) {
|
||||
walletCodeUseService.generate(detail.getId(), detail.getUserId(), WalletCodeBizEnum.FOREIGN, detail.getCount());
|
||||
}
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCheckData(Long walletId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletForeignEntity>()
|
||||
.eq(WalletForeignEntity::getUserId, walletId)
|
||||
.eq(WalletForeignEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode())
|
||||
);
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
+62
-1
@@ -1,24 +1,37 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
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.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletFreezeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletFreezeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletActiveVo;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletFreezeVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletFreezeMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletFreezeService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletManageService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletTypeService;
|
||||
import com.bsd.pjcloud.wallet.utils.FlowUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -37,9 +50,15 @@ import java.util.Map;
|
||||
@Service
|
||||
public class WalletFreezeServiceImpl extends ServiceImpl<WalletFreezeMapper, WalletFreezeEntity> implements WalletFreezeService {
|
||||
|
||||
static private final String TAG = "饭卡冻结记录表";
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
private final WalletManageService walletManageService;
|
||||
|
||||
@Override
|
||||
public Page<WalletFreezeVo> pageJoin(Page page, WalletFreezeDto dto) {
|
||||
Page<WalletFreezeVo> list = baseMapper.pageJoin(page, dto);
|
||||
@@ -60,4 +79,46 @@ public class WalletFreezeServiceImpl extends ServiceImpl<WalletFreezeMapper, Wal
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(WalletFreezeDto dto) {
|
||||
// 查询发起人
|
||||
R<UserInfo> userData = userService.getByUserId(dto.getUserId());
|
||||
if (ObjectUtil.isEmpty(userData.getData())) {
|
||||
throw new RuntimeException("发起人不存在");
|
||||
}
|
||||
// 查询钱包
|
||||
WalletManageEntity wallet = walletManageService.getWallet(dto.getUserId(), dto.getWalletTypeId());
|
||||
if (ObjectUtil.isEmpty(wallet)) {
|
||||
throw new RuntimeException("用户钱包不存在");
|
||||
}
|
||||
dto.setDeptId(userData.getData().getSysUser().getDeptId());
|
||||
dto.setFreeStatus(YesNoEnum.NO.getCode());
|
||||
dto.setWalletId(wallet.getId());
|
||||
dto.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
baseMapper.insert(dto);
|
||||
// 发起审批
|
||||
String processId = flowUtil.startFlow("TASK_FREEZE_FLOW", userData.getData().getSysUser(), dto.getId());
|
||||
baseMapper.updateById(WalletFreezeEntity.builder().id(dto.getId()).processId(processId).build());
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
if (!flowUtil.checkCallback(dto)) return;
|
||||
String processId = dto.getProcessInstanceId();
|
||||
WalletFreezeEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletFreezeEntity>()
|
||||
.eq(WalletFreezeEntity::getProcessId, processId)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(WalletFreezeEntity.builder().id(detail.getId()).freeStatus(YesNoEnum.YES.getCode()).processStatus(processStatus).build());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
-3
@@ -65,11 +65,16 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
UserInfo user = null;
|
||||
if (checkPermission) {
|
||||
user = userService.getByUserId(userId).getData();
|
||||
String autoWalletRoleCode = ParamResolver.getStr("WALLET_AUTO_CREATE");
|
||||
if (ObjectUtil.isEmpty(autoWalletRoleCode)) {
|
||||
log.info("|{}|创建用户电子钱包失败,userId:{},WALLET_AUTO_CREATE参数未配置", TAG, userId);
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
log.info("|{}|创建用户电子钱包失败,userId:{},用户id不存在", TAG, userId);
|
||||
return;
|
||||
}
|
||||
String role = Arrays.stream(user.getRoleCodes()).filter(v -> ObjectUtil.equals(v, ParamResolver.getStr("WALLET_AUTO_CREATE"))).findFirst().get();
|
||||
String role = Arrays.stream(user.getRoleCodes()).filter(v -> ObjectUtil.equals(v, autoWalletRoleCode)).findFirst().get();
|
||||
if (ObjectUtil.isEmpty(role)) {
|
||||
log.info("|{}|创建用户电子钱包失败,userId:{},没有{}权限", TAG, userId, "WALLET_AUTO_CREATE");
|
||||
return;
|
||||
@@ -117,6 +122,16 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WalletManageEntity getWallet(Long userId, Long walletTypeId) {
|
||||
WalletTypeEntity walletType = walletTypeService.getById(walletTypeId);
|
||||
if (ObjectUtil.isEmpty(walletType)) return null;
|
||||
return baseMapper.selectOne(new LambdaQueryWrapper<WalletManageEntity>()
|
||||
.eq(WalletManageEntity::getUserId, userId)
|
||||
.eq(WalletManageEntity::getWalletTypeId, walletType.getId())
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Cacheable(value = CacheConstants.WALLET_DETAIL, key = "#walletId", condition = "#walletId != null", unless = "#result == null")
|
||||
public WalletManageEntity getWallet(Long walletId) {
|
||||
@@ -145,13 +160,13 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletManageVo::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));
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletManageVo::getDeptId).distinct().toList();
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(page.getRecords(), deptList.getData());
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
return R.ok(list);
|
||||
|
||||
+126
@@ -1,16 +1,142 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
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.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.NodeStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletStrideDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletForeignEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletStrideEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletStrideVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletStrideMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletStrideService;
|
||||
import com.bsd.pjcloud.wallet.utils.FlowUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 跨单位就餐
|
||||
*
|
||||
* @author pjcloud
|
||||
* @date 2025-01-02 16:27:26
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WalletStrideServiceImpl extends ServiceImpl<WalletStrideMapper, WalletStrideEntity> implements WalletStrideService {
|
||||
|
||||
static private final String TAG = "跨单位就餐";
|
||||
|
||||
private final RemoteUserService userService;
|
||||
private final RemoteDeptService deptService;
|
||||
private final RemoteFlowApiFlowService flowApiFlowService;
|
||||
|
||||
private final WalletCodeUseServiceImpl walletCodeUseService;
|
||||
|
||||
private final FlowUtil flowUtil;
|
||||
|
||||
@Override
|
||||
public Boolean apply(WalletStrideDto dto) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(WalletStrideDto dto) {
|
||||
// 查询发起人
|
||||
R<UserInfo> userData = userService.getByUserId(dto.getUserId());
|
||||
if (ObjectUtil.isEmpty(userData.getData())) {
|
||||
throw new RuntimeException("发起人不存在");
|
||||
}
|
||||
// 判断之前有没有在审核的
|
||||
if (isCheckData(dto.getUserId())) {
|
||||
throw new RuntimeException("已提交申请,请勿重复提交");
|
||||
}
|
||||
dto.setDeptId(userData.getData().getSysUser().getDeptId());
|
||||
dto.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
baseMapper.insert(dto);
|
||||
// 发起审批
|
||||
String processId = flowUtil.startFlow("TASK_STRIDE_FLOW", userData.getData().getSysUser(), dto.getId());
|
||||
baseMapper.updateById(WalletStrideEntity.builder().id(dto.getId()).processId(processId).build());
|
||||
return dto.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WalletStrideVo> pageJoin(Page page, WalletStrideDto dto) {
|
||||
Page<WalletStrideVo> list = baseMapper.pageJoin(page, dto);
|
||||
if (ObjectUtil.isNotEmpty(list.getRecords())) {
|
||||
// 用户
|
||||
List<Long> userIds = list.getRecords().stream().map(WalletStrideVo::getUserId).distinct().toList();
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list.getRecords(), CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.getRecords().stream().map(WalletStrideVo::getDeptId).distinct().toList();
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list.getRecords(), deptList.getData());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WalletStrideVo detail(Long id) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
if (!flowUtil.checkCallback(dto)) return;
|
||||
String processId = dto.getProcessInstanceId();
|
||||
WalletStrideEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletStrideEntity>()
|
||||
.eq(WalletStrideEntity::getProcessId, processId)
|
||||
);
|
||||
if (ObjectUtil.isEmpty(detail)) return;
|
||||
try {
|
||||
Boolean isConsent = flowUtil.isConsent(dto);
|
||||
String processStatus = isConsent ? TaskCheckStatusEnum.RESULT.getCode() : TaskCheckStatusEnum.REJECT.getCode();
|
||||
baseMapper.updateById(WalletStrideEntity.builder().id(detail.getId()).processStatus(processStatus).build());
|
||||
// 创建券
|
||||
if (isConsent) {
|
||||
walletCodeUseService.generate(detail.getId(), detail.getUserId(), WalletCodeBizEnum.STRIDE, detail.getCount());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isCheckData(Long walletId) {
|
||||
Long count = baseMapper.selectCount(new LambdaQueryWrapper<WalletStrideEntity>()
|
||||
.eq(WalletStrideEntity::getUserId, walletId)
|
||||
.eq(WalletStrideEntity::getProcessStatus, NodeStatusEnum.JXZ.getCode())
|
||||
);
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
+6
-8
@@ -1,6 +1,5 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -19,12 +18,12 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.excel.vo.ErrorMessage;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
import com.bsd.pjcloud.wallet.api.dto.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeApplyDto;
|
||||
import com.bsd.pjcloud.wallet.api.dto.excel.WalletRechargeExcelDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.WalletRechargeApplyVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletRechargeApplyMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeApplyMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletManageService;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeApplyService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -36,7 +35,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 充值/扣款申请
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.WalletRechargeImportMapper;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeImportMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeImportService;
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargePackageDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargePackageVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargePackageMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargePackageService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 充值套餐表
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-03 18:33:55
|
||||
*/
|
||||
@Service
|
||||
public class WalletRechargePackageServiceImpl extends ServiceImpl<WalletRechargePackageMapper, WalletRechargePackageEntity> implements WalletRechargePackageService {
|
||||
|
||||
@Override
|
||||
public Page<WalletRechargePackageVo> pageJoin(Page page, WalletRechargePackageDto dto) {
|
||||
return baseMapper.pageJoin(page, dto);
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl.recharge;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargeDto;
|
||||
import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeVo;
|
||||
import com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeMapper;
|
||||
import com.bsd.pjcloud.wallet.service.WalletRechargeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 会员钱包充值
|
||||
*
|
||||
* @author dzc
|
||||
* @date 2025-01-03 18:36:02
|
||||
*/
|
||||
@Service
|
||||
public class WalletRechargeServiceImpl extends ServiceImpl<WalletRechargeMapper, WalletRechargeEntity> implements WalletRechargeService {
|
||||
|
||||
@Override
|
||||
public Page<WalletRechargeVo> pageJoin(Page page, WalletRechargeDto dto) {
|
||||
return baseMapper.pageJoin(page, dto);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
package com.bsd.pjcloud.wallet.utils;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Dict;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.resolver.ParamResolver;
|
||||
import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService;
|
||||
import com.bsd.pjcloud.flow.task.constant.NodeUserTypeEnum;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto;
|
||||
import com.bsd.pjcloud.flow.task.dto.ProcessNodeRecordAssignUserParamDto;
|
||||
import com.bsd.pjcloud.flow.task.entity.Process;
|
||||
import com.bsd.pjcloud.flow.task.vo.FormItemVO;
|
||||
import com.bsd.pjcloud.flow.task.vo.ProcessVO;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class FlowUtil {
|
||||
|
||||
static private final String TAG = "钱包审批流工具类";
|
||||
|
||||
private final RemoteFlowApiFlowService flowApiFlowService;
|
||||
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
public String startFlow(String flowIdKey, SysUser user, Long businessId) {
|
||||
// 发起工作流
|
||||
String defaultRole = ParamResolver.getStr(flowIdKey);
|
||||
if (ObjectUtil.isEmpty(defaultRole)) {
|
||||
log.error("|{}|请配置跨单位审批流程ID;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("请配置跨单位审批流程ID");
|
||||
}
|
||||
R<ProcessVO> detail = flowApiFlowService.getDetail(defaultRole);
|
||||
if (Optional.of(detail.getData()).map(Process::getId).isEmpty()) {
|
||||
log.error("|{}|未查询到该审批流程;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("未查询到该审批流程");
|
||||
}
|
||||
ProcessVO processVo = detail.getData();
|
||||
ProcessInstanceParamDto processDto = new ProcessInstanceParamDto();
|
||||
Map<String, Object> paramMap = readMap(processVo, user);
|
||||
processDto.setFlowId(processVo.getFlowId());
|
||||
processDto.setParamMap(paramMap);
|
||||
processDto.setStartUserId(String.valueOf(user.getUserId()));
|
||||
R<String> startVo = flowApiFlowService.startProcessInstance(processDto);
|
||||
return startVo.getData();
|
||||
}
|
||||
|
||||
public Map<String, Object> readMap(ProcessVO vo, SysUser user) {
|
||||
Map<String, Object> paramMap = new HashMap<>();
|
||||
Dict rootUser = Dict.create()
|
||||
.set("id", user.getUserId())
|
||||
.set("name", user.getUsername())
|
||||
.set("type", NodeUserTypeEnum.USER.getKey());
|
||||
paramMap.put("root", CollUtil.newArrayList(rootUser));
|
||||
try {
|
||||
List<FormItemVO> formItemVOList = objectMapper.readValue(vo.getFormItems(), new TypeReference<>() {
|
||||
});
|
||||
for (FormItemVO v : formItemVOList) {
|
||||
if (ObjectUtil.equals(v.getType(), "Layout")) continue;
|
||||
if (!ObjectUtil.isAllNotEmpty(v.getId(), v.getProps())) continue;
|
||||
paramMap.put(v.getId(), v.getProps().getValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
// 检查回调是否正确
|
||||
public Boolean checkCallback(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
if (!ObjectUtil.isAllNotEmpty(dto, dto.getFlowId())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
// 是否同意
|
||||
public Boolean isConsent(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
if (!ObjectUtil.isAllNotEmpty(dto, dto.getNodeId())) return false;
|
||||
String statusKey = dto.getNodeId() + "_approve_condition";
|
||||
JSONObject jsonObject = JSON.parseObject(dto.getData());
|
||||
return Boolean.parseBoolean(jsonObject.get(statusKey).toString());
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<?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.WalletRechargeApplyMapper">
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeApplyMapper">
|
||||
|
||||
<resultMap id="walletRechargeApplyMap" type="com.bsd.pjcloud.wallet.api.entity.WalletRechargeApplyEntity">
|
||||
<resultMap id="walletRechargeApplyMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
<?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.WalletRechargeImportMapper">
|
||||
<resultMap id="walletRechargeImportMap" type="com.bsd.pjcloud.wallet.api.entity.WalletRechargeImportEntity">
|
||||
<mapper namespace="com.bsd.pjcloud.wallet.mapper.recharge.WalletRechargeImportMapper">
|
||||
<resultMap id="walletRechargeImportMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeImportEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="applyId" column="apply_id"/>
|
||||
+29
@@ -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.wallet.mapper.recharge.WalletRechargeMapper">
|
||||
<resultMap id="walletRechargeMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="walletId" column="wallet_id"/>
|
||||
<result property="totalPrice" column="total_price"/>
|
||||
<result property="payPrice" column="pay_price"/>
|
||||
<result property="bonusPrice" column="bonus_price"/>
|
||||
<result property="packageId" column="package_id"/>
|
||||
<result property="payStatus" column="pay_status"/>
|
||||
<result property="payOrderId" column="pay_order_id"/>
|
||||
<result property="payChannelCode" column="pay_channel_code"/>
|
||||
<result property="payTime" column="pay_time"/>
|
||||
<result property="payRefundId" column="pay_refund_id"/>
|
||||
<result property="refundTotalPrice" column="refund_total_price"/>
|
||||
<result property="refundPayPrice" column="refund_pay_price"/>
|
||||
<result property="refundBonusPrice" column="refund_bonus_price"/>
|
||||
<result property="refundTime" column="refund_time"/>
|
||||
<result property="refundStatus" column="refund_status"/>
|
||||
<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>
|
||||
+19
@@ -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.recharge.WalletRechargePackageMapper">
|
||||
|
||||
<resultMap id="walletRechargePackageMap" type="com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="payPrice" column="pay_price"/>
|
||||
<result property="bonusPrice" column="bonus_price"/>
|
||||
<result property="status" column="status"/>
|
||||
<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