This commit is contained in:
xiaofajia 2024-12-13 18:13:43 +08:00
parent 45c7558e4b
commit ec43afe316
4 changed files with 22 additions and 17 deletions

View File

@ -113,13 +113,14 @@ public class ShopInspectionGoodsController extends BaseController
*/
@GetMapping("/partnerGoodsDetail")
public CommonResult partnerGoodsDetail(Long goodsId) throws Exception {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1");
ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper);
if (ObjectUtils.isEmpty(one)){
throw new Exception("您不是商户");
}
// 暂时注掉
// LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
// LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
// queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1");
// ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper);
// if (ObjectUtils.isEmpty(one)){
// throw new Exception("您不是商户");
// }
return success(appInspectionPartnerService.goodsDetail(goodsId));
}

View File

@ -1083,11 +1083,12 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
@Override
public ShopInspectionGoods goodsDetail(Long goodsId) {
ShopInspectionGoods goods = goodsService.getById(goodsId);
LoginUser user = SecurityFrameworkUtils.getLoginUser();
ShopMallPartners partners = baseMapper.selectById(goods.getPartnerId());
if (!partners.getUserId().equals(user.getId())){
return null;
}
// 暂时注掉
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
// ShopMallPartners partners = baseMapper.selectById(goods.getPartnerId());
// if (!partners.getUserId().equals(user.getId())){
// return null;
// }
LambdaQueryWrapper<InspectionGoodsSku> queryWrapper =new LambdaQueryWrapper<>();
queryWrapper.eq(InspectionGoodsSku::getGoodsId,goodsId);
List<InspectionGoodsSku> list = skuService.list(queryWrapper);

View File

@ -345,8 +345,10 @@ FROM
FROM
shop_inspection_category cate
INNER JOIN inspection_category_template template on template.category_id = cate.id
<if test="partnerId == null">
left JOIN shop_inspection_goods goods ON goods.goods_category_id = cate.id and goods.partner_id = #{partnerId}
where goods.id is null
</if>
group by cate.id
ORDER BY cate.order_num

View File

@ -51,13 +51,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
INNER JOIN shop_mall_partners smp ON smp.partner_id = sig.partner_id AND smp.is_banned = '0'
INNER JOIN shop_inspection_category sic ON sic.id = sig.goods_category_id
<where>
and sig.deleted = '0' and smp.deleted = '0' and sic.deleted = '0'
<if test="vo.id != null "> and sig.id = #{vo.id}</if>
<if test="vo.title != null and title != ''"> and sig.title like concat('%', #{vo.title}, '%')</if>
<if test="vo.title != null and vo.title != ''"> and sig.title like concat('%', #{vo.title}, '%')</if>
<if test="vo.goodsCategoryId!= null "> and sig.goods_category_id = #{vo.goodsCategoryId}</if>
<if test="vo.partnerName!= null "> and smp.partner_name like concat('%',#{vo.partnerName},'%')</if>
<if test="vo.partnerId!= null "> and sig.partner_id = #{vo.partnerId}</if>
<if test="vo.isListing != null and vo.isListing != ''">and sig.is_listing = #{vo.isListing}</if>
</where>
ORDER BY FIELD(sig.listing_status,1,2,3,0), create_time desc
ORDER BY sig.is_listing, sig.create_time desc
</select>
</mapper>