张涛 1年前
父节点
当前提交
96f259c5b2

+ 3
- 0
db/2023/09/06.sql 查看文件

@@ -0,0 +1,3 @@
1
+ALTER TABLE `invoice_fill`.`ta_invoice_detail`
2
+ADD COLUMN `is_need_lodging` char(10) NULL COMMENT '0不需要 1需要 是否需要住宿清单' AFTER `mail_address`,
3
+ADD COLUMN `room_code` varchar(255) NULL COMMENT '房号' AFTER `is_need_lodging`;

+ 44
- 0
src/main/java/com/njyunzhi/invoice/common/excel/IsNeedLodqingCoverter.java 查看文件

@@ -0,0 +1,44 @@
1
+package com.njyunzhi.invoice.common.excel;
2
+
3
+import com.alibaba.excel.converters.Converter;
4
+import com.alibaba.excel.enums.CellDataTypeEnum;
5
+import com.alibaba.excel.metadata.GlobalConfiguration;
6
+import com.alibaba.excel.metadata.data.WriteCellData;
7
+import com.alibaba.excel.metadata.property.ExcelContentProperty;
8
+
9
+public class IsNeedLodqingCoverter implements Converter<String> {
10
+        @Override
11
+        public Class supportJavaTypeKey() {
12
+            return String.class;
13
+        }
14
+
15
+        @Override
16
+        public CellDataTypeEnum supportExcelTypeKey() {
17
+            return CellDataTypeEnum.STRING;
18
+        }
19
+
20
+        /**
21
+         * 写 Excel
22
+         * @param value
23
+         * @param contentProperty
24
+         * @param globalConfiguration
25
+         * @return
26
+         * @throws Exception
27
+         */
28
+        @Override
29
+        public WriteCellData<?> convertToExcelData(String value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
30
+            if (null == value) return null;
31
+
32
+            String val;
33
+            switch (value) {
34
+                case "1":
35
+                    val = "是";
36
+                    break;
37
+                default:
38
+                    val = "否";
39
+            }
40
+
41
+
42
+            return new WriteCellData(val);
43
+        }
44
+}

+ 16
- 7
src/main/java/com/njyunzhi/invoice/entity/TaInvoiceDetail.java 查看文件

@@ -3,18 +3,17 @@ package com.njyunzhi.invoice.entity;
3 3
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
4 4
 import com.alibaba.excel.annotation.ExcelProperty;
5 5
 import com.baomidou.mybatisplus.annotation.IdType;
6
-import java.time.LocalDateTime;
7
-
8 6
 import com.baomidou.mybatisplus.annotation.TableField;
9 7
 import com.baomidou.mybatisplus.annotation.TableId;
10
-import java.io.Serializable;
11
-import java.util.List;
12
-
8
+import com.njyunzhi.invoice.common.excel.IsNeedLodqingCoverter;
13 9
 import io.swagger.annotations.ApiModel;
14 10
 import io.swagger.annotations.ApiModelProperty;
15 11
 import lombok.Data;
16 12
 import lombok.EqualsAndHashCode;
17
-import lombok.experimental.Accessors;
13
+
14
+import java.io.Serializable;
15
+import java.time.LocalDateTime;
16
+import java.util.List;
18 17
 
19 18
 /**
20 19
  * <p>
@@ -27,7 +26,7 @@ import lombok.experimental.Accessors;
27 26
 @Data
28 27
 @EqualsAndHashCode(callSuper = false)
29 28
 @ExcelIgnoreUnannotated
30
-@ApiModel(value="TaInvoiceDetail对象", description="报销明细")
29
+@ApiModel(value = "TaInvoiceDetail对象", description = "报销明细")
31 30
 public class TaInvoiceDetail implements Serializable {
32 31
 
33 32
     private static final long serialVersionUID = 1L;
@@ -108,6 +107,14 @@ public class TaInvoiceDetail implements Serializable {
108 107
     @ApiModelProperty(value = "住宿清单")
109 108
     private String stayRemark;
110 109
 
110
+    @ExcelProperty(index = 12, converter = IsNeedLodqingCoverter.class)
111
+    @ApiModelProperty(value = "0不需要 1需要 是否需要住宿清单")
112
+    private String isNeedLodging;
113
+
114
+    @ExcelProperty(index = 13)
115
+    @ApiModelProperty(value = "房号")
116
+    private String roomCode;
117
+
111 118
     @ApiModelProperty(value = "状态")
112 119
     private Integer status;
113 120
 
@@ -117,4 +124,6 @@ public class TaInvoiceDetail implements Serializable {
117 124
     @ApiModelProperty("报销明细")
118 125
     @TableField(exist = false)
119 126
     private List<TaInvoiceItem> itemList;
127
+
128
+
120 129
 }

+ 1
- 1
src/main/resources/application-dev.yml 查看文件

@@ -8,7 +8,7 @@ spring:
8 8
   datasource:
9 9
     url: jdbc:mysql://112.2.2.154:3394/invoice_fill?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
10 10
     username: invoice_fill
11
-    password: invoice_fill@ABCD1234
11
+    password: invoice_fill
12 12
 
13 13
 wx:
14 14
   mp:

二进制
src/main/resources/excel/invoice_tpl.xlsx 查看文件


+ 3
- 1
src/main/resources/mapper/TaInvoiceDetailMapper.xml 查看文件

@@ -101,7 +101,9 @@
101 101
             t.`merge_remark`,
102 102
             t.`stay_remark`,
103 103
             t.`status`,
104
-            t.`create_date`
104
+            t.`create_date`,
105
+            t.`is_need_lodging`,
106
+            t.`room_code`
105 107
         FROM
106 108
             ta_invoice_detail t
107 109
                 INNER JOIN ta_invoice_item s ON t.invoice_id = s.invoice_id AND t.invoice_person_id = s.invoice_person_id