Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -28,6 +28,8 @@ public @interface SaAdminCheckPermission {
|
||||
@AliasFor(annotation = SaCheckPermission.class)
|
||||
String [] value() default {};
|
||||
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* 验证模式:AND | OR,默认AND
|
||||
* @return 验证模式
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
package com.czg.account.dto.extend;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 店铺扩展信息 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-19
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ShopExtendDTO {
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@NotNull
|
||||
private String autokey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
@NotEmpty
|
||||
private String value;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
|
||||
package com.czg.account.dto.flow;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户余额流水 实体类。
|
||||
*
|
||||
@@ -26,27 +29,56 @@ public class ShopUserFlowDTO implements Serializable {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 当前余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 已退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 类型:cashIn 会员充值,awardIn 充值奖励,wechatIn 微信小程序充值,alipayIn 支付宝小程序充值,orderPay 订单消费,orderRefund 订单退款,rechargeRefund 充值退款 adminOp 管理员手动增减
|
||||
* 类型:
|
||||
* cashIn 现金充值,
|
||||
* wechatIn 微信小程序充值,
|
||||
* alipayIn 支付宝小程序充值,
|
||||
* awardIn 充值奖励,
|
||||
* rechargeRefund 充值退款
|
||||
* <p>
|
||||
* orderPay 订单消费,
|
||||
* orderRefund 订单退款,
|
||||
* <p>
|
||||
* adminIn 管理员充值
|
||||
* adminOut管理员消费
|
||||
*/
|
||||
private String bizCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 加减号
|
||||
* 关联id,
|
||||
* 订单支付/订单退款/霸王餐时 订单id
|
||||
* 支付/退款 tb_order_payment.id
|
||||
*/
|
||||
private String type;
|
||||
|
||||
private String remark;
|
||||
private Long relationId;
|
||||
/**
|
||||
* 充值记录id 当前表的id
|
||||
* 退款使用
|
||||
*/
|
||||
private Long rechargeId;
|
||||
|
||||
/**
|
||||
* 关联订单编号,支付单号,退款单号
|
||||
|
||||
@@ -31,6 +31,11 @@ public class ShopUserMoneyEditDTO {
|
||||
* 支付/退款 tb_order_payment.id
|
||||
*/
|
||||
private Long relationId;
|
||||
/**
|
||||
* 充值记录id 当前表的id
|
||||
* 退款使用
|
||||
*/
|
||||
private Long rechargeId;
|
||||
/**
|
||||
* 浮动金额
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺扩展信息 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-19
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_extend")
|
||||
public class ShopExtend implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 商户Id
|
||||
*/
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* img:图片;text:文本;
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 自定义key
|
||||
*/
|
||||
private String autoKey;
|
||||
|
||||
/**
|
||||
* 值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private String detail;
|
||||
|
||||
}
|
||||
@@ -127,4 +127,11 @@ public class ShopUser implements Serializable {
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
if (amount == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -37,36 +38,67 @@ public class ShopUserFlow implements Serializable {
|
||||
private Long userId;
|
||||
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 当前余额
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 已退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 类型:cashIn 会员充值,awardIn 充值奖励,wechatIn 微信小程序充值,alipayIn 支付宝小程序充值,orderPay 订单消费,orderRefund 订单退款,rechargeRefund 充值退款 adminOp 管理员手动增减
|
||||
* 类型:
|
||||
* cashIn 现金充值,
|
||||
* wechatIn 微信小程序充值,
|
||||
* alipayIn 支付宝小程序充值,
|
||||
* awardIn 充值奖励,
|
||||
* rechargeRefund 充值退款
|
||||
* <p>
|
||||
* orderPay 订单消费,
|
||||
* orderRefund 订单退款,
|
||||
* <p>
|
||||
* adminIn 管理员充值
|
||||
* adminOut管理员消费
|
||||
*/
|
||||
private String bizCode;
|
||||
|
||||
/**
|
||||
* 加减号
|
||||
* 备注
|
||||
*/
|
||||
private String type;
|
||||
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否可退款
|
||||
*/
|
||||
private Integer isCanRefund;
|
||||
|
||||
/**
|
||||
* 关联id,
|
||||
* 订单支付/订单退款/霸王餐时 订单id
|
||||
* 支付/退款 tb_order_payment.id
|
||||
*/
|
||||
private Long relationId;
|
||||
/**
|
||||
* 充值记录id 当前表的id
|
||||
* 退款使用
|
||||
*/
|
||||
private Long rechargeId;
|
||||
|
||||
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
if (amount == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundAmount() {
|
||||
if (refundAmount == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return refundAmount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.extend.ShopExtendDTO;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.ShopExtend;
|
||||
|
||||
/**
|
||||
* 店铺扩展信息 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-19
|
||||
*/
|
||||
public interface ShopExtendService extends IService<ShopExtend> {
|
||||
|
||||
Boolean edit(Long shopId, ShopExtendDTO shopExtendDTO);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
|
||||
/**
|
||||
* 用户余额流水 服务层。
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.czg.order.enums.PayEnums;
|
||||
import com.czg.order.vo.OrderInfoVo;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -21,9 +23,9 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
||||
|
||||
Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param);
|
||||
|
||||
void payCallBackOrder(String orderNo, JSONObject resultJson);
|
||||
void payCallBackOrder(@NotBlank String orderNo, @NotNull JSONObject resultJson);
|
||||
|
||||
void refundCallBackOrder();
|
||||
void refundCallBackOrder(@NotBlank String orderNo, @NotNull JSONObject resultJson);
|
||||
|
||||
void upOrderInfo(Long orderId, BigDecimal payAmount, LocalDateTime payTime, Long payOrderId, PayEnums payType);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.czg;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.mybatisflex.core.row.Db;
|
||||
import com.mybatisflex.core.row.Row;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -41,12 +42,15 @@ public class LoadingRole implements CommandLineRunner {
|
||||
Method valueMethod = annotationClass.getMethod("value");
|
||||
String[] permissions = (String[]) valueMethod.invoke(annotation);
|
||||
|
||||
Method nameMethod = annotationClass.getMethod("name");
|
||||
String permissionName = (String) nameMethod.invoke(annotation);
|
||||
|
||||
for (String s : permissions) {
|
||||
String sql = "select * from sys_menu where permission=?";
|
||||
Row menu1 = Db.selectOneBySql(sql, s);
|
||||
if (menu1 != null) {
|
||||
Long menuId = menu1.getLong("menu_id");
|
||||
String name = menu1.getString("name");
|
||||
String title = menu1.getString("title");
|
||||
String permission = menu1.getString("permission");
|
||||
String listSql = "select * from sys_roles_menus where menu_id=? and role_id=?";
|
||||
List<Row> count1 = Db.selectListBySql(listSql, menuId, 1L);
|
||||
@@ -54,14 +58,20 @@ public class LoadingRole implements CommandLineRunner {
|
||||
if (count1.isEmpty()) {
|
||||
sql = "INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (?, ?);";
|
||||
Db.insertBySql(sql, menu1, 1L);
|
||||
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", name, permission);
|
||||
log.info("接口菜单添加成功, 菜单名称: {}, 菜单权限: {}", title, permission);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(permissionName) && !title.equals(permissionName)) {
|
||||
sql = "update sys_menu set title=? where menu_id=?";
|
||||
Db.updateBySql(sql, permissionName, menuId);
|
||||
log.info("接口菜单修改成功, 旧名称: {}, 新菜单名称: {}", title, permissionName);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
sql = "INSERT INTO `czg_cashier`.`sys_menu` ( `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`, `active_menu`, `is_shop`) VALUES " +
|
||||
"(0, 2, ?, NULL, '', 2, '', '', b'0', b'0', b'0', ?, NULL, NULL, ?, NULL, NULL, 0);";
|
||||
Db.insertBySql(sql, s, s, DateUtil.date());
|
||||
Db.insertBySql(sql, StrUtil.isNotBlank(permissionName) ? permissionName : s, s, DateUtil.date());
|
||||
sql = "select * from sys_menu where permission=?";
|
||||
Row info = Db.selectOneBySql(sql, s);
|
||||
Long menuId = info.getLong("menu_id");
|
||||
|
||||
Reference in New Issue
Block a user