瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/state_grid/invoice_fill_service into dev

Yansen 1 年之前
父節點
當前提交
c27fe0c7bc

+ 1
- 1
deploy/.s/1636896505560465-cn-shanghai-stategrid-service-invoice-filling-httpTrigger.json 查看文件

22
       "disableURLInternet": false
22
       "disableURLInternet": false
23
     },
23
     },
24
     "createdTime": "2022-07-18T02:02:16Z",
24
     "createdTime": "2022-07-18T02:02:16Z",
25
-    "lastModifiedTime": "2023-09-11T09:38:02Z",
25
+    "lastModifiedTime": "2023-09-12T02:45:10Z",
26
     "status": null,
26
     "status": null,
27
     "targetArn": null,
27
     "targetArn": null,
28
     "name": "httpTrigger"
28
     "name": "httpTrigger"

+ 3
- 3
deploy/.s/1636896505560465-cn-shanghai-stategrid-service-invoice-filling.json 查看文件

8
     "timeout": 30,
8
     "timeout": 30,
9
     "initializer": "",
9
     "initializer": "",
10
     "initializationTimeout": 3,
10
     "initializationTimeout": 3,
11
-    "codeSize": 69229221,
12
-    "codeChecksum": "3053493131185536708",
11
+    "codeSize": 69225347,
12
+    "codeChecksum": "6954604591044511436",
13
     "memorySize": 1024,
13
     "memorySize": 1024,
14
     "gpuMemorySize": null,
14
     "gpuMemorySize": null,
15
     "environmentVariables": {},
15
     "environmentVariables": {},
16
     "createdTime": "2022-07-18T02:02:16Z",
16
     "createdTime": "2022-07-18T02:02:16Z",
17
-    "lastModifiedTime": "2023-09-11T09:37:59Z",
17
+    "lastModifiedTime": "2023-09-12T02:45:06Z",
18
     "instanceConcurrency": 1,
18
     "instanceConcurrency": 1,
19
     "instanceSoftConcurrency": null,
19
     "instanceSoftConcurrency": null,
20
     "customContainerConfig": null,
20
     "customContainerConfig": null,

+ 1
- 1
deploy/.s/1636896505560465-cn-shanghai-stategrid-service.json 查看文件

12
     },
12
     },
13
     "serviceId": "6e96fa7b-9988-4908-b06a-0aa7e510c881",
13
     "serviceId": "6e96fa7b-9988-4908-b06a-0aa7e510c881",
14
     "createdTime": "2022-02-26T04:50:56Z",
14
     "createdTime": "2022-02-26T04:50:56Z",
15
-    "lastModifiedTime": "2023-09-11T09:38:02Z",
15
+    "lastModifiedTime": "2023-09-12T02:45:10Z",
16
     "vpcConfig": {
16
     "vpcConfig": {
17
       "vpcId": "",
17
       "vpcId": "",
18
       "vSwitchIds": [],
18
       "vSwitchIds": [],

+ 1
- 1
deploy/.s/invoice-filling.stategrid.njyunzhi.com.json 查看文件

36
     ]
36
     ]
37
   },
37
   },
38
   "createdTime": "2022-07-18T02:03:47Z",
38
   "createdTime": "2022-07-18T02:03:47Z",
39
-  "lastModifiedTime": "2023-09-11T09:38:03Z",
39
+  "lastModifiedTime": "2023-09-12T02:45:10Z",
40
   "keepFullPath": null,
40
   "keepFullPath": null,
41
   "subdomainCount": null,
41
   "subdomainCount": null,
42
   "wafConfig": null
42
   "wafConfig": null

+ 1
- 1
deploy/s.prod.yaml 查看文件

49
       function:
49
       function:
50
         name: invoice-filling
50
         name: invoice-filling
51
         description: '发票确认'
51
         description: '发票确认'
52
-        codeUri: ../target/invoice-0.0.7.jar
52
+        codeUri: ../target/invoice-0.0.8.jar
53
         runtime: custom
53
         runtime: custom
54
         memorySize: 1024
54
         memorySize: 1024
55
         timeout: 30
55
         timeout: 30

+ 45
- 49
src/main/java/com/njyunzhi/invoice/controller/TaInvoiceFillController.java 查看文件

2
 
2
 
3
 import com.alibaba.excel.EasyExcel;
3
 import com.alibaba.excel.EasyExcel;
4
 import com.alibaba.excel.ExcelWriter;
4
 import com.alibaba.excel.ExcelWriter;
5
-import com.alibaba.excel.metadata.Head;
6
-import com.alibaba.excel.support.ExcelTypeEnum;
7
-import com.alibaba.excel.write.merge.AbstractMergeStrategy;
8
 import com.alibaba.excel.write.metadata.WriteSheet;
5
 import com.alibaba.excel.write.metadata.WriteSheet;
9
 import com.alibaba.excel.write.metadata.fill.FillConfig;
6
 import com.alibaba.excel.write.metadata.fill.FillConfig;
10
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
7
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
13
 import com.njyunzhi.invoice.common.*;
10
 import com.njyunzhi.invoice.common.*;
14
 import com.njyunzhi.invoice.common.excel.MergeRowStrategy;
11
 import com.njyunzhi.invoice.common.excel.MergeRowStrategy;
15
 import com.njyunzhi.invoice.entity.TaInvoiceDetail;
12
 import com.njyunzhi.invoice.entity.TaInvoiceDetail;
13
+import com.njyunzhi.invoice.entity.TaInvoiceFill;
16
 import com.njyunzhi.invoice.service.ITaInvoiceDetailService;
14
 import com.njyunzhi.invoice.service.ITaInvoiceDetailService;
15
+import com.njyunzhi.invoice.service.ITaInvoiceFillService;
17
 import io.swagger.annotations.Api;
16
 import io.swagger.annotations.Api;
18
 import io.swagger.annotations.ApiOperation;
17
 import io.swagger.annotations.ApiOperation;
19
 import io.swagger.annotations.ApiParam;
18
 import io.swagger.annotations.ApiParam;
20
-import org.apache.poi.ss.usermodel.Cell;
21
-import org.apache.poi.ss.usermodel.Sheet;
22
 import org.slf4j.Logger;
19
 import org.slf4j.Logger;
23
 import org.slf4j.LoggerFactory;
20
 import org.slf4j.LoggerFactory;
24
 import org.springframework.beans.factory.annotation.Autowired;
21
 import org.springframework.beans.factory.annotation.Autowired;
25
-import org.springframework.web.bind.annotation.PathVariable;
26
-import org.springframework.web.bind.annotation.RequestBody;
27
-import org.springframework.web.bind.annotation.RequestMapping;
28
-import org.springframework.web.bind.annotation.RequestMethod;
29
-import org.springframework.web.bind.annotation.RequestParam;
30
-import com.njyunzhi.invoice.service.ITaInvoiceFillService;
31
-import com.njyunzhi.invoice.entity.TaInvoiceFill;
32
-import org.springframework.web.bind.annotation.RestController;
22
+import org.springframework.web.bind.annotation.*;
33
 
23
 
34
 import javax.servlet.http.HttpServletResponse;
24
 import javax.servlet.http.HttpServletResponse;
35
-import java.io.File;
36
 import java.io.InputStream;
25
 import java.io.InputStream;
37
 import java.util.HashMap;
26
 import java.util.HashMap;
38
 import java.util.List;
27
 import java.util.List;
41
 
30
 
42
 /**
31
 /**
43
  * <p>
32
  * <p>
44
-    * 报销主表 前端控制器
45
-    * </p>
33
+ * 报销主表 前端控制器
34
+ * </p>
46
  *
35
  *
47
  * @author yansen
36
  * @author yansen
48
  * @since 2022-07-04
37
  * @since 2022-07-04
66
 
55
 
67
     /**
56
     /**
68
      * 分页查询列表
57
      * 分页查询列表
58
+     *
69
      * @param pageNum
59
      * @param pageNum
70
      * @param pageSize
60
      * @param pageSize
71
      * @return
61
      * @return
72
      */
62
      */
73
-    @RequestMapping(value="/{client}/invoice",method= RequestMethod.GET)
74
-    @ApiOperation(value="列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
63
+    @RequestMapping(value = "/{client}/invoice", method = RequestMethod.GET)
64
+    @ApiOperation(value = "列表", notes = "列表", httpMethod = "GET", response = ResponseBean.class)
75
     public ResponseBean taInvoiceFillList(@ApiParam("客户端") @PathVariable String client,
65
     public ResponseBean taInvoiceFillList(@ApiParam("客户端") @PathVariable String client,
76
-                                          @ApiParam("页码") @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
77
-                                          @ApiParam("单页数据量") @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
78
-                                          @ApiParam("班级名称") @RequestParam(value ="name", required = false) String name) throws Exception{
66
+                                          @ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
67
+                                          @ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
68
+                                          @ApiParam("班级名称") @RequestParam(value = "name", required = false) String name,
69
+                                          @ApiParam("状态") @RequestParam(value = "status", required = false) String status) throws Exception {
79
         IPage<TaInvoiceFill> pg = new Page<>(pageNum, pageSize);
70
         IPage<TaInvoiceFill> pg = new Page<>(pageNum, pageSize);
80
         QueryWrapper<TaInvoiceFill> queryWrapper = new QueryWrapper<>();
71
         QueryWrapper<TaInvoiceFill> queryWrapper = new QueryWrapper<>();
81
         queryWrapper.gt("status", Constants.STATUS_DELETE);
72
         queryWrapper.gt("status", Constants.STATUS_DELETE);
73
+        queryWrapper.eq(!StringUtils.isEmpty(status),"status", status);
82
         queryWrapper.like(!StringUtils.isEmpty(name), "name", "%" + name + "%");
74
         queryWrapper.like(!StringUtils.isEmpty(name), "name", "%" + name + "%");
83
         queryWrapper.orderByAsc("create_date");
75
         queryWrapper.orderByAsc("create_date");
84
 
76
 
91
         return ResponseBean.success(result);
83
         return ResponseBean.success(result);
92
     }
84
     }
93
 
85
 
94
-    @RequestMapping(value="/admin/invoice/{id}/export",method= RequestMethod.POST)
95
-    @ApiOperation(value="导出", notes = "导出", httpMethod = "POST", response = ResponseBean.class)
86
+    @RequestMapping(value = "/admin/invoice/{id}/export", method = RequestMethod.POST)
87
+    @ApiOperation(value = "导出", notes = "导出", httpMethod = "POST", response = ResponseBean.class)
96
     public void export(@ApiParam("班级ID") @PathVariable String id,
88
     public void export(@ApiParam("班级ID") @PathVariable String id,
97
-                               HttpServletResponse response) throws Exception {
89
+                       HttpServletResponse response) throws Exception {
98
         TaInvoiceFill invoiceFill = iTaInvoiceFillService.getById(id);
90
         TaInvoiceFill invoiceFill = iTaInvoiceFillService.getById(id);
99
         if (null == invoiceFill) {
91
         if (null == invoiceFill) {
100
             throw new Exception("为找到班级信息");
92
             throw new Exception("为找到班级信息");
109
 
101
 
110
         response.setContentType("application/vnd.ms-excel");
102
         response.setContentType("application/vnd.ms-excel");
111
         response.setCharacterEncoding("utf-8");
103
         response.setCharacterEncoding("utf-8");
112
-        response.setHeader("Content-disposition", "attachment;filename="+expFile);
104
+        response.setHeader("Content-disposition", "attachment;filename=" + expFile);
113
 
105
 
114
         List<Object> mergeDataList = list.stream().map(x -> x.getPersonName()).collect(Collectors.toList());
106
         List<Object> mergeDataList = list.stream().map(x -> x.getPersonName()).collect(Collectors.toList());
115
         ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), TaInvoiceDetail.class).withTemplate(inputStream).build();
107
         ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), TaInvoiceDetail.class).withTemplate(inputStream).build();
126
 
118
 
127
     /**
119
     /**
128
      * 保存对象
120
      * 保存对象
121
+     *
129
      * @param taInvoiceFill 实体对象
122
      * @param taInvoiceFill 实体对象
130
      * @return
123
      * @return
131
      */
124
      */
132
-    @RequestMapping(value="/admin/invoice",method= RequestMethod.POST)
133
-    @ApiOperation(value="保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
134
-    public ResponseBean taInvoiceFillAdd(@ApiParam("保存内容") @RequestBody TaInvoiceFill taInvoiceFill) throws Exception{
125
+    @RequestMapping(value = "/admin/invoice", method = RequestMethod.POST)
126
+    @ApiOperation(value = "保存", notes = "保存", httpMethod = "POST", response = ResponseBean.class)
127
+    public ResponseBean taInvoiceFillAdd(@ApiParam("保存内容") @RequestBody TaInvoiceFill taInvoiceFill) throws Exception {
135
 
128
 
136
         if (null == taInvoiceFill.getStatus()) {
129
         if (null == taInvoiceFill.getStatus()) {
137
             taInvoiceFill.setStatus(Constants.STATUS_READY);
130
             taInvoiceFill.setStatus(Constants.STATUS_READY);
138
         }
131
         }
139
 
132
 
140
-        if (iTaInvoiceFillService.save(taInvoiceFill)){
133
+        if (iTaInvoiceFillService.save(taInvoiceFill)) {
141
             return ResponseBean.success(taInvoiceFill);
134
             return ResponseBean.success(taInvoiceFill);
142
-        }else {
135
+        } else {
143
             return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
136
             return ResponseBean.error("保存失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
144
         }
137
         }
145
     }
138
     }
146
 
139
 
147
     /**
140
     /**
148
      * 根据id删除对象
141
      * 根据id删除对象
149
-     * @param id  实体ID
142
+     *
143
+     * @param id 实体ID
150
      */
144
      */
151
-    @RequestMapping(value="/admin/invoice/{id}", method= RequestMethod.DELETE)
152
-    @ApiOperation(value="删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
153
-    public ResponseBean taInvoiceFillDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception{
154
-        if(iTaInvoiceFillService.removeLogicById(id)){
145
+    @RequestMapping(value = "/admin/invoice/{id}", method = RequestMethod.DELETE)
146
+    @ApiOperation(value = "删除", notes = "删除", httpMethod = "DELETE", response = ResponseBean.class)
147
+    public ResponseBean taInvoiceFillDelete(@ApiParam("对象ID") @PathVariable String id) throws Exception {
148
+        if (iTaInvoiceFillService.removeLogicById(id)) {
155
             return ResponseBean.success("success");
149
             return ResponseBean.success("success");
156
-        }else {
150
+        } else {
157
             return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
151
             return ResponseBean.error("删除失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
158
         }
152
         }
159
     }
153
     }
160
 
154
 
161
     /**
155
     /**
162
      * 修改对象
156
      * 修改对象
163
-     * @param id  实体ID
157
+     *
158
+     * @param id            实体ID
164
      * @param taInvoiceFill 实体对象
159
      * @param taInvoiceFill 实体对象
165
      * @return
160
      * @return
166
      */
161
      */
167
-    @RequestMapping(value="/admin/invoice/{id}",method= RequestMethod.PUT)
168
-    @ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
162
+    @RequestMapping(value = "/admin/invoice/{id}", method = RequestMethod.PUT)
163
+    @ApiOperation(value = "更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
169
     public ResponseBean taInvoiceFillUpdate(@ApiParam("对象ID") @PathVariable String id,
164
     public ResponseBean taInvoiceFillUpdate(@ApiParam("对象ID") @PathVariable String id,
170
-                                        @ApiParam("更新内容") @RequestBody TaInvoiceFill taInvoiceFill) throws Exception{
165
+                                            @ApiParam("更新内容") @RequestBody TaInvoiceFill taInvoiceFill) throws Exception {
171
 
166
 
172
         taInvoiceFill.setInvoiceId(id);
167
         taInvoiceFill.setInvoiceId(id);
173
-        if (iTaInvoiceFillService.updateById(taInvoiceFill)){
168
+        if (iTaInvoiceFillService.updateById(taInvoiceFill)) {
174
             return ResponseBean.success(iTaInvoiceFillService.getById(id));
169
             return ResponseBean.success(iTaInvoiceFillService.getById(id));
175
-        }else {
170
+        } else {
176
             return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
171
             return ResponseBean.error("修改失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
177
         }
172
         }
178
     }
173
     }
179
 
174
 
180
     /**
175
     /**
181
      * 根据id查询对象
176
      * 根据id查询对象
182
-     * @param id  实体ID
177
+     *
178
+     * @param id 实体ID
183
      */
179
      */
184
-    @RequestMapping(value="/admin/invoice/{id}",method= RequestMethod.GET)
185
-    @ApiOperation(value="详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
186
-    public ResponseBean taInvoiceFillGet(@ApiParam("对象ID") @PathVariable String id) throws Exception{
180
+    @RequestMapping(value = "/admin/invoice/{id}", method = RequestMethod.GET)
181
+    @ApiOperation(value = "详情", notes = "详情", httpMethod = "GET", response = ResponseBean.class)
182
+    public ResponseBean taInvoiceFillGet(@ApiParam("对象ID") @PathVariable String id) throws Exception {
187
         return ResponseBean.success(iTaInvoiceFillService.getById(id));
183
         return ResponseBean.success(iTaInvoiceFillService.getById(id));
188
     }
184
     }
189
 
185
 
190
 
186
 
191
-    @RequestMapping(value="/h5/invoice/{invoiceId}",method= RequestMethod.GET)
192
-    @ApiOperation(value="获取报销单", notes = "获取报销单", httpMethod = "GET", response = ResponseBean.class)
193
-    public ResponseBean getInvoice(@ApiParam("班级ID") @PathVariable(value ="invoiceId") String invoiceId) throws Exception{
187
+    @RequestMapping(value = "/h5/invoice/{invoiceId}", method = RequestMethod.GET)
188
+    @ApiOperation(value = "获取报销单", notes = "获取报销单", httpMethod = "GET", response = ResponseBean.class)
189
+    public ResponseBean getInvoice(@ApiParam("班级ID") @PathVariable(value = "invoiceId") String invoiceId) throws Exception {
194
         TaInvoiceFill taInvoiceFill = iTaInvoiceFillService.getById(invoiceId);
190
         TaInvoiceFill taInvoiceFill = iTaInvoiceFillService.getById(invoiceId);
195
         if (null == taInvoiceFill || taInvoiceFill.getStatus() != Constants.STATUS_NORMAL) {
191
         if (null == taInvoiceFill || taInvoiceFill.getStatus() != Constants.STATUS_NORMAL) {
196
             return ResponseBean.error("报销单不存在");
192
             return ResponseBean.error("报销单不存在");

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

10
 import java.io.Serializable;
10
 import java.io.Serializable;
11
 import java.util.List;
11
 import java.util.List;
12
 
12
 
13
+import com.njyunzhi.invoice.common.excel.IsNeedLodqingCoverter;
13
 import io.swagger.annotations.ApiModel;
14
 import io.swagger.annotations.ApiModel;
14
 import io.swagger.annotations.ApiModelProperty;
15
 import io.swagger.annotations.ApiModelProperty;
15
 import lombok.Data;
16
 import lombok.Data;
108
     @ApiModelProperty(value = "住宿清单")
109
     @ApiModelProperty(value = "住宿清单")
109
     private String stayRemark;
110
     private String stayRemark;
110
 
111
 
112
+        @ExcelProperty(index = 12, converter = IsNeedLodqingCoverter.class)
113
+    @ApiModelProperty(value = "0不需要 1需要 是否需要住宿清单")
114
+    private String isNeedLodging;
115
+
116
+    @ExcelProperty(index = 13)
117
+    @ApiModelProperty(value = "房号")
118
+    private String roomCode;
119
+
111
     @ApiModelProperty(value = "收件人姓名")
120
     @ApiModelProperty(value = "收件人姓名")
112
     private String mailUser;
121
     private String mailUser;
113
 
122
 

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

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

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


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

104
             t.`mail_phone`,
104
             t.`mail_phone`,
105
             t.`mail_address`,
105
             t.`mail_address`,
106
             t.`status`,
106
             t.`status`,
107
-            t.`create_date`
107
+            t.`create_date`,
108
+            t.`is_need_lodging`,
109
+            t.`room_code`
108
         FROM
110
         FROM
109
             ta_invoice_detail t
111
             ta_invoice_detail t
110
                 INNER JOIN ta_invoice_item s ON t.invoice_id = s.invoice_id AND t.invoice_person_id = s.invoice_person_id
112
                 INNER JOIN ta_invoice_item s ON t.invoice_id = s.invoice_id AND t.invoice_person_id = s.invoice_person_id