This commit is contained in:
wangjinlei
2024-05-30 13:15:22 +08:00
parent cf3e3e9dca
commit 6ab30dd9bd
3 changed files with 23 additions and 5 deletions

View File

@@ -23,11 +23,9 @@ public class TaihuWelfareController {
return taihuWelfareService.getTaihuWelfareArticleList(param);
}
public R getTaihuWelfareProductList(){
return null;
@RequestMapping("/getTaihuWelfareProductList")
public R getTaihuWelfareProductList(@RequestBody ParamTo param){
return taihuWelfareService.getTaihuWelfareProductList(param);
}
}

View File

@@ -8,4 +8,6 @@ import com.peanut.modules.common.to.ParamTo;
public interface TaihuWelfareService extends IService<TaihuWelfareEntity> {
R getTaihuWelfareArticleList(ParamTo param);
R getTaihuWelfareProductList(ParamTo param);
}

View File

@@ -3,15 +3,22 @@ package com.peanut.modules.common.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.peanut.common.utils.R;
import com.peanut.modules.common.dao.ShopStoreToProductDao;
import com.peanut.modules.common.dao.TaihuWelfareDao;
import com.peanut.modules.common.entity.ShopProduct;
import com.peanut.modules.common.entity.ShopStoreToProductEntity;
import com.peanut.modules.common.entity.TaihuWelfareEntity;
import com.peanut.modules.common.service.TaihuWelfareService;
import com.peanut.modules.common.to.ParamTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("commonTaihuWelfareService")
public class TaihuWelfareServiceImpl extends ServiceImpl<TaihuWelfareDao, TaihuWelfareEntity> implements TaihuWelfareService {
@Autowired
private ShopStoreToProductDao shopStoreToProductDao;
@Override
public R getTaihuWelfareArticleList(ParamTo param) {
@@ -20,4 +27,15 @@ public class TaihuWelfareServiceImpl extends ServiceImpl<TaihuWelfareDao, TaihuW
Page<TaihuWelfareEntity> taihuWelfareEntityPage = this.getBaseMapper().selectPage(new Page<>(param.getPage(), param.getLimit()), wrapper);
return R.ok().put("page",taihuWelfareEntityPage);
}
@Override
public R getTaihuWelfareProductList(ParamTo param) {
MPJLambdaWrapper<ShopStoreToProductEntity> wrapper = new MPJLambdaWrapper<>();
wrapper.selectAll(ShopProduct.class);
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopStoreToProductEntity::getProductId);
wrapper.eq(ShopStoreToProductEntity::getStoreId,1);
wrapper.orderByAsc(ShopStoreToProductEntity::getSort);
Page<ShopStoreToProductEntity> shopStoreToProductEntityPage = shopStoreToProductDao.selectPage(new Page<>(param.getPage(), param.getLimit()), wrapper);
return R.ok().put("page",shopStoreToProductEntityPage);
}
}