| | |
| | | private GoodsBargainPriceDetailService goodsBargainPriceDetailService; |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | @Resource |
| | | private GoodsEvaluateService goodsEvaluateService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public PageInfo<GoodsVO> goodsList(Goods search) { |
| | | Integer vipId = 0; |
| | | String provinceCode = null; |
| | | String cityCode = null; |
| | | String districtCode = null; |
| | | String provinceCode = "0"; |
| | | String cityCode = "0"; |
| | | String districtCode = "0"; |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | if(StringUtils.isNotEmpty(token)){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public GoodsVO goodsDetail(Long goodsId, String longitude, String latitude) { |
| | | public GoodsVO goodsDetail(Long goodsId, Integer shopId, String longitude, String latitude) { |
| | | if (goodsId == null || goodsId <= 0) { |
| | | throw new NullPointerException("商品ID不能为空"); |
| | | } |
| | |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | Price price = getPrice(vipId, goods.getId(), null, 1, provinceCode, cityCode, districtCode); |
| | | Price price = getPrice(vipId, goods.getId(), shopId, 1, provinceCode, cityCode, districtCode); |
| | | if(null != price){ |
| | | goodsVO.setPointPayment(price.getPointPayment() ? 1 : 0); |
| | | goodsVO.setCashPayment(price.getCashPayment() ? 1 : 0); |
| | |
| | | } |
| | | Integer integer = orderClient.getGoodsSaleNum(goods.getId(), 1).getData(); |
| | | goodsVO.setSaleNum(integer); |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).ne(GoodsEvaluate::getComment, "") |
| | | .orderByDesc(GoodsEvaluate::getGrade).eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment) |
| | | .eq(GoodsEvaluate::getDelFlag, 0).last(" limit 0, 1").one(); |
| | | if (null != goodsEvaluate) { |
| | | AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId()); |
| | | if(null != appUserById){ |
| | | goodsEvaluate.setUserName(appUserById.getName()); |
| | | goodsEvaluate.setAvatar(appUserById.getAvatar()); |
| | | goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId())); |
| | | } |
| | | } |
| | | goodsVO.setGoodsEvaluate(goodsEvaluate); |
| | | return goodsVO; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public IPage<Goods> getManageGoodsList(Page<Goods> page, Goods goods) { |
| | | return goodsMapper.selectManageGoodsList(page, goods); |
| | | IPage<Goods> goodsIPage = goodsMapper.selectManageGoodsList(page, goods); |
| | | goodsIPage.getRecords().forEach(goods1 -> { |
| | | Integer data = orderClient.getGoodsSaleNum(goods1.getId(), 1).getData(); |
| | | goods1.setSaleNum(data); |
| | | }); |
| | | return goodsIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | area.setProvinceCode(goodsArea.getProvinceCode()); |
| | | area.setCityCode(goodsArea.getCityCode()); |
| | | area.setDistrictsCode(goodsArea.getDistrictsCode()); |
| | | if(null != area.getSellingPrice() && null != area.getIntegral()){ |
| | | if(null != area.getSellingPrice() || null != area.getIntegral()){ |
| | | goodsAreaList2.add(area); |
| | | } |
| | | } |
| | |
| | | List<AppUser> appUsers = appUserClient.listByIds(userIds); |
| | | for (GoodsAppUser goodsAppUser : goodsAppUserList) { |
| | | appUsers.stream().filter(u -> u.getId().equals(goodsAppUser.getAppUserId())).findFirst().ifPresent( u -> { |
| | | goodsAppUser.setAppUserIdStr(goodsAppUser.getAppUserId().toString()); |
| | | goodsAppUser.setUserName(u.getName()); |
| | | goodsAppUser.setPhone(u.getPhone()); |
| | | VipSetting vipSetting = vipSettingService.getById(u.getVipId()); |