小程序主页接口修改

This commit is contained in:
张松 2025-03-10 17:21:47 +08:00
parent ceebf9ff21
commit 7c374f46a5
5 changed files with 18 additions and 5 deletions

View File

@ -11,12 +11,9 @@ import com.czg.sa.StpKit;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 店铺消息推送相关
* @author Administrator

View File

@ -98,4 +98,5 @@ public interface ProductService extends IService<Product> {
* @param param 商品报损入参
*/
void reportDamage(ProductReportDamageParam param);
}
}

View File

@ -42,4 +42,7 @@ public interface ProductMapper extends BaseMapper<Product> {
List<RecommendProVO> selectRecommendProductList(@Param("lng") String lng, @Param("lat") String lat, @Param("address") String address,
@Param("classify") Integer classify, @Param("orderType") Integer orderType,
@Param("distanceType") Integer distanceType, @Param("name") String name);
List<Product> getTodayProInfo();
}

View File

@ -102,6 +102,8 @@ public class HomePageServiceImpl implements HomePageService {
}
homeUpVO.setMenuList(sysDictList);
homeUpVO.setTodayProInfo(productMapper.getTodayProInfo());
return homeUpVO;
}

View File

@ -169,7 +169,7 @@
from tb_prod_sku as a
left join tb_product c on c.id=a.product_id
left join tb_shop_info as b on a.shop_id=b.id
where c.id is not null
where c.id is not null and c.group_category_id is not null
<if test="address != null and address != ''">
and (b.cities like concat('%', #{address}, '%') or b.districts like concat('%', #{address}, '%'))
</if>
@ -199,6 +199,16 @@
</if>
</select>
<select id="getTodayProInfo" resultType="com.czg.product.entity.Product">
select 1000 AS distance,
c.name, a.origin_price, a.sale_price, b.shop_name, b.districts, c.cover_img, b.logo, c.id,
a.real_sales_number saleNum, round(a.sale_price / a.origin_price, 2) discount,
c.id productId, a.id skuId, b.id shopId
from tb_prod_sku as a
left join tb_product c on c.id=a.product_id
left join tb_shop_info as b on a.shop_id=b.id
where c.group_category_id is not null and c.create_time >= date_format(now(), '%Y-%m-%d 00:00:00')
</select>
<update id="updateProductStockNum">
update tb_product
<if test="type == 'add'">