Browse Source

1/20

master
wangpengfei 1 year ago
parent
commit
2026350648
  1. 3
      src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java
  2. 10
      src/main/java/com/yxt/yythmall/biz/lpkgiftcard/LpkGiftCardRest.java
  3. 31
      src/main/java/com/yxt/yythmall/biz/lpkgiftcard/LpkGiftCardService.java
  4. 61
      src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java
  5. 2
      src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java
  6. 6
      src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java
  7. 1
      src/main/java/com/yxt/yythmall/mallplus/mbg/pms/entity/brand/BrandVo.java

3
src/main/java/com/yxt/yythmall/api/vegecallerreservedetails/VegeCellarReserveDetails.java

@ -1,5 +1,6 @@
package com.yxt.yythmall.api.vegecallerreservedetails; package com.yxt.yythmall.api.vegecallerreservedetails;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
@ -20,7 +21,9 @@ public class VegeCellarReserveDetails {
private String cardSid; private String cardSid;
private String goodsSid; private String goodsSid;
private double goodsNumber=0; private double goodsNumber=0;
@TableField(exist = false)
private String num; private String num;
@TableField(exist = false)
private String orderSid; private String orderSid;
private String goodsName; private String goodsName;
} }

10
src/main/java/com/yxt/yythmall/biz/lpkgiftcard/LpkGiftCardRest.java

@ -185,10 +185,10 @@ public class LpkGiftCardRest {
// public ResultBean getAllType(@PathVariable("type") String type ) { // public ResultBean getAllType(@PathVariable("type") String type ) {
// return lpkGiftCardService.getAllType(type); // return lpkGiftCardService.getAllType(type);
// } // }
@ApiOperation("根据类型查询商品") // @ApiOperation("根据类型查询商品")
@PostMapping("/getGoodsByType") // @PostMapping("/getGoodsByType")
public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) { // public ResultBean getGoodsByType(@RequestBody LpkGiftCardQuery query) {
return lpkGiftCardService. getGoodsByTypeSid(query); // return lpkGiftCardService. getGoodsByTypeSid(query);
} // }
} }

31
src/main/java/com/yxt/yythmall/biz/lpkgiftcard/LpkGiftCardService.java

@ -1731,21 +1731,22 @@ public class LpkGiftCardService extends MybatisBaseService<LpkGiftCardMapper, Lp
return rb.success().setData(vo); return rb.success().setData(vo);
} }
public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) { // public ResultBean getGoodsByTypeSid(LpkGiftCardQuery query) {
ResultBean rb=new ResultBean().fail(); // ResultBean rb=new ResultBean().fail();
List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData(); // List<GiftBagGoodss> giftBagGoodss=lpkGoodsService.getAllGoodsApplets(query).getData();
ShoppingCartQuery query1=new ShoppingCartQuery(); // ShoppingCartQuery query1=new ShoppingCartQuery();
query1.setAffiliation(query.getAffiliation());query1.setCustomerSid(query.getCustomerSid()); // query1.setAffiliation(query.getAffiliation());query1.setCustomerSid(query.getCustomerSid());
List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData(); // List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
l.forEach(s->{ // l.forEach(s->{
giftBagGoodss.forEach(d->{ // giftBagGoodss.forEach(d->{
if(s.getGoodsSid().equals(d.getGoodsSid())){ // if(s.getGoodsSid().equals(d.getGoodsSid())){
d.setGoodsNumber(s.getGoodsNumber()); // d.setGoodsNumber(s.getGoodsNumber());
} // }
}); // d.setMefenPrice(String.valueOf((int)(Double.valueOf(d.getPrice())* Double.valueOf(d.getWeight()))));
}); // });
return rb.success().setData(giftBagGoodss); // });
} // return rb.success().setData(giftBagGoodss);
// }
} }

61
src/main/java/com/yxt/yythmall/biz/lpkgoods/LpkGoodsService.java

@ -224,30 +224,16 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
public ResultBean vegeCellarTypeList(LpkGoodsQuery query) { public ResultBean vegeCellarTypeList(LpkGoodsQuery query) {
ResultBean rb=new ResultBean().fail(); ResultBean rb=new ResultBean().fail();
List<GoodsTypeVo> vo =new ArrayList<>(); List<GoodsTypeVo> vo =new ArrayList<>();
GoodsTypeVo vo2=new GoodsTypeVo(); List<BrandVo> list1= IPmsBrandService.getList().getData();
vo2.setSid("0"); for (BrandVo brandVo : list1) {
vo2.setName("百姓菜窖"); GoodsTypeVo vo1=new GoodsTypeVo();
query.setAffiliation(vo2.getSid()); query.setAffiliation(brandVo.getId());
List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query); List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query);
vo2.setCount(String.valueOf(myGoodsVos.size())); vo1.setName(brandVo.getBrandName());
vo1.setId(brandVo.getId());
GoodsTypeVo vo3=new GoodsTypeVo(); vo1.setCount(String.valueOf(myGoodsVos.size()));
vo3.setSid("1"); vo.add(vo1);
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);
return rb.success().setData(vo); return rb.success().setData(vo);
} }
public ResultBean<List<GoodsTypeVo>> getAllType() { public ResultBean<List<GoodsTypeVo>> getAllType() {
@ -269,15 +255,30 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods
ResultBean rb=new ResultBean().fail(); ResultBean rb=new ResultBean().fail();
List<GiftBagGoodss> giftBagGoodss=baseMapper.getAllGoodsApplets(query); List<GiftBagGoodss> giftBagGoodss=baseMapper.getAllGoodsApplets(query);
ShoppingCartQuery query1=new ShoppingCartQuery(); 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(); List<ShoppingCartVo> l=shoppingCartService.shoppingCartList(query1).getData();
l.forEach(s->{ 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->{ giftBagGoodss.forEach(d->{
if(s.getGoodsSid().equals(d.getGoodsSid())){ // d.setIconUrl(fileUploadComponent.getUrlPrefix()+d.getIconUrl());
d.setGoodsNumber(s.getGoodsNumber()); 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); return rb.success().setData(giftBagGoodss);
} }
} }

2
src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java

@ -60,7 +60,7 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
public ResultBean<List<ShoppingCartVo>> shoppingCartList(ShoppingCartQuery query) { public ResultBean<List<ShoppingCartVo>> shoppingCartList(ShoppingCartQuery query) {
ResultBean rb = ResultBean.fireFail(); ResultBean rb = ResultBean.fireFail();
ShoppingCart entity=new ShoppingCart(); 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->{ list.forEach(s->{
s.setTotalPrice(String.valueOf((int)(Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber())))); s.setTotalPrice(String.valueOf((int)(Double.valueOf(s.getPrice())* Double.valueOf(s.getGoodsNumber()))));
s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl()); s.setIconUrl(fileUploadComponent.getUrlPrefix() +s.getIconUrl());

6
src/main/java/com/yxt/yythmall/biz/vegecallerreservedetail/VegeCellarReserveDetailsService.java

@ -9,12 +9,14 @@ import com.yxt.yythmall.api.customerstore.CustomerStoreDto;
import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo; import com.yxt.yythmall.api.empcardgiftgoods.EmpCardGiftGoodsVo;
import com.yxt.yythmall.api.lpkgiftcard.AppletVo; import com.yxt.yythmall.api.lpkgiftcard.AppletVo;
import com.yxt.yythmall.api.lpkgiftcard.GoodsVo; 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.vegecallerreservedetails.VegeCellarReserveDetails;
import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto; import com.yxt.yythmall.api.vegecallerreserveorder.VegeCellarReserveOrderDto;
import com.yxt.yythmall.api.vegetablecellar.VegetableCellar; import com.yxt.yythmall.api.vegetablecellar.VegetableCellar;
import com.yxt.yythmall.biz.customerstore.CustomerStoreService; import com.yxt.yythmall.biz.customerstore.CustomerStoreService;
import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService; import com.yxt.yythmall.biz.empcardgiftgoods.EmpCardGiftGoodsService;
import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService; import com.yxt.yythmall.biz.lpkgiftcard.LpkGiftCardService;
import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService; import com.yxt.yythmall.biz.vegetablecellar.VegetableCellarService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -33,6 +35,8 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
VegetableCellarService vegetableCellarService; VegetableCellarService vegetableCellarService;
@Autowired @Autowired
CustomerStoreService customerStoreService; CustomerStoreService customerStoreService;
@Autowired
LpkGoodsService lpkGoodsService;
public ResultBean<VegeCellarReserveDetails> getReserveByCardSid(String carSid, String goodsSid) { public ResultBean<VegeCellarReserveDetails> getReserveByCardSid(String carSid, String goodsSid) {
@ -49,8 +53,10 @@ public class VegeCellarReserveDetailsService extends MybatisBaseService<VegeCell
for (GoodsVo goods1 : dto.getGoodsVos()) { for (GoodsVo goods1 : dto.getGoodsVos()) {
if (goods1.getSelect() != 0) { if (goods1.getSelect() != 0) {
// goods.setCardSid(dto.getSid()); // goods.setCardSid(dto.getSid());
LpkGoods goods2=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",goods1.getGoodsSid()));
goods.setGoodsSid(goods1.getGoodsSid()); goods.setGoodsSid(goods1.getGoodsSid());
goods.setGoodsNumber(goods1.getSelect()); goods.setGoodsNumber(goods1.getSelect());
goods.setGoodsName(goods2.getName());
goods.setCreateTime(new DateTime()); goods.setCreateTime(new DateTime());
baseMapper.insert(goods); baseMapper.insert(goods);
VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid()) VegetableCellar vegetableCellar= vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid",dto.getCustomerSid())

1
src/main/java/com/yxt/yythmall/mallplus/mbg/pms/entity/brand/BrandVo.java

@ -19,4 +19,5 @@ public class BrandVo {
private String qssl; private String qssl;
@ApiModelProperty("订购协议") @ApiModelProperty("订购协议")
private String dgxy; private String dgxy;
private String count;
} }

Loading…
Cancel
Save