|
|
@ -21,6 +21,7 @@ import com.yxt.ordermall.api.lpkgoods.*; |
|
|
|
import com.yxt.ordermall.api.shoppingcart.ShoppingCart; |
|
|
|
import com.yxt.ordermall.api.shoppingcart.ShoppingCartQuery; |
|
|
|
import com.yxt.ordermall.api.shoppingcart.ShoppingCartVo; |
|
|
|
import com.yxt.ordermall.api.vegetablecellar.VegetableCellar; |
|
|
|
import com.yxt.ordermall.biz.enterprisecertification.EnterpriseCertificationService; |
|
|
|
import com.yxt.ordermall.biz.func.basebrandinfo.BaseBrandInfoVo; |
|
|
|
import com.yxt.ordermall.biz.func.basegoodssku.*; |
|
|
@ -34,6 +35,7 @@ import com.yxt.ordermall.biz.func.commonmethod.CommonMethod; |
|
|
|
import com.yxt.ordermall.biz.func.commonmethod.DataRule; |
|
|
|
import com.yxt.ordermall.biz.lpkcustomer.LpkCustomerService; |
|
|
|
import com.yxt.ordermall.biz.shoppingcart.ShoppingCartService; |
|
|
|
import com.yxt.ordermall.biz.vegetablecellar.VegetableCellarService; |
|
|
|
import com.yxt.ordermall.feign.base.basebrandinfo.BaseBrandInfoFeign; |
|
|
|
import com.yxt.ordermall.feign.base.basegoodssku.BaseGoodsSkuFeign; |
|
|
|
import com.yxt.ordermall.feign.base.basegoodsspu.BaseGoodsSpuFeign; |
|
|
@ -53,6 +55,7 @@ import java.text.DecimalFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author wangpengfei |
|
|
@ -81,6 +84,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
BaseGoodsTypeFeign baseGoodsTypeFeign; |
|
|
|
@Autowired |
|
|
|
BaseBrandInfoFeign baseBrandInfoFeign; |
|
|
|
@Autowired |
|
|
|
VegetableCellarService vegetableCellarService; |
|
|
|
|
|
|
|
public ResultBean<PagerVo<LpkGoodsVo>> goodsListPage(PagerQuery<LpkGoodsQuery> pq) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
@ -380,13 +385,38 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
} |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
query.setNow(sdf.format(new Date())); |
|
|
|
List<MyGoodsVo> vo =baseMapper.getGoodsApplet(query); |
|
|
|
vo.forEach(s->{ |
|
|
|
double i=Double.valueOf(s.getGoodsNumber()); |
|
|
|
s.setGoodsNumber(DoubleUtils.removeZeros(String.valueOf((int)i))); |
|
|
|
s.setWeight(DoubleUtils.removeZeros(s.getWeight())); |
|
|
|
s.setIconUrl(fileUploadComponent.getUrlPrefix()+s.getIconUrl()); |
|
|
|
}); |
|
|
|
List<MyGoodsVo> goodsApplet = baseMapper.getGoodsApplet(query); |
|
|
|
List<MyGoodsVo> vo = new ArrayList<>(); |
|
|
|
if(goodsApplet.size()!=0){ |
|
|
|
List<String > strings=goodsApplet.stream().map(s->s.getGoodsSid()).collect(Collectors.toList()); |
|
|
|
ResultBean<List<GoodsSkuDetailVo>> goodsInSkuSid = baseGoodsSkuFeign.getGoodsInSkuSid(strings); |
|
|
|
if(!goodsInSkuSid.getCode().equals("200")){ |
|
|
|
return goodsInSkuSid; |
|
|
|
} |
|
|
|
|
|
|
|
for (GoodsSkuDetailVo datum : goodsInSkuSid.getData()) { |
|
|
|
for (MyGoodsVo myGoodsVo : goodsApplet) { |
|
|
|
if(myGoodsVo.getGoodsSid().equals(datum.getSkuSid())){ |
|
|
|
MyGoodsVo vo1=new MyGoodsVo(); |
|
|
|
vo1.setGoodsSid(datum.getSkuSid()); |
|
|
|
vo1.setName(datum.getGoodsName()); |
|
|
|
vo1.setSpecificationUnit(datum.getSPackUnit()); |
|
|
|
vo1.setCount("0"); |
|
|
|
vo1.setGoodsNumber(myGoodsVo.getGoodsNumber()); |
|
|
|
if(StringUtils.isNotBlank(datum.getPicUrl())){ |
|
|
|
vo1.setIconUrl(fileUploadComponent.getUrlPrefix()+datum.getPicUrl()); |
|
|
|
} |
|
|
|
vo1.setWeight(datum.getTitle()); |
|
|
|
vo1.setPackageSpecs(datum.getSPackageSpecs()); |
|
|
|
vo1.setPackprice(datum.getSPackPrice()); |
|
|
|
vo1.setPackUnit(datum.getSPackUnit()); |
|
|
|
vo1.setQuantityOfPackage(datum.getSQuantityOfPackage()); |
|
|
|
vo.add(vo1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
public ResultBean<PagerVo<MyGoodsVo>> vegeCellarInvalidList(PagerQuery<LpkGoodsQuery> pq) { |
|
|
@ -423,19 +453,23 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
return rb.setMsg("参数不全"); |
|
|
|
} |
|
|
|
List<GoodsTypeVo> vo =new ArrayList<>(); |
|
|
|
List<BrandVo> list1= IPmsBrandService.getList().getData(); |
|
|
|
for (BrandVo brandVo : list1) { |
|
|
|
OrgPathQuery orgPathQuery=new OrgPathQuery(); |
|
|
|
orgPathQuery.setOrgPath(query.getOrgPath()); |
|
|
|
ResultBean<List<BaseBrandInfoVo>> listResultBean = baseBrandInfoFeign.listAll(orgPathQuery); |
|
|
|
if(!listResultBean.getCode().equals("200")){ |
|
|
|
return listResultBean; |
|
|
|
} |
|
|
|
for (BaseBrandInfoVo datum : listResultBean.getData()) { |
|
|
|
GoodsTypeVo vo1=new GoodsTypeVo(); |
|
|
|
query.setAffiliation(brandVo.getId()); |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
query.setNow(sdf.format(new Date())); |
|
|
|
List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query); |
|
|
|
vo1.setName(brandVo.getBrandName()); |
|
|
|
vo1.setId(brandVo.getId()); |
|
|
|
vo1.setSid(brandVo.getId()); |
|
|
|
vo1.setCount(String.valueOf(myGoodsVos.size())); |
|
|
|
query.setAffiliation(datum.getSid()); |
|
|
|
List<VegetableCellar> list = vegetableCellarService.list(new QueryWrapper<VegetableCellar>().eq("customerSid", query.getCustomerSid()).eq("affiliation", query.getAffiliation())); |
|
|
|
vo1.setName(datum.getBrandName()); |
|
|
|
vo1.setId(datum.getSid()); |
|
|
|
vo1.setSid(datum.getSid()); |
|
|
|
vo1.setCount(String.valueOf(list.size())); |
|
|
|
vo.add(vo1); |
|
|
|
} |
|
|
|
|
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
public ResultBean<List<GoodsTypeVo>> getAllType() { |
|
|
|