Quellcode durchsuchen

分类绑定商品处理

fubojin vor 15 Stunden
Ursprung
Commit
dcb88425dd

+ 10 - 0
yami-shop-api/src/main/java/com/yami/shop/api/controller/OrderRefundController.java

@@ -668,6 +668,16 @@ public class OrderRefundController {
             orderService.updateById(order);
         }
         orderRefundService.changeStatus(refundSn, 40);
+
+        OrderRefundRecord orderRefundRecord = new OrderRefundRecord();
+        orderRefundRecord.setOrderRefundId(orderRefund.getRefundId());
+        orderRefundRecord.setInstructions("用户主动撤回申请,退货退款关闭。");
+        Date date = new Date();
+        orderRefundRecord.setCreateTime(date);
+        orderRefundRecord.setUpdateTime(date);
+        orderRefundRecord.setAuditStatus(4);
+        orderRefundRecord.setSort(4);
+        orderRefundRecordMapper.insert(orderRefundRecord);
         return ResponseEntity.ok("撤销成功");
     }
 

+ 2 - 2
yami-shop-api/src/main/resources/application.yml

@@ -2,8 +2,8 @@
 spring:
   # 环境 dev|prod|docker
   profiles:
-    active: dev
-#    active: prod
+#    active: dev
+    active: prod
   #文件上传设置
   servlet:
     multipart:

+ 1 - 1
yami-shop-bean/src/main/java/com/yami/shop/bean/model/OrderRefundRecord.java

@@ -27,7 +27,7 @@ public class OrderRefundRecord {
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
 
-    @ApiModelProperty(value = "审核状态(1-申请原因,2-商家待审核,5-用户待发货,7-待商家收货,10-审核通过,20-驳回,30-退款成功)")
+    @ApiModelProperty(value = "审核状态(1-申请原因,2-商家待审核,3-申请已通过,4-用户撤回申请, 5-用户待发货,7-待商家收货,10-审核通过,20-驳回,30-退款成功)")
     private Integer auditStatus;
 
     @ApiModelProperty(value = "排序")

+ 9 - 0
yami-shop-bean/src/main/java/com/yami/shop/bean/vo/OrderRefundVo.java

@@ -7,6 +7,8 @@
 
 package com.yami.shop.bean.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.yami.shop.bean.model.OrderRefundRecord;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -85,6 +87,10 @@ public class OrderRefundVo implements Serializable{
      * 是否填写了退货物流信息(1:已填写,0:未填写)
      */
     private Boolean isReturnLogistics;
+    /**
+     * 申请人
+     */
+    private String receiver;
 
     /**
      * 申请原因
@@ -198,4 +204,7 @@ public class OrderRefundVo implements Serializable{
     @ApiModelProperty(value = "退款商品详情")
     private List<OrderRefundSkuVo> orderRefundSkuList;
 
+    @ApiModelProperty(value = "退款轨迹")
+    private List<OrderRefundRecord> orderRefundRecordList;
+
 }

+ 12 - 6
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderRefundController.java

@@ -3,27 +3,25 @@ package com.yami.shop.platform.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.github.binarywang.wxpay.service.WxPayService;
-import com.yami.shop.bean.app.dto.ApiOrderRefundDto;
 import com.yami.shop.bean.dto.OrderRefundDto;
-import com.yami.shop.bean.model.OrderItem;
 import com.yami.shop.bean.model.OrderRefund;
-import com.yami.shop.bean.model.OrderRefundSku;
+import com.yami.shop.bean.model.OrderRefundRecord;
 import com.yami.shop.bean.param.OrderRefundCountParam;
 import com.yami.shop.bean.param.OrderRefundStaisticsParam;
 import com.yami.shop.bean.vo.OrderRefundSkuVo;
 import com.yami.shop.bean.vo.OrderRefundVo;
 import com.yami.shop.common.util.PageParam;
+import com.yami.shop.common.util.R;
 import com.yami.shop.dao.OrderItemMapper;
+import com.yami.shop.dao.OrderRefundMapper;
+import com.yami.shop.dao.OrderRefundRecordMapper;
 import com.yami.shop.dao.OrderRefundSkuMapper;
 import com.yami.shop.service.OrderRefundService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-import com.yami.shop.common.util.R;
 
 import java.util.List;
 
@@ -43,6 +41,7 @@ public class OrderRefundController {
     private final OrderRefundService orderRefundService;
     private final OrderRefundSkuMapper orderRefundskuMapper;
     private final OrderItemMapper orderItemMapper;
+    private final OrderRefundRecordMapper orderRefundRecordMapper;
 
     /**
      * 分页查询
@@ -79,6 +78,13 @@ public class OrderRefundController {
     @ApiOperation(value = "查看退款订单详情", notes = "查看退款订单详情")
     public R<OrderRefundVo> orderRefundInfo(@PathVariable("refundId") Long refundId) {
         OrderRefundVo orderRefundVo = orderRefundService.selectInfoById(refundId);
+
+        //获取申请退款轨迹
+        List<OrderRefundRecord> orderRefundRecords = orderRefundRecordMapper.selectList(new LambdaQueryWrapper<OrderRefundRecord>()
+                .eq(OrderRefundRecord::getOrderRefundId, refundId)
+                .orderByDesc(OrderRefundRecord::getSort));
+        orderRefundVo.setOrderRefundRecordList(orderRefundRecords);
+
         List<OrderRefundSkuVo> orderRefundSkuVos = orderRefundskuMapper.selectByRefundId(refundId);
         orderRefundSkuVos.forEach(c -> c.setOrderItem(orderItemMapper.selectById(c.getOrderItemId())));
         orderRefundVo.setOrderRefundSkuList(orderRefundSkuVos);

+ 21 - 29
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/ShopCategoryController.java

@@ -3,12 +3,14 @@ package com.yami.shop.platform.controller;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.yami.shop.bean.model.ShopCategory;
+import com.yami.shop.bean.model.ShopDetail;
 import com.yami.shop.bean.param.CategoryProductDTO;
 import com.yami.shop.common.util.PageParam;
 import com.yami.shop.common.util.R;
 import com.yami.shop.security.platform.model.YamiSysUser;
 import com.yami.shop.security.platform.util.SecurityUtils;
 import com.yami.shop.service.IShopCategoryService;
+import com.yami.shop.service.ShopDetailService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
@@ -19,6 +21,8 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -35,11 +39,12 @@ import java.util.List;
 public class ShopCategoryController {
 
     private final IShopCategoryService shopCategoryService;
+    private final ShopDetailService shopDetailService;
 
     /**
      * 分页查询门店前台类目列表
      *
-     * @param pageParam 分页参数
+     * @param pageParam    分页参数
      * @param shopCategory 查询条件
      * @return 分页结果
      */
@@ -70,7 +75,7 @@ public class ShopCategoryController {
         if (shopId == null) {
             return R.FAIL("门店不能为空!");
         }
-        return R.SUCCESS(shopCategoryService.treeShopCategory(shopId,name));
+        return R.SUCCESS(shopCategoryService.treeShopCategory(shopId, name));
     }
 
 
@@ -87,9 +92,9 @@ public class ShopCategoryController {
             throw new RuntimeException("导出模板失败:" + e.getMessage());
         }
     }
+
     /**
      * 导入门店前台类目
-     *
      */
     @PostMapping("/import")
     @ApiOperation(value = "导入门店前台类目", notes = "导入门店前台类目")
@@ -100,7 +105,6 @@ public class ShopCategoryController {
     }
 
 
-
     /**
      * 根据ID获取门店前台类目详情
      *
@@ -128,12 +132,16 @@ public class ShopCategoryController {
     @ApiOperation(value = "新增门店前台类目", notes = "新增门店前台类目")
     public R<Void> save(@Valid @RequestBody ShopCategory shopCategory) {
         // 设置默认值
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+        String date = sdf.format(new Date());
+        String random = String.valueOf((int) (Math.random() * 10000));
+        shopCategory.setCode("F" + date + random);
         shopCategory.setIsDelete(0);
-        boolean result = shopCategoryService.save(shopCategory);
-        if (result) {
-            return R.SUCCESS();
-        }
-        return R.FAIL("新增门店前台类目失败");
+
+        ShopDetail shopDetailByShopId = shopDetailService.getShopDetailByShopId(shopCategory.getShopId());
+        shopCategory.setHbShopId(shopDetailByShopId.getHbStationId());
+        shopCategoryService.save(shopCategory);
+        return R.SUCCESS();
     }
 
     /**
@@ -154,12 +162,8 @@ public class ShopCategoryController {
         if (dbShopCategory == null) {
             return R.FAIL("门店前台类目不存在");
         }
-
-        boolean result = shopCategoryService.updateById(shopCategory);
-        if (result) {
-            return R.SUCCESS();
-        }
-        return R.FAIL("修改门店前台类目失败");
+        shopCategoryService.updateById(shopCategory);
+        return R.SUCCESS();
     }
 
     /**
@@ -172,21 +176,9 @@ public class ShopCategoryController {
     @ApiOperation(value = "删除门店前台类目", notes = "删除门店前台类目(逻辑删除)")
     @ApiImplicitParam(name = "id", value = "门店前台类目ID", required = true, dataType = "Long", paramType = "path")
     public R<Void> delete(@PathVariable Long id) {
-        // 检查是否存在
-        ShopCategory dbShopCategory = shopCategoryService.getById(id);
-        if (dbShopCategory == null) {
-            return R.FAIL("门店前台类目不存在");
-        }
+        shopCategoryService.delete(id);
+        return R.SUCCESS();
 
-        // 逻辑删除
-        ShopCategory shopCategory = new ShopCategory();
-        shopCategory.setId(id);
-        shopCategory.setIsDelete(1);
-        boolean result = shopCategoryService.updateById(shopCategory);
-        if (result) {
-            return R.SUCCESS();
-        }
-        return R.FAIL("删除门店前台类目失败");
     }
 
 

+ 5 - 0
yami-shop-service/src/main/java/com/yami/shop/service/IShopCategoryService.java

@@ -44,4 +44,9 @@ public interface IShopCategoryService extends IService<ShopCategory> {
      */
     IPage<Category> listByParentIdAndShopId(Long parentId, Long shopId, Integer current, Integer size);
 
+    /**
+     * 删除分类
+     * @param id 分类id
+     */
+    void delete(Long id);
 }

+ 25 - 4
yami-shop-service/src/main/java/com/yami/shop/service/hb/impl/HBGoodsService.java

@@ -46,6 +46,7 @@ public class HBGoodsService implements IHBGoodsService {
     private final FrontCategoryMapper frontCategoryMapper;
     private final ShopCategoryMapper shopCategoryMapper;
     private final CategoryProdHbMapper categoryProdHbMapper;
+    private final CategoryProdMapper categoryProdMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -198,7 +199,7 @@ public class HBGoodsService implements IHBGoodsService {
                 for (CategoryProdHb categoryProd : categoryProds) {
                     FrontCategory frontCategory = frontCategoryMapper.selectOne(new LambdaQueryWrapper<FrontCategory>()
                             .eq(FrontCategory::getCode, categoryProd.getCode()));
-                    addShopCategory(frontCategory, shopDetail.getShopId(), shopDetail.getHbStationId());
+                    addShopCategory(frontCategory, categoryProd.getProdId(),shopDetail.getShopId(), shopDetail.getHbStationId());
                 }
 
 
@@ -219,7 +220,7 @@ public class HBGoodsService implements IHBGoodsService {
      * @return
      */
     @Transactional(rollbackFor = Exception.class)
-    public void addShopCategory(FrontCategory frontCategory, Long shopId, String hbShopId) {
+    public void addShopCategory(FrontCategory frontCategory,Long prodId, Long shopId, String hbShopId) {
         ShopCategory shopCategoryByCode = shopCategoryMapper.selectOne(new LambdaQueryWrapper<ShopCategory>()
                 .eq(ShopCategory::getCode, frontCategory.getCode())
                 .eq(ShopCategory::getShopId, shopId)
@@ -245,7 +246,7 @@ public class HBGoodsService implements IHBGoodsService {
                 FrontCategory frontCategoryParent = frontCategoryMapper.selectOne(new LambdaQueryWrapper<FrontCategory>()
                         .eq(FrontCategory::getCode, frontCategory.getParentCode())
                         .eq(FrontCategory::getIsDelete, 0));
-                addShopCategory(frontCategoryParent, shopId, hbShopId);
+                addShopCategory(frontCategoryParent,prodId, shopId, hbShopId);
 
                 shopCategoryByCode1 = shopCategoryMapper.selectOne(new LambdaQueryWrapper<ShopCategory>()
                         .eq(ShopCategory::getCode, frontCategory.getParentCode())
@@ -268,6 +269,26 @@ public class HBGoodsService implements IHBGoodsService {
         shopCategory.setIsLeaves(frontCategory.getIsLeaves());
 
         shopCategoryMapper.insert(shopCategory);
+
+        //二级添加门店-分类管理
+        if (shopCategory.getLevel() == 2) {
+           Integer count = categoryProdMapper.selectCount(new LambdaQueryWrapper<CategoryProd>()
+                    .eq(CategoryProd::getCode, shopCategory.getCode())
+                    .eq(CategoryProd::getIsDelete, 0)
+                    .eq(CategoryProd::getShopId, shopCategory.getShopId()));
+
+           if (count == 0){
+               CategoryProd categoryProd = new CategoryProd();
+               categoryProd.setProdId(prodId);
+               categoryProd.setCategoryId(shopCategory.getId());
+               categoryProd.setCode(shopCategory.getCode());
+               categoryProd.setShopId(shopCategory.getShopId());
+               categoryProd.setIsDelete(0);
+               categoryProd.setCreateTime(new Date());
+
+               categoryProdMapper.insert(categoryProd);
+           }
+        }
     }
 
     @Override
@@ -633,7 +654,7 @@ public class HBGoodsService implements IHBGoodsService {
                     .eq(FrontCategory::getCode, ztFrontCategoryCodeLevel));
             ShopDetail shopDetail = shopDetailMapper.selectById(shopSku.getShopId());
 
-            addShopCategory(frontCategory, shopSku.getShopId(), shopDetail.getHbStationId());
+            addShopCategory(frontCategory, spuId, shopSku.getShopId(), shopDetail.getHbStationId());
         }
 
     }

+ 1 - 0
yami-shop-service/src/main/java/com/yami/shop/service/impl/CategoryProdServiceImpl.java

@@ -60,6 +60,7 @@ public class CategoryProdServiceImpl extends ServiceImpl<CategoryProdMapper, Cat
             //查看父类绑定商品是否存在不存在添加
             Integer integer1 = categoryPropMapper.selectCount(new LambdaQueryWrapper<CategoryProd>()
                     .eq(CategoryProd::getCode, categoryProductDTO.getParentCode())
+                    .eq(CategoryProd::getShopId, categoryProductDTO.getShopId())
                     .eq(CategoryProd::getIsDelete, 0));
             if (integer1 == 0) {
                 CategoryProd categoryProdParent = new CategoryProd();

+ 1 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/OrderServiceImpl.java

@@ -1203,7 +1203,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //生成待商家审核记录
             OrderRefundRecord orderRefundRecord = new OrderRefundRecord();
             orderRefundRecord.setOrderRefundId(orderRefund.getRefundId());
-            orderRefundRecord.setInstructions("已完成退款,具体到账时间请查询支付账户");
+            orderRefundRecord.setInstructions("商家收到商品并确认不影响二次销售后,将会为您处理退款");
             Date date = new Date();
             orderRefundRecord.setCreateTime(date);
             orderRefundRecord.setUpdateTime(date);

+ 27 - 1
yami-shop-service/src/main/java/com/yami/shop/service/impl/ShopCategoryServiceImpl.java

@@ -11,6 +11,7 @@ import com.yami.shop.bean.dto.ShopCategoryExcelDTO;
 import com.yami.shop.bean.model.*;
 import com.yami.shop.bean.param.CategoryProductDTO;
 import com.yami.shop.common.exception.GlobalException;
+import com.yami.shop.common.util.R;
 import com.yami.shop.dao.*;
 import com.yami.shop.service.CategoryProdService;
 import com.yami.shop.service.IShopCategoryService;
@@ -123,11 +124,14 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
                 for (int i = 0; i < shopCategories.size(); i++) {
                     ShopCategoryExcelDTO category = shopCategories.get(i);
 
+
                     ShopCategoryLog shopCategoryLog = new ShopCategoryLog();
+                    ShopDetail shopDetail = shopDetailMapper.selectByHbStationId(category.getHbShopId());
+                    shopCategoryLog.setShopId(shopDetail.getShopId());
+                    shopCategoryLog.setHbShopId(category.getHbShopId());
                     shopCategoryLog.setName(category.getName());
                     shopCategoryLog.setSubName(category.getSubName());
                     shopCategoryLog.setSubSubName(category.getSubSubName());
-                    shopCategoryLog.setHbShopId(category.getHbShopId());
                     shopCategoryLog.setIsFail(true);
                     shopCategoryLog.setTaskCode(code);
                     shopCategoryLog.setTaskName("导入前台类目");
@@ -186,6 +190,28 @@ public class ShopCategoryServiceImpl extends ServiceImpl<ShopCategoryMapper, Sho
         return res;
     }
 
+    @Override
+    public void delete(Long id) {
+        // 检查是否存在
+        ShopCategory dbShopCategory = shopCategoryMapper.selectById(id);
+        if (dbShopCategory == null) {
+           new GlobalException("门店前台类目不存在");
+        }
+
+        // 逻辑删除
+        Integer integer = categoryProdMapper.selectCount(new LambdaQueryWrapper<CategoryProd>()
+                .eq(CategoryProd::getCategoryId, id)
+                .eq(CategoryProd::getIsDelete, 0));
+        if (integer > 0) {
+            new GlobalException("门店前台类目下有商品,请先删除商品");
+        }
+
+        ShopCategory shopCategory = new ShopCategory();
+        shopCategory.setId(id);
+        shopCategory.setIsDelete(1);
+        shopCategoryMapper.updateById(shopCategory);
+    }
+
 
     /**
      * 添加对应的二级和三级类目

+ 3 - 1
yami-shop-service/src/main/resources/mapper/OrderRefundMapper.xml

@@ -507,10 +507,12 @@
                o.actual_total    as actualTotal,
                o.product_nums    as productNums,
                o.hb_order_status as hbOrderStatus,
-               tsd.shop_name     as shopName
+               tsd.shop_name     as shopName,
+               uao.receiver        as receiver
         from tz_order_refund refund
                  join tz_shop_detail tsd on refund.shop_id = tsd.shop_id
                  join tz_order o on refund.order_id = o.order_id
+        left join tz_user_addr_order uao on o.addr_order_id = uao.addr_order_id
         where refund.refund_id = #{refundId}
     </select>
     <select id="findByOrderNumber" resultType="com.yami.shop.bean.model.OrderRefund">

+ 43 - 46
yami-shop-service/src/main/resources/mapper/ProductMapper.xml

@@ -783,54 +783,51 @@
     </select>
 
     <select id="listProdByCIdAndSId" parameterType="com.yami.shop.bean.dto.ProdByCategoryIdAndShopIdDTO" resultType="com.yami.shop.bean.model.Product">
+
         SELECT
             tp.prod_id,
-            MAX(tp.prod_name) AS prod_name,
-            tsc.shop_id AS shop_id,
-            MAX(tp.brand_id) AS brand_id,
-            MAX(tp.brand_name) AS brand_name,
-            MAX(tp.ori_price) AS ori_price,
-            MIN(cp.channel_prod_price) as price,
-            MAX(tp.score_price) AS score_price,
-            MAX(tp.brief) AS brief,
-            MAX(tp.video) AS video,
-            MAX(tp.pic) AS pic,
-            MAX(tp.content) AS content,
-            MAX(tp.imgs) AS imgs,
-            MAX(tp.status) AS status,
-            MAX(tp.is_delete) AS is_delete,
-            MAX(tp.shop_category_id) AS shop_category_id,
-            MAX(tp.category_id) AS category_id,
-            MAX(tp.hb_front_category_id) AS hb_front_category_id,
-            MAX(tp.sold_num) AS sold_num,
-            SUM(tss.shop_sku_stocks) AS total_stocks,
-            MAX(tp.delivery_mode) AS delivery_mode,
-            MAX(tp.delivery_template_id) AS delivery_template_id,
-            MAX(tp.create_time) AS create_time,
-            MAX(tp.update_time) AS update_time,
-            MAX(tp.putaway_time) AS putaway_time,
-            MAX(tp.version) AS version,
-            MAX(tp.prod_type) AS prod_type,
-            MAX(tp.activity_id) AS activity_id,
-            MAX(tp.sup_id) AS sup_id,
-            MAX(tp.hb_spu_id) AS hb_spu_id,
-            MAX(tp.hb_status) AS hb_status
-        FROM
-            tz_prod tp
-                LEFT JOIN tz_category_prod tcp ON tp.prod_id = tcp.prod_id
-                LEFT JOIN tz_shop_category tsc ON tcp.`code` = tsc.`code`
-                LEFT JOIN tz_shop_sku tss ON  tss.spu_id=tcp.prod_id
-                LEFT JOIN tz_channel_prod cp ON  (cp.shop_id=tsc.shop_id AND cp.sku_id=tss.sku_id)
-        WHERE
-            tp.STATUS = 1 and tp.`is_delete`=0
-          AND tcp.is_delete = 0
-          AND tcp.shop_id = #{prodByCategoryIdAndShopIdDTO.shopId}
-          AND cp.is_delete = 0
-          AND tsc.is_delete = 0
-          AND cp.channel_prod_price IS NOT NULL
-          AND tsc.shop_id=#{prodByCategoryIdAndShopIdDTO.shopId}
-          AND tsc.id=#{prodByCategoryIdAndShopIdDTO.categoryId}
-        GROUP BY tp.prod_id, tsc.shop_id
+            tp.prod_name,
+            tcp.shop_id,
+            tp.brand_id,
+            tp.brand_name,
+            tp.ori_price,
+            MIN(cp.channel_prod_price) AS price,
+            tp.score_price,
+            tp.brief,
+            tp.video,
+            tp.pic,
+            tp.content,
+            tp.imgs,
+            tp.status,
+            tp.is_delete,
+            tp.shop_category_id,
+            tp.category_id,
+            tp.hb_front_category_id,
+            tp.sold_num,
+            COALESCE(SUM(tss.shop_sku_stocks), 0) AS total_stocks,
+            tp.delivery_mode,
+            tp.delivery_template_id,
+            tp.create_time,
+            tp.update_time,
+            tp.putaway_time,
+            tp.version,
+            tp.prod_type,
+            tp.activity_id,
+            tp.sup_id,
+            tp.hb_spu_id,
+            tp.hb_status
+        FROM tz_prod tp
+                 INNER JOIN tz_category_prod tcp ON tp.prod_id = tcp.prod_id
+                   AND tcp.is_delete = 0 AND tcp.shop_id = #{prodByCategoryIdAndShopIdDTO.shopId}
+                   and tcp.category_id = #{prodByCategoryIdAndShopIdDTO.categoryId}
+                 LEFT JOIN tz_shop_sku tss ON tss.spu_id = tp.prod_id
+                 JOIN tz_channel_prod cp ON cp.shop_id = tcp.shop_id
+            AND cp.sku_id = tss.sku_id
+            AND cp.is_delete = 0
+            AND cp.channel_prod_price IS NOT NULL
+        WHERE tp.STATUS = 1
+          AND tp.`is_delete` = 0
+        GROUP BY tp.prod_id
         ORDER BY MAX(tp.create_time) DESC
     </select>
 

+ 2 - 57
yami-shop-service/src/main/resources/mapper/ShopDetailMapper.xml

@@ -131,68 +131,13 @@
 
 
     <select id="selectByOutStationNo" resultType="com.yami.shop.bean.model.ShopDetail">
-        select shop_id,
-               out_station_no,
-               shop_name,
-               user_id,
-               intro,
-               shop_owner,
-               mobile,
-               tel,
-               shop_lat,
-               shop_lng,
-               shop_address,
-               province,
-               province_id,
-               city,
-               city_id,
-               area,
-               area_id,
-               shop_logo,
-               shop_status,
-               create_time,
-               update_time,
-               is_distribution,
-               business_license,
-               identity_card_front,
-               identity_card_later,
-               sync,
-               category,
-               third_party_code
+        select *
         from tz_shop_detail
         where out_station_no = #{outStationNo}
     </select>
 
     <select id="selectByHbStationId" resultType="com.yami.shop.bean.model.ShopDetail">
-        select shop_id,
-               hb_station_id,
-               out_station_no,
-               shop_name,
-               user_id,
-               intro,
-               shop_owner,
-               mobile,
-               tel,
-               shop_lat,
-               shop_lng,
-               shop_address,
-               province,
-               province_id,
-               city,
-               city_id,
-               area,
-               area_id,
-               shop_logo,
-               shop_status,
-               create_time,
-               update_time,
-               is_distribution,
-               business_license,
-               identity_card_front,
-               identity_card_later,
-               sync,
-               category,
-               third_party_code
+        select *
         from tz_shop_detail
         where hb_station_id = #{hbStationId}
     </select>