活动 传参 shopId
This commit is contained in:
parent
7aa726d0a0
commit
0c8a998006
|
|
@ -13,6 +13,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺充值活动管理
|
* 店铺充值活动管理
|
||||||
|
*
|
||||||
* @author ww
|
* @author ww
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
|
|
@ -29,8 +30,8 @@ public class ShopActivateController {
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("activate:list")
|
@SaAdminCheckPermission("activate:list")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<List<ShopActivateDTO>> detail() {
|
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
||||||
return CzgResult.success(shopActivateService.getList());
|
return CzgResult.success(shopActivateService.getList(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.czg.resp.CzgResult;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -25,8 +26,8 @@ public class UserShopActivateController {
|
||||||
* 店铺充值活动列表
|
* 店铺充值活动列表
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public CzgResult<List<ShopActivateDTO>> detail() {
|
public CzgResult<List<ShopActivateDTO>> detail(@RequestParam(required = false) Long shopId) {
|
||||||
return CzgResult.success(shopActivateService.getList());
|
return CzgResult.success(shopActivateService.getList(shopId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface ShopActivateService extends IService<ShopActivate> {
|
public interface ShopActivateService extends IService<ShopActivate> {
|
||||||
|
|
||||||
List<ShopActivateDTO> getList();
|
List<ShopActivateDTO> getList(Long shopId);
|
||||||
|
|
||||||
Boolean add(ShopActivateDTO activateDTO);
|
Boolean add(ShopActivateDTO activateDTO);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,9 @@ public class ShopActivateServiceImpl extends ServiceImpl<ShopActivateMapper, Sho
|
||||||
private ShopUserService shopUserService;
|
private ShopUserService shopUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopActivateDTO> getList() {
|
public List<ShopActivateDTO> getList(Long shopId) {
|
||||||
List<ShopActivateDTO> activateDtoS = queryChain().select()
|
List<ShopActivateDTO> activateDtoS = queryChain().select()
|
||||||
.eq(ShopActivate::getShopId, StpKit.USER.getShopId())
|
.eq(ShopActivate::getShopId, shopId == null ? StpKit.USER.getShopId() : shopId)
|
||||||
.orderBy(ShopActivate::getAmount, true)
|
.orderBy(ShopActivate::getAmount, true)
|
||||||
.listAs(ShopActivateDTO.class);
|
.listAs(ShopActivateDTO.class);
|
||||||
for (ShopActivateDTO activateDTO : activateDtoS) {
|
for (ShopActivateDTO activateDTO : activateDtoS) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue