| | |
| | | shop.setEditDate(new Date()); |
| | | shop.setIsdeleted(Constants.ONE); |
| | | shopMapper.updateById(shop); |
| | | shopGoodsRelationMapper.delete(new UpdateWrapper<ShopGoodsRelation>().lambda().eq(ShopGoodsRelation::getShopId,id)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | queryWrapper.selectAll(Shop.class); |
| | | |
| | | queryWrapper.eq(Shop::getId,id); |
| | | queryWrapper.select("(select AVG(SCORE) from shop_comment where ISDELETED=0 and OBJ_ID=t.id) as score");//门店评分 |
| | | // queryWrapper.select("(select AVG(SCORE) from shop_comment where ISDELETED=0 and OBJ_ID=t.id) as score");//门店评分 |
| | | /** ----------------start店铺访问数据----------------*/ |
| | | // queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id) as shopTotalVisits");//主页总访问量 |
| | | // queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id and to_days(CREATE_DATE)=to_days(now()) ) as shopNowVisits");//今日访问量 |
| | |
| | | // queryWrapper.select("(select sum(LIMIT_PRICE) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0 and STATUS=1 ) as couponUserMoney");//优惠券使用金额(元) |
| | | /** ----------------end店铺优惠券数据----------------*/ |
| | | |
| | | queryWrapper.select("(select count(g.id) from goodsorder where g.ISDELETED=0 and g.DISTRIBUTION_SHOP_ID=t.id ) as totalOrderNUm");//优惠券使用金额(元) |
| | | queryWrapper.select("(select count(g.id) from goodsorder g where g.ISDELETED=0 and g.DISTRIBUTION_SHOP_ID=t.id ) as totalOrderNUm");//优惠券使用金额(元) |
| | | Shop shop= shopJoinMapper.selectJoinOne(Shop.class,queryWrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | |
| | | queryWrapper.selectAll(Shop.class); |
| | | if(pageWrap.getModel().getGoodsId()!=null){ |
| | | //查询某商品的供货价 |
| | | queryWrapper.select("(select s.price from shop_goods_relation s where s.ISDELETED=0 and s.shop_id = t.id and s.GOODS_ID="+pageWrap.getModel().getGoodsId()+") as goodsPrice "); |
| | | queryWrapper.select("(select s.price from shop_goods_relation s where s.ISDELETED=0 and s.shop_id = t.id and s.GOODS_ID="+pageWrap.getModel().getGoodsId()+" limit 1) as goodsPrice "); |
| | | } |
| | | queryWrapper.select("(select count(s.id) from shop_goods_relation s left join goods g on s.goods_id =g.id where g.status=0 and s.ISDELETED=0 and s.shop_id=t.id) as pricedGoodsNum "); |
| | | queryWrapper.selectAs(Labels::getName,Shop::getBigAreaName); |
| | | queryWrapper.selectAs(Member::getNickname,Shop::getNickName); |
| | | queryWrapper.selectAs(Member::getImgurl,Shop::getMemberImgurl); |
| | |
| | | IPage<Shop> result = shopJoinMapper.selectJoinPage(page, Shop.class, queryWrapper); |
| | | String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode() |
| | | + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode(); |
| | | long goodsNum = goodsMapper.selectCount(new QueryWrapper<Goods>().lambda() |
| | | .eq(Goods::getIsdeleted,Constants.ZERO) |
| | | .eq(Goods::getStatus,Constants.ZERO)); |
| | | for(Shop model:result.getRecords()){ |
| | | model.setImgFullUrl(path); |
| | | model.setAreas( AreasServiceImpl.getAddressByAreaId(model.getAreaId())); |
| | | model.setGoodsNum(goodsNum); |
| | | if(model.getLatitude()!=null && model.getLongitude()!=null){ |
| | | model.setLocationInfo(model.getLatitude().doubleValue()+","+model.getLongitude().doubleValue()); |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public SaleReportResponse saleReport(SaleReportRequest request,String shopId){ |
| | | public SaleReportResponse saleReport(SaleReportRequest request,Integer shopId){ |
| | | SaleReportResponse saleReportResponse = new SaleReportResponse(); |
| | | saleReportResponse.setSaleTotal(BigDecimal.ZERO); |
| | | saleReportResponse.setOrderNum(Constants.ZERO); |
| | |
| | | .selectAll(Goodsorder.class) |
| | | .selectAs(Member::getPhone,Goodsorder::getPhone) |
| | | .selectAs(Member::getNickname,Goodsorder::getNickName) |
| | | .select(" select ifnull(sum(g.SHOP_SETTLEMENT),0) from goodsorder_detail g where t.id = g.ORDER_ID ",Goodsorder::getShopSettlement) |
| | | .leftJoin(Member.class,Member::getId,Goodsorder::getMemberId) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .eq(Goodsorder::getDistributionShopId,shopId) |
| | |
| | | } |
| | | return saleReportResponse; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |