傅行帆 6 年前
父节点
当前提交
d4a339219c

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

304
         tpTransaction.setCreateDate(new Date());
304
         tpTransaction.setCreateDate(new Date());
305
         tpTransaction.setUpdateUser(userId);
305
         tpTransaction.setUpdateUser(userId);
306
         tpTransaction.setUpdateDate(new Date());
306
         tpTransaction.setUpdateDate(new Date());
307
+        tpTransaction.setIsReported("0");
307
 
308
 
308
         //判断身份是否为业主且状态为已停用
309
         //判断身份是否为业主且状态为已停用
309
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);
310
         TaSysRole sysRole = taSysRoleMapper.findRoleByUserId(userId);

+ 6
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpTransactionMapper.xml 查看文件

86
       <if test="type != null" >
86
       <if test="type != null" >
87
         type,
87
         type,
88
       </if>
88
       </if>
89
+      <if test="isReported != null" >
90
+        is_reported,
91
+      </if>
89
       <if test="createUser != null" >
92
       <if test="createUser != null" >
90
         create_user,
93
         create_user,
91
       </if>
94
       </if>
124
       <if test="type != null" >
127
       <if test="type != null" >
125
         #{type,jdbcType=CHAR},
128
         #{type,jdbcType=CHAR},
126
       </if>
129
       </if>
130
+      <if test="isReported != null" >
131
+        #{isReported,jdbcType=CHAR},
132
+      </if>
127
       <if test="createUser != null" >
133
       <if test="createUser != null" >
128
         #{createUser,jdbcType=INTEGER},
134
         #{createUser,jdbcType=INTEGER},
129
       </if>
135
       </if>

+ 14
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/TransactionController.java 查看文件

79
 		responseBean = transactionService.getTransactionInfo(id);
79
 		responseBean = transactionService.getTransactionInfo(id);
80
 		return responseBean;
80
 		return responseBean;
81
 	}
81
 	}
82
+	
83
+	@ApiOperation(value = "作废二手租赁", notes = "作废二手租赁")
84
+	@ApiImplicitParams({
85
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
86
+			@ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "Login-Type", value = "值为 web"),
87
+			@ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "id", value = "交易id")
88
+	})
89
+	@RequestMapping(value = "/transaction/update/{id}",method = RequestMethod.POST)
90
+	public ResponseBean updateTransaction(@PathVariable(value = "id") Integer id, HttpSession session){
91
+		ResponseBean responseBean = new ResponseBean();
92
+		UserElement userElement = getUserElement(session);
93
+		responseBean = transactionService.updateTransactionById(id,userElement.getId());
94
+		return responseBean;
95
+	}
82
 }
96
 }

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

23
 	 * @return
23
 	 * @return
24
 	 */
24
 	 */
25
 	ResponseBean getTransactionInfo(Integer id);
25
 	ResponseBean getTransactionInfo(Integer id);
26
+	
27
+	/**
28
+	 * 作废二手交易
29
+	 * @param id
30
+	 * @return
31
+	 */
32
+	ResponseBean updateTransactionById(Integer id,Integer userId);
26
 }
33
 }

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

17
 import org.springframework.beans.factory.annotation.Autowired;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.stereotype.Service;
18
 import org.springframework.stereotype.Service;
19
 
19
 
20
+import javax.xml.crypto.Data;
21
+import java.time.LocalDateTime;
22
+import java.util.Date;
20
 import java.util.List;
23
 import java.util.List;
21
 import java.util.Map;
24
 import java.util.Map;
22
 import java.util.stream.Collectors;
25
 import java.util.stream.Collectors;
73
 		responseBean.addSuccess(map);
76
 		responseBean.addSuccess(map);
74
 		return responseBean;
77
 		return responseBean;
75
 	}
78
 	}
79
+	
80
+	/**
81
+	 * 作废二手交易
82
+	 *
83
+	 * @param id
84
+	 * @return
85
+	 */
86
+	@Override
87
+	public ResponseBean updateTransactionById(Integer id,Integer userId) {
88
+		ResponseBean responseBean = new ResponseBean();
89
+		TpTransaction tpTransaction = new TpTransaction();
90
+		tpTransaction.setId(id);
91
+		tpTransaction.setStatus("0");
92
+		tpTransaction.setUpdateUser(userId);
93
+		tpTransaction.setUpdateDate(LocalDateTime.now());
94
+		int count = tpTransactionMapper.updateById(tpTransaction);
95
+		if (count > 0){
96
+			responseBean.addSuccess(count);
97
+			return responseBean;
98
+		}
99
+		responseBean.addError("作废出错");
100
+		return responseBean;
101
+	}
76
 }
102
 }

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

20
             1 = 1
20
             1 = 1
21
             AND t.community_id = #{tpTransaction.communityId}
21
             AND t.community_id = #{tpTransaction.communityId}
22
         <if test="tpTransaction.id != null and tpTransaction.id != ''">
22
         <if test="tpTransaction.id != null and tpTransaction.id != ''">
23
-            and t.id = #{tpTransaction.id}
23
+            and t.id like concat('%',#{tpTransaction.id},'%')
24
         </if>
24
         </if>
25
         <if test="tpTransaction.transactionTitle != null and tpTransaction.transactionTitle != ''">
25
         <if test="tpTransaction.transactionTitle != null and tpTransaction.transactionTitle != ''">
26
             and t.transaction_title like concat('%',#{tpTransaction.transactionTitle,jdbcType=VARCHAR},'%')
26
             and t.transaction_title like concat('%',#{tpTransaction.transactionTitle,jdbcType=VARCHAR},'%')

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

15
     method: 'get'
15
     method: 'get'
16
   })
16
   })
17
 }
17
 }
18
+
19
+// 作废 活动详情
20
+export function updateTransactionById(id) {
21
+  return request({
22
+    url: '/transaction/update/' + id,
23
+    method: 'post'
24
+  })
25
+}

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

1
-import { fetchList, transactionById } from '@/api/transaction'
1
+import { fetchList, transactionById, updateTransactionById } from '@/api/transaction'
2
 
2
 
3
 const transaction = {
3
 const transaction = {
4
   namespaced: true,
4
   namespaced: true,
38
           reject(error)
38
           reject(error)
39
         })
39
         })
40
       })
40
       })
41
+    },
42
+    UpdateTransactionById({ commit, state }, id) {
43
+      return new Promise((resolve, reject) => {
44
+        updateTransactionById(id).then(response => {
45
+          resolve(response)
46
+        }).catch(error => {
47
+          reject(error)
48
+        })
49
+      })
41
     }
50
     }
42
   }
51
   }
43
 }
52
 }

+ 0
- 5
VUECODE/smart-property-manage/src/views/social/transaction/index.vue 查看文件

24
       highlight-current-row
24
       highlight-current-row
25
       style="width: 100%; margin-top: 20px;"
25
       style="width: 100%; margin-top: 20px;"
26
       @sort-change="sortChange">
26
       @sort-change="sortChange">
27
-      <el-table-column
28
-        label="序号"
29
-        align="center"
30
-        type="index"
31
-        width="50"/>
32
       <el-table-column label="编号" align="center">
27
       <el-table-column label="编号" align="center">
33
         <template slot-scope="scope">
28
         <template slot-scope="scope">
34
           <span>{{ scope.row.id }}</span>
29
           <span>{{ scope.row.id }}</span>

+ 29
- 1
VUECODE/smart-property-manage/src/views/social/transaction/info/transactionInfo.vue 查看文件

7
     <div class="activityContextImg">
7
     <div class="activityContextImg">
8
       <img v-for="item in ruleForm.contentImg" :src="item" width="700" height="500" >
8
       <img v-for="item in ruleForm.contentImg" :src="item" width="700" height="500" >
9
     </div>
9
     </div>
10
+    <el-button v-if="ruleForm.status === '1'" type="primary" style="width: 130px;margin-left: 250px;" @click="invalid">作废</el-button>
10
   </div>
11
   </div>
11
 </template>
12
 </template>
12
 
13
 
19
       asOfdate: '2018/10/10 23:59:59',
20
       asOfdate: '2018/10/10 23:59:59',
20
       ruleForm: {
21
       ruleForm: {
21
         id: '',
22
         id: '',
23
+        status: '',
22
         transactionTitle: '',
24
         transactionTitle: '',
23
         transactionContent: '', // 交易内容详细
25
         transactionContent: '', // 交易内容详细
24
         contentImg: [] // 活动内容配图
26
         contentImg: [] // 活动内容配图
30
   },
32
   },
31
   methods: {
33
   methods: {
32
     ...mapActions('transaction', [
34
     ...mapActions('transaction', [
33
-      'TransactionById'
35
+      'TransactionById',
36
+      'UpdateTransactionById'
34
     ]),
37
     ]),
35
     getById(id) { // 根据ID获取活动信息
38
     getById(id) { // 根据ID获取活动信息
36
       this.TransactionById(id).then((res) => {
39
       this.TransactionById(id).then((res) => {
37
         const resData = res.data.tpTransaction
40
         const resData = res.data.tpTransaction
38
         this.ruleForm.transactionTitle = resData.transactionTitle
41
         this.ruleForm.transactionTitle = resData.transactionTitle
39
         this.ruleForm.transactionContent = resData.transactionContent
42
         this.ruleForm.transactionContent = resData.transactionContent
43
+        this.ruleForm.status = resData.status
40
         this.ruleForm.contentImg = res.data.list
44
         this.ruleForm.contentImg = res.data.list
41
       }).catch(() => {
45
       }).catch(() => {
42
         console.log('get list error')
46
         console.log('get list error')
43
       })
47
       })
48
+    },
49
+    invalid(){
50
+      this.$confirm('确定要作废此帖吗?作废相当于删除帖子, 是否继续?', '作废确认提示', {
51
+        confirmButtonText: '确定作废',
52
+        cancelButtonText: '取消',
53
+        type: 'warning'
54
+      }).then(() => {
55
+        this.UpdateTransactionById(this.$route.params.id).then((res) => {
56
+          if (res.code === '0') {
57
+          this.$message({
58
+            message: "作废成功",
59
+            type: 'success'
60
+          })
61
+          // 切换路由
62
+          this.$router.push({ name: 'transaction-import' })
63
+          return
64
+        }
65
+        this.$message.error(res.message)
66
+        }).catch(() => {
67
+          console.log('update error')
68
+        })
69
+      }).catch(() => {
70
+        console.log("cancel")        
71
+      });
44
     }
72
     }
45
   }
73
   }
46
 }
74
 }