dingxin 6 年之前
父節點
當前提交
56b837548f

+ 6
- 0
CODE/smart-community/app-api/pom.xml 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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="/transactions/delete",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 查看文件

@@ -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 查看文件

@@ -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
 }

+ 7
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TransactionServiceImpl.java 查看文件

@@ -13,7 +13,6 @@ import com.community.huiju.model.*;
13 13
 import com.community.huiju.service.ITransactionService;
14 14
 import com.google.common.collect.Maps;
15 15
 import org.springframework.beans.factory.annotation.Autowired;
16
-import org.springframework.stereotype.Service;
17 16
 
18 17
 import javax.xml.crypto.Data;
19 18
 import java.time.LocalDateTime;
@@ -251,14 +250,20 @@ public class TransactionServiceImpl extends ServiceImpl<TpTransactionMapper, TpT
251 250
 		ResponseBean responseBean = new ResponseBean();
252 251
 		JSONObject object= JSONObject.parseObject(paramets);
253 252
 		Integer id = object.getInteger("id");
253
+		/*回复*/
254
+		String replyTaUserName = object.getString("replyTaUserName");
255
+		/*被回复*/
256
+		String taUserName = object.getString("taUserName");
254 257
 		Integer status = object.getInteger("status");
258
+		Date createDate = object.getDate("createDate");
259
+
255 260
 		Integer pageNum = object.getInteger("pageNum");
256 261
 		Integer pageSize = object.getInteger("pageSize");
257 262
 		Page<TransactionReply> page = new Page<>();
258 263
 		page.setSize(pageSize == null ? 10 : pageSize);
259 264
 		page.setCurrent(pageNum == null ? 1 : pageNum);
260 265
 		// 分页查询
261
-		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,id,userID,status);
266
+		List<TransactionReply> TransactionReplylList = transactionReplyMapper.transactionReplyList(page,id,userID,status,taUserName,createDate,replyTaUserName);
262 267
 		//查询帖子评论所带图片
263 268
 
264 269
 		for (TransactionReply transactionReply:TransactionReplylList){

+ 12
- 1
CODE/smart-community/property-api/src/main/resources/mapper/TransactionReplyMapper.xml 查看文件

@@ -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>

+ 15
- 3
VUECODE/smart-property-manage/src/api/transaction.js 查看文件

@@ -89,12 +89,24 @@ export function transactionReplyList(data) {
89 89
     url: '/transactionReplyList',
90 90
     method: 'post',
91 91
     data: {
92
-      transactionTitle: data.transactionTitle,
93 92
       id: data.id,
94
-      userName: data.userName,
93
+      replyTaUserName: data.replyTaUserName,
94
+      taUserName: data.taUserName,
95 95
       status: data.status,
96 96
       pageNum: data.pageNum,
97
-      pageSize: data.pageSize
97
+      pageSize: data.pageSize,
98
+      createDate: data.dataValue
99
+    }
100
+  })
101
+}
102
+
103
+export function deleteReply(data) {
104
+  console.log(data)
105
+  return request({
106
+    url: '/deleteReply',
107
+    method: 'post',
108
+    data: {
109
+      id: data
98 110
     }
99 111
   })
100 112
 }

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/transaction.js 查看文件

@@ -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 } from '@/api/transaction'
2 2
 
3 3
 const transaction = {
4 4
   namespaced: true,
@@ -92,6 +92,15 @@ 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
+      })
95 104
     }
96 105
   }
97 106
 }

+ 12
- 9
VUECODE/smart-property-manage/src/views/social/transaction/reply/transactionreply.vue 查看文件

@@ -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"
@@ -90,7 +90,8 @@ export default {
90 90
 				taUserName: '',
91 91
 				transactionId: '',
92 92
         pageNum: '1',
93
-        pageSize: 10
93
+        pageSize: 10,
94
+        dataValue: ''
94 95
       },
95 96
       total: 0, // 数据总数
96 97
       transactionsList: [],
@@ -173,16 +174,20 @@ export default {
173 174
       this.listQuery.pageNum = 1
174 175
       this.listQuery.pageSize = 10
175 176
       this.listQuery.ownerName =''
176
-      this.listQuery.id=''
177 177
       this.listQuery.status=''
178
-      this.listQuery.userName=''
178
+      this.listQuery.taUserName=''
179
+      this.listQuery.dataValue=''
180
+      this.listQuery.dataValue=''
181
+      this.listQuery.replyTaUserName=''
179 182
       this.dataQuery()
180 183
     },
181
-    deleteId(){
184
+    deleteReply(){
182 185
       const ids = this.deleteIds
183 186
       this.listLoading = true
184
-      console.log(ids)
185
-      this.$store.dispatch('transaction/TransactionsDelete', ids).then((res) => {
187
+      if(ids<1){
188
+      this.$message.error('请选择一条数据')
189
+        }
190
+      this.$store.dispatch('transaction/DeleteReply', ids).then((res) => {
186 191
         this.listLoading = false
187 192
         this.dataQuery()
188 193
       }).catch(() => {
@@ -191,8 +196,6 @@ export default {
191 196
       })
192 197
     },
193 198
 
194
-
195
-    
196 199
     formatDate(val) {
197 200
       if (val === null) {
198 201
         return ''