|
|
@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateTime; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -11,11 +12,13 @@ import com.yxt.common.base.utils.StringUtils; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.yyth.api.appletgiftbag.*; |
|
|
|
import com.yxt.yyth.api.lpkgoods.*; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
@ -147,5 +150,118 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
public ResultBean<List<GiftBagGoods>> getAllGiftBagPage(PagerQuery<AppletGiftBagQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
AppletGiftBagQuery query = pq.getParams(); |
|
|
|
// AppletGiftBagDetailVo appletGiftBagVo=new AppletGiftBagDetailVo();
|
|
|
|
// appletGiftBagVo.setPrice("1000");
|
|
|
|
IPage<GiftBagGoods> page = PagerUtil.queryToPage(pq); |
|
|
|
// IPage<AppletGiftBagVo> pagging = baseMapper.giftBagListPage(page, qw);
|
|
|
|
IPage<GiftBagGoods> pagging = new Page<>(); |
|
|
|
GiftBagGoods goods=new GiftBagGoods(); |
|
|
|
goods.setRemark("富含蛋白顾、钙、铁、硒等有益元素。"); |
|
|
|
goods.setName("西瓜红密薯"); |
|
|
|
goods.setUnitName("份"); |
|
|
|
// goods.setGoodsNumber("3");
|
|
|
|
goods.setIconUrl("https://lpk.yyundong.com/upload/20231123/64dfc05b0db1f9_20231124100240220734.jpg"); |
|
|
|
goods.setPrice("1.5"); |
|
|
|
goods.setSpecificationUnit("斤"); |
|
|
|
goods.setWeight("7"); |
|
|
|
goods.setTotalValue("10.5"); |
|
|
|
GiftBagGoods goods1=new GiftBagGoods(); |
|
|
|
goods1.setRemark("北方大白菜打过霜后,口感发甜,更加可口"); |
|
|
|
goods1.setName("北方大白菜"); |
|
|
|
goods1.setUnitName("份"); |
|
|
|
// goods1.setGoodsNumber("3");
|
|
|
|
goods1.setIconUrl("https://lpk.yyundong.com/upload/20231123/2960ea0741fe500_20231124100318707963.jpg"); |
|
|
|
goods1.setPrice("0.5"); |
|
|
|
goods1.setSpecificationUnit("斤"); |
|
|
|
goods1.setWeight("15"); |
|
|
|
goods1 .setTotalValue("7.5"); |
|
|
|
GiftBagGoods goods2=new GiftBagGoods(); |
|
|
|
goods2.setRemark("淀粉含量较高,口感更粉、更紧实"); |
|
|
|
goods.setName("张北土豆"); |
|
|
|
goods2.setUnitName("份"); |
|
|
|
// goods2.setGoodsNumber("3");
|
|
|
|
goods2.setIconUrl("https://lpk.yyundong.com/upload/20231123/64e0ca26fd65ab_20231124100217727035.jpg"); |
|
|
|
goods2.setPrice("1"); |
|
|
|
goods2.setSpecificationUnit("斤"); |
|
|
|
goods2.setWeight("5"); |
|
|
|
goods2.setTotalValue("5"); |
|
|
|
GiftBagGoods goods3=new GiftBagGoods(); |
|
|
|
goods3.setRemark("原料纯正,只有红薯粉,没有其他添加剂"); |
|
|
|
goods3.setName("纯红薯粉条"); |
|
|
|
goods3.setUnitName("份"); |
|
|
|
// goods3.setGoodsNumber("3");
|
|
|
|
goods3.setIconUrl("https://lpk.yyundong.com/upload/20231123/64df3f35d0de3f_20231124100252533644.png"); |
|
|
|
goods3.setPrice("10"); |
|
|
|
goods3.setSpecificationUnit("斤"); |
|
|
|
goods3.setWeight("2"); |
|
|
|
goods3.setTotalValue("20"); |
|
|
|
GiftBagGoods goods4=new GiftBagGoods(); |
|
|
|
goods4.setRemark("味甜爽口,被誉为水中之宝。"); |
|
|
|
goods4.setName("泥坑藕"); |
|
|
|
goods4.setUnitName("份"); |
|
|
|
// goods4.setGoodsNumber("3");
|
|
|
|
goods4.setIconUrl("https://lpk.yyundong.com/upload/20231130/泥坑藕_20231130151949723069.jpg"); |
|
|
|
goods4.setPrice("5"); |
|
|
|
goods4.setSpecificationUnit("斤"); |
|
|
|
goods4.setWeight("5"); |
|
|
|
goods4.setTotalValue("25"); |
|
|
|
List<GiftBagGoods> goodsList=new ArrayList<>(); |
|
|
|
goodsList.add(goods); |
|
|
|
goodsList.add(goods1); |
|
|
|
goodsList.add(goods2); |
|
|
|
goodsList.add(goods3); |
|
|
|
goodsList.add(goods4); |
|
|
|
pagging.setRecords(goodsList); |
|
|
|
PagerVo<AppletGiftBagVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
// appletGiftBagVo.setGoods(goodsList);
|
|
|
|
// records.removeAll(Collections.single ton(null));
|
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
public ResultBean<PagerVo<AppletGiftBagVo>> appletGiftBagListPage(PagerQuery<AppletGiftBagQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
AppletGiftBagQuery query = pq.getParams(); |
|
|
|
QueryWrapper<AppletGiftBag> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("1", "1"); |
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
qw.like("name", query.getName()); |
|
|
|
} |
|
|
|
qw.orderByDesc("isRecommend"); |
|
|
|
qw.orderByDesc("createTime"); |
|
|
|
IPage<AppletGiftBag> page = PagerUtil.queryToPage(pq); |
|
|
|
// IPage<AppletGiftBagVo> pagging = baseMapper.giftBagListPage(page, qw);
|
|
|
|
IPage<AppletGiftBagVo> pagging = new Page<>(); |
|
|
|
AppletGiftBagVo appletGiftBagVo=new AppletGiftBagVo(); |
|
|
|
appletGiftBagVo.setName("父母陪伴窖卡"); |
|
|
|
appletGiftBagVo.setPrice("1000"); |
|
|
|
appletGiftBagVo.setIsRecommend("1"); |
|
|
|
appletGiftBagVo.setIconUrl("1"); |
|
|
|
appletGiftBagVo.setRemark("送父母,不能常伴左右,就在冬日为父母送上一份暖暖孝心。"); |
|
|
|
appletGiftBagVo.setCount("7种蔬菜"); |
|
|
|
AppletGiftBagVo appletGiftBagVo1=new AppletGiftBagVo(); |
|
|
|
appletGiftBagVo1.setName("亲朋关怀窖卡"); |
|
|
|
appletGiftBagVo1.setPrice("288"); |
|
|
|
appletGiftBagVo1.setIsRecommend("2"); |
|
|
|
appletGiftBagVo1.setIconUrl("1"); |
|
|
|
appletGiftBagVo1.setRemark("送亲朋,直接转发二维码,方便快捷奉上每日的贴心关怀。"); |
|
|
|
appletGiftBagVo1.setCount("6种蔬菜"); |
|
|
|
AppletGiftBagVo appletGiftBagVo2=new AppletGiftBagVo(); |
|
|
|
appletGiftBagVo2.setName("关爱家人窖卡"); |
|
|
|
appletGiftBagVo2.setPrice("1000"); |
|
|
|
appletGiftBagVo2.setIsRecommend("2"); |
|
|
|
appletGiftBagVo2.setIconUrl("1"); |
|
|
|
appletGiftBagVo2.setRemark("送亲朋,直接转发二维码,方便快捷奉上每日的贴心关怀。"); |
|
|
|
appletGiftBagVo2.setCount("6种蔬菜"); |
|
|
|
List<AppletGiftBagVo> appletGiftBagVos=new ArrayList<>(); |
|
|
|
appletGiftBagVos.add(appletGiftBagVo); |
|
|
|
appletGiftBagVos.add(appletGiftBagVo1); |
|
|
|
appletGiftBagVos.add(appletGiftBagVo2); |
|
|
|
pagging.setRecords(appletGiftBagVos); |
|
|
|
|
|
|
|
PagerVo<AppletGiftBagVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
// records.removeAll(Collections.singleton(null));
|
|
|
|
return rb.success().setData(p); |
|
|
|
} |
|
|
|
} |
|
|
|