|
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
8
|
8
|
import com.huiju.estateagents.base.ResponseBean;
|
9
|
9
|
import com.huiju.estateagents.center.taUser.entity.TaUser;
|
10
|
10
|
import com.huiju.estateagents.center.taUser.mapper.TaUserMapper;
|
|
11
|
+import com.huiju.estateagents.common.DateUtils;
|
|
12
|
+import com.huiju.estateagents.common.StringUtils;
|
11
|
13
|
import com.huiju.estateagents.property.common.UserElement;
|
12
|
14
|
import com.huiju.estateagents.property.dao.*;
|
13
|
15
|
import com.huiju.estateagents.property.exception.WisdomException;
|
|
@@ -120,7 +122,10 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
120
|
122
|
respMap.put("list", invoiceIPage.getRecords());
|
121
|
123
|
respMap.put("billName", bill.getBillName());
|
122
|
124
|
respMap.put("billExplain", bill.getBillExplain());
|
|
125
|
+ respMap.put("startDate", bill.getStartDate());
|
123
|
126
|
respMap.put("endDate", bill.getEndDate());
|
|
127
|
+ respMap.put("communityId", bill.getCommunityId());
|
|
128
|
+
|
124
|
129
|
|
125
|
130
|
responseBean.addSuccess(respMap);
|
126
|
131
|
|
|
@@ -262,6 +267,13 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
262
|
267
|
JSONObject jsonObject = JSONObject.parseObject(parameter);
|
263
|
268
|
// 收费项ID
|
264
|
269
|
Integer billId = jsonObject.getInteger("billId");
|
|
270
|
+ //
|
|
271
|
+ Integer communityId = jsonObject.getInteger("communityId");
|
|
272
|
+
|
|
273
|
+ if (null == billId || null == communityId) {
|
|
274
|
+ return ResponseBean.error("收费ID或者小区不能为空", ResponseBean.ERROR_MISSING_PARAMS);
|
|
275
|
+ }
|
|
276
|
+
|
265
|
277
|
// 区/期
|
266
|
278
|
Integer phase = jsonObject.getInteger("phaseId");
|
267
|
279
|
// 栋
|
|
@@ -290,6 +302,7 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
290
|
302
|
// 校验 期/区/栋/单元/楼层/户号
|
291
|
303
|
QueryWrapper<TpRoomNo> roomNoQueryWrapper = new QueryWrapper<>();
|
292
|
304
|
roomNoQueryWrapper.eq("org_id", userElement.getOrgId());
|
|
305
|
+ roomNoQueryWrapper.eq("community_id", communityId);
|
293
|
306
|
roomNoQueryWrapper.eq("phase_id", phase);
|
294
|
307
|
roomNoQueryWrapper.eq("building_id", building);
|
295
|
308
|
roomNoQueryWrapper.eq("unit_id", unit);
|
|
@@ -386,7 +399,10 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
386
|
399
|
map.put("billId", billId);
|
387
|
400
|
map.put("orgId", userElement.getOrgId());
|
388
|
401
|
|
|
402
|
+ Bill bill = billMapper.selectById(billId);
|
|
403
|
+
|
389
|
404
|
List<BillInvoice> billInvoices = billInvoiceMapper.selectBillInvoiceTemp(map);
|
|
405
|
+ billInvoices.stream().forEach(e -> e.setCommunityId(bill.getCommunityId()));
|
390
|
406
|
|
391
|
407
|
responseBean.addSuccess(billInvoices);
|
392
|
408
|
return responseBean;
|
|
@@ -439,7 +455,7 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
439
|
455
|
@Override
|
440
|
456
|
public ResponseBean exportExcel(TaUser userElement, Integer billId) {
|
441
|
457
|
ResponseBean responseBean = new ResponseBean();
|
442
|
|
- String [] title = new String[] { "收费单号","房屋信息","收费单说明","金额(元)","流水","缴费状态","缴费人","缴费时间","新建时间","新建人","修改人","修改时间" };
|
|
458
|
+ String [] title = new String[] {"序号", "收费名称", "开始时间", "结束时间", "类别", "收费单号","期/区","楼栋","单元","房室","金额(元)","订单流水","缴费状态","缴费人","缴费时间" };
|
443
|
459
|
|
444
|
460
|
HSSFWorkbook excel = excel(title, userElement, billId,null);
|
445
|
461
|
responseBean.addSuccess(excel);
|
|
@@ -488,70 +504,109 @@ public class BillInvoiceServiceImpl extends ServiceImpl<BillInvoiceMapper, BillI
|
488
|
504
|
IPage<BillInvoice> billInvoiceIPage = billInvoiceMapper.selectBillInvoiceEffective(page, map);
|
489
|
505
|
List<BillInvoice> records = billInvoiceIPage.getRecords();
|
490
|
506
|
|
|
507
|
+ Bill bill = billMapper.selectById(billId);
|
|
508
|
+ if (null == bill) {
|
|
509
|
+ return workbook;
|
|
510
|
+ }
|
491
|
511
|
|
492
|
512
|
// 写入内容
|
|
513
|
+ int line = 0;
|
493
|
514
|
for (int i = 1; i<= billInvoiceIPage.getPages(); i++) {
|
494
|
515
|
for (int t = 0; t<records.size(); t++) {
|
|
516
|
+ line ++;
|
|
517
|
+ BillInvoice billInvoice = records.get(t);
|
495
|
518
|
row = sheet.createRow(++rowNum);
|
496
|
|
- // 收费单号
|
|
519
|
+
|
|
520
|
+ // 序号
|
497
|
521
|
cell = row.createCell(0);
|
498
|
|
- cell.setCellValue(records.get(t).getId());
|
|
522
|
+ cell.setCellValue(line);
|
499
|
523
|
cell.setCellStyle(style);
|
500
|
|
- // 房屋信息
|
|
524
|
+
|
|
525
|
+ // 收费名称
|
501
|
526
|
cell = row.createCell(1);
|
502
|
|
- cell.setCellValue(records.get(t).getPhase() + records.get(t).getBuilding() + records.get(t).getUnit() + records.get(t).getRoomNo());
|
|
527
|
+ cell.setCellValue(StringUtils.ifNull(billInvoice.getBillInvoiceExplain(), bill.getBillName()));
|
503
|
528
|
cell.setCellStyle(style);
|
504
|
|
- // 业主姓名
|
505
|
|
-// cell = row.createCell(2);
|
506
|
|
-// cell.setCellValue(records.get(t).getOwnerName());
|
507
|
|
-// cell.setCellStyle(style);
|
508
|
|
- // 收费单说明
|
|
529
|
+
|
|
530
|
+ // 开始时间
|
509
|
531
|
cell = row.createCell(2);
|
510
|
|
- cell.setCellValue(records.get(t).getBillInvoiceExplain());
|
|
532
|
+ cell.setCellValue(DateUtils.format(bill.getStartDate(), "yyyy-MM-dd"));
|
511
|
533
|
cell.setCellStyle(style);
|
512
|
|
- // 金额(元)
|
|
534
|
+
|
|
535
|
+ // 结束时间
|
513
|
536
|
cell = row.createCell(3);
|
514
|
|
- double price = Double.valueOf(records.get(t).getPayPrice()) / 100.00;
|
515
|
|
- cell.setCellValue(price);
|
|
537
|
+ cell.setCellValue(DateUtils.format(bill.getEndDate(), "yyyy-MM-dd"));
|
516
|
538
|
cell.setCellStyle(style);
|
517
|
|
- if (null != records.get(t).getBillStatementId()) {
|
518
|
|
- // 流水
|
519
|
|
- cell = row.createCell(4);
|
520
|
|
- cell.setCellValue(records.get(t).getBillStatementId());
|
521
|
|
- cell.setCellStyle(style);
|
522
|
|
- }
|
523
|
|
- // 缴费状态
|
|
539
|
+
|
|
540
|
+ // 类别
|
|
541
|
+ cell = row.createCell(4);
|
|
542
|
+ cell.setCellValue(bill.getIsTicket() ? "维修" : "物业");
|
|
543
|
+ cell.setCellStyle(style);
|
|
544
|
+
|
|
545
|
+ // 收费单号
|
524
|
546
|
cell = row.createCell(5);
|
525
|
|
- cell.setCellValue("0".equals(records.get(t).getBillStatus()) ? "未交费" : "1".equals(records.get(t).getBillStatus()) ? "已线上缴费" : "已线下缴费");
|
|
547
|
+ cell.setCellValue(billInvoice.getId());
|
526
|
548
|
cell.setCellStyle(style);
|
527
|
|
- // 缴费人
|
|
549
|
+
|
|
550
|
+ // 房屋信息
|
528
|
551
|
cell = row.createCell(6);
|
529
|
|
- cell.setCellValue(records.get(t).getPayName());
|
|
552
|
+ cell.setCellValue(billInvoice.getPhase());
|
530
|
553
|
cell.setCellStyle(style);
|
531
|
|
- if (null != records.get(t).getPayDate()) {
|
532
|
|
- // 缴费时间
|
533
|
|
- cell = row.createCell(7);
|
534
|
|
- cell.setCellValue(dateFormat.format(records.get(t).getPayDate()));
|
535
|
|
- cell.setCellStyle(style);
|
536
|
|
- }
|
537
|
|
- // 新建时间
|
|
554
|
+
|
|
555
|
+ cell = row.createCell(7);
|
|
556
|
+ cell.setCellValue(billInvoice.getBuilding());
|
|
557
|
+ cell.setCellStyle(style);
|
|
558
|
+
|
538
|
559
|
cell = row.createCell(8);
|
539
|
|
- cell.setCellValue(dateFormat.format(records.get(t).getCreateDate()));
|
|
560
|
+ cell.setCellValue(billInvoice.getUnit());
|
540
|
561
|
cell.setCellStyle(style);
|
541
|
|
- // 新建人
|
|
562
|
+
|
542
|
563
|
cell = row.createCell(9);
|
543
|
|
- cell.setCellValue(records.get(t).getCreateUserName());
|
|
564
|
+ cell.setCellValue(billInvoice.getRoomNo());
|
544
|
565
|
cell.setCellStyle(style);
|
545
|
|
- // 修改人
|
|
566
|
+
|
|
567
|
+ // 金额(元)
|
546
|
568
|
cell = row.createCell(10);
|
547
|
|
- cell.setCellValue(records.get(t).getUpdateUserName());
|
|
569
|
+ double price = Double.valueOf(billInvoice.getPayPrice()) / 100.00;
|
|
570
|
+ cell.setCellValue(price);
|
548
|
571
|
cell.setCellStyle(style);
|
549
|
|
- if (null != records.get(t).getUpdateDate()) {
|
550
|
|
- // 修改时间
|
|
572
|
+ if (null != billInvoice.getBillStatementId()) {
|
|
573
|
+ // 流水
|
551
|
574
|
cell = row.createCell(11);
|
552
|
|
- cell.setCellValue(dateFormat.format(records.get(t).getUpdateDate()));
|
|
575
|
+ cell.setCellValue(billInvoice.getBillStatementId());
|
|
576
|
+ cell.setCellStyle(style);
|
|
577
|
+ }
|
|
578
|
+ // 缴费状态
|
|
579
|
+ cell = row.createCell(12);
|
|
580
|
+ cell.setCellValue("0".equals(billInvoice.getBillStatus()) ? "未交费" : "1".equals(billInvoice.getBillStatus()) ? "已线上缴费" : "已线下缴费");
|
|
581
|
+ cell.setCellStyle(style);
|
|
582
|
+ // 缴费人
|
|
583
|
+ cell = row.createCell(13);
|
|
584
|
+ cell.setCellValue(billInvoice.getPayName());
|
|
585
|
+ cell.setCellStyle(style);
|
|
586
|
+ if (null != billInvoice.getPayDate()) {
|
|
587
|
+ // 缴费时间
|
|
588
|
+ cell = row.createCell(14);
|
|
589
|
+ cell.setCellValue(dateFormat.format(billInvoice.getPayDate()));
|
553
|
590
|
cell.setCellStyle(style);
|
554
|
591
|
}
|
|
592
|
+// // 新建时间
|
|
593
|
+// cell = row.createCell(8);
|
|
594
|
+// cell.setCellValue(dateFormat.format(billInvoice.getCreateDate()));
|
|
595
|
+// cell.setCellStyle(style);
|
|
596
|
+// // 新建人
|
|
597
|
+// cell = row.createCell(9);
|
|
598
|
+// cell.setCellValue(billInvoice.getCreateUserName());
|
|
599
|
+// cell.setCellStyle(style);
|
|
600
|
+// // 修改人
|
|
601
|
+// cell = row.createCell(10);
|
|
602
|
+// cell.setCellValue(billInvoice.getUpdateUserName());
|
|
603
|
+// cell.setCellStyle(style);
|
|
604
|
+// if (null != billInvoice.getUpdateDate()) {
|
|
605
|
+// // 修改时间
|
|
606
|
+// cell = row.createCell(11);
|
|
607
|
+// cell.setCellValue(dateFormat.format(billInvoice.getUpdateDate()));
|
|
608
|
+// cell.setCellStyle(style);
|
|
609
|
+// }
|
555
|
610
|
}
|
556
|
611
|
page.setCurrent(i);
|
557
|
612
|
page.setSize(500);
|