张延森 4 年前
父节点
当前提交
ad1599163a

+ 0
- 2
src/main/java/com/huiju/estateagents/EstateagentsApplication.java 查看文件

@@ -1,6 +1,5 @@
1 1
 package com.huiju.estateagents;
2 2
 
3
-import com.huiju.estateagents.websocket.ChatServer;
4 3
 import org.springframework.boot.SpringApplication;
5 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6 5
 import org.springframework.context.ConfigurableApplicationContext;
@@ -15,7 +14,6 @@ public class EstateagentsApplication {
15 14
 	public static void main(String[] args) {
16 15
 		SpringApplication springApplication = new SpringApplication(EstateagentsApplication.class);
17 16
 		ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
18
-//		ChatServer.setApplicationContext(configurableApplicationContext);
19 17
 	}
20 18
 
21 19
 }

+ 10
- 0
src/main/java/com/huiju/estateagents/common/DateUtils.java 查看文件

@@ -6,6 +6,7 @@ import java.time.LocalDateTime;
6 6
 import java.time.ZoneId;
7 7
 import java.time.format.DateTimeFormatter;
8 8
 import java.util.Date;
9
+import java.util.Locale;
9 10
 
10 11
 public class DateUtils {
11 12
     public static LocalDateTime date2LocalDateTime(Date date) {
@@ -123,4 +124,13 @@ public class DateUtils {
123 124
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
124 125
         return LocalDateTime.parse(target, df);
125 126
     }
127
+
128
+    public static LocalDateTime parse(String str, String format) {
129
+        if (null == str || "".equals(str) || "null".equals(str) || "undefined".equals(str)) {
130
+            return null;
131
+        }
132
+
133
+        DateTimeFormatter df = DateTimeFormatter.ofPattern(format, Locale.CHINA);
134
+        return LocalDateTime.parse(str, df);
135
+    }
126 136
 }

+ 22
- 19
src/main/java/com/huiju/estateagents/property/controller/BillController.java 查看文件

@@ -4,7 +4,8 @@ package com.huiju.estateagents.property.controller;
4 4
 import com.huiju.estateagents.base.BaseController;
5 5
 import com.huiju.estateagents.base.ResponseBean;
6 6
 import com.huiju.estateagents.center.taUser.entity.TaUser;
7
-import com.huiju.estateagents.property.common.UserElement;
7
+import com.huiju.estateagents.common.DateUtils;
8
+import com.huiju.estateagents.common.StringUtils;
8 9
 import com.huiju.estateagents.property.model.Bill;
9 10
 import com.huiju.estateagents.property.service.IBillService;
10 11
 import io.swagger.annotations.Api;
@@ -20,9 +21,7 @@ import javax.servlet.http.HttpServletRequest;
20 21
 import javax.servlet.http.HttpServletResponse;
21 22
 import javax.servlet.http.HttpSession;
22 23
 import java.io.OutputStream;
23
-import java.text.ParseException;
24
-import java.text.SimpleDateFormat;
25
-import java.util.Date;
24
+import java.time.LocalDateTime;
26 25
 import java.util.List;
27 26
 import java.util.Map;
28 27
 
@@ -52,17 +51,23 @@ public class BillController extends BaseController {
52 51
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
53 52
     })
54 53
     @RequestMapping(value = "/admin/bills",method = RequestMethod.GET)
55
-    public ResponseBean getList(@RequestParam(value = "billId", required = false) Integer billId,
54
+    public ResponseBean getList(@RequestParam("communityId") Integer communityId,
55
+                                @RequestParam(value = "billId", required = false) Integer billId,
56 56
                                 @RequestParam(value = "billName", required = false) String billName,
57
-                                @RequestParam(value = "billExplain", required = false) String billExplain,
57
+                                @RequestParam(value = "startDate", required = false) String startDate,
58
+                                @RequestParam(value = "endDate", required = false) String endDate,
59
+                                @RequestParam(value = "isTicket", required = false) Boolean isTicket,
58 60
                                 @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
59 61
                                 @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize, HttpServletRequest request){
60 62
         ResponseBean responseBean = new ResponseBean();
61 63
         TaUser userElement = getTaUser(request);
62 64
         Bill bill = new Bill();
63 65
         bill.setId(billId);
66
+        bill.setCommunityId(communityId);
64 67
         bill.setBillName(billName);
65
-        bill.setBillExplain(billExplain);
68
+        bill.setIsTicket(isTicket);
69
+        bill.setStartDate(!StringUtils.isEmpty(startDate) ? DateUtils.parse(startDate + " 00:00:00", "yyyy-MM-dd HH:mm:ss") : null);
70
+        bill.setEndDate(!StringUtils.isEmpty(startDate) ? DateUtils.parse(endDate + " 23:59:59", "yyyy-MM-dd HH:mm:ss") : null);
66 71
         bill.setOrgId(userElement.getOrgId());
67 72
         responseBean = iBillService.getBillList(bill,pageNum,pageSize);
68 73
         return responseBean;
@@ -91,23 +96,21 @@ public class BillController extends BaseController {
91 96
     // @ApiOperation(value = "上传缴费项接口, 保存/修改", notes = "上传缴费项接口, 保存/修改")
92 97
     @PostMapping(value = "/admin/bill/uploadExcel/add", consumes = "multipart/*", headers = "content-type=multipart/form-data")
93 98
     public ResponseBean addUploadExcel(HttpServletRequest request,
99
+                                       @RequestParam("communityId") Integer communityId,
94 100
                                        @RequestParam(value = "billId", required = false) Integer billId,
95 101
                                        @RequestParam(value = "file", required = false) MultipartFile file,
96
-                                       @RequestParam("billExplain") String billExplain,
102
+//                                       @RequestParam("billExplain") String billExplain,
97 103
                                        @RequestParam("billName") String billName,
98
-                                       @RequestParam("endDate") Date endDate,
104
+                                       @RequestParam("startDate") String startDate,
105
+                                       @RequestParam("endDate") String endDate,
99 106
                                        @RequestParam("billStatus") String billStatus) {
100 107
         ResponseBean responseBean = new ResponseBean();
101 108
         TaUser userElement = getTaUser(request);
102
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
103
-//        Date date = null;
104
-//        try {
105
-//            String d = simpleDateFormat.format(new Long(endDate));
106
-//            date = simpleDateFormat.parse(d);
107
-//        } catch (ParseException e) {
108
-//            e.printStackTrace();
109
-//        }
110
-        responseBean = iBillService.getExcelData(billId, file, billExplain, billName, endDate, billStatus, userElement);
109
+
110
+        LocalDateTime stDate = DateUtils.parse(startDate + " 00:00:00", "yyyy-MM-dd HH:mm:ss");
111
+        LocalDateTime edDate = DateUtils.parse(endDate + " 23:59:59", "yyyy-MM-dd HH:mm:ss");
112
+
113
+        responseBean = iBillService.saveExcelData(billId, file, communityId, billName, stDate, edDate, billStatus, userElement);
111 114
         return responseBean;
112 115
     }
113 116
 
@@ -149,7 +152,7 @@ public class BillController extends BaseController {
149 152
 
150 153
     })
151 154
     @RequestMapping(value = "/admin/bill/downloadExcel", method = RequestMethod.GET)
152
-    public void exportExcel(@RequestParam(value = "phaseId") Integer communityId,
155
+    public void exportExcel(@RequestParam(value = "communityId") Integer communityId,
153 156
                             @RequestParam(value = "phaseId",required = false) String phaseId,
154 157
                             @RequestParam(value = "buildingId",required = false) String buildingId,
155 158
                             HttpServletResponse response, HttpServletRequest request) {

+ 3
- 2
src/main/java/com/huiju/estateagents/property/controller/BillInvoiceController.java 查看文件

@@ -6,6 +6,7 @@ import com.huiju.estateagents.base.BaseController;
6 6
 import com.huiju.estateagents.base.ResponseBean;
7 7
 import com.huiju.estateagents.center.taUser.entity.TaUser;
8 8
 import com.huiju.estateagents.property.common.UserElement;
9
+import com.huiju.estateagents.property.model.Bill;
9 10
 import com.huiju.estateagents.property.model.BillInvoice;
10 11
 import com.huiju.estateagents.property.service.IBillInvoiceService;
11 12
 import com.huiju.estateagents.property.service.IBillService;
@@ -64,11 +65,11 @@ public class BillInvoiceController extends BaseController {
64 65
 
65 66
     })
66 67
     @RequestMapping(value = "/admin/bill/invoice/updateBill", method = RequestMethod.PUT)
67
-    public ResponseBean updateBill(HttpServletRequest request, @RequestBody String parameter) {
68
+    public ResponseBean updateBill(HttpServletRequest request, @RequestBody Bill bill) {
68 69
         ResponseBean responseBean = new ResponseBean();
69 70
 
70 71
         TaUser userElement = getTaUser(request);
71
-        responseBean = iBillService.updateBillNameAndBillExplainAndEndDate(userElement, parameter);
72
+        responseBean = iBillService.updateBillNameAndBillExplainAndEndDate(userElement, bill);
72 73
         return responseBean;
73 74
     }
74 75
 

+ 47
- 0
src/main/java/com/huiju/estateagents/property/entity/TpBillType.java 查看文件

@@ -0,0 +1,47 @@
1
+package com.huiju.estateagents.property.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import io.swagger.annotations.ApiModel;
6
+import io.swagger.annotations.ApiModelProperty;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+import java.io.Serializable;
12
+import java.time.LocalDateTime;
13
+
14
+/**
15
+ * <p>
16
+ * 
17
+ * </p>
18
+ *
19
+ * @author yansen
20
+ * @since 2021-01-19
21
+ */
22
+@Data
23
+@EqualsAndHashCode(callSuper = false)
24
+@Accessors(chain = true)
25
+@ApiModel(value="TpBillType 对象", description="")
26
+public class TpBillType implements Serializable {
27
+
28
+    private static final long serialVersionUID = 1L;
29
+
30
+    @ApiModelProperty(value = "ID")
31
+    @TableId(value = "id", type = IdType.AUTO)
32
+    private Integer id;
33
+
34
+    @ApiModelProperty(value = "名称")
35
+    private String name;
36
+
37
+    @ApiModelProperty(value = "状态")
38
+    private Integer status;
39
+
40
+    @ApiModelProperty(value = "创建时间")
41
+    private LocalDateTime createDate;
42
+
43
+    @ApiModelProperty(value = "所属机构")
44
+    private Integer orgId;
45
+
46
+
47
+}

+ 17
- 0
src/main/java/com/huiju/estateagents/property/mapper/TpBillTypeMapper.java 查看文件

@@ -0,0 +1,17 @@
1
+package com.huiju.estateagents.property.mapper;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.huiju.estateagents.property.entity.TpBillType;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ *  Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2021-01-19
14
+ */
15
+@Mapper
16
+public interface TpBillTypeMapper extends BaseMapper<TpBillType> {
17
+}

+ 14
- 1
src/main/java/com/huiju/estateagents/property/model/Bill.java 查看文件

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 import java.util.Date;
12 13
 
13 14
 /**
@@ -32,6 +33,8 @@ public class Bill implements Serializable {
32 33
     /**
33 34
      * 小区id
34 35
      */
36
+    private Integer communityId;
37
+
35 38
     private Integer orgId;
36 39
 
37 40
     /**
@@ -66,10 +69,12 @@ public class Bill implements Serializable {
66 69
      */
67 70
     private String billStatus;
68 71
 
72
+    private LocalDateTime startDate;
73
+
69 74
     /**
70 75
      * 截止时间
71 76
      */
72
-    private Date endDate;
77
+    private LocalDateTime endDate;
73 78
 
74 79
     /**
75 80
      * 创建人
@@ -91,5 +96,13 @@ public class Bill implements Serializable {
91 96
      */
92 97
     private Date updateDate;
93 98
 
99
+    /**
100
+     * 收费类型
101
+     */
102
+    private Integer typeId;
94 103
 
104
+    /**
105
+     * 是否工单费用
106
+     */
107
+    private Boolean isTicket;
95 108
 }

+ 6
- 3
src/main/java/com/huiju/estateagents/property/model/BillInvoice.java 查看文件

@@ -30,9 +30,6 @@ public class BillInvoice implements Serializable {
30 30
     @TableId(value = "id", type = IdType.AUTO)
31 31
     private Integer id;
32 32
 
33
-    /**
34
-     * 小区id
35
-     */
36 33
     private Integer orgId;
37 34
 
38 35
     /**
@@ -129,6 +126,12 @@ public class BillInvoice implements Serializable {
129 126
     @TableField(exist = false)
130 127
     private String ownerName;
131 128
 
129
+    /**
130
+     * 小区
131
+     */
132
+    @TableField(exist = false)
133
+    private Integer communityId;
134
+
132 135
     /**
133 136
      * 期
134 137
      */

+ 4
- 5
src/main/java/com/huiju/estateagents/property/service/IBillService.java 查看文件

@@ -3,11 +3,10 @@ package com.huiju.estateagents.property.service;
3 3
 import com.baomidou.mybatisplus.extension.service.IService;
4 4
 import com.huiju.estateagents.base.ResponseBean;
5 5
 import com.huiju.estateagents.center.taUser.entity.TaUser;
6
-import com.huiju.estateagents.property.common.UserElement;
7 6
 import com.huiju.estateagents.property.model.Bill;
8 7
 import org.springframework.web.multipart.MultipartFile;
9 8
 
10
-import java.util.Date;
9
+import java.time.LocalDateTime;
11 10
 import java.util.List;
12 11
 import java.util.Map;
13 12
 
@@ -28,7 +27,7 @@ public interface IBillService extends IService<Bill> {
28 27
      * @param userElement
29 28
      * @return
30 29
      */
31
-    ResponseBean updateBillNameAndBillExplainAndEndDate(TaUser userElement, String parameter);
30
+    ResponseBean updateBillNameAndBillExplainAndEndDate(TaUser userElement, Bill bill);
32 31
 
33 32
     /**
34 33
      * 根据ID查询 缴费项
@@ -48,6 +47,7 @@ public interface IBillService extends IService<Bill> {
48 47
 
49 48
 	/**
50 49
 	 * 上传excel, 解析, 但不入库
50
+	 *
51 51
 	 * @param file
52 52
 	 * @return
53 53
 	 */
@@ -57,13 +57,12 @@ public interface IBillService extends IService<Bill> {
57 57
 	 * 上传excel, 解析 入库
58 58
 	 * @param billId
59 59
 	 * @param file
60
-	 * @param billExplain
61 60
 	 * @param billName
62 61
 	 * @param endDate
63 62
 	 * @param billStatus
64 63
 	 * @return
65 64
 	 */
66
-	ResponseBean getExcelData(Integer billId, MultipartFile file, String billExplain, String billName, Date endDate, String billStatus, TaUser userElement);
65
+	ResponseBean saveExcelData(Integer billId, MultipartFile file, Integer communityId, String billName, LocalDateTime startDate, LocalDateTime endDate, String billStatus, TaUser userElement);
67 66
 
68 67
 	/**
69 68
 	 * 修改 缴费项状态

+ 94
- 39
src/main/java/com/huiju/estateagents/property/service/impl/BillInvoiceServiceImpl.java 查看文件

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

+ 26
- 38
src/main/java/com/huiju/estateagents/property/service/impl/BillServiceImpl.java 查看文件

@@ -1,6 +1,5 @@
1 1
 package com.huiju.estateagents.property.service.impl;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5 4
 import com.baomidou.mybatisplus.core.metadata.IPage;
6 5
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -38,7 +37,6 @@ import org.springframework.web.multipart.MultipartFile;
38 37
 
39 38
 import java.io.IOException;
40 39
 import java.io.InputStream;
41
-import java.text.ParseException;
42 40
 import java.text.SimpleDateFormat;
43 41
 import java.time.LocalDateTime;
44 42
 import java.util.Date;
@@ -106,15 +104,20 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
106 104
 
107 105
     @Override
108 106
     @Transactional(rollbackFor = Exception.class)
109
-    public ResponseBean updateBillNameAndBillExplainAndEndDate(TaUser userElement, String parameter) {
107
+    public ResponseBean updateBillNameAndBillExplainAndEndDate(TaUser userElement, Bill bill) {
110 108
         ResponseBean responseBean = new ResponseBean();
111
-        Bill bill = JSONObject.parseObject(parameter, Bill.class);
109
+//        Bill bill = JSONObject.parseObject(parameter, Bill.class);
112 110
         if (StringUtils.isEmpty(bill.getBillName())) {
113 111
             responseBean.addError("收费项名称不能为空");
114 112
             return responseBean;
115 113
         }
116
-        if (StringUtils.isEmpty(bill.getBillExplain())) {
117
-            responseBean.addError("缴费项说明");
114
+//        if (StringUtils.isEmpty(bill.getBillExplain())) {
115
+//            responseBean.addError("缴费项说明");
116
+//            return responseBean;
117
+//        }
118
+
119
+        if (bill.getStartDate() == null) {
120
+            responseBean.addError("截止时间不能为空");
118 121
             return responseBean;
119 122
         }
120 123
         if (bill.getEndDate() == null) {
@@ -187,26 +190,9 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
187 190
 
188 191
     @Override
189 192
     @Transactional(rollbackFor = Exception.class)
190
-    public ResponseBean getExcelData(Integer billId, MultipartFile file, String billExplain, String billName, Date endDate, String billStatus, TaUser userElement) {
193
+    public ResponseBean saveExcelData(Integer billId, MultipartFile file, Integer communityId, String billName, LocalDateTime startDate, LocalDateTime endDate, String billStatus, TaUser userElement) {
191 194
         ResponseBean responseBean = new ResponseBean();
192 195
 
193
-        // 获取本地时间
194
-        Date date = new Date();
195
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
196
-        String formatDate = simpleDateFormat.format(date);
197
-        Date parse = null;
198
-        try {
199
-            parse = simpleDateFormat.parse(formatDate);
200
-        } catch (ParseException e) {
201
-            e.printStackTrace();
202
-        }
203
-
204
-        if (endDate.getTime() < parse.getTime()) {
205
-            responseBean.addError("不能小于当前时间!");
206
-            return responseBean;
207
-        }
208
-
209
-
210 196
         List<BillInvoice> records = null;
211 197
         if (billId != null) {
212 198
             // 查询出这个收费单, 存在的缴费单数据
@@ -240,8 +226,10 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
240 226
 
241 227
         // 存入缴费项表
242 228
         Bill bill = new Bill();
229
+        bill.setCommunityId(communityId);
243 230
         bill.setBillName(billName);
244
-        bill.setBillExplain(billExplain);
231
+//        bill.setBillExplain(billExplain);
232
+        bill.setStartDate(startDate);
245 233
         bill.setEndDate(endDate);
246 234
         if (StringUtils.isNotBlank(strSumDouble)) {
247 235
             strSumDouble = strSumDouble.substring(0, strSumDouble.lastIndexOf("."));
@@ -354,7 +342,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
354 342
                     throw new WisdomException("房产:" + e.getPhase() + e.getBuilding() + e.getUnit() + e.getLevel() + e.getRoomNo() + " 不存在!请核对!");
355 343
                 }
356 344
                 billInvoice.setRoomNoId(tpRoomNo.getId());
357
-                billInvoice.setBillInvoiceExplain(e.getBillExplain());
345
+                billInvoice.setBillInvoiceExplain(billName);
358 346
                 billInvoice.setPayPrice(e.getPayPrice());
359 347
                 billInvoice.setBillStatus("0");
360 348
                 billInvoice.setCreateUser(userElement.getUserId());
@@ -472,17 +460,17 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
472 460
             String roomNo = cell.getStringCellValue().trim();
473 461
 
474 462
 
475
-            // 收费说明可以为空
476
-            cell = getCell(row.getCell(6));
477
-            String billExplain = null;
478
-            if (null != cell) {
479
-                billExplain = cell.getStringCellValue().trim();
480
-                if (billExplain.length() > 100) {
481
-                    throw new WisdomException("第" + currentRow + "行 收费说明超出100字,请精简到100字以内");
482
-                }
483
-            }
463
+//            // 收费说明可以为空
464
+//            cell = getCell(row.getCell(6));
465
+//            String billExplain = null;
466
+//            if (null != cell) {
467
+//                billExplain = cell.getStringCellValue().trim();
468
+//                if (billExplain.length() > 100) {
469
+//                    throw new WisdomException("第" + currentRow + "行 收费说明超出100字,请精简到100字以内");
470
+//                }
471
+//            }
484 472
 
485
-            cell = getCell(row.getCell(7));
473
+            cell = getCell(row.getCell(6));
486 474
             if (null == cell) {
487 475
                 throw new WisdomException("第" + currentRow + "行 金额 不能为空");
488 476
             }
@@ -496,7 +484,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
496 484
             temp.setUnit(unit);
497 485
             temp.setRoomNo(roomNo);
498 486
             // temp.setOwnerName(ownerName);
499
-            temp.setBillExplain(billExplain);
487
+//            temp.setBillExplain(billExplain);
500 488
 
501 489
 
502 490
             if (StringUtils.isNotBlank(money)) {
@@ -662,7 +650,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
662 650
                 if (index == records.size()) {
663 651
                     index = 0;
664 652
                     pageNum ++;
665
-                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getOrgId(), communityId, pageNum * pageSize, pageSize);
653
+                    records = tpRoomNoMapper.selectComunityList(userElement.getOrgId(), communityId, phaseId,buildingId, pageNum * pageSize, pageSize);
666 654
                 }
667 655
                 if (records.isEmpty()) {
668 656
                     break;

+ 3
- 1
src/main/java/com/huiju/estateagents/property/service/impl/TpTicketServiceImpl.java 查看文件

@@ -55,6 +55,7 @@ import java.io.IOException;
55 55
 import java.time.LocalDateTime;
56 56
 import java.time.ZoneId;
57 57
 import java.time.ZoneOffset;
58
+import java.time.temporal.TemporalAdjusters;
58 59
 import java.util.*;
59 60
 
60 61
 /**
@@ -1225,7 +1226,8 @@ public class TpTicketServiceImpl extends ServiceImpl<TpTicketMapper, TpTicket> i
1225 1226
         Bill bill = new Bill();
1226 1227
         bill.setBillName(tpTicket.getTicketTitle());
1227 1228
         bill.setBillExplain(ticket.getPriceExplain());
1228
-        bill.setEndDate(Date.from(LocalDateTime.now().plusMonths(1).atZone( ZoneId.systemDefault()).toInstant()));
1229
+        // 当前时间的下个月初 - 1秒 = 本月月末的最后时间
1230
+        bill.setEndDate(LocalDateTime.now().plusMonths(1).with(TemporalAdjusters.firstDayOfMonth()).minusSeconds(1));
1229 1231
         bill.setPayPrice(ticket.getPrice().toString());
1230 1232
 
1231 1233
         bill.setPayedNum(0);

+ 16
- 19
src/main/resources/mapper/property/BillMapper.xml 查看文件

@@ -3,32 +3,29 @@
3 3
 <mapper namespace="com.huiju.estateagents.property.dao.BillMapper">
4 4
     <select id="selectListByParams" resultType="com.huiju.estateagents.property.model.Bill">
5 5
         SELECT
6
-            t.id,
7
-            t.org_id,
8
-            t.bill_name,
9
-            t.bill_explain,
10
-            t.pay_total_num,
11
-            t.payed_num,
12
-            t.unpayed_num,
13
-            t.bill_status,
14
-            t.end_date,
15
-            t.create_user,
16
-            t.create_date,
17
-            t.update_user,
18
-            t.update_date
6
+            t.*
19 7
         FROM
20 8
             tp_bill t
21 9
         WHERE
22
-        1 = 1
23
-        AND t.org_id = #{bill.orgId}
24
-        <if test="bill.id != null and bill.id != '' or bill.id ==0">
25
-            and t.id like concat('%',#{bill.id},'%')
10
+            t.org_id = #{bill.orgId}
11
+            and t.community_id = #{bill.communityId}
12
+        <if test="bill.id != null">
13
+            and t.id = #{bill.id}
26 14
         </if>
27 15
         <if test="bill.billName != null and bill.billName != ''">
28 16
             and t.bill_name like concat('%',#{bill.billName,jdbcType=VARCHAR},'%')
29 17
         </if>
30
-        <if test="bill.billExplain != null and bill.billExplain != ''">
31
-            and t.bill_explain like concat('%',#{bill.billExplain,jdbcType=VARCHAR},'%')
18
+        <if test="bill.startDate != null">
19
+            and t.start_date &gt;= #{bill.startDate}
20
+        </if>
21
+        <if test="bill.endDate != null">
22
+            and t.end_date &lt;= #{bill.endDate}
23
+        </if>
24
+        <if test="bill.isTicket">
25
+            and t.is_ticket = 1
26
+        </if>
27
+        <if test="!bill.isTicket">
28
+            and t.is_ticket = 0
32 29
         </if>
33 30
         order by t.id DESC
34 31
     </select>

+ 5
- 0
src/main/resources/mapper/property/TpBillTypeMapper.xml 查看文件

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.huiju.estateagents.property.mapper.TpBillTypeMapper">
4
+
5
+</mapper>

二进制
src/main/resources/缴费单模板.xls 查看文件


二进制
src/main/resources/缴费单模板.xls.old 查看文件