Browse Source

Merge branch 'V3.0.0' of http://git.ycjcjy.com/fuxingfan/smartCommunity into V3.0.0

魏熙美 6 years ago
parent
commit
b775c764dd
19 changed files with 1099 additions and 14 deletions
  1. 28
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java
  2. 6
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpShopServicelmpl.java
  4. 19
    3
      CODE/smart-community/app-api/src/main/resources/mapper/TpShopAppraisalMapper.xml
  5. 82
    6
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpShopController.java
  6. 33
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ShopAppraisalMapper.java
  7. 18
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ShopAppraisalReplayMapper.java
  8. 29
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/Message.java
  9. 106
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/ShopAppraisal.java
  10. 72
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/ShopAppraisalReplay.java
  11. 48
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpShopService.java
  12. 99
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpShopServiceImpl.java
  13. 6
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java
  14. 36
    0
      CODE/smart-community/property-api/src/main/resources/mapper/ShopAppraisalMapper.xml
  15. 5
    0
      CODE/smart-community/property-api/src/main/resources/mapper/ShopAppraisalReplayMapper.xml
  16. 56
    0
      VUECODE/smart-property-manage/src/api/shopType.js
  17. 6
    0
      VUECODE/smart-property-manage/src/router/index.js
  18. 46
    1
      VUECODE/smart-property-manage/src/store/modules/shopType.js
  19. 403
    0
      VUECODE/smart-property-manage/src/views/shop/shopReplay/index.vue

+ 28
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java View File

81
      */
81
      */
82
      private  Integer transactionId;
82
      private  Integer transactionId;
83
 
83
 
84
+    public TpMessage() {
85
+    }
86
+
84
     public Integer getTransactionId() {
87
     public Integer getTransactionId() {
85
         return transactionId;
88
         return transactionId;
86
     }
89
     }
305
     public void setAnnouncementId(Integer announcementId) {
308
     public void setAnnouncementId(Integer announcementId) {
306
         this.announcementId = announcementId;
309
         this.announcementId = announcementId;
307
     }
310
     }
311
+
312
+    public TpMessage(Integer ticketId, Integer communityId, String messageType, String adviceType, String modelType, Integer uuid, String uuidType, String source, String messageContent, String status, String result, String meaasgeTypeId, String readStatus, Integer createUser, Date createDate, Integer updateUser, Date updateDate, Integer billId, Integer activityId, Integer announcementId, Integer transactionId) {
313
+        this.ticketId = ticketId;
314
+        this.communityId = communityId;
315
+        this.messageType = messageType;
316
+        this.adviceType = adviceType;
317
+        this.modelType = modelType;
318
+        this.uuid = uuid;
319
+        this.uuidType = uuidType;
320
+        this.source = source;
321
+        this.messageContent = messageContent;
322
+        this.status = status;
323
+        this.result = result;
324
+        this.meaasgeTypeId = meaasgeTypeId;
325
+        this.readStatus = readStatus;
326
+        this.createUser = createUser;
327
+        this.createDate = createDate;
328
+        this.updateUser = updateUser;
329
+        this.updateDate = updateDate;
330
+        this.billId = billId;
331
+        this.activityId = activityId;
332
+        this.announcementId = announcementId;
333
+        this.transactionId = transactionId;
334
+    }
335
+
308
 }
336
 }

+ 6
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java View File

596
         tpTransactionReply.setUuidName(userElement.getUserName());
596
         tpTransactionReply.setUuidName(userElement.getUserName());
597
         tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
597
         tpTransactionReply.setUuidRole(taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId()).getDescription());
598
 
598
 
599
+        TpTransactionReply tpTransactionReplyBack = new TpTransactionReply();
599
         //replyId为空的情况下被回复人就是帖子的创建人
600
         //replyId为空的情况下被回复人就是帖子的创建人
600
         if (StringUtils.isEmpty(tpTransactionReply.getReplyId())) {
601
         if (StringUtils.isEmpty(tpTransactionReply.getReplyId())) {
601
             TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(tpTransactionReply.getTransactionId(),tpTransactionReply.getCommunityId());
602
             TpTransaction tpTransaction = tpTransactionMapper.selectByPrimaryKey(tpTransactionReply.getTransactionId(),tpTransactionReply.getCommunityId());
611
             tpTransactionReply.setReplyUuidRole(replyRole);
612
             tpTransactionReply.setReplyUuidRole(replyRole);
612
             tpTransactionReply.setPublishType("1");
613
             tpTransactionReply.setPublishType("1");
613
         }else{
614
         }else{
614
-            TpTransactionReply tpTransactionReplyBack = tpTransactionReplyMapper.selectByPrimaryKey(tpTransactionReply.getReplyId());
615
+             tpTransactionReplyBack = tpTransactionReplyMapper.selectByPrimaryKey(tpTransactionReply.getReplyId());
615
     
616
     
616
             //塞入被回复人信息
617
             //塞入被回复人信息
617
             tpTransactionReply.setReplyUuid(tpTransactionReplyBack.getUuid());
618
             tpTransactionReply.setReplyUuid(tpTransactionReplyBack.getUuid());
636
                 tdImagesMapper.insert(tdImages);
637
                 tdImagesMapper.insert(tdImages);
637
             }
638
             }
638
         }
639
         }
640
+        // 推消息
641
+        TpMessage  tpMessage=new TpMessage(null,userElement.getCommunityId(),"11","1","1", tpTransactionReplyBack.getUuid(),"1","2",  userElement.getUserName()+":"+tpTransactionReply.getReplyContent(),
642
+                                          "1",null,null,"0",userElement.getUserVerifyId(),new Date(),null,null,null,null,null,tpTransactionReplyBack.getTransactionId());
643
+        tpMessageMapper.insert(tpMessage);
639
         response.addSuccess("成功");
644
         response.addSuccess("成功");
640
         return response;
645
         return response;
641
     }
646
     }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpShopServicelmpl.java View File

180
         tpShopAppraisal.setAppraisalTel(userElement.getLoginName());
180
         tpShopAppraisal.setAppraisalTel(userElement.getLoginName());
181
         String photo = taUserMapper.selectByPrimaryKey(userElement.getId()).getHeadPortrait();
181
         String photo = taUserMapper.selectByPrimaryKey(userElement.getId()).getHeadPortrait();
182
         tpShopAppraisal.setAppraisalAvatar(photo);
182
         tpShopAppraisal.setAppraisalAvatar(photo);
183
-        tpShopAppraisal.setScore("1");
183
+        tpShopAppraisal.setSort(1);
184
         tpShopAppraisal.setStatus("1");
184
         tpShopAppraisal.setStatus("1");
185
         tpShopAppraisal.setCreateUser(userElement.getUserVerifyId());
185
         tpShopAppraisal.setCreateUser(userElement.getUserVerifyId());
186
         tpShopAppraisal.setCreateDate(new Date());
186
         tpShopAppraisal.setCreateDate(new Date());

+ 19
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpShopAppraisalMapper.xml View File

177
 
177
 
178
   <select id="shopEvaluateList" resultMap="BaseResultMap">
178
   <select id="shopEvaluateList" resultMap="BaseResultMap">
179
     select
179
     select
180
-    <include refid="Base_Column_List" />
181
-    from tp_shop_appraisal where shop_id = #{shopID,jdbcType=INTEGER} and community_id = #{communityId,jdbcType=INTEGER} and status = 1
182
-  </select>
180
+     sa.id,
181
+     sa.community_id,
182
+     sa.shop_id,
183
+     sa.score,
184
+     sa.content,
185
+     sa.appraisal_people,
186
+     sa.appraisal_tel,
187
+     sa.appraisal_avatar,
188
+     sa.sort,
189
+     sa.STATUS,
190
+     sa.create_user,
191
+     sa.create_date
192
+     from tp_shop_appraisal sa
193
+     left join tp_shop_appraisal_replay sar on sa.id = sar.shop_appraisal_id
194
+     where sa.shop_id = #{shopID,jdbcType=INTEGER}
195
+     and sa.community_id = #{communityId,jdbcType=INTEGER}
196
+     and sa.status = 1
197
+     order by sa.sort desc,sar.update_date desc,sar.create_date desc
198
+</select>
183
 
199
 
184
   <select id="evaluateCount" resultType="int">
200
   <select id="evaluateCount" resultType="int">
185
     select
201
     select

+ 82
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TpShopController.java View File

3
 
3
 
4
 import com.alibaba.fastjson.JSONArray;
4
 import com.alibaba.fastjson.JSONArray;
5
 import com.alibaba.fastjson.JSONObject;
5
 import com.alibaba.fastjson.JSONObject;
6
+import com.baomidou.mybatisplus.extension.api.R;
6
 import com.community.commom.mode.ResponseBean;
7
 import com.community.commom.mode.ResponseBean;
7
 import com.community.commom.session.UserElement;
8
 import com.community.commom.session.UserElement;
8
 import com.community.huiju.common.base.BaseController;
9
 import com.community.huiju.common.base.BaseController;
16
 import io.swagger.annotations.ApiOperation;
17
 import io.swagger.annotations.ApiOperation;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.cloud.context.config.annotation.RefreshScope;
19
 import org.springframework.cloud.context.config.annotation.RefreshScope;
19
-import org.springframework.web.bind.annotation.PathVariable;
20
-import org.springframework.web.bind.annotation.RequestBody;
21
-import org.springframework.web.bind.annotation.RequestMapping;
22
-import org.springframework.web.bind.annotation.RequestMethod;
23
-import org.springframework.web.bind.annotation.RequestParam;
24
-import org.springframework.web.bind.annotation.RestController;
20
+import org.springframework.web.bind.annotation.*;
25
 
21
 
26
 import javax.servlet.http.HttpSession;
22
 import javax.servlet.http.HttpSession;
27
 import java.time.LocalDateTime;
23
 import java.time.LocalDateTime;
168
 		}
164
 		}
169
 		return responseBean;
165
 		return responseBean;
170
 	}
166
 	}
167
+
168
+	@ApiOperation(value = "线下商铺评价列表", notes = "线下商铺评价列表")
169
+	@ApiImplicitParams({
170
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "商铺编号"),
171
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "shopName", value = "商铺名称"),
172
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "score", value = "商铺名称"),
173
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "content", value = "评价内容"),
174
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "appraisalPeople", value = "评价人"),
175
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "appraisalTel", value = "评价人电话"),
176
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
177
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度"),
178
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
179
+	})
180
+	@RequestMapping(value = "/shopAppraisalList",method = RequestMethod.GET)
181
+	public ResponseBean shopAppraisalList(@RequestParam(value = "id",required = false) Integer id,
182
+									@RequestParam(value = "shopName",required = false) String shopName,
183
+									@RequestParam(value = "score",required = false) String score,
184
+									@RequestParam(value = "content",required = false) String content,
185
+									@RequestParam(value = "appraisalPeople",required = false) String appraisalPeople,
186
+									@RequestParam(value = "appraisalTel",required = false) String appraisalTel,
187
+									@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
188
+									@RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
189
+									HttpSession session) {
190
+		UserElement userElement = getUserElement(session);
191
+		ResponseBean responseBean = shopService.shopAppraisalList(id,shopName,score,content,appraisalPeople,appraisalTel,userElement,pageNum,pageSize);
192
+		return responseBean;
193
+	}
194
+
195
+	@ApiOperation(value = "线下商铺回复评价和修改评价", notes = "线下商铺回复评价和修改评价")
196
+	@ApiImplicitParams({
197
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "评论ID"),
198
+			@ApiImplicitParam(paramType = "query", dataType = "String", name = "replayContent", value = "内容"),
199
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "code", value = "1:添加,2:修改"),
200
+	})
201
+	@RequestMapping(value = "/shopAppraisalReplay/AddandEditor",method = RequestMethod.POST)
202
+	public ResponseBean shopAppraisalReplayAddandEditor(@RequestParam(value = "id") Integer id,
203
+											@RequestParam(value = "replayContent") String replayContent,
204
+											@RequestParam(value = "code") Integer code,
205
+										  	HttpSession session) {
206
+		UserElement userElement = getUserElement(session);
207
+		ResponseBean responseBean = shopService.shopAppraisalReplayAddandEditor(id,userElement,replayContent,code);
208
+		return responseBean;
209
+	}
210
+
211
+	@ApiOperation(value = "线下商铺回复评论详情", notes = "线下商铺回复评论详情")
212
+	@ApiImplicitParams({
213
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "评论ID"),
214
+	})
215
+	@RequestMapping(value = "/shopAppraisal/details",method = RequestMethod.GET)
216
+	public ResponseBean shopAppraisalDetails(@RequestParam(value = "id") Integer id) {
217
+		ResponseBean responseBean = shopService.shopAppraisalDetails(id);
218
+		return responseBean;
219
+	}
220
+
221
+	@ApiOperation(value = "线下商铺评论上架和下架", notes = "线下商铺评论上架和下架")
222
+	@ApiImplicitParams({
223
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "parameter", value = "评论ID[],status:上架,2下架"),
224
+	})
225
+	@RequestMapping(value = "/shopAppraisal/Status",method = RequestMethod.POST)
226
+	public ResponseBean shopAppraisalStatus(@RequestBody String parameter,
227
+												  HttpSession session ) {
228
+		UserElement userElement = getUserElement(session);
229
+		ResponseBean responseBean = shopService.shopAppraisalStatus(parameter,userElement);
230
+		return responseBean;
231
+	}
232
+
233
+	@ApiOperation(value = "线下商铺评论修改权重", notes = "线下商铺评论修改权重")
234
+	@ApiImplicitParams({
235
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "id", value = "评论ID"),
236
+			@ApiImplicitParam(paramType = "query", dataType = "Integer", name = "sort", value = "权重值"),
237
+	})
238
+	@RequestMapping(value = "/shopAppraisalSort/Sort",method = RequestMethod.POST)
239
+	public ResponseBean shopAppraisalSort(@RequestParam(value = "id") Integer id,
240
+												  @RequestParam(value = "sort") Integer sort,
241
+												  HttpSession session ) {
242
+		UserElement userElement = getUserElement(session);
243
+		ResponseBean responseBean = shopService.shopAppraisalSort(id,sort,userElement);
244
+		return responseBean;
245
+	}
246
+
171
 }
247
 }

+ 33
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ShopAppraisalMapper.java View File

1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
+import com.community.huiju.model.ShopAppraisal;
6
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
+import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+/**
11
+ * <p>
12
+ * 商铺评价表 Mapper 接口
13
+ * </p>
14
+ *
15
+ * @author jobob
16
+ * @since 2019-07-04
17
+ */
18
+@Mapper
19
+public interface ShopAppraisalMapper extends BaseMapper<ShopAppraisal> {
20
+
21
+    /**
22
+     * 线下商铺评价列表
23
+     * @param page
24
+     * @param id
25
+     * @param shopName
26
+     * @param score
27
+     * @param content
28
+     * @param appraisalPeople
29
+     * @param appraisalTel
30
+     * @return
31
+     */
32
+    IPage<ShopAppraisal> ticketList(Page page, @Param("id") Integer id, @Param("shopName")String shopName, @Param("score")String score, @Param("content")String content, @Param("appraisalPeople")String appraisalPeople, @Param("appraisalTel")String appraisalTel);
33
+}

+ 18
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/ShopAppraisalReplayMapper.java View File

1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ShopAppraisalReplay;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 商铺回复表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-07-04
14
+ */
15
+@Mapper
16
+public interface ShopAppraisalReplayMapper extends BaseMapper<ShopAppraisalReplay> {
17
+
18
+}

+ 29
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/Message.java View File

3
 import com.baomidou.mybatisplus.annotation.TableName;
3
 import com.baomidou.mybatisplus.annotation.TableName;
4
 import java.time.LocalDateTime;
4
 import java.time.LocalDateTime;
5
 import java.io.Serializable;
5
 import java.io.Serializable;
6
+import java.util.Date;
7
+
6
 import lombok.Data;
8
 import lombok.Data;
7
 import lombok.EqualsAndHashCode;
9
 import lombok.EqualsAndHashCode;
8
 import lombok.experimental.Accessors;
10
 import lombok.experimental.Accessors;
129
      */
131
      */
130
     private Integer transactionId;
132
     private Integer transactionId;
131
 
133
 
134
+    public Message(Integer ticketId, Integer communityId, String messageType, String adviceType, String modelType, Integer uuid, String uuidType, String source, String messageContent, String status, String result, String meaasgeTypeId, String readStatus, Integer createUser, LocalDateTime createDate, Integer updateUser, LocalDateTime updateDate, Integer billId, Integer activityId, Integer announcementId, Integer transactionId) {
135
+        this.ticketId = ticketId;
136
+        this.communityId = communityId;
137
+        this.messageType = messageType;
138
+        this.adviceType = adviceType;
139
+        this.modelType = modelType;
140
+        this.uuid = uuid;
141
+        this.uuidType = uuidType;
142
+        this.source = source;
143
+        this.messageContent = messageContent;
144
+        this.status = status;
145
+        this.result = result;
146
+        this.meaasgeTypeId = meaasgeTypeId;
147
+        this.readStatus = readStatus;
148
+        this.createUser = createUser;
149
+        this.createDate = createDate;
150
+        this.updateUser = updateUser;
151
+        this.updateDate = updateDate;
152
+        this.billId = billId;
153
+        this.activityId = activityId;
154
+        this.announcementId = announcementId;
155
+        this.transactionId = transactionId;
156
+    }
157
+
158
+    public  Message(){
159
+
160
+    }
132
 }
161
 }

+ 106
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/ShopAppraisal.java View File

1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import com.baomidou.mybatisplus.annotation.TableName;
7
+import java.time.LocalDateTime;
8
+import java.io.Serializable;
9
+import lombok.Data;
10
+import lombok.EqualsAndHashCode;
11
+import lombok.experimental.Accessors;
12
+
13
+/**
14
+ * <p>
15
+ * 商铺评价表
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-07-04
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@TableName("tp_shop_appraisal")
25
+public class ShopAppraisal implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+
32
+    /**
33
+     * 小区ID
34
+     */
35
+    private Integer communityId;
36
+
37
+    /**
38
+     * 商铺ID
39
+     */
40
+    private Integer shopId;
41
+
42
+    /**
43
+     * 评分 0- 5
44
+     */
45
+    private String score;
46
+
47
+    /**
48
+     * 评价内容
49
+     */
50
+    private String content;
51
+
52
+    /**
53
+     * 评价人
54
+     */
55
+    private String appraisalPeople;
56
+
57
+    /**
58
+     * 评价人手机号
59
+     */
60
+    private String appraisalTel;
61
+
62
+    /**
63
+     * 评价人头像
64
+     */
65
+    private String appraisalAvatar;
66
+
67
+    /**
68
+     * 权重
69
+     */
70
+    private Integer sort;
71
+
72
+    /**
73
+     * 评价状态 1 是有效  0 是无效
74
+     */
75
+    private String status;
76
+
77
+    /**
78
+     * 创建人ID
79
+     */
80
+    private Integer createUser;
81
+
82
+    /**
83
+     * 创建时间
84
+     */
85
+    private LocalDateTime createDate;
86
+
87
+    /**
88
+     * 商铺名称
89
+     */
90
+    @TableField(exist = false)
91
+    private String shopName;
92
+
93
+    /**
94
+     * 回复内容
95
+     */
96
+    @TableField(exist = false)
97
+    private String replayContent;
98
+
99
+    /**
100
+     * 回复人
101
+     */
102
+    @TableField(exist = false)
103
+    private  String replayPeople;
104
+
105
+
106
+}

+ 72
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/ShopAppraisalReplay.java View File

1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import java.time.LocalDateTime;
7
+import java.io.Serializable;
8
+import lombok.Data;
9
+import lombok.EqualsAndHashCode;
10
+import lombok.experimental.Accessors;
11
+
12
+/**
13
+ * <p>
14
+ * 商铺回复表
15
+ * </p>
16
+ *
17
+ * @author jobob
18
+ * @since 2019-07-04
19
+ */
20
+@Data
21
+@EqualsAndHashCode(callSuper = false)
22
+@Accessors(chain = true)
23
+@TableName("tp_shop_appraisal_replay")
24
+public class ShopAppraisalReplay implements Serializable {
25
+
26
+    private static final long serialVersionUID = 1L;
27
+
28
+    @TableId(value = "id", type = IdType.AUTO)
29
+    private Integer id;
30
+
31
+    /**
32
+     * 小区ID
33
+     */
34
+    private Integer communityId;
35
+
36
+    /**
37
+     * 商铺评论ID
38
+     */
39
+    private Integer shopAppraisalId;
40
+
41
+    /**
42
+     * 回复内容
43
+     */
44
+    private String replayContent;
45
+
46
+    /**
47
+     * 回复人
48
+     */
49
+    private String replayPeople;
50
+
51
+    /**
52
+     * 创建人
53
+     */
54
+    private Integer createUser;
55
+
56
+    /**
57
+     * 创建时间
58
+     */
59
+    private LocalDateTime createDate;
60
+
61
+    /**
62
+     * 更新人
63
+     */
64
+    private Integer updateUser;
65
+
66
+    /**
67
+     * 更新时间
68
+     */
69
+    private LocalDateTime updateDate;
70
+
71
+
72
+}

+ 48
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITpShopService.java View File

50
 	 * @return
50
 	 * @return
51
 	 */
51
 	 */
52
 	ResponseBean updateShop(TpShop shop, UserElement userElement);
52
 	ResponseBean updateShop(TpShop shop, UserElement userElement);
53
+
54
+	/**
55
+	 * 线下商铺评价列表
56
+	 * @param id
57
+	 * @param shopName
58
+	 * @param score
59
+	 * @param content
60
+	 * @param appraisalPeople
61
+	 * @param appraisalTel
62
+	 * @param userElement
63
+	 * @param pageNum
64
+	 * @param pageSize
65
+	 * @return
66
+	 */
67
+    ResponseBean shopAppraisalList(Integer id, String shopName, String score, String content, String appraisalPeople, String appraisalTel, UserElement userElement, Integer pageNum, Integer pageSize);
68
+
69
+	/**
70
+	 * 线下商铺回复评价
71
+	 * @param id
72
+	 * @param userElement
73
+	 * @param replayContent
74
+	 * @return
75
+	 */
76
+	ResponseBean shopAppraisalReplayAddandEditor(Integer id, UserElement userElement, String replayContent,Integer code);
77
+
78
+	/**
79
+	 * 线下商铺评论详情
80
+	 * @param id
81
+	 * @return
82
+	 */
83
+	ResponseBean shopAppraisalDetails(Integer id);
84
+
85
+	/**
86
+	 * 线下商铺评论上架和下架
87
+	 * @param parameter
88
+	 * @param userElement
89
+	 * @return
90
+	 */
91
+	ResponseBean shopAppraisalStatus(String parameter, UserElement userElement);
92
+
93
+	/**
94
+	 * 下商铺修改权重
95
+	 * @param id
96
+	 * @param sort
97
+	 * @param userElement
98
+	 * @return
99
+	 */
100
+	ResponseBean shopAppraisalSort(Integer id, Integer sort, UserElement userElement);
53
 }
101
 }

+ 99
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpShopServiceImpl.java View File

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.alibaba.fastjson.JSONObject;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
6
 import com.community.commom.mode.ResponseBean;
9
 import com.community.commom.mode.ResponseBean;
7
 import com.community.commom.session.UserElement;
10
 import com.community.commom.session.UserElement;
8
 import com.community.commom.utils.AccountValidatorUtil;
11
 import com.community.commom.utils.AccountValidatorUtil;
12
+import com.community.huiju.dao.ShopAppraisalMapper;
13
+import com.community.huiju.dao.ShopAppraisalReplayMapper;
9
 import com.community.huiju.dao.TpShopImgMapper;
14
 import com.community.huiju.dao.TpShopImgMapper;
10
 import com.community.huiju.dao.TpShopMapper;
15
 import com.community.huiju.dao.TpShopMapper;
11
-import com.community.huiju.model.TpShop;
12
-import com.community.huiju.model.TpShopImg;
16
+import com.community.huiju.model.*;
13
 import com.community.huiju.service.ITpShopService;
17
 import com.community.huiju.service.ITpShopService;
14
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.stereotype.Service;
19
 import org.springframework.stereotype.Service;
38
 	
42
 	
39
 	@Autowired
43
 	@Autowired
40
 	private TpShopImgMapper shopImgMapper;
44
 	private TpShopImgMapper shopImgMapper;
45
+
46
+	@Autowired
47
+	private ShopAppraisalMapper shopAppraisalMapper;
48
+
49
+	@Autowired
50
+	private ShopAppraisalReplayMapper shopAppraisalReplayMapper;
41
 	
51
 	
42
 	/**
52
 	/**
43
 	 * 根据条件查询商铺列表
53
 	 * 根据条件查询商铺列表
211
 		responseBean.addSuccess("修改成功");
221
 		responseBean.addSuccess("修改成功");
212
 		return responseBean;
222
 		return responseBean;
213
 	}
223
 	}
224
+
225
+	@Override
226
+	public ResponseBean shopAppraisalList(Integer id, String shopName, String score, String content, String appraisalPeople, String appraisalTel, UserElement userElement, Integer pageNum, Integer pageSize) {
227
+		ResponseBean responseBean= new ResponseBean<>();
228
+		Page<ShopAppraisal> page = new Page();
229
+		page.setCurrent(pageNum);
230
+		page.setSize(pageSize);
231
+		IPage<ShopAppraisal> pageInfo = shopAppraisalMapper.ticketList(page,id,shopName,score,content,appraisalPeople,appraisalTel);
232
+		Map<String,Object> map = new HashMap<>();
233
+		map.put("list", pageInfo);
234
+		map.put("total", page.getTotal());
235
+		responseBean.addSuccess(map);
236
+		return responseBean;
237
+	}
238
+
239
+	@Override
240
+	public ResponseBean shopAppraisalReplayAddandEditor(Integer id, UserElement userElement, String replayContent,Integer code) {
241
+		ResponseBean responseBean= new ResponseBean();
242
+		// 添加回复
243
+		int codes = code.intValue();
244
+		if (codes == 1) {
245
+		ShopAppraisalReplay shopAppraisalReplay= new ShopAppraisalReplay();
246
+			shopAppraisalReplay.setCommunityId(userElement.getCommunityId())
247
+					           .setShopAppraisalId(id)
248
+							   .setReplayContent(replayContent)
249
+							   .setReplayPeople(userElement.getUserName())
250
+					           .setCreateUser(userElement.getId())
251
+							   .setCreateDate(LocalDateTime.now());
252
+			shopAppraisalReplayMapper.insert(shopAppraisalReplay);
253
+		}
254
+		// 修改回复
255
+		if (codes == 2){
256
+			// 根据小区查询当前回复信息
257
+			QueryWrapper<ShopAppraisalReplay> shopAppraisalReplayQueryWrapper= new QueryWrapper<>();
258
+			shopAppraisalReplayQueryWrapper.eq("shop_appraisal_id",id);
259
+			shopAppraisalReplayQueryWrapper.eq("community_id",userElement.getCommunityId());
260
+			ShopAppraisalReplay shopAppraisalReplayQuery= shopAppraisalReplayMapper.selectOne(shopAppraisalReplayQueryWrapper);
261
+			shopAppraisalReplayQuery.setReplayContent(replayContent)
262
+									.setUpdateUser(userElement.getId())
263
+									.setUpdateDate(LocalDateTime.now());
264
+			shopAppraisalReplayMapper.updateById(shopAppraisalReplayQuery);
265
+		}
266
+		responseBean.addSuccess("成功");
267
+		return responseBean;
268
+	}
269
+
270
+	@Override
271
+	public ResponseBean shopAppraisalDetails(Integer id) {
272
+		ResponseBean responseBean= new ResponseBean<>();
273
+		// 评论详情
274
+		ShopAppraisal shopAppraisal= shopAppraisalMapper.selectById(id);
275
+		// 回复详情
276
+		QueryWrapper<ShopAppraisalReplay> shopAppraisalReplayQueryWrapper= new QueryWrapper<>();
277
+		shopAppraisalReplayQueryWrapper.eq("shop_appraisal_id",id);
278
+		shopAppraisalReplayQueryWrapper.eq("community_id",shopAppraisal.getCommunityId());
279
+		ShopAppraisalReplay shopAppraisalReplay = shopAppraisalReplayMapper.selectOne(shopAppraisalReplayQueryWrapper);
280
+		Map<String,Object> map = new HashMap<>();
281
+		map.put("shopAppraisal",shopAppraisal);
282
+		map.put("shopAppraisalReplay",shopAppraisalReplay);
283
+		responseBean.addSuccess(map);
284
+		return responseBean;
285
+	}
286
+
287
+	@Override
288
+	public ResponseBean shopAppraisalStatus(String parameter, UserElement userElement) {
289
+		ResponseBean responseBean= new ResponseBean<>();
290
+		JSONObject object = JSONObject.parseObject(parameter);
291
+		String status = object.getString("status");
292
+		Integer[] arrayList = object.getJSONArray("id").toArray(new Integer[]{});
293
+		for (Integer id:arrayList) {
294
+			ShopAppraisal shopAppraisal = new ShopAppraisal();
295
+			shopAppraisal.setId(id).setStatus(status);
296
+			shopAppraisalMapper.updateById(shopAppraisal);
297
+		}
298
+		responseBean.addSuccess("成功");
299
+		return responseBean;
300
+	}
301
+
302
+	@Override
303
+	public ResponseBean shopAppraisalSort(Integer id, Integer sort, UserElement userElement) {
304
+		ResponseBean responseBean= new ResponseBean<>();
305
+		ShopAppraisal shopAppraisal= new ShopAppraisal();
306
+		shopAppraisal.setId(id).setSort(sort);
307
+		shopAppraisalMapper.updateById(shopAppraisal);
308
+		responseBean.addSuccess("成功");
309
+		return responseBean;
310
+	}
214
 }
311
 }

+ 6
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java View File

61
 	@Autowired
61
 	@Autowired
62
 	private TaSysRoleMapper taSysRoleMapper;
62
 	private TaSysRoleMapper taSysRoleMapper;
63
 
63
 
64
+	@Autowired
65
+	private  MessageMapper tpMessageMapper;
66
+
64
 
67
 
65
 	@Override
68
 	@Override
66
 	public ResponseBean getTransactionList(String parameter,Integer communityId) {
69
 	public ResponseBean getTransactionList(String parameter,Integer communityId) {
393
 			tdImages.setCreateUser(userElement.getId());
396
 			tdImages.setCreateUser(userElement.getId());
394
 			tdImagesMapper.insert(tdImages);
397
 			tdImagesMapper.insert(tdImages);
395
 		}
398
 		}
399
+		Message  tpMessage=new Message(null,userElement.getCommunityId(),"11","1","1", tpTransaction.getUuid(),"1","2",  userElement.getUserName()+":"+ replyContent,
400
+				"1",null,null,"0",userElement.getUserVerifyId(),LocalDateTime.now(),null,null,null,null,null,tpTransaction.getId());
401
+		tpMessageMapper.insert(tpMessage);
396
 		response.addSuccess("成功");
402
 		response.addSuccess("成功");
397
 		return response;
403
 		return response;
398
 	}
404
 	}

+ 36
- 0
CODE/smart-community/property-api/src/main/resources/mapper/ShopAppraisalMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.ShopAppraisalMapper">
4
+    <select id="ticketList" resultType="com.community.huiju.model.ShopAppraisal">
5
+        SELECT
6
+            *,
7
+            s.shop_name as shopName,
8
+            ar.replay_content as replayContent,
9
+            ar.replay_people as replayPeople
10
+        FROM
11
+            tp_shop_appraisal sa
12
+        LEFT JOIN tp_shop s ON sa.shop_id = s.id
13
+        LEFT JOIN tp_shop_appraisal_replay ar ON sa.id = ar.shop_appraisal_id
14
+        <where>
15
+            <if test="id !=null and id != ''">
16
+                and sa.id like concat('%',#{id},'%')
17
+            </if>
18
+            <if test="shopName !=null and shopName != ''">
19
+                and s.shop_name like concat('%',#{shopName},'%')
20
+            </if>
21
+            <if test="score !=null and score != ''">
22
+                and sa.score like concat('%',#{score},'%')
23
+            </if>
24
+            <if test="content !=null and content != ''">
25
+                and sa.content like concat('%',#{content},'%')
26
+            </if>
27
+            <if test="appraisalPeople !=null and appraisalPeople != ''">
28
+                and sa.appraisal_people like concat('%',#{appraisalPeople},'%')
29
+            </if>
30
+            <if test="appraisalTel !=null and appraisalTel != ''">
31
+                and sa.appraisal_tel like concat('%',#{appraisalTel},'%')
32
+            </if>
33
+        </where>
34
+        order by sa.sort desc,sa.create_date desc
35
+    </select>
36
+</mapper>

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/ShopAppraisalReplayMapper.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.ShopAppraisalReplayMapper">
4
+
5
+</mapper>

+ 56
- 0
VUECODE/smart-property-manage/src/api/shopType.js View File

109
   })
109
   })
110
 }
110
 }
111
 
111
 
112
+export function shopAppraisalList(data) {
113
+  return request({
114
+    url: '/shopAppraisalList',
115
+    method: 'get',
116
+    params: {
117
+      id: data.id,
118
+      shopName: data.shopName,
119
+      score: data.score,
120
+      content: data.content,
121
+      appraisalPeople: data.appraisalPeople,
122
+      appraisalTel: data.appraisalTel,
123
+      pageSize: data.pageSize,
124
+      pageNum: data.pageNum
125
+    }
126
+  })
127
+}
128
+export function shopAppraisalDetails(data) {
129
+  return request({
130
+    url: '/shopAppraisal/details',
131
+    method: 'get',
132
+    params: {
133
+      id: data.id
134
+    }
135
+  })
136
+}
137
+export function shopAppraisalReplayAddandEditor(data) {
138
+  return request({
139
+    url: '/shopAppraisalReplay/AddandEditor',
140
+    method: 'post',
141
+    params: {
142
+      id: data.id,
143
+      replayContent: data.replayContent,
144
+      code: data.code
145
+    }
146
+  })
147
+}
148
+export function shopAppraisalStatuss(data) {
149
+  return request({
150
+    url: '/shopAppraisal/Status',
151
+    method: 'post',
152
+    data: {
153
+      id: data.ides,
154
+      status: data.status
155
+    }
156
+  })
157
+}
158
+export function shopAppraisalSort(data) {
159
+  return request({
160
+    url: '/shopAppraisalSort/Sort',
161
+    method: 'post',
162
+    params: {
163
+      id: data.id,
164
+      sort: data.sort
165
+    }
166
+  })
167
+}

+ 6
- 0
VUECODE/smart-property-manage/src/router/index.js View File

414
         name: 'shop-edit',
414
         name: 'shop-edit',
415
         hidden: true,
415
         hidden: true,
416
         meta: { title: '修改商铺信息', icon: 'table' }
416
         meta: { title: '修改商铺信息', icon: 'table' }
417
+      },
418
+      {
419
+        path: '/shop/shopReplay/index',
420
+        component: () => import('@/views/shop/shopReplay/index'),
421
+        name: 'shop-shopReplay',
422
+        meta: { title: '评价列表', icon: 'table' }
417
       }
423
       }
418
     ]
424
     ]
419
   },
425
   },

+ 46
- 1
VUECODE/smart-property-manage/src/store/modules/shopType.js View File

1
-import { fetchShopTypeList, changeShopSetting, addShopType, getShopType, updateShopType, deleteShopType, fetchShopList, fetchShopTypeSelect, addShop, getShop, updateShop, shelfShop, obtainedShop } from '@/api/shopType'
1
+import { fetchShopTypeList, changeShopSetting, addShopType, getShopType, updateShopType, deleteShopType, fetchShopList, fetchShopTypeSelect, addShop, getShop, updateShop, shelfShop, obtainedShop, shopAppraisalList, shopAppraisalDetails, shopAppraisalReplayAddandEditor, shopAppraisalStatuss, shopAppraisalSort } from '@/api/shopType'
2
 
2
 
3
 const transaction = {
3
 const transaction = {
4
   namespaced: true,
4
   namespaced: true,
128
           reject(error)
128
           reject(error)
129
         })
129
         })
130
       })
130
       })
131
+    },
132
+    ShopAppraisalList({ commit }, listQuery) {
133
+      return new Promise((resolve, reject) => {
134
+        shopAppraisalList(listQuery).then(response => {
135
+          resolve(response)
136
+        }).catch(error => {
137
+          reject(error)
138
+        })
139
+      })
140
+    },
141
+    ShopAppraisalDetails({ commit }, listQuery) {
142
+      return new Promise((resolve, reject) => {
143
+        shopAppraisalDetails(listQuery).then(response => {
144
+          resolve(response)
145
+        }).catch(error => {
146
+          reject(error)
147
+        })
148
+      })
149
+    },
150
+    ShopAppraisalReplayAddandEditor({ commit }, listQuery) {
151
+      return new Promise((resolve, reject) => {
152
+        shopAppraisalReplayAddandEditor(listQuery).then(response => {
153
+          resolve(response)
154
+        }).catch(error => {
155
+          reject(error)
156
+        })
157
+      })
158
+    },
159
+    ShopAppraisalStatuss({ commit }, listQuery) {
160
+      return new Promise((resolve, reject) => {
161
+        shopAppraisalStatuss(listQuery).then(response => {
162
+          resolve(response)
163
+        }).catch(error => {
164
+          reject(error)
165
+        })
166
+      })
167
+    },
168
+    ShopAppraisalSort({ commit }, listQuery) {
169
+      return new Promise((resolve, reject) => {
170
+        shopAppraisalSort(listQuery).then(response => {
171
+          resolve(response)
172
+        }).catch(error => {
173
+          reject(error)
174
+        })
175
+      })
131
     }
176
     }
132
   }
177
   }
133
 }
178
 }

+ 403
- 0
VUECODE/smart-property-manage/src/views/shop/shopReplay/index.vue View File

1
+<template>
2
+  <div>
3
+    <el-form :inline="true" :model="listQuery" class="form-listQuery">
4
+      <el-form-item class="filter-item"  label="商铺编号">
5
+        <el-input v-model="listQuery.id"  placeholder="商铺编号"/>
6
+      </el-form-item>
7
+      <el-form-item class="filter-item"  label="商铺名称">
8
+        <el-input v-model="listQuery.shopName" placeholder="商铺名称"/>
9
+      </el-form-item>
10
+      <el-form-item class="filter-item"  label="评价分数">
11
+        <el-select v-model="listQuery.score" placeholder="评价分数">
12
+         <el-option label="请选择" value=""/>
13
+         <el-option label="1" value="1"/>
14
+         <el-option label="2" value="2"/>
15
+         <el-option label="3" value="3"/>
16
+         <el-option label="4" value="4"/>
17
+         <el-option label="5" value="5"/>
18
+        </el-select>
19
+      </el-form-item>
20
+      <el-form-item class="filter-item"  label="评价内容">
21
+        <el-input  v-model="listQuery.content" placeholder="评价内容"/>
22
+      </el-form-item>
23
+      <el-form-item class="filter-item"  label="评价人">
24
+        <el-input  v-model="listQuery.appraisalPeople" placeholder="评价人"/>
25
+      </el-form-item>
26
+      <el-form-item class="filter-item"  label="评价人手机号">
27
+        <el-input  v-model="listQuery.appraisalTel" placeholder="评价人手机号"/>
28
+      </el-form-item>
29
+      <el-form-item>
30
+        <el-button type="info" class="filter-item" @click="handleFilter">清空</el-button>
31
+        <el-button type="primary" @click="search">查询</el-button>
32
+      </el-form-item>
33
+
34
+      <el-row>
35
+      <el-button type="primary" @click=" replyAdd()">回复评价</el-button>
36
+      <el-button type="primary" @click="enditreply()">修改评价</el-button>
37
+      <el-button type="info" @click="enditandAdd(0)">下架评价</el-button>
38
+      <el-button type="info" @click="enditandAdd(1)">上架评价</el-button>
39
+      <span style="padding-left:20%;font-size:0.7vw;color:#C0C0C0;">注:权重越大,APP端展示越靠前(权重相同时按编辑时间从晚到早排序)</span>
40
+      </el-row>
41
+    </el-form>
42
+      <el-table
43
+      v-loading="listLoading"
44
+      ref="multipleTable"
45
+      :data="listData.records"
46
+      border
47
+      tooltip-effect="dark"
48
+      style="width: 100%; margin-top: 20px;"
49
+      @selection-change="handleSelectionChange">
50
+      <el-table-column
51
+        type="selection"
52
+        width="55"/>
53
+      <el-table-column prop="id" label="序号" align="center"/>
54
+      <el-table-column prop="roomName" label="商铺名称" align="center">
55
+         <template slot-scope="scope" >
56
+          <a>
57
+            <!-- <span :title="scope.row.roomName" @click="clickTitle(scope.row.id)" style="color: #009FCC"> -->
58
+            {{ scope.row.shopName}}
59
+            <!-- </span> -->
60
+          </a>
61
+      </template>
62
+      </el-table-column>
63
+      <el-table-column prop="score" label="评价分数" align="center"/>
64
+      <el-table-column prop="content" label="评价内容" align="center">
65
+      <template slot-scope="scope">
66
+        <a :title="scope.row.content">
67
+          <span style="color: #8B8378	">
68
+           {{ scope.row.content.length>='15'?scope.row.content.substring(0,15)+'..':scope.row.content }}
69
+          </span>
70
+          <span v-if="scope.row.content==='null'">
71
+           {{ scope.row.content='' }}
72
+          </span>
73
+        </a>
74
+       </template>
75
+      </el-table-column>
76
+      <el-table-column prop="appraisalPeople" label="评价人" align="center"/>
77
+      <el-table-column prop="appraisalTel" label="评价人手机" align="center"/>
78
+      <el-table-column prop="sort" label="评价权重" align="center">
79
+         <template slot-scope="scope">
80
+          <a><span style="color: #009FCC	" @click="sort(scope.row.id,scope.row.sort)">{{ scope.row.sort }}</span></a>
81
+         </template>
82
+      </el-table-column>
83
+      <el-table-column prop="replayContent" label="回复内容" align="center">
84
+        <template slot-scope="scope">
85
+        <a :title="scope.row.replayContent" v-if="scope.row.replayContent !=null">
86
+          <span style="color: #8B8378	">
87
+           {{ scope.row.replayContent.length>='15'?scope.row.replayContent.substring(0,15)+'..':scope.row.replayContent }}
88
+          </span>
89
+          <span v-if="scope.row.replayContent==='null'">
90
+           {{ scope.row.replayContent='' }}
91
+          </span>
92
+        </a>
93
+       </template>
94
+      </el-table-column>
95
+      <el-table-column prop="replayPeople" label="回复人" align="center"/>
96
+      <el-table-column prop="createDate" label="时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
97
+      <el-table-column prop="replayContent" label="评论状态" align="center">
98
+        <template slot-scope="scope">
99
+          <span style="color: #8B8378	" v-if="scope.row.status==='0'">已下架</span>
100
+          <span v-if="scope.row.status==='1'">已上架</span>
101
+       </template>
102
+      </el-table-column>
103
+
104
+    </el-table>
105
+        <div class="block">
106
+      <el-pagination
107
+        :current-page.sync="listQuery.pageNum"
108
+        :page-sizes="[10, 20, 50, 100]"
109
+        :page-size.sync="listQuery.pageSize"
110
+        :total="total"
111
+        layout="total, sizes, prev, pager, next, jumper"
112
+        @size-change="handleSizeChange"
113
+        @current-change="handleCurrentChange"/>
114
+  </div>
115
+  <el-dialog title="回复评价" :visible.sync="listQuery.dialogFormVisible" :show-close="listQuery.close">
116
+      <el-form :model="listQuery" label-position="left">
117
+        <el-form-item :label-width="listQuery.formLabelWidth"  label="评价内容">
118
+          <span>{{ this.listQuery.content }}</span>
119
+        </el-form-item>
120
+        <el-form-item :label-width="listQuery.formLabelWidth"  label="回复内容">
121
+          <textarea v-model="listQuery.replayContent" placeholder="输入对上方业主评价的回复,最多100字" class="textarea-inherit" rows="8"></textarea> 
122
+        </el-form-item>
123
+      </el-form>
124
+      <div slot="footer" class="dialog-footer">
125
+        <el-button @click="TransactionReplyOff">取 消</el-button>
126
+        <el-button type="primary" @click="TransactionReplyAdd()">确 定</el-button>
127
+      </div>
128
+    </el-dialog>
129
+</div>
130
+
131
+</template>
132
+
133
+<script>
134
+export default {
135
+    data() {
136
+        return {
137
+          listQuery: {
138
+            id: '',
139
+            shopName: '',
140
+            score: '',
141
+            messageType:'',
142
+            content:'',
143
+            appraisalPeople:'',
144
+            replayContent:'',
145
+            code:'',
146
+            appraisalTel:'',
147
+            status:'',
148
+            pageNum: 1,
149
+            pageSize: 10,
150
+            roomStatusIds: [],
151
+            dialogFormVisible: false,
152
+            formLabelWidth: '120px',
153
+            close: false,
154
+            ides:[]       
155
+          },
156
+           deleteIds: [], // 选择的id集合
157
+           total: 0,
158
+           listLoading: true, // 加载圈
159
+           listData: [],
160
+        }
161
+    },
162
+    mounted(){
163
+    this.dataQuery()
164
+    },
165
+    methods:{
166
+    dataQuery() { // 查询数据
167
+      this.listLoading = true
168
+      this.$store.dispatch('shopType/ShopAppraisalList', this.listQuery).then((res) => {
169
+        const resData = res.data
170
+        this.listData = resData.list
171
+        this.listQuery.pageNum = resData.list.current
172
+        this.listQuery.pageSize = resData.pageSize
173
+        this.total = resData.total
174
+        this.listLoading = false
175
+      }).catch(() => {
176
+        this.listLoading = false
177
+        console.log('error HotelRoom')
178
+      })
179
+    },
180
+    handleSizeChange(val) {
181
+      console.log(`每页 ${val} 条`)
182
+      this.listQuery.pageSize = val
183
+      this.dataQuery()
184
+    },
185
+    handleCurrentChange(val) {
186
+      console.log(`当前页: ${val}`)
187
+      this.listQuery.pageNum = val
188
+      this.dataQuery()
189
+    },
190
+    handleFilter() {
191
+      this.listQuery.id = ''
192
+      this.listQuery.shopName = ''
193
+      this.listQuery.score = ''
194
+      this.listQuery.content = ''
195
+      this.listQuery.appraisalPeople = ''
196
+      this.listQuery.appraisalTel = ''
197
+      this.listQuery.pageNum = 1
198
+      this.listQuery.pageSize = 10
199
+      this.dataQuery()
200
+    },
201
+    search() {
202
+      this.dataQuery()
203
+    },
204
+    handleSelectionChange(data) {
205
+      this.deleteIds = [] // 设置为 空
206
+      for (let i = 0; i < data.length; i++) {
207
+      this.deleteIds.push(data[i].id)
208
+    }
209
+    },
210
+     formatDate(val) {
211
+      if (val === null) {
212
+        return ''
213
+      }
214
+      var value = new Date(val)
215
+      var year = value.getFullYear()
216
+      var month = this.padDate(value.getMonth() + 1)
217
+      var day = this.padDate(value.getDate())
218
+      var hour = this.padDate(value.getHours())
219
+      var minutes = this.padDate(value.getMinutes())
220
+      var seconds = this.padDate(value.getSeconds())
221
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
222
+    },
223
+      padDate(value) {
224
+      value = value < 10 ? '0' + value : value
225
+      return value
226
+    },
227
+    enditandAdd(state){
228
+      const ids = this.deleteIds
229
+      if (ids.length < 1) {
230
+        this.$message.error('请选择一行数据进行修改!')
231
+        return
232
+      }
233
+      if (ids.length > 1 ) {
234
+        this.$message.error('只能选择一行数据进行修改!')
235
+        return
236
+      }  
237
+      this.shopAppraisalStatus(state)
238
+   
239
+    },
240
+    clickTitle(ids){
241
+    this.$router.push({ name: 'grogshop-grogshopRoomEdit', query: { id: ids}})
242
+    },
243
+     // 弹出层
244
+    replyAdd(){
245
+        this.listQuery.code = 1
246
+        console.log('code',this.listQuery.code)
247
+      const ids = this.deleteIds
248
+      if (ids.length < 1) {
249
+        this.$message.error('请选择一行数据进行添加!')
250
+        return
251
+      }
252
+       if (ids.length > 1 ) {
253
+        this.$message.error('只能选择一行数据进行添加!')
254
+        return
255
+      }  
256
+         this.listQuery.id = ids[0]
257
+          this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
258
+           if( res.data.shopAppraisalReplay !=null){
259
+             this.listQuery.id = ''
260
+              this.$message({
261
+              message: '您已回复当前评价',
262
+              type: 'warning'
263
+            });
264
+             return
265
+           }else{
266
+              this.listQuery.dialogFormVisible = true
267
+              this.ShopAppraisalDetails()
268
+           }       
269
+      }).catch(() => {
270
+        console.log('error ShopAppraisalDetails')
271
+      })
272
+    },
273
+    // 查看详情
274
+    ShopAppraisalDetails(state){
275
+         this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
276
+              this.listQuery.content = res.data.shopAppraisal.content
277
+      }).catch(() => {
278
+        console.log('error ShopAppraisalDetails')
279
+      })
280
+    },
281
+    // 回复评论
282
+    TransactionReplyAdd(){
283
+        if (this.listQuery.replayContent ==='') {
284
+        this.$message.error('请输入您的回复内容')
285
+        return
286
+      }
287
+      this.$store.dispatch('shopType/ShopAppraisalReplayAddandEditor', this.listQuery).then((res) => {
288
+            this.$message({
289
+            message: '成功',
290
+            type: 'success'
291
+            })
292
+            this.listQuery.dialogFormVisible = false
293
+            this.listQuery.replayContent = ''
294
+            this.listQuery.id = ''
295
+            this.listQuery.content = ''
296
+            this.dataQuery()
297
+      }).catch(() => {
298
+        console.log('error ShopAppraisalDetails')
299
+      })       
300
+    },
301
+    TransactionReplyOff(){
302
+     this.listQuery.dialogFormVisible = false
303
+     this.listQuery.replayContent = ''
304
+     this.listQuery.id = ''
305
+     this.listQuery.content = ''
306
+    },
307
+    // 修改回复
308
+    enditreply(){
309
+      this.listQuery.code = 2
310
+      const ids = this.deleteIds
311
+      if (ids.length < 1) {
312
+        this.$message.error('请选择一行数据进行修改!')
313
+        return
314
+      }
315
+       if (ids.length > 1 ) {
316
+        this.$message.error('只能选择一行数据进行修改!')
317
+        return
318
+      }  
319
+     this.listQuery.id = ids[0]
320
+     this.$store.dispatch('shopType/ShopAppraisalDetails', this.listQuery).then((res) => {
321
+              this.listQuery.content = res.data.shopAppraisal.content
322
+               if(res.data.shopAppraisalReplay == null){
323
+                 this.listQuery.id = ''
324
+                 this.$message({
325
+                  message: '请先回复当前评价内容',
326
+                  type: 'warning'
327
+                });
328
+                return                
329
+             }
330
+              this.listQuery.replayContent = res.data.shopAppraisalReplay.replayContent
331
+              this.listQuery.dialogFormVisible = true
332
+      }).catch(() => {
333
+        console.log('error ShopAppraisalDetails')
334
+      }) 
335
+    },
336
+    // 上架和下架
337
+    shopAppraisalStatus(state){
338
+      const ids = this.deleteIds
339
+      this.listQuery.ides = ids
340
+      this.listQuery.status = state
341
+      this.$store.dispatch('shopType/ShopAppraisalStatuss', this.listQuery).then((res) => {
342
+        this.listQuery.id = ''
343
+        this.dataQuery()
344
+      }).catch(() => {
345
+        console.log('error ShopAppraisalStatuss')
346
+      })       
347
+    },
348
+    // 修改权重
349
+    sort(id,sort) {
350
+        this.$prompt('请输入权重值', '提示', {
351
+          inputValue: sort,
352
+          confirmButtonText: '确定',
353
+          cancelButtonText: '取消',
354
+          inputPattern: /^[0-9]*$/,
355
+          inputErrorMessage: '请输入数字'
356
+        }).then(({ value }) => {
357
+          this.shopAppraisalStatus(value,id)
358
+        }).catch(() => {   
359
+        });
360
+      },
361
+      shopAppraisalStatus(sort,id){
362
+        this.listQuery.sort = sort
363
+        this.listQuery.id = id
364
+      this.$store.dispatch('shopType/ShopAppraisalSort', this.listQuery).then((res) => {
365
+         this.$message({
366
+            message: '修改成功',
367
+            type: 'success'
368
+            })
369
+        this.listQuery.id = ''
370
+        this.dataQuery()
371
+      }).catch(() => {
372
+        console.log('error ShopAppraisalStatuss')
373
+      })       
374
+    }
375
+  }
376
+}
377
+</script>
378
+
379
+<style>
380
+.form-listQuery{
381
+  margin-top: 20px;
382
+  margin-left: 30px;
383
+}
384
+.root{
385
+  display: flex;
386
+  flex-flow: column;
387
+}
388
+.block{
389
+  display: flex;
390
+  justify-content: flex-end;
391
+  margin-top: 10px;
392
+}
393
+.spanSize{
394
+    color:aqua
395
+}
396
+.textarea-inherit {
397
+        width: 100%;
398
+        overflow: auto;
399
+        word-break: break-all;
400
+        /* transform:translateY(5%);  */
401
+        margin-left: -2.5%;
402
+    }
403
+</style>