Procházet zdrojové kódy

医健宝订单评价

lmx před 4 dny
rodič
revize
3114dfb911

+ 14 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreOrderScrmComment.java

@@ -2,6 +2,7 @@ package com.fs.his.domain;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.EqualsAndHashCode;
@@ -81,4 +82,17 @@ public class FsStoreOrderScrmComment extends BaseEntity{
      * 查看自己的评价
      */
     private Integer showSelf;
+
+    private String userAvatar;
+
+    @ApiModelProperty(value = "页码,默认为1")
+    private Integer pageNum =1;
+    @ApiModelProperty(value = "页码,默认为1")
+    private Integer page =1;
+    @ApiModelProperty(value = "页大小,默认为10")
+    private Integer pageSize = 10;
+    @ApiModelProperty(value = "限制数量")
+    private Integer limit;
+    @ApiModelProperty(value = "搜索字符串")
+    private String keyword;
 }

+ 3 - 2
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -1181,8 +1181,9 @@ public interface FsStoreOrderMapper
     @Select("select \n" +
             "t1.store_id as storeId,\n" +
             "t2.store_name as storeName,\n" +
-            "t1.item_json as itemJson from fs_store_order_scrm t1\n" +
-            " t1.status" +
+            "t1.item_json as itemJson, " +
+            "t1.status " +
+            "from fs_store_order_scrm t1\n" +
             "left join fs_store_scrm t2 on t1.store_id = t2.store_id\n" +
             "where t1.id = #{orderId}")
     ProductAndStroreVO getProductAndStroreInfoByOrderId(@Param("orderId") Long orderId);

+ 12 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderScrmCommentServiceImpl.java

@@ -11,6 +11,9 @@ import com.fs.his.mapper.FsStoreOrderMapper;
 import com.fs.his.mapper.FsStoreOrderScrmCommentMapper;
 import com.fs.his.service.IFsStoreOrderScrmCommentService;
 import com.fs.his.vo.ProductAndStroreVO;
+import com.fs.hisStore.domain.FsStoreOrderScrm;
+import com.fs.hisStore.enums.OrderInfoEnum;
+import com.fs.hisStore.mapper.FsStoreOrderScrmMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -28,6 +31,9 @@ public class FsStoreOrderScrmCommentServiceImpl implements IFsStoreOrderScrmComm
 
     @Autowired
     FsStoreOrderMapper fsStoreOrderMapper;
+
+    @Autowired
+    FsStoreOrderScrmMapper fsStoreOrderScrmMapper;
     /**
      * 查询订单评价
      * 
@@ -76,8 +82,13 @@ public class FsStoreOrderScrmCommentServiceImpl implements IFsStoreOrderScrmComm
             }
             ids.deleteCharAt(ids.length()-1);
             fsStoreOrderScrmComment.setProductIds(ids.toString());
+            fsStoreOrderScrmCommentMapper.insertFsStoreOrderScrmComment(fsStoreOrderScrmComment);
+            FsStoreOrderScrm fsStoreOrderScrm = new FsStoreOrderScrm();;
+            fsStoreOrderScrm.setId(fsStoreOrderScrmComment.getOrderId());
+            fsStoreOrderScrm.setStatus(OrderInfoEnum.STATUS_4.getValue());
+            return fsStoreOrderScrmMapper.updateFsStoreOrder(fsStoreOrderScrm);
         }
-        return fsStoreOrderScrmCommentMapper.insertFsStoreOrderScrmComment(fsStoreOrderScrmComment);
+        return 0;
     }
 
     /**

+ 5 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreOrderScrmMapper.java

@@ -475,7 +475,11 @@ public interface FsStoreOrderScrmMapper
             "<if test = 'maps.userId != null     '> " +
             "and o.user_id=#{maps.userId} " +
             "</if>" +
-            " order by o.id desc "+
+            "<if test = 'maps.statusList != null  '> " +
+            "and o.status in " +
+            "<foreach  item='item' index='index' collection='maps.statusList.split(\",\")' open='(' separator=',' close=')'> #{item}    </foreach>"+
+            "</if>" +
+            " order by o.create_time desc "+
             "</script>"})
     List<FsMyStoreOrderListQueryVO> selectFsMyStoreOrderListVO(@Param("maps")FsMyStoreOrderQueryParam param);
     @Select("select * from fs_store_order_scrm where order_code=#{orderCode}")

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsMyStoreOrderQueryParam.java

@@ -13,4 +13,5 @@ public class FsMyStoreOrderQueryParam extends BaseQueryParam implements Serializ
     private Long companyId;
     private Long companyUserId;
     private Integer deliveryStatus;
+    private String statusList;
 }

+ 35 - 32
fs-service/src/main/resources/mapper/his/FsStoreOrderScrmCommentMapper.xml

@@ -48,38 +48,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     <select id="selectFsStoreOrderScrmCommentByUser" parameterType="FsStoreOrderScrmComment" resultMap="FsStoreOrderScrmCommentResult">
-        select comment_id,
-               order_id,
-               content,
-               case when  is_anonymous != 1 then nick_name else '匿名用户' end as nick_name,
-               user_id,
-               is_anonymous,
-               is_show,
-               rating,
-               merchant_reply,
-               image_url,
-               video_url,
-               product_ids,
-               is_del,
-               store_id,
-               store_name,
-               create_time,
-               update_time
-        from fs_store_order_scrm_comment
-        where  is_del != 1 and (isShow = 1 or user_id = #{userId})
-            <if test="orderId != null "> and order_id = #{orderId}</if>
-            <if test="showSelf != null and showSelf = 1"> and user_id = #{userId}</if>
-            <if test="content != null  and content != ''"> and content = #{content}</if>
-            <if test="nickName != null  and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
-            <if test="isAnonymous != null "> and is_anonymous = #{isAnonymous}</if>
-            <if test="rating != null  and rating != ''"> and rating = #{rating}</if>
-            <if test="merchantReply != null  and merchantReply != ''"> and merchant_reply = #{merchantReply}</if>
-            <if test="imageUrl != null  and imageUrl != ''"> and image_url = #{imageUrl}</if>
-            <if test="videoUrl != null  and videoUrl != ''"> and video_url = #{videoUrl}</if>
-            <if test="productIds != null  and productIds != ''"> and find_in_set(#{productIds}, product_ids) > 0</if>
-            <if test="storeId != null "> and store_id = #{storeId}</if>
-            <if test="storeName != null  and storeName != ''"> and store_name like concat('%', #{storeName}, '%')</if>
-            order by create_time desc
+        select
+        t1.comment_id,
+        t1.order_id,
+        t1.content,
+        case when  t1.is_anonymous != 1 then t1.nick_name else '匿名用户' end as nick_name,
+        t1.user_id,
+        t1.is_anonymous,
+        t1.is_show,
+        t1.rating,
+        t1.merchant_reply,
+        t1.image_url,
+        t1.video_url,
+        t1.product_ids,
+        t1.is_del,
+        t1.store_id,
+        t1.store_name,
+        t1.create_time,
+        t1.update_time,
+        t2.avatar as user_avatar
+        from fs_store_order_scrm_comment t1
+        left join fs_user t2 on t1.user_id = t2.user_id
+        where  t1.is_del != 1 and (t1.is_show = 1 or t1.user_id = #{userId})
+            <if test="orderId != null and orderId != '' "> and t1.order_id = #{orderId}</if>
+            <if test="showSelf != null and showSelf != 0"> and t1.user_id = #{userId}</if>
+            <if test="content != null  and content != ''"> and t1.content = #{content}</if>
+            <if test="nickName != null  and nickName != ''"> and t1.nick_name like concat('%', #{nickName}, '%')</if>
+            <if test="isAnonymous != null "> and t1.is_anonymous = #{isAnonymous}</if>
+            <if test="rating != null  and rating != ''"> and t1.rating = #{rating}</if>
+            <if test="merchantReply != null  and merchantReply != ''"> and t1.merchant_reply = #{merchantReply}</if>
+            <if test="imageUrl != null  and imageUrl != ''"> and t1.image_url = #{imageUrl}</if>
+            <if test="videoUrl != null  and videoUrl != ''"> and t1.video_url = #{videoUrl}</if>
+            <if test="productIds != null  and productIds != ''"> and find_in_set(#{productIds}, t1.product_ids) > 0</if>
+            <if test="storeId != null "> and t1.store_id = #{storeId}</if>
+            <if test="storeName != null  and storeName != ''"> and t1.store_name like concat('%', #{storeName}, '%')</if>
+            order by t1.create_time desc
     </select>
 
     <select id="selectFsStoreOrderScrmCommentByManager"  parameterType="FsStoreOrderScrmComment" resultMap="FsStoreOrderScrmCommentResult">

+ 5 - 3
fs-user-app/src/main/java/com/fs/app/controller/store/StoreOrderScrmController.java

@@ -1178,15 +1178,17 @@ public class StoreOrderScrmController extends AppBaseController {
      * @return
      */
 
-    @Login
+//    @Login
     @ApiOperation("用户端获取订单评价")
     @PostMapping("/selectFsStoreOrderScrmCommentByUser")
     public R selectFsStoreOrderScrmCommentByUser(@RequestBody FsStoreOrderScrmComment fsStoreOrderScrmComment){
-        if(null == fsStoreOrderScrmComment.getOrderId() && null == fsStoreOrderScrmComment.getUserId()){
+        if(null == fsStoreOrderScrmComment.getOrderId() && null == fsStoreOrderScrmComment.getUserId() && null == fsStoreOrderScrmComment.getProductIds() && null == fsStoreOrderScrmComment.getStoreId()){
             return R.error("查询参数错误,请检查");
         }
+        PageHelper.startPage(fsStoreOrderScrmComment.getPage(), fsStoreOrderScrmComment.getPageSize());
         List<FsStoreOrderScrmComment> fsStoreOrderScrmComments = orderScrmCommentService.selectFsStoreOrderScrmCommentByUser(fsStoreOrderScrmComment);
-        return R.ok().put("data",fsStoreOrderScrmComments);
+        PageInfo<FsStoreOrderScrmComment> listPageInfo=new PageInfo<>(fsStoreOrderScrmComments);
+        return R.ok().put("data",listPageInfo);
     }
 
     @Login