1/20
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.yxt.yythmall.api.vegecallerreservedetails;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -20,7 +21,9 @@ public class VegeCellarReserveDetails {
|
||||
private String cardSid;
|
||||
private String goodsSid;
|
||||
private double goodsNumber=0;
|
||||
@TableField(exist = false)
|
||||
private String num;
|
||||
@TableField(exist = false)
|
||||
private String orderSid;
|
||||
private String goodsName;
|
||||
}
|
||||
|
||||
@@ -185,10 +185,10 @@ public class LpkGiftCardRest {
|
||||
// public ResultBean getAllType(@PathVariable("type") String type ) {
|
||||
// return lpkGiftCardService.getAllType(type);
|
||||
// }
|
||||
@ApiOperation("根据类型查询商品")
|
||||
@PostMapping("/getGoodsByType")
|
||||
public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) {
|
||||
return lpkGiftCardService. getGoodsByTypeSid(query);
|
||||
}
|
||||
// @ApiOperation("根据类型查询商品")
|
||||
// @PostMapping("/getGoodsByType")
|
||||
// public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) {
|
||||
// return lpkGiftCardService. getGoodsByTypeSid(query);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -1731,21 +1731,22 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
|
||||
public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData();
|
||||
ShoppingCartQuery query1=new ShoppingCartQuery();
|
||||
query1.setAffiliation(query.getAffiliation());query1.setCustomerSid(query.getCustomerSid());
|
||||
List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
|
||||
l.forEach(s->{
|
||||
giftBagGoodss.forEach(d->{
|
||||
if(s.getGoodsSid().equals(d.getGoodsSid())){
|
||||
d.setGoodsNumber(s.getGoodsNumber());
|
||||
}
|
||||
});
|
||||
});
|
||||
return rb.success().setData(giftBagGoodss);
|
||||
}
|
||||
// public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
|
||||
// ResultBean rb=new ResultBean().fail();
|
||||
// List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData();
|
||||
// ShoppingCartQuery query1=new ShoppingCartQuery();
|
||||
// query1.setAffiliation(query.getAffiliation());query1.setCustomerSid(query.getCustomerSid());
|
||||
// List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
|
||||
// l.forEach(s->{
|
||||
// giftBagGoodss.forEach(d->{
|
||||
// if(s.getGoodsSid().equals(d.getGoodsSid())){
|
||||
// d.setGoodsNumber(s.getGoodsNumber());
|
||||
// }
|
||||
// d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
// });
|
||||
// });
|
||||
// return rb.success().setData(giftBagGoodss);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -224,30 +224,16 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
public ResultBean vegeCellarTypeList(LpkGoodsQuery query) {
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GoodsTypeVo> vo =new ArrayList<>();
|
||||
GoodsTypeVo vo2=new GoodsTypeVo();
|
||||
vo2.setSid("0");
|
||||
vo2.setName("百姓菜窖");
|
||||
query.setAffiliation(vo2.getSid());
|
||||
List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query);
|
||||
vo2.setCount(String.valueOf(myGoodsVos.size()));
|
||||
|
||||
GoodsTypeVo vo3=new GoodsTypeVo();
|
||||
vo3.setSid("1");
|
||||
vo3.setName("精品菜窖");
|
||||
query.setAffiliation(vo3.getSid());
|
||||
List<MyGoodsVo> myGoodsVos1 =baseMapper.getGoodsApplet(query);
|
||||
vo3.setCount(String.valueOf(myGoodsVos1.size()));
|
||||
|
||||
GoodsTypeVo vo4=new GoodsTypeVo();
|
||||
vo4.setSid("2");
|
||||
vo4.setName("企业菜窖");
|
||||
query.setAffiliation(vo4.getSid());
|
||||
List<MyGoodsVo> myGoodsVos2 =baseMapper.getGoodsApplet(query);
|
||||
vo4.setCount(String.valueOf(myGoodsVos2.size()));
|
||||
// vo.add(vo1);
|
||||
vo.add(vo2);
|
||||
vo.add(vo3);
|
||||
vo.add(vo4);
|
||||
List<BrandVo> list1= IPmsBrandService.getList().getData();
|
||||
for (BrandVo brandVo : list1) {
|
||||
GoodsTypeVo vo1=new GoodsTypeVo();
|
||||
query.setAffiliation(brandVo.getId());
|
||||
List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query);
|
||||
vo1.setName(brandVo.getBrandName());
|
||||
vo1.setId(brandVo.getId());
|
||||
vo1.setCount(String.valueOf(myGoodsVos.size()));
|
||||
vo.add(vo1);
|
||||
}
|
||||
return rb.success().setData(vo);
|
||||
}
|
||||
public ResultBean<List<GoodsTypeVo>> getAllType() {
|
||||
@@ -269,15 +255,30 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
|
||||
ResultBean rb=new ResultBean().fail();
|
||||
List<GiftBagGoodss> giftBagGoodss=baseMapper.getAllGoodsApplets(query);
|
||||
ShoppingCartQuery query1=new ShoppingCartQuery();
|
||||
query1.setAffiliation(query.getBrandId());query1.setCustomerSid(query.getCustomerSid());
|
||||
query1.setBrandId(query.getBrandId());
|
||||
query1.setCustomerSid(query.getCustomerSid());
|
||||
List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
|
||||
l.forEach(s->{
|
||||
giftBagGoodss.forEach(d->{
|
||||
if(s.getGoodsSid().equals(d.getGoodsSid())){
|
||||
d.setGoodsNumber(s.getGoodsNumber());
|
||||
}
|
||||
});
|
||||
giftBagGoodss.forEach(d->{
|
||||
d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
// d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
});
|
||||
if(l.size()==0){
|
||||
giftBagGoodss.forEach(d->{
|
||||
// d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
});
|
||||
}else{
|
||||
l.forEach(s->{
|
||||
giftBagGoodss.forEach(d->{
|
||||
if(s.getGoodsSid().equals(d.getGoodsSid())){
|
||||
d.setGoodsNumber(s.getGoodsNumber());
|
||||
}
|
||||
// d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
|
||||
d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return rb.success().setData(giftBagGoodss);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
|
||||
public ResultBean<List<ShoppingCartVo>> shoppingCartList(ShoppingCartQuery query) {
|
||||
ResultBean rb = ResultBean.fireFail();
|
||||
ShoppingCart entity=new ShoppingCart();
|
||||
List<ShoppingCartVo> list= baseMapper.ShoppingCartList(query.getCustomerSid(),query.getAffiliation());
|
||||
List<ShoppingCartVo> list= baseMapper.ShoppingCartList(query.getCustomerSid(),query.getBrandId());
|
||||
list.forEach(s->{
|
||||
s.setTotalPrice(String.valueOf((int)(Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber()))));
|
||||
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl());
|
||||
|
||||
@@ -9,12 +9,14 @@ import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
|
||||
import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.AppletVo;
|
||||
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo;
|
||||
import com.yxt.yythmall.api.lpkgoods.LpkGoods;
|
||||
import com.yxt.yythmall.api.vegecallerreservedetails.VegeCellarReserveDetails;
|
||||
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
|
||||
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
|
||||
import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
|
||||
import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService;
|
||||
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
|
||||
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
|
||||
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -33,6 +35,8 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
|
||||
VegetableCellarService vegetableCellarService;
|
||||
@Autowired
|
||||
CustomerStoreService customerStoreService;
|
||||
@Autowired
|
||||
LpkGoodsService lpkGoodsService;
|
||||
|
||||
|
||||
public ResultBean<VegeCellarReserveDetails> getReserveByCardSid(String carSid, String goodsSid) {
|
||||
@@ -49,8 +53,10 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
|
||||
for (GoodsVo goods1 : dto.getGoodsVos()) {
|
||||
if (goods1.getSelect() != 0) {
|
||||
// goods.setCardSid(dto.getSid());
|
||||
LpkGoods goods2=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
|
||||
goods.setGoodsSid(goods1.getGoodsSid());
|
||||
goods.setGoodsNumber(goods1.getSelect());
|
||||
goods.setGoodsName(goods2.getName());
|
||||
goods.setCreateTime(new DateTime());
|
||||
baseMapper.insert(goods);
|
||||
VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())
|
||||
|
||||
@@ -19,4 +19,5 @@ public class BrandVo {
|
||||
private String qssl;
|
||||
@ApiModelProperty("订购协议")
|
||||
private String dgxy;
|
||||
private String count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user