Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
71d5e49759
|
|
@ -24,13 +24,14 @@ public class ShopMerchantController {
|
||||||
/**
|
/**
|
||||||
* 商户支付信息获取
|
* 商户支付信息获取
|
||||||
* 权限标识: shopMerchant:detail
|
* 权限标识: shopMerchant:detail
|
||||||
|
* @param shopId 店铺id
|
||||||
* @return 支付信息
|
* @return 支付信息
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckRole("管理员")
|
@SaAdminCheckRole("管理员")
|
||||||
@SaAdminCheckPermission(value = "shopMerchant:detail", name = "商户支付信息获取")
|
@SaAdminCheckPermission(value = "shopMerchant:detail", name = "商户支付信息获取")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<ShopMerchant> detail() {
|
public CzgResult<ShopMerchant> detail(@RequestParam Integer shopId) {
|
||||||
return CzgResult.success(shopMerchantService.detail());
|
return CzgResult.success(shopMerchantService.detail(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -42,7 +43,6 @@ public class ShopMerchantController {
|
||||||
@SaAdminCheckPermission(value = "shopMerchant:edit", name = "商户支付信息修改")
|
@SaAdminCheckPermission(value = "shopMerchant:edit", name = "商户支付信息修改")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopMerchantEditDTO shopMerchantEditDTO) {
|
public CzgResult<Boolean> edit(@RequestBody @Validated ShopMerchantEditDTO shopMerchantEditDTO) {
|
||||||
shopMerchantEditDTO.setShopId(StpKit.USER.getLoginIdAsLong());
|
|
||||||
return CzgResult.success(shopMerchantService.edit(shopMerchantEditDTO));
|
return CzgResult.success(shopMerchantService.edit(shopMerchantEditDTO));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.czg.account.dto.merchant;
|
package com.czg.account.dto.merchant;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -8,6 +9,7 @@ import lombok.Data;
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ShopMerchantEditDTO {
|
public class ShopMerchantEditDTO {
|
||||||
|
@NotNull(message = "店铺id不为空")
|
||||||
private Long shopId;
|
private Long shopId;
|
||||||
@NotEmpty(message = "支付系统商户id不为空")
|
@NotEmpty(message = "支付系统商户id不为空")
|
||||||
private String storeId;
|
private String storeId;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import java.io.Serializable;
|
||||||
*/
|
*/
|
||||||
public interface ShopMerchantService extends IService<ShopMerchant> {
|
public interface ShopMerchantService extends IService<ShopMerchant> {
|
||||||
|
|
||||||
ShopMerchant detail();
|
ShopMerchant detail(Integer shopId);
|
||||||
|
|
||||||
Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO);
|
Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO);
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,18 @@ import java.io.Serializable;
|
||||||
public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, ShopMerchant> implements ShopMerchantService {
|
public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, ShopMerchant> implements ShopMerchantService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ShopMerchant detail() {
|
public ShopMerchant detail(Integer shopId) {
|
||||||
ShopMerchant one = queryChain().eq(ShopMerchant::getShopId, StpKit.USER.getLoginIdAsLong()).one();
|
ShopMerchant one = queryChain().eq(ShopMerchant::getShopId, shopId).one();
|
||||||
return one == null ? new ShopMerchant() : one;
|
return one == null ? new ShopMerchant() : one;
|
||||||
}
|
}
|
||||||
|
|
||||||
@CacheEvict(key = "#shopMerchantEditDTO.id")
|
@CacheEvict(key = "#shopMerchantEditDTO.shopId")
|
||||||
@Override
|
@Override
|
||||||
public Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO) {
|
public Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO) {
|
||||||
ShopMerchant shopMerchant = queryChain().eq(ShopMerchant::getShopId, shopMerchantEditDTO.getShopId()).one();
|
ShopMerchant shopMerchant = queryChain().eq(ShopMerchant::getShopId, shopMerchantEditDTO.getShopId()).one();
|
||||||
if (shopMerchant == null) {
|
if (shopMerchant == null) {
|
||||||
shopMerchant = new ShopMerchant();
|
shopMerchant = new ShopMerchant();
|
||||||
|
shopMerchant.setShopId(shopMerchantEditDTO.getShopId());
|
||||||
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
|
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
|
||||||
return save(shopMerchant);
|
return save(shopMerchant);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -737,7 +737,7 @@ public class PayServiceImpl implements PayService {
|
||||||
try {
|
try {
|
||||||
return shopMerchantService.getById(shopId);
|
return shopMerchantService.getById(shopId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new CzgException(e.getMessage());
|
throw new CzgException("暂未开通支付");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue