Merge branch 'prod' into test

This commit is contained in:
2025-12-20 15:46:52 +08:00
5 changed files with 25 additions and 12 deletions

View File

@@ -101,8 +101,8 @@ public class RoleController {
@SaAdminCheckPermission(parentName = "角色管理接口", value = "role:remove", name = "角色删除")
@DeleteMapping
public CzgResult<Boolean> remove(@RequestBody @Validated RoleRemoveDTO roleRemoveDTO) {
if (roleRemoveDTO.id() == 1L || roleRemoveDTO.id() == 2L) {
return CzgResult.failure("超级管理员角色不可删除");
if (roleRemoveDTO.id() == 1L || roleRemoveDTO.id() == 2L || roleRemoveDTO.id() == 3L) {
return CzgResult.failure("默认角色不可删除");
}
return CzgResult.success(roleService.removeById(roleRemoveDTO.id()));
}

View File

@@ -110,9 +110,14 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser> i
MemberLevelConfig memberLevelConfig = memberLevelConfigService.getById(shopUser.getMemberLevelId());
if (memberLevelConfig != null) {
shopUser.setMemberName(memberLevelConfig.getName());
shopUser.setDiscount(memberLevelConfig.getDiscount());
MemberConfigVO configVO = memberConfigService.detail(memberLevelConfig.getShopId());
if (configVO.getIsOpen().equals(1L)) {
shopUser.setIsMemberPrice(configVO.getIsMemberPrice());
shopUser.setDiscount(memberLevelConfig.getDiscount());
}else {
shopUser.setIsMemberPrice(0);
shopUser.setDiscount(100);
}
}
}
return shopUser;

View File

@@ -152,6 +152,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
// Step 2: 解析 apiInfo 并判断菜单是否已绑定
for (BaseMenu menu : menuList) {
if (menu.getMenuId() == 1L) {
continue;
}
// 解析 apiInfo
if (StrUtil.isNotBlank(menu.getApiInfo())) {
List<MenuApiInfoItemDTO> itemDTOS = JSONArray.parseArray(menu.getApiInfo())
@@ -177,6 +180,9 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
List<SysMenu> matchedMenus = sysMenuService.list(wrapper);
for (SysMenu matched : matchedMenus) {
if (matched.getMenuId() == 1L) {
continue;
}
long count = sysRolesMenusService.count(new QueryWrapper()
.eq("menu_id", matched.getMenuId())
.eq("role_id", roleId)

View File

@@ -1260,12 +1260,6 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
}
orderDetailService.updateOrderDetailStatus(orderInfo.getId(), OrderStatusEnums.DONE.getCode());
if (orderInfo.getUserId() != null) {
ThreadUtil.execAsync(() -> exShopUserInfo(orderInfo));
}
if (StrUtil.isNotBlank(orderInfo.getTableCode())) {
ThreadUtil.execAsync(() -> exTable(orderInfo));
}
// 保存消息参数(避免闭包中引用的变量被修改)
final Long orderId = orderInfo.getId();
final boolean isPrint = orderInfo.getIsPrint() == 1;
@@ -1276,6 +1270,12 @@ public class OrderInfoCustomServiceImpl implements OrderInfoCustomService {
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override
public void afterCommit() {
if (orderInfo.getUserId() != null) {
ThreadUtil.execAsync(() -> exShopUserInfo(orderInfo));
}
if (StrUtil.isNotBlank(orderInfo.getTableCode())) {
ThreadUtil.execAsync(() -> exTable(orderInfo));
}
// 事务成功提交后执行消息发送
String printParam = orderId + "_" + (!"after-pay".equals(payMode) ? 1 : 0) + "_1";
rabbitPublisher.sendOrderPrintMsg(printParam, isPrint);

View File

@@ -60,6 +60,8 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import java.math.BigDecimal;
import java.math.RoundingMode;
@@ -246,8 +248,8 @@ public class PayServiceImpl implements PayService {
orderInfo.setRemark(payParam.getCheckOrderPay().getRemark());
}
log.info("发放经验值");
memberConfigService.deliver(shopUser, TableValueConstant.MemberExpFlow.Type.COST, orderInfo.getOrderAmount(), null, orderInfo.getId());
// log.info("发放经验值");
// memberConfigService.deliver(shopUser, TableValueConstant.MemberExpFlow.Type.COST, orderInfo.getOrderAmount(), null, orderInfo.getId());
Long flowId = shopUserService.updateMoney(shopUserMoneyEditDTO);
orderInfoCustomService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),