商户信息接口bug修复

This commit is contained in:
张松 2025-03-12 11:01:40 +08:00
parent 594245a022
commit d80a6b747e
4 changed files with 9 additions and 5 deletions

View File

@ -24,13 +24,14 @@ public class ShopMerchantController {
/**
* 商户支付信息获取
* 权限标识: shopMerchant:detail
* @param shopId 店铺id
* @return 支付信息
*/
@SaAdminCheckRole("管理员")
@SaAdminCheckPermission(value = "shopMerchant:detail", name = "商户支付信息获取")
@GetMapping
public CzgResult<ShopMerchant> detail() {
return CzgResult.success(shopMerchantService.detail());
public CzgResult<ShopMerchant> detail(@RequestParam Integer shopId) {
return CzgResult.success(shopMerchantService.detail(shopId));
}
/**

View File

@ -1,6 +1,7 @@
package com.czg.account.dto.merchant;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
/**
@ -8,6 +9,7 @@ import lombok.Data;
*/
@Data
public class ShopMerchantEditDTO {
@NotNull(message = "店铺id不为空")
private Long shopId;
@NotEmpty(message = "支付系统商户id不为空")
private String storeId;

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
*/
public interface ShopMerchantService extends IService<ShopMerchant> {
ShopMerchant detail();
ShopMerchant detail(Integer shopId);
Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO);
@Override

View File

@ -26,8 +26,8 @@ import java.io.Serializable;
public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, ShopMerchant> implements ShopMerchantService {
@Override
public ShopMerchant detail() {
ShopMerchant one = queryChain().eq(ShopMerchant::getShopId, StpKit.USER.getLoginIdAsLong()).one();
public ShopMerchant detail(Integer shopId) {
ShopMerchant one = queryChain().eq(ShopMerchant::getShopId, shopId).one();
return one == null ? new ShopMerchant() : one;
}
@ -37,6 +37,7 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
ShopMerchant shopMerchant = queryChain().eq(ShopMerchant::getShopId, shopMerchantEditDTO.getShopId()).one();
if (shopMerchant == null) {
shopMerchant = new ShopMerchant();
shopMerchant.setShopId(shopMerchantEditDTO.getShopId());
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
return save(shopMerchant);
}