| | |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.api.domain.vo.MerGoodsPriceListVo; |
| | | import com.ruoyi.system.api.domain.vo.MgtSelectGoodsPageVo; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import com.ruoyi.system.api.domain.vo.StaticsShopMgtGoodsVO; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteOrderService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | return list; |
| | | } |
| | | @Resource |
| | | private RemoteOrderService remoteOrderService; |
| | | @Override |
| | | public StaticsShopMgtGoodsVO staticsShopMgtGoods(PageShopMgtGoodsDTO pageShopMgtGoodsDTO) { |
| | | StaticsShopMgtGoodsVO vo = new StaticsShopMgtGoodsVO(); |
| | | |
| | | //1.查找门店 |
| | | Shop shop = remoteShopService.getShop(pageShopMgtGoodsDTO.getShopId()).getData(); |
| | | if (null == shop || shop.getDelFlag() != 0 || shop.getShopStatus() == -1) { |
| | | return vo; |
| | | } |
| | | List<Shop> shops = new ArrayList<>(); |
| | | //2.判断门店是否经销商 |
| | | if (shop.getShopType()==1){ |
| | | //经销商 获取下级-加盟商ids |
| | | shops = remoteShopService.getFranchiseeIdsBYDealerId(shop.getShopId()); |
| | | } |
| | | //将该门店加入 |
| | | shops.add(shop); |
| | | List<Long> shopIds = shops.stream().map(Shop::getShopId).collect(Collectors.toList()); |
| | | //查询信息 |
| | | pageShopMgtGoodsDTO.setShopIds(shopIds); |
| | | //3.根据shopId查询商品ids |
| | | List<String> goodsId= goodsMapper.staticsShopMgtGoods(pageShopMgtGoodsDTO); |
| | | |
| | | //查询商品销量 销售额 |
| | | return remoteOrderService.getGoodsSellStatic(goodsId).getData(); |
| | | } |
| | | @Override |
| | | public R<Void> updateGoodsPrice(UpdateGoodsPriceDTO updateGoodsPriceDTO) { |
| | | //判断当前登录人员类型 |