dingxin 6 år sedan
förälder
incheckning
560cbfbe64

+ 2
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Visa fil

@@ -342,10 +342,10 @@ public class SocialServiceImpl implements SocialServiceI {
342 342
         tpTransaction.setUuid(userElement.getUserVerifyId());
343 343
         tpTransaction.setUuidType("app");
344 344
         tpTransaction.setUuidName(userElement.getUserName());
345
-        tpTransaction.setCreateUser(userElement.getId());
345
+        tpTransaction.setCreateUser(userElement.getUserVerifyId());
346 346
         tpTransaction.setStatus("1");
347 347
         tpTransaction.setCreateDate(new Date());
348
-        tpTransaction.setUpdateUser(userElement.getId());
348
+        tpTransaction.setUpdateUser(userElement.getUserVerifyId());
349 349
         tpTransaction.setUpdateDate(new Date());
350 350
         TaUserVerify taUserVerify= taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
351 351
         tpTransaction.setRoomNoName(taUserVerify.getRoomNoName());

+ 6
- 3
CODE/smart-community/app-api/src/main/resources/mapper/TpRentalHouseMapper.xml Visa fil

@@ -566,13 +566,16 @@
566 566
       and community_id = #{communityId}
567 567
       and rh.house_status = 1
568 568
     </where>
569
-    order by rh.sort desc, update_date desc
569
+    <if test="priceFluctuate == 3">
570
+      order by rh.sort desc, update_date desc
571
+    </if>
572
+
570 573
     <if test="priceFluctuate == 1" >
571
-        , (rh.rental_price+0)  asc
574
+      order by (rh.rental_price+0)  asc, rh.sort desc, update_date desc
572 575
     </if>
573 576
 
574 577
     <if test="priceFluctuate == 2" >
575
-        , (rh.rental_price+0)  desc
578
+      order by (rh.rental_price+0)  desc, rh.sort desc, update_date desc
576 579
     </if>
577 580
   </select>
578 581
 </mapper>

+ 3
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BillController.java Visa fil

@@ -80,9 +80,10 @@ public class BillController extends BaseController {
80 80
 
81 81
     @ApiOperation(value = "上传缴费项接口, 预览", notes = "上传缴费项接口, 预览")
82 82
     @PostMapping(value = "/bill/uploadExcel/get", consumes = "multipart/*", headers = "content-type=multipart/form-data")
83
-    public ResponseBean getUploadExcel(@RequestParam("file") MultipartFile file) {
83
+    public ResponseBean getUploadExcel(@RequestParam("file") MultipartFile file, HttpSession session) {
84 84
         ResponseBean responseBean = new ResponseBean();
85
-        responseBean = iBillService.getExcelData(file);
85
+        UserElement userElement = getUserElement(session);
86
+        responseBean = iBillService.getExcelData(file, userElement);
86 87
         return responseBean;
87 88
     }
88 89
 

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBillService.java Visa fil

@@ -49,7 +49,7 @@ public interface IBillService extends IService<Bill> {
49 49
 	 * @param file
50 50
 	 * @return
51 51
 	 */
52
-    ResponseBean getExcelData(MultipartFile file);
52
+    ResponseBean getExcelData(MultipartFile file,  UserElement userElement);
53 53
 
54 54
 	/**
55 55
 	 * 上传excel, 解析 入库

+ 40
- 25
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Visa fil

@@ -158,14 +158,14 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
158 158
 
159 159
     @Override
160 160
     @Transactional(rollbackFor = Exception.class)
161
-    public ResponseBean getExcelData(MultipartFile file) {
161
+    public ResponseBean getExcelData(MultipartFile file, UserElement userElement) {
162 162
         ResponseBean responseBean = new ResponseBean();
163 163
         if (file == null) {
164 164
             responseBean.addError("对象不能为空");
165 165
             return responseBean;
166 166
         }
167 167
 
168
-        responseBean = getExcelData(file, responseBean);
168
+        responseBean = getExcelData(file, responseBean, userElement.getCommunityId());
169 169
         List<TempBill> tempBills = (List<TempBill>) responseBean.getData();
170 170
 
171 171
         Map<String, Object> map = Maps.newHashMap();
@@ -213,7 +213,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
213 213
             return responseBean;
214 214
         }
215 215
 
216
-        responseBean = getExcelData(file, responseBean);
216
+        responseBean = getExcelData(file, responseBean, userElement.getCommunityId());
217 217
         List<TempBill> tempBills = (List<TempBill>) responseBean.getData();
218 218
 
219 219
         Double sumDouble = 0.0;
@@ -273,9 +273,18 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
273 273
         // int rows = billMapper.insert(bill);
274 274
         boolean b = this.saveOrUpdate(bill);
275 275
         if (b) {
276
+            QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
277
+            queryWrapper.eq("community_id", userElement.getCommunityId());
278
+            queryWrapper.eq("message_type", "7");
279
+            queryWrapper.eq("model_type", "2");
280
+            queryWrapper.eq("source", "2");
281
+            queryWrapper.eq("status", "1");
282
+            queryWrapper.eq("advice_type","4");
283
+            queryWrapper.eq("bill_id", billId);
284
+            Message message = messageMapper.selectOne(queryWrapper);
276 285
             // 草稿时插入消息
277
-            if ("2".equals(bill.getBillStatus())) {
278
-                Message message = new Message();
286
+            if ("2".equals(bill.getBillStatus()) && null == message) {
287
+                message = new Message();
279 288
                 message.setCommunityId(userElement.getCommunityId());
280 289
                 message.setMessageType("7");
281 290
                 message.setAdviceType("4");
@@ -295,14 +304,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
295 304
             }
296 305
             // 发布时消息为无效
297 306
             if ("0".equals(bill.getBillStatus())) {
298
-                QueryWrapper<Message> queryWrapper = new QueryWrapper<>();
299
-                queryWrapper.eq("community_id", userElement.getCommunityId());
300
-                queryWrapper.eq("message_type", "7");
301
-                queryWrapper.eq("model_type", "2");
302
-                queryWrapper.eq("source", "2");
303
-                queryWrapper.eq("status", "1");
304
-                queryWrapper.eq("advice_type","4");
305
-                Message message = messageMapper.selectOne(queryWrapper);
306 307
                 if (null != message) {
307 308
                     message.setStatus("0");
308 309
                     message.setUpdateDate(LocalDateTime.now());
@@ -310,7 +311,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
310 311
                     messageMapper.updateById(message);
311 312
                 }
312 313
 
313
-
314 314
                 // 插入消息表, 消息类型为 消息
315 315
                 Message messageModel = new Message();
316 316
                 messageModel.setCommunityId(userElement.getCommunityId());
@@ -390,7 +390,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
390 390
         return responseBean;
391 391
     }
392 392
 
393
-    private ResponseBean getExcelData(MultipartFile file, ResponseBean responseBean) {
393
+    private ResponseBean getExcelData(MultipartFile file, ResponseBean responseBean, Integer communityId) {
394 394
 
395 395
         // 数据
396 396
         List<TempBill> tempBills = Lists.newArrayList();
@@ -424,26 +424,39 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
424 424
             int currentRow = i + 1;
425 425
             Row row = sheetAt.getRow(i);
426 426
             Cell cell = getCell(row.getCell(0));
427
+            if (null == cell) {
428
+                throw new WisdomException("第" + currentRow + "行 编号 不能为空");
429
+            }
430
+            // 获取编号
431
+            String roomId = cell.getStringCellValue().trim();
432
+            QueryWrapper<TpRoomNo> roomNoQueryWrapper = new QueryWrapper<>();
433
+            roomNoQueryWrapper.eq("community_id", communityId);
434
+            roomNoQueryWrapper.eq("id", roomId);
435
+            TpRoomNo tpRoomNo = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
436
+            if (null == tpRoomNo) {
437
+                throw new WisdomException("编号: " + roomId + " 不是本小区的房产");
438
+            }
439
+            cell = getCell(row.getCell(1));
427 440
             if (null == cell) {
428 441
                 throw new WisdomException("第" + currentRow + "行 期/区 不能为空");
429 442
             }
430 443
             String phase = cell.getStringCellValue().trim();
431
-            cell = getCell(row.getCell(1));
444
+            cell = getCell(row.getCell(2));
432 445
             if (null == cell) {
433 446
                 throw new WisdomException("第" + currentRow + "行 楼栋 不能为空");
434 447
             }
435 448
             String building = cell.getStringCellValue().trim();
436
-            cell = getCell(row.getCell(2));
449
+            cell = getCell(row.getCell(3));
437 450
             if (null == cell) {
438 451
                 throw new WisdomException("第" + currentRow + "行 单元 不能为空");
439 452
             }
440 453
             String unit = cell.getStringCellValue().trim();
441
-            cell = getCell(row.getCell(3));
454
+            cell = getCell(row.getCell(4));
442 455
             if (null == cell) {
443 456
                 throw new WisdomException("第" + currentRow + "行 楼层 不能为空");
444 457
             }
445 458
             String level = cell.getStringCellValue().trim();
446
-            cell = getCell(row.getCell(4));
459
+            cell = getCell(row.getCell(5));
447 460
             if (null == cell) {
448 461
                 throw new WisdomException("第" + currentRow + "行 房号 不能为空");
449 462
             }
@@ -451,7 +464,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
451 464
 
452 465
 
453 466
             // 收费说明可以为空
454
-            cell = getCell(row.getCell(5));
467
+            cell = getCell(row.getCell(6));
455 468
             String billExplain = null;
456 469
             if (null != cell) {
457 470
                 billExplain = cell.getStringCellValue().trim();
@@ -460,7 +473,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
460 473
                 }
461 474
             }
462 475
 
463
-            cell = getCell(row.getCell(6));
476
+            cell = getCell(row.getCell(7));
464 477
             if (null == cell) {
465 478
                 throw new WisdomException("第" + currentRow + "行 金额 不能为空");
466 479
             }
@@ -624,14 +637,16 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
624 637
                 TpRoomNo tpRoomNo = records.get(index);
625 638
                 row = sheet.createRow(currentRow);
626 639
                 cell = row.createCell(0);
627
-                cell.setCellValue(tpRoomNo.getPhaseName());
640
+                cell.setCellValue(tpRoomNo.getId() + "");
628 641
                 cell = row.createCell(1);
629
-                cell.setCellValue(tpRoomNo.getBuildingName());
642
+                cell.setCellValue(tpRoomNo.getPhaseName());
630 643
                 cell = row.createCell(2);
631
-                cell.setCellValue(tpRoomNo.getUnitName());
644
+                cell.setCellValue(tpRoomNo.getBuildingName());
632 645
                 cell = row.createCell(3);
633
-                cell.setCellValue(tpRoomNo.getLevelName());
646
+                cell.setCellValue(tpRoomNo.getUnitName());
634 647
                 cell = row.createCell(4);
648
+                cell.setCellValue(tpRoomNo.getLevelName());
649
+                cell = row.createCell(5);
635 650
                 cell.setCellValue(tpRoomNo.getName());
636 651
                 currentRow ++;
637 652
                 index ++;

Binär
CODE/smart-community/property-api/src/main/resources/缴费单模板.xls Visa fil


+ 1
- 1
VUECODE/smart-property-manage/config/dev.env.js Visa fil

@@ -4,5 +4,5 @@ const prodEnv = require('./prod.env')
4 4
 
5 5
 module.exports = merge(prodEnv, {
6 6
   NODE_ENV: '"development"',
7
-  BASE_API: '"http://106.14.20.193:8086/property-api"',
7
+  BASE_API: '"http://localhost:8086/property-api"',
8 8
 })

+ 4
- 4
VUECODE/smart-property-manage/src/router/index.js Visa fil

@@ -129,28 +129,28 @@ export const constantRouterMap = [
129 129
         component: () => import('@/views/social/transaction/transactionAdd'),
130 130
         name: 'transaction-add',
131 131
         hidden: true,
132
-        meta: { title: '添加二手求购', icon: 'table' }
132
+        meta: { title: '添加话题', icon: 'table' }
133 133
       },
134 134
       {
135 135
         path: '/transaction/transaction',
136 136
         component: () => import('@/views/social/transaction/transactionEdit'),
137 137
         name: 'transaction-edit',
138 138
         hidden: true,
139
-        meta: { title: '修改二手求购', icon: 'table' }
139
+        meta: { title: '修改话题', icon: 'table' }
140 140
       },
141 141
       {
142 142
         path: '/transaction/info',
143 143
         component: () => import('@/views/social/transaction/transactionDetails'),
144 144
         name: 'transaction-info',
145 145
         hidden: true,
146
-        meta: { title: '二手求购租赁详情', icon: 'table' }
146
+        meta: { title: '话题详情', icon: 'table' }
147 147
       },
148 148
       {
149 149
         path: '/transaction/reply',
150 150
         component: () => import('@/views/social/transaction/reply/transactionreply'),
151 151
         name: 'transactionreply-index',
152 152
         hidden: true,
153
-        meta: { title: '二手帖子回复列表', icon: 'table' }
153
+        meta: { title: '话题回复列表', icon: 'table' }
154 154
       },
155 155
       {
156 156
         path: '/transaction/transactionReport',

+ 16
- 5
VUECODE/smart-property-manage/src/views/bill/add/index.vue Visa fil

@@ -27,11 +27,12 @@
27 27
             :before-upload="beforeUpload"
28 28
             :data="ruleForm"
29 29
             :action="uploadUrl"
30
+            :headers="uploadHeaders"
30 31
             name="file"
31 32
             class="upload-demo"
32 33
             multiple>
33 34
             <el-button slot="trigger" size="small" type="primary">选取账单文件并预览</el-button>
34
-        </el-upload>
35
+          </el-upload>
35 36
         </el-col>
36 37
       </el-row>
37 38
       <span style="color: #99a9bf; font-size: 13px;">如果想修改下表的内容,请重新下载excel模板填写金额后上传,系统会直接删除下表所有旧数据,以新的excel内容为准</span>
@@ -52,8 +53,8 @@
52 53
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
53 54
         </el-table-column>
54 55
         <!--<el-table-column-->
55
-          <!--prop="ownerName"-->
56
-          <!--label="户主姓名"/>-->
56
+        <!--prop="ownerName"-->
57
+        <!--label="户主姓名"/>-->
57 58
         <el-table-column
58 59
           prop="billExplain"
59 60
           align="center"
@@ -85,7 +86,7 @@
85 86
 import { mapState, mapActions, mapMutations } from 'vuex'
86 87
 import waves from '@/directive/waves' // Waves directive
87 88
 import { parseTime } from '@/utils'
88
-
89
+import { getToken } from '@/utils/auth'
89 90
 export default {
90 91
   computed: {
91 92
     ...mapState('role', {
@@ -123,7 +124,10 @@ export default {
123 124
       total: 0,
124 125
       list: [], // 数据
125 126
       tempList: [], // 临时数据
126
-      files: '' // 文件
127
+      files: '', // 文件
128
+      uploadHeaders: { // 上传文件的请求头
129
+        'X-Auth-Token': getToken()
130
+      }
127 131
     }
128 132
   },
129 133
   created() {
@@ -169,6 +173,8 @@ export default {
169 173
         this.$message.error(response.message)
170 174
         return
171 175
       }
176
+      this.listQuery.pageNum = 1
177
+      this.listQuery.pageSize = 10
172 178
       this.tempList = response.data.list
173 179
       this.total = response.data.total
174 180
       this.list = this.getList()
@@ -312,6 +318,11 @@ export default {
312 318
         console.log('error BillDownloadExcel')
313 319
       })
314 320
     }
321
+    // uploadHeaders() { // 设置文件上传的请求头
322
+    //   const uploadHeaders = { 'X-Auth-Token': this.token }
323
+    //   console.log('上传缴费单Token: ', uploadHeaders)
324
+    //   return uploadHeaders
325
+    // }
315 326
   }
316 327
 }
317 328
 </script>

+ 19
- 3
VUECODE/smart-property-manage/src/views/social/transaction/index.vue Visa fil

@@ -210,8 +210,19 @@ export default {
210 210
         this.$message.error('请选择一行数据进行修改!')
211 211
         return
212 212
       }
213
-       let id= this.deleteIds[0]
214
-       this.$router.push({ name: 'transaction-edit', query: { id: id }})
213
+      let id= this.deleteIds[0]
214
+      this.$store.dispatch('transaction/TransactionById', id).then((res) => {
215
+        const tpTransactionData = res.data.tpTransaction
216
+        if(tpTransactionData.uuidType === 'prop' && this.$store.getters.userData.id === tpTransactionData.uuid){
217
+          this.$router.push({ name: 'transaction-edit', query: { id: id }})
218
+        }else{
219
+          this.$message.error('您不是话题发布人,无法修改')
220
+          return
221
+        }
222
+        }).catch(() => {
223
+          this.$message.error('您不是话题发布人,无法修改')
224
+          return
225
+        })
215 226
       },
216 227
     deleteTransaction(){
217 228
       const ids = this.deleteIds
@@ -268,7 +279,12 @@ export default {
268 279
       var year = value.getFullYear()
269 280
       var month = value.getMonth() + 1
270 281
       var day = value.getDate()
271
-      return year + '-' + month + '-' + day
282
+      var hour = this.padDate(value.getHours())
283
+      var minutes = this.padDate(value.getMinutes())
284
+      var seconds = this.padDate(value.getSeconds())
285
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
286
+      // return year + '-' + month + '-' + day
287
+      // return year + '-' + month + '-' + day
272 288
     },
273 289
     // 举报数量
274 290
     report(sum,id){

+ 4
- 1
VUECODE/smart-property-manage/src/views/social/transaction/reply/transactionreply.vue Visa fil

@@ -230,7 +230,10 @@ export default {
230 230
       var year = value.getFullYear()
231 231
       var month = value.getMonth() + 1
232 232
       var day = value.getDate()
233
-      return year + '-' + month + '-' + day
233
+      var hour = this.padDate(value.getHours())
234
+      var minutes = this.padDate(value.getMinutes())
235
+      var seconds = this.padDate(value.getSeconds())
236
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
234 237
     },
235 238
     // 弹出层
236 239
     TransactionReplyOpen(id){

+ 13
- 1
VUECODE/smart-property-manage/src/views/social/transaction/transactionDetails.vue Visa fil

@@ -144,7 +144,19 @@ export default {
144 144
       return year + '-' + month + '-' + day
145 145
     },
146 146
     edi() { 
147
-      this.$router.push({ name: 'transaction-edit', query: { id: this.ruleForm.id }})
147
+      this.$store.dispatch('transaction/TransactionById', this.ruleForm.id).then((res) => {
148
+        const tpTransactionData = res.data.tpTransaction
149
+        if(tpTransactionData.uuidType === 'prop' && this.$store.getters.userData.id === tpTransactionData.uuid){
150
+          this.$router.push({ name: 'transaction-edit', query: { id: this.ruleForm.id }})
151
+        }else{
152
+          this.$message.error('您不是话题发布人,无法修改')
153
+          return
154
+        }
155
+        }).catch(() => {
156
+          this.$message.error('您不是话题发布人,无法修改')
157
+          return
158
+        })
159
+      
148 160
     },
149 161
     // 查看此帖子的所有回复
150 162
     replyList(){

+ 4
- 1
VUECODE/smart-property-manage/src/views/social/transaction/transactionReport/report.vue Visa fil

@@ -127,7 +127,10 @@ export default {
127 127
       var year = value.getFullYear()
128 128
       var month = value.getMonth() + 1
129 129
       var day = value.getDate()
130
-      return year + '-' + month + '-' + day
130
+      var hour = this.padDate(value.getHours())
131
+      var minutes = this.padDate(value.getMinutes())
132
+      var seconds = this.padDate(value.getSeconds())
133
+      return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
131 134
     }
132 135
   }
133 136
 }