feat:二维码
This commit is contained in:
1 parent
872ebe235f
commit
fdab8dfd7a
55 files changed
+854
-173
No files matched your search
+2
@@ -11,6 +11,8 @@ import java.util.Arrays;
|
||||
public enum WalletCodeBizEnum {
|
||||
STRIDE("1", "跨单位"),
|
||||
FOREIGN("2", "外来人员"),
|
||||
CANTEEN_RESERVE("3", "食堂线上预订"),
|
||||
SUPERMARKET_RESERVE("4", "超市线上预订"),
|
||||
;
|
||||
private final String code;
|
||||
|
||||
|
||||
+2
@@ -10,4 +10,6 @@ public class WalletManageDto extends WalletManageEntity {
|
||||
|
||||
private List<Long> userIds;
|
||||
|
||||
private List<Long> walletIds;
|
||||
|
||||
}
|
||||
+8
@@ -4,6 +4,7 @@ import com.bsd.pjcloud.wallet.api.entity.WalletTransactionEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -32,4 +33,11 @@ public class WalletTransactionDto extends WalletTransactionEntity {
|
||||
|
||||
private List<String> bizTypes;
|
||||
|
||||
private LocalDate[] createTimeList;
|
||||
|
||||
/**
|
||||
* 是否查询order
|
||||
*/
|
||||
private Boolean isFindOrder = false;
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.wallet.api.dto;
|
||||
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WalletTypeDto extends WalletTypeEntity {
|
||||
|
||||
private List<Long> walletTypeIds;
|
||||
|
||||
}
|
||||
+1
-1
@@ -94,7 +94,7 @@ public class WalletManageEntity extends Model<WalletManageEntity> {
|
||||
* 饭卡绑定状态
|
||||
*/
|
||||
@Schema(description = "饭卡绑定状态")
|
||||
private Integer activeBindStatus;
|
||||
private String activeBindStatus;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
||||
+76
-64
@@ -21,88 +21,100 @@ import java.time.LocalDateTime;
|
||||
public class WalletTransactionEntity extends Model<WalletTransactionEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@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")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 会员钱包 id
|
||||
*/
|
||||
@Schema(description = "会员钱包 id")
|
||||
private Long walletId;
|
||||
|
||||
/**
|
||||
* 关联类型
|
||||
*/
|
||||
@Schema(description="关联类型")
|
||||
/**
|
||||
* 关联类型
|
||||
*/
|
||||
@Schema(description = "关联类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 关联业务编号
|
||||
*/
|
||||
@Schema(description="关联业务编号")
|
||||
/**
|
||||
* 关联业务编号
|
||||
*/
|
||||
@Schema(description = "关联业务编号")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 流水标题
|
||||
*/
|
||||
@Schema(description="流水标题")
|
||||
/**
|
||||
* 流水标题
|
||||
*/
|
||||
@Schema(description = "流水标题")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 交易金额, 单位分
|
||||
*/
|
||||
@Schema(description="交易金额, 单位分")
|
||||
/**
|
||||
* 交易金额, 单位分
|
||||
*/
|
||||
@Schema(description = "交易金额, 单位分")
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 余额, 单位分
|
||||
*/
|
||||
@Schema(description="余额, 单位分")
|
||||
/**
|
||||
* 余额, 单位分
|
||||
*/
|
||||
@Schema(description = "余额, 单位分")
|
||||
private Integer balance;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@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 String updateBy;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description="修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "修改时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description="删除标记")
|
||||
private String delFlag;
|
||||
/**
|
||||
* 删除标记
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除标记")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description="租户ID")
|
||||
private Long tenantId;
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
}
|
||||
+27
@@ -3,12 +3,26 @@ package com.bsd.pjcloud.wallet.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 com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletCodeUseEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(contextId = "remoteCodeUseService", value = ServiceNameConstants.WALLET_SERVICE)
|
||||
public interface RemoteCodeUseService {
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-code-use/get-by-biz-ids")
|
||||
R<List<WalletCodeUseEntity>> getByBizIds(@RequestParam List<Long> ids);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-code-use/get-by-biz-id")
|
||||
R<WalletCodeUseEntity> getByBizId(@RequestParam Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 核销二维码
|
||||
*
|
||||
@@ -28,4 +42,17 @@ public interface RemoteCodeUseService {
|
||||
@NoToken
|
||||
@GetMapping("/wallet-code-use/is-cancel-code")
|
||||
R<Boolean> isCancelCode(@RequestParam Long id);
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
*
|
||||
* @param id
|
||||
* @param userId
|
||||
* @param walletCodeBiz
|
||||
* @param count
|
||||
* @return
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/wallet-code-use/generate-code")
|
||||
R<Boolean> generateCode(@RequestParam Long id, @RequestParam Long userId, @RequestParam WalletCodeBizEnum walletCodeBiz, @RequestParam Integer count);
|
||||
}
|
||||
+1
@@ -3,6 +3,7 @@ package com.bsd.pjcloud.wallet.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 com.bsd.pjcloud.wallet.api.constant.WalletCodeBizEnum;
|
||||
import com.bsd.pjcloud.wallet.api.constant.WalletTypeEnum;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package com.bsd.pjcloud.wallet.api.utils;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.admin.api.entity.SysUser;
|
||||
import com.bsd.pjcloud.admin.api.vo.base.BaseUserInterface;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@UtilityClass
|
||||
public class MchDataUtil {
|
||||
|
||||
public <T extends BaseMchInterface> List<T> convertMchList(List<T> list, Map<Long, MchManageVo> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertMch(v, map.get(v.getMerchantId())));
|
||||
}
|
||||
|
||||
public <T extends BaseMchInterface> T convertMch(T v, MchManageVo vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setMerchantName(vo.getName());
|
||||
v.setLogoPic(vo.getLogoPic());
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.bsd.pjcloud.wallet.api.utils;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletManageEntity;
|
||||
import com.bsd.pjcloud.wallet.api.entity.WalletTypeEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseMchInterface;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletInterface;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletTypeInterface;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@UtilityClass
|
||||
public class WalletDataUtil {
|
||||
|
||||
public <T extends BaseMchInterface> List<T> convertMchList(List<T> list, Map<Long, MchManageVo> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertMch(v, map.get(v.getMerchantId())));
|
||||
}
|
||||
|
||||
public <T extends BaseMchInterface> T convertMch(T v, MchManageVo vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setMerchantName(vo.getName());
|
||||
v.setLogoPic(vo.getLogoPic());
|
||||
return v;
|
||||
}
|
||||
|
||||
public <T extends BaseWalletTypeInterface> List<T> convertWalletTYpeList(List<T> list, Map<Long, WalletTypeEntity> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertWalletType(v, map.get(v.getWalletTypeId())));
|
||||
}
|
||||
|
||||
public <T extends BaseWalletTypeInterface> T convertWalletType(T v, WalletTypeEntity vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setWalletTypeId(vo.getId());
|
||||
v.setWalletTypeName(vo.getName());
|
||||
v.setWalletTypeUniqueCode(vo.getUniqueCode());
|
||||
v.setWalletTypeIcon(vo.getIcon());
|
||||
return v;
|
||||
}
|
||||
|
||||
public <T extends BaseWalletInterface> List<T> convertWalletList(List<T> list, Map<Long, WalletManageEntity> map) {
|
||||
return CollectionUtils.convertList(list, v -> convertWallet(v, map.get(v.getWalletId())));
|
||||
}
|
||||
|
||||
public <T extends BaseWalletInterface> T convertWallet(T v, WalletManageEntity vo) {
|
||||
if (ObjectUtil.isEmpty(vo)) return v;
|
||||
v.setWalletId(vo.getId());
|
||||
v.setWalletTypeId(vo.getWalletTypeId());
|
||||
v.setWalletCardNumber(vo.getCardNumber());
|
||||
v.setWalletBalance(vo.getBalance());
|
||||
v.setWalletTotalExpense(vo.getTotalExpense());
|
||||
v.setWalletTotalRecharge(vo.getTotalRecharge());
|
||||
v.setWalletFreezePrice(vo.getFreezePrice());
|
||||
v.setWalletIsFreeze(vo.getIsFreeze());
|
||||
v.setWalletActiveBindTime(vo.getActiveBindTime());
|
||||
v.setWalletActiveBindStatus(vo.getActiveBindStatus());
|
||||
return v;
|
||||
}
|
||||
|
||||
}
|
||||
+53
-1
@@ -3,10 +3,14 @@ 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.WalletTransactionEntity;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletInterface;
|
||||
import com.bsd.pjcloud.wallet.api.vo.base.BaseWalletTypeInterface;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class WalletTransactionVo extends WalletTransactionEntity implements BaseUserInterface, BaseDeptInterface {
|
||||
public class WalletTransactionVo extends WalletTransactionEntity implements BaseUserInterface, BaseDeptInterface, BaseWalletTypeInterface, BaseWalletInterface {
|
||||
|
||||
/**
|
||||
* 用户相关
|
||||
@@ -28,11 +32,59 @@ public class WalletTransactionVo extends WalletTransactionEntity implements Base
|
||||
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 钱包相关
|
||||
*/
|
||||
|
||||
private Long walletId;
|
||||
|
||||
private String walletCardNumber;
|
||||
|
||||
private Integer walletBalance;
|
||||
|
||||
private Integer walletTotalExpense;
|
||||
|
||||
private Integer walletTotalRecharge;
|
||||
|
||||
private Integer walletFreezePrice;
|
||||
|
||||
private Boolean walletIsFreeze;
|
||||
|
||||
private LocalDateTime walletActiveBindTime;
|
||||
|
||||
private String walletActiveBindStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 钱包类型相关
|
||||
*/
|
||||
private Long walletTypeId;
|
||||
|
||||
private String walletTypeName;
|
||||
|
||||
private String walletTypeUniqueCode;
|
||||
|
||||
private String walletTypeIcon;
|
||||
|
||||
/**
|
||||
* 订单相关
|
||||
*/
|
||||
private Long orderHardId;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private Long orderDeptId;
|
||||
|
||||
private Long orderWalletId;
|
||||
|
||||
private Long orderParentCarId;
|
||||
|
||||
private Integer orderTotalPrice;
|
||||
|
||||
private Integer orderExtraPrice;
|
||||
|
||||
private Integer orderPayPrice;
|
||||
|
||||
private LocalDateTime orderPayTime;
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.base;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public interface BaseWalletInterface {
|
||||
|
||||
Long getWalletId();
|
||||
|
||||
void setWalletId(Long walletId);
|
||||
|
||||
Long getWalletTypeId();
|
||||
|
||||
void setWalletTypeId(Long walletTypeId);
|
||||
|
||||
String getWalletCardNumber();
|
||||
|
||||
void setWalletCardNumber(String walletCardNumber);
|
||||
|
||||
Integer getWalletBalance();
|
||||
|
||||
void setWalletBalance(Integer walletBalance);
|
||||
|
||||
Integer getWalletTotalExpense();
|
||||
|
||||
void setWalletTotalExpense(Integer walletTotalExpense);
|
||||
|
||||
Integer getWalletTotalRecharge();
|
||||
|
||||
void setWalletTotalRecharge(Integer walletTotalRecharge);
|
||||
|
||||
Integer getWalletFreezePrice();
|
||||
|
||||
void setWalletFreezePrice(Integer walletFreezePrice);
|
||||
|
||||
Boolean getWalletIsFreeze();
|
||||
|
||||
void setWalletIsFreeze(Boolean walletIsFreeze);
|
||||
|
||||
LocalDateTime getWalletActiveBindTime();
|
||||
|
||||
void setWalletActiveBindTime(LocalDateTime walletActiveBindTime);
|
||||
|
||||
String getWalletActiveBindStatus();
|
||||
|
||||
void setWalletActiveBindStatus(String walletActiveBindStatus);
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.wallet.api.vo.base;
|
||||
|
||||
public interface BaseWalletTypeInterface {
|
||||
|
||||
Long getWalletTypeId();
|
||||
|
||||
void setWalletTypeId(Long walletTypeId);
|
||||
|
||||
String getWalletTypeName();
|
||||
|
||||
void setWalletTypeName(String walletTypeName);
|
||||
|
||||
String getWalletTypeUniqueCode();
|
||||
|
||||
void setWalletTypeUniqueCode(String walletTypeUniqueCode);
|
||||
|
||||
String getWalletTypeIcon();
|
||||
|
||||
void setWalletTypeIcon(String walletTypeIcon);
|
||||
}
|
||||
Reference in new issue
Block a user