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

View File

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

View File

@ -345,8 +345,10 @@ FROM
FROM FROM
shop_inspection_category cate shop_inspection_category cate
INNER JOIN inspection_category_template template on template.category_id = cate.id INNER JOIN inspection_category_template template on template.category_id = cate.id
left JOIN shop_inspection_goods goods ON goods.goods_category_id = cate.id and goods.partner_id = #{partnerId} <if test="partnerId == null">
where goods.id is 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 group by cate.id
ORDER BY cate.order_num 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_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 INNER JOIN shop_inspection_category sic ON sic.id = sig.goods_category_id
<where> <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.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.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.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.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> </where>
ORDER BY FIELD(sig.listing_status,1,2,3,0), create_time desc ORDER BY sig.is_listing, sig.create_time desc
</select> </select>
</mapper> </mapper>