Browse Source

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

魏熙美 6 years ago
parent
commit
c78c5655b5

+ 6
- 0
CODE/smart-community/app-api/pom.xml View File

@@ -195,6 +195,12 @@
195 195
             <groupId>mysql</groupId>
196 196
             <artifactId>mysql-connector-java</artifactId>
197 197
         </dependency>
198
+        <dependency>
199
+            <groupId>org.springframework</groupId>
200
+            <artifactId>spring-context</artifactId>
201
+            <version>5.1.5.RELEASE</version>
202
+            <scope>compile</scope>
203
+        </dependency>
198 204
 
199 205
 
200 206
     </dependencies>

+ 6
- 0
CODE/smart-community/property-api/pom.xml View File

@@ -203,6 +203,12 @@
203 203
 			<artifactId>fastjson</artifactId>
204 204
 			<version>1.2.56</version>
205 205
 		</dependency>
206
+        <dependency>
207
+            <groupId>com.google.guava</groupId>
208
+            <artifactId>guava</artifactId>
209
+            <version>27.1-jre</version>
210
+            <scope>compile</scope>
211
+        </dependency>
206 212
 
207 213
 
208 214
     </dependencies>

+ 11
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java View File

@@ -116,7 +116,8 @@ public class TransactionController extends BaseController {
116 116
 
117 117
 	@ApiOperation(value = "二手评论列表",nickname ="二手评论列表")
118 118
 	@ApiImplicitParams({
119
-			@ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value ="id:帖子id" )})
119
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value ="id:帖子id,replyTaUserName:被回复人,taUserName:回复人," +
120
+					"status:(0回复我的,1回复全部物业人员的,2全部物业人员回复的,3话题发起人回复的),createDate:时间" )})
120 121
 	@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token")
121 122
 	@RequestMapping(value="/transactionReplyList",method = RequestMethod.POST)
122 123
 	public ResponseBean transactionReplyList(@RequestBody String paramets, HttpSession session){
@@ -124,4 +125,13 @@ public class TransactionController extends BaseController {
124 125
 		ResponseBean  transactionReplyList= transactionService.transactionReplyList(paramets,userElement.getCommunityId(),userElement.getId());
125 126
 		return transactionReplyList;
126 127
 	}
128
+
129
+	@ApiOperation(value = "删除二手帖子评论",nickname ="删除二手帖子评论")
130
+	@ApiImplicitParams({
131
+			@ApiImplicitParam(paramType = "body", dataType = "String", name = "paramets", value ="id:帖子id(多个)" )})
132
+	@RequestMapping(value="/deleteReply",method = RequestMethod.POST)
133
+	public ResponseBean deleteReply(@RequestBody String paramets, HttpSession session){
134
+		ResponseBean  transactionsUpdata= transactionService.deleteReply(paramets);
135
+		return transactionsUpdata;
136
+	}
127 137
 }

+ 2
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TransactionReplyMapper.java View File

@@ -5,6 +5,7 @@ import com.community.huiju.model.TransactionReply;
5 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
6 6
 import org.apache.ibatis.annotations.Param;
7 7
 
8
+import java.util.Date;
8 9
 import java.util.List;
9 10
 
10 11
 /**
@@ -23,5 +24,5 @@ public interface TransactionReplyMapper extends BaseMapper<TransactionReply> {
23 24
      * @param id
24 25
      * @return
25 26
      */
26
-    List<TransactionReply> transactionReplyList(Page page, @Param("id") Integer id,@Param("userID") Integer userID,@Param("status") Integer status);
27
+    List<TransactionReply> transactionReplyList(Page page, @Param("id") Integer id, @Param("userID") Integer userID, @Param("status") Integer status,@Param("taUserName") String taUserName, @Param("createDate") Date createDate, @Param("replyTaUserName") String replyTaUserName);
27 28
 }

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

@@ -66,4 +66,11 @@ public interface ITransactionService extends IService<TpTransaction> {
66 66
 	 * @return
67 67
 	 */
68 68
 	ResponseBean transactionReplyList(String paramets, Integer communityId, Integer id);
69
+
70
+	/**
71
+	 * 删除二手帖子评论
72
+	 * @param paramets
73
+	 * @return
74
+	 */
75
+    ResponseBean deleteReply(String paramets);
69 76
 }

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

@@ -251,14 +251,20 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
251 251
 		ResponseBean responseBean = new ResponseBean();
252 252
 		JSONObject object= JSONObject.parseObject(paramets);
253 253
 		Integer id = object.getInteger("id");
254
+		/*回复*/
255
+		String replyTaUserName = object.getString("replyTaUserName");
256
+		/*被回复*/
257
+		String taUserName = object.getString("taUserName");
254 258
 		Integer status = object.getInteger("status");
259
+		Date createDate = object.getDate("createDate");
260
+
255 261
 		Integer pageNum = object.getInteger("pageNum");
256 262
 		Integer pageSize = object.getInteger("pageSize");
257 263
 		Page<TransactionReply> page = new Page<>();
258 264
 		page.setSize(pageSize == null ? 10 : pageSize);
259 265
 		page.setCurrent(pageNum == null ? 1 : pageNum);
260 266
 		// 分页查询
261
-		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,id,userID,status);
267
+		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,id,userID,status,taUserName,createDate,replyTaUserName);
262 268
 		//查询帖子评论所带图片
263 269
 
264 270
 		for (TransactionReply transactionReply:TransactionReplylList){
@@ -282,4 +288,17 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
282 288
 		responseBean.addSuccess(map);
283 289
 		return responseBean;
284 290
 	}
291
+
292
+	@Override
293
+	public ResponseBean deleteReply(String paramets) {
294
+		ResponseBean responseBean= new ResponseBean();
295
+		 JSONObject object= JSONObject.parseObject(paramets);
296
+	 	JSONArray array= object.getJSONArray("id");
297
+	 	Integer[]	Reply= array.toArray(new Integer[]{});
298
+	 	for (Integer id:Reply){
299
+			transactionReplyMapper.deleteById(id);
300
+		}
301
+	 	responseBean.addSuccess("成功");
302
+		return responseBean;
303
+	}
285 304
 }

+ 12
- 1
CODE/smart-community/property-api/src/main/resources/mapper/TransactionReplyMapper.xml View File

@@ -36,6 +36,17 @@
36 36
     AND re.release_identity in(1,2)
37 37
     AND re.ta_user_id = tr.create_user
38 38
     </if>
39
-    </select>
40 39
 
40
+    <if test="taUserName != null and taUserName !=''">
41
+        and re.ta_user_name like concat('%',#{ taUserName,jdbcType=VARCHAR},'%')
42
+    </if>
43
+
44
+    <if test="replyTaUserName != null and replyTaUserName !=''">
45
+        and re.reply_ta_user_name like concat('%',#{ replyTaUserName,jdbcType=VARCHAR},'%')
46
+    </if>
47
+
48
+    <if test="createDate != null">
49
+        and  date_format(re.create_date,'%Y%m%d')=date_format(#{createDate},'%Y%m%d')
50
+    </if>
51
+    </select>
41 52
 </mapper>

+ 32
- 7
VUECODE/smart-property-manage/src/api/transaction.js View File

@@ -23,7 +23,7 @@ export function updateTransactionById(id) {
23 23
     method: 'post'
24 24
   })
25 25
 }
26
-
26
+// 帖子列表
27 27
 export function transactionsList(data) {
28 28
   return request({
29 29
     url: '/transactions',
@@ -38,7 +38,7 @@ export function transactionsList(data) {
38 38
     }
39 39
   })
40 40
 }
41
-
41
+// 添加二手帖子
42 42
 export function transactionsAdd(data) {
43 43
   return request({
44 44
     url: '/transactions/add',
@@ -55,7 +55,7 @@ export function transactionsAdd(data) {
55 55
     }
56 56
   })
57 57
 }
58
-
58
+// 编辑二手帖子
59 59
 export function transactionsEdit(data) {
60 60
   return request({
61 61
     url: '/transactions/updata',
@@ -72,6 +72,7 @@ export function transactionsEdit(data) {
72 72
     }
73 73
   })
74 74
 }
75
+// 删除二手帖子
75 76
 export function transactionsDelete(data) {
76 77
   console.log('1111')
77 78
   console.log(data)
@@ -83,18 +84,42 @@ export function transactionsDelete(data) {
83 84
     }
84 85
   })
85 86
 }
86
-
87
+// 评论列表
87 88
 export function transactionReplyList(data) {
88 89
   return request({
89 90
     url: '/transactionReplyList',
90 91
     method: 'post',
91 92
     data: {
92
-      transactionTitle: data.transactionTitle,
93 93
       id: data.id,
94
-      userName: data.userName,
94
+      replyTaUserName: data.replyTaUserName,
95
+      taUserName: data.taUserName,
95 96
       status: data.status,
96 97
       pageNum: data.pageNum,
97
-      pageSize: data.pageSize
98
+      pageSize: data.pageSize,
99
+      createDate: data.dataValue
100
+    }
101
+  })
102
+}
103
+// 删除评论
104
+export function deleteReply(data) {
105
+  console.log(data)
106
+  return request({
107
+    url: '/deleteReply',
108
+    method: 'post',
109
+    data: {
110
+      id: data
111
+    }
112
+  })
113
+}
114
+// 添加评论
115
+export function transactionReplyAdd(data) {
116
+  return request({
117
+    url: '/TransactionReply/add',
118
+    method: 'post',
119
+    data: {
120
+      id: data.id,
121
+      contentImg: data.contentImg,
122
+      replyContent: data.replyContent
98 123
     }
99 124
   })
100 125
 }

+ 19
- 1
VUECODE/smart-property-manage/src/store/modules/transaction.js View File

@@ -1,4 +1,4 @@
1
-import { fetchList, transactionById, updateTransactionById, transactionsList, transactionsAdd, transactionsEdit, transactionsDelete, transactionReplyList } from '@/api/transaction'
1
+import { fetchList, transactionById, updateTransactionById, transactionsList, transactionsAdd, transactionsEdit, transactionsDelete, transactionReplyList, deleteReply, transactionReplyAdd } from '@/api/transaction'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -92,6 +92,24 @@ const transaction = {
92 92
           reject(error)
93 93
         })
94 94
       })
95
+    },
96
+    DeleteReply({ commit }, data) {
97
+      return new Promise((resolve, reject) => {
98
+        deleteReply(data).then(response => {
99
+          resolve(response)
100
+        }).catch(error => {
101
+          reject(error)
102
+        })
103
+      })
104
+    },
105
+    TransactionReplyAdd({ commit }, data) {
106
+      return new Promise((resolve, reject) => {
107
+        transactionReplyAdd(data).then(response => {
108
+          resolve(response)
109
+        }).catch(error => {
110
+          reject(error)
111
+        })
112
+      })
95 113
     }
96 114
   }
97 115
 }

+ 94
- 33
VUECODE/smart-property-manage/src/views/social/transaction/reply/transactionreply.vue View File

@@ -34,7 +34,7 @@
34 34
       </el-form-item>
35 35
     </el-form>
36 36
     <div class="button">
37
-      <el-button type="danger" >作废</el-button>
37
+      <el-button type="danger" @click="deleteReply">作废</el-button>
38 38
     </div>
39 39
     <el-table
40 40
       v-loading="listLoading"
@@ -57,7 +57,7 @@
57 57
       <el-table-column prop="replyTaUserName" label="被回复人" align="center"/>
58 58
       <el-table-column prop="createDate" label="时间" align="center"><template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template></el-table-column>
59 59
       <el-table-column prop="viewCount" label="操作" align="center">
60
-      <template slot-scope="scope"><a><span style="color: #63B8FF" @click="TransactionReplyAdd(scope.row.id)">{{ '回复此回复' }}</span></a></template>
60
+      <template slot-scope="scope"><a><span style="color: #63B8FF" @click="TransactionReplyOpen(scope.row.id)">{{ '回复此回复' }}</span></a></template>
61 61
       </el-table-column>  
62 62
     </el-table>
63 63
     <div class="block">
@@ -70,6 +70,33 @@
70 70
         @size-change="handleSizeChange"
71 71
         @current-change="handleCurrentChange"/>
72 72
     </div>
73
+    <el-dialog title="回复发帖人" :visible.sync="listQuery.dialogFormVisible" :show-close="listQuery.close">
74
+      <el-form :model="listQuery">
75
+        <el-form-item label="活动名称" :label-width="listQuery.formLabelWidth">
76
+          <textarea v-model="listQuery.textContent" placeholder="回复TA或向TA提问" class="textarea-inherit" id="message_textarea" rows="8"></textarea> 
77
+        </el-form-item>
78
+        <el-form-item>
79
+        <el-upload
80
+          :limit="8"
81
+          :on-preview="handlePictureCardPreview"
82
+          :on-remove="handleRemove"
83
+          :on-success="handleSuccessContentImg"
84
+          :file-list="contentImgList"
85
+          name="uploadFiles"
86
+          action="http://106.14.20.193:8086/property-api/uploadimage"
87
+          list-type="picture-card">
88
+          <i class="el-icon-plus"/>
89
+        </el-upload>
90
+        <el-dialog :visible.sync="dialogVisible">
91
+          <img :src="dialogImageUrl" width="100%" alt="">
92
+        </el-dialog>
93
+      </el-form-item>
94
+      </el-form>
95
+      <div slot="footer" class="dialog-footer">
96
+        <el-button @click="TransactionReplyOff">取 消</el-button>
97
+        <el-button type="primary" @click="TransactionReplyAdd()">确 定</el-button>
98
+      </div>
99
+    </el-dialog>
73 100
   </div>
74 101
 </template>
75 102
 
@@ -90,8 +117,16 @@ export default {
90 117
 				taUserName: '',
91 118
 				transactionId: '',
92 119
         pageNum: '1',
93
-        pageSize: 10
120
+        pageSize: 10,
121
+        dataValue: '',
122
+        dialogFormVisible: false,
123
+        formLabelWidth: '120px',
124
+        contentImg: [], 
125
+        close: false  
94 126
       },
127
+      contentImgList: [],
128
+      dialogVisible: false,
129
+      dialogImageUrl: '',
95 130
       total: 0, // 数据总数
96 131
       transactionsList: [],
97 132
       deleteIds: [], // 选择的id集合
@@ -121,28 +156,20 @@ export default {
121 156
       value = value < 10 ? '0' + value : value
122 157
       return value
123 158
     },
124
-    getStatus(row) { // 获取状态
125
-      // let statusName = ''
126
-
127
-      // // 判断状态
128
-      // // switch (row.status) {
129
-      // //   case '0':
130
-      // //     statusName = '已作废'
131
-      // //     break
132
-      // //   case '1':
133
-      // //     statusName = '已发布'
134
-      // //     break
135
-      // //   case '2':
136
-      // //     statusName = '草稿'
137
-      // //     break
138
-      // // }
139
-
140
-      // // 如果修改时间和创建时间不一致, 就显示已修改
141
-      // if (row.status === '1' && (row.updateDate > row.createDate)) {
142
-      //   statusName = '已修改'
143
-      // }
144
-
145
-      // return statusName
159
+    handlePictureCardPreview(file) { //配图文件列表中已上传的文件时的钩子
160
+      this.dialogImageUrl = file.url
161
+      this.dialogVisible = true
162
+    },
163
+    handleRemove(file, fileList) { //配图移除时
164
+      this.listQuery.contentImg = []
165
+      for (let i = 0; i < fileList.length; i++) {
166
+        this.listQuery.contentImg.push(fileList[i].response.data[0])
167
+      }
168
+      console.log(file, fileList)
169
+    },
170
+    handleSuccessContentImg(response, file, fileList) { // 配图上传成功时回调
171
+      const resImg = response.data[0]
172
+      this.listQuery.contentImg.push(resImg)
146 173
     },
147 174
     dataQuery() { // 查询数据
148 175
       this.listLoading = true
@@ -173,16 +200,20 @@ export default {
173 200
       this.listQuery.pageNum = 1
174 201
       this.listQuery.pageSize = 10
175 202
       this.listQuery.ownerName =''
176
-      this.listQuery.id=''
177 203
       this.listQuery.status=''
178
-      this.listQuery.userName=''
204
+      this.listQuery.taUserName=''
205
+      this.listQuery.dataValue=''
206
+      this.listQuery.dataValue=''
207
+      this.listQuery.replyTaUserName=''
179 208
       this.dataQuery()
180 209
     },
181
-    deleteId(){
210
+    deleteReply(){
182 211
       const ids = this.deleteIds
183 212
       this.listLoading = true
184
-      console.log(ids)
185
-      this.$store.dispatch('transaction/TransactionsDelete', ids).then((res) => {
213
+      if(ids<1){
214
+      this.$message.error('请选择一条数据')
215
+        }
216
+      this.$store.dispatch('transaction/DeleteReply', ids).then((res) => {
186 217
         this.listLoading = false
187 218
         this.dataQuery()
188 219
       }).catch(() => {
@@ -191,8 +222,6 @@ export default {
191 222
       })
192 223
     },
193 224
 
194
-
195
-    
196 225
     formatDate(val) {
197 226
       if (val === null) {
198 227
         return ''
@@ -202,7 +231,34 @@ export default {
202 231
       var month = value.getMonth() + 1
203 232
       var day = value.getDate()
204 233
       return year + '-' + month + '-' + day
205
-    }
234
+    },
235
+    // 弹出层
236
+    TransactionReplyOpen(id){
237
+      this.listQuery.dialogFormVisible = true
238
+      this.listQuery.id = id
239
+    },
240
+    // 取消
241
+    TransactionReplyOff(){
242
+       this.listQuery.dialogFormVisible = false
243
+       this.contentImgList = []
244
+       console.log('this.contentImgList',this.contentImgList)
245
+       this.listQuery.contentImg = []
246
+       console.log(' this.listQuery.contentImg', this.listQuery.contentImg)
247
+       this.dataQuery()
248
+    },
249
+    // 添加评论
250
+    TransactionReplyAdd(){
251
+       this.listQuery.dialogFormVisible = false
252
+       console.log(this.listQuery.id,'this.listQuery.id')
253
+       
254
+        this.$store.dispatch('transaction/TransactionReplyAdd', this.listQuery).then((res) => {
255
+        this.listLoading = false
256
+        this.dataQuery()
257
+      }).catch(() => {
258
+        this.listLoading = false
259
+        console.log('error TransactionReplyAdd')
260
+      })
261
+    } 
206 262
   }
207 263
 }
208 264
 </script>
@@ -230,5 +286,10 @@ export default {
230 286
 .button {
231 287
   margin-left: 20px;
232 288
 }
289
+.textarea-inherit {
290
+        width: 100%;
291
+        overflow: auto;
292
+        word-break: break-all; 
293
+    }
233 294
 </style>
234 295