Ver código fonte

修改pom依赖(解决导出依赖包冲突问题)

wangqiong 1 ano atrás
pai
commit
0e432058e6

+ 0
- 5
pom.xml Ver arquivo

@@ -138,11 +138,6 @@
138 138
                 <artifactId>qomo-data-selfReport</artifactId>
139 139
                 <version>${dmp.version}</version>
140 140
             </dependency>
141
-<!--            <dependency>-->
142
-<!--                <groupId>commons-io</groupId>-->
143
-<!--                <artifactId>commons-io</artifactId>-->
144
-<!--                <version>2.11.0</version>-->
145
-<!--            </dependency>-->
146 141
         </dependencies>
147 142
     </dependencyManagement>
148 143
     <!-- 环境 -->

+ 4
- 3
qomo-kn-cost-manage-start/src/main/resources/application-dev.yml Ver arquivo

@@ -282,8 +282,8 @@ jeecg:
282 282
     #webapp文件路径
283 283
     webapp: /opt/webapp
284 284
   shiro:
285
-    excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
286
-#    excludeUrls: /**/**,/**/**/**
285
+#    excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
286
+    excludeUrls: /**/**,/**/**/**
287 287
 
288 288
   #阿里云oss存储和大鱼短信秘钥配置
289 289
   oss:
@@ -436,7 +436,8 @@ seaTunnelHome: /opt/service/apache-seatunnel-2.3.4
436 436
 hiveMetastoreUri: thrift://192.168.50.102:9083
437 437
 hiveSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hive-site.xml
438 438
 hdfsSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hdfs-site.xml
439
-
439
+hdfs:
440
+  enable: false
440 441
 minio:
441 442
   server: http://192.168.50.9
442 443
   port: 9100

+ 0
- 34
qomo-kn-cost-manage/pom.xml Ver arquivo

@@ -13,12 +13,6 @@
13 13
         <dependency>
14 14
             <groupId>org.qomo.boot</groupId>
15 15
             <artifactId>qomo-system-biz</artifactId>
16
-            <version>${revision}</version>
17
-        </dependency>
18
-        <dependency>
19
-            <groupId>org.projectlombok</groupId>
20
-            <artifactId>lombok</artifactId>
21
-            <scope>provided</scope>
22 16
         </dependency>
23 17
         <dependency>
24 18
             <groupId>com.google.auto.service</groupId>
@@ -29,33 +23,5 @@
29 23
             <groupId>com.zzsmart.qomo</groupId>
30 24
             <artifactId>qomo-data-integration</artifactId>
31 25
         </dependency>
32
-        <dependency>
33
-            <groupId>org.projectlombok</groupId>
34
-            <artifactId>lombok</artifactId>
35
-            <version>RELEASE</version>
36
-            <scope>compile</scope>
37
-        </dependency>
38
-        <dependency>
39
-            <groupId>org.apache.poi</groupId>
40
-            <artifactId>poi</artifactId>
41
-            <version>5.2.3</version>
42
-        </dependency>
43
-        <dependency>
44
-            <groupId>org.apache.poi</groupId>
45
-            <artifactId>poi-ooxml</artifactId>
46
-            <version>5.2.3</version>
47
-        </dependency>
48
-        <!--自己添加的依赖-->
49
-<!--        <dependency>-->
50
-<!--            <groupId>commons-io</groupId>-->
51
-<!--            <artifactId>commons-io</artifactId>-->
52
-<!--            <version>2.11.0</version>-->
53
-<!--        </dependency>-->
54
-        <dependency>
55
-            <groupId>com.alibaba</groupId>
56
-            <artifactId>easyexcel</artifactId>
57
-            <version>4.0.1</version> <!-- 请检查并使用最新稳定版本 -->
58
-        </dependency>
59
-
60 26
     </dependencies>
61 27
 </project>

+ 1
- 0
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java Ver arquivo

@@ -139,6 +139,7 @@ public class AppSceneCostStandardDetailController extends JeecgController<AppSce
139 139
      */
140 140
 //    @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls")
141 141
     @RequestMapping(value = "/exportXls")
142
+    @ApiOperation(value = "cost-单行查询导出", notes = "cost-单行查询导出")
142 143
     public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardDetail appSceneCostStandardDetail) {
143 144
         return super.exportXls(request, appSceneCostStandardDetail, AppSceneCostStandardDetail.class, "app_scene_cost_standard_detail");
144 145
     }

+ 6
- 19
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostHourRate.java Ver arquivo

@@ -29,7 +29,12 @@ import java.util.Date;
29 29
 @ApiModel(value = "app_scene_cost_hour_rate对象", description = "app_scene_cost_hour_rate")
30 30
 public class AppSceneCostHourRate implements Serializable {
31 31
     private static final long serialVersionUID = 1L;
32
-
32
+    /**
33
+     * 主键
34
+     */
35
+    @TableId(type = IdType.ASSIGN_ID)
36
+    @ApiModelProperty(value = "主键")
37
+    private String id;
33 38
     /**
34 39
      * 年度
35 40
      */
@@ -106,22 +111,4 @@ public class AppSceneCostHourRate implements Serializable {
106 111
     @Excel(name = "维护时间", width = 15)
107 112
     @ApiModelProperty(value = "维护时间")
108 113
     private String maintenanceTime;
109
-    /**
110
-     * 预留字段1
111
-     */
112
-    @Excel(name = "预留字段1", width = 15)
113
-    @ApiModelProperty(value = "预留字段1")
114
-    private String reserve1;
115
-    /**
116
-     * 预留字段2
117
-     */
118
-    @Excel(name = "预留字段2", width = 15)
119
-    @ApiModelProperty(value = "预留字段2")
120
-    private BigDecimal reserve2;
121
-    /**
122
-     * 主键
123
-     */
124
-    @TableId(type = IdType.ASSIGN_ID)
125
-    @ApiModelProperty(value = "主键")
126
-    private String id;
127 114
 }

+ 0
- 135
qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java Ver arquivo

@@ -1,135 +0,0 @@
1
-package com.zzsmart.qomo.kn.cost.manage.util;
2
-
3
-import com.alibaba.excel.EasyExcel;
4
-import com.alibaba.excel.annotation.ExcelProperty;
5
-import com.alibaba.excel.write.metadata.style.WriteCellStyle;
6
-import com.alibaba.excel.write.metadata.style.WriteFont;
7
-import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
8
-import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail;
9
-import org.apache.poi.ss.usermodel.*;
10
-
11
-import javax.servlet.http.HttpServletResponse;
12
-import java.io.IOException;
13
-import java.io.UnsupportedEncodingException;
14
-import java.lang.reflect.Field;
15
-import java.net.URLEncoder;
16
-import java.nio.charset.StandardCharsets;
17
-import java.util.ArrayList;
18
-import java.util.HashSet;
19
-import java.util.List;
20
-import java.util.Set;
21
-
22
-public class EasyExcelUtil {
23
-    /**
24
-     * 导出Excel文件到HTTP响应流,包含自定义表头。
25
-     *
26
-     * @param response HTTP响应对象
27
-     * @param fileName 导出的文件名
28
-     * @param head     表头信息列表
29
-     * @param data     需要导出的数据列表
30
-     * @param clazz    数据模型的Class类型
31
-     * @throws IOException IO异常
32
-     */
33
-    public static <T> void export(HttpServletResponse response, String fileName, List<?> head, List<T> data, Class<T> clazz) throws IOException {
34
-        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
35
-        response.setCharacterEncoding(StandardCharsets.UTF_8.name());
36
-        try {
37
-            fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()).replaceAll("\\+", "%20");
38
-            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
39
-        } catch (UnsupportedEncodingException e) {
40
-            e.printStackTrace();
41
-        }
42
-
43
-        // 自定义表头样式
44
-        HorizontalCellStyleStrategy horizontalCellStyleStrategy = getHorizontalCellStyleStrategy();
45
-
46
-        // 使用EasyExcel导出
47
-        try {
48
-            EasyExcel.write(response.getOutputStream(), clazz)
49
-                    // 注册样式策略
50
-                    .registerWriteHandler(horizontalCellStyleStrategy).sheet("1111").doWrite(data);
51
-        } catch (IOException e) {
52
-            e.printStackTrace();
53
-            throw new RuntimeException(e);
54
-        }
55
-//        FileOutputStream outputStream=  new FileOutputStream(fileName);
56
-//        try {
57
-//            EasyExcel.write(outputStream)
58
-//                    // 设置自定义样式,可选
59
-//                    .sheet("Sheet1") // 设置工作表名称
60
-//                    .doWrite(data); // 将数据写入Excel
61
-//        } catch (Exception e) {
62
-//            e.printStackTrace();
63
-//            System.out.println("zheli==============");
64
-//        } finally {
65
-////            if (excelWriter != null) {
66
-////                excelWriter.finish();
67
-////            }
68
-//            if (outputStream != null) {
69
-//                outputStream.close();
70
-//            }
71
-
72
-//        }
73
-    }
74
-
75
-    /**
76
-     * 创建自定义的水平单元格样式策略,用于表头样式。
77
-     *
78
-     * @return 水平单元格样式策略
79
-     */
80
-    private static HorizontalCellStyleStrategy getHorizontalCellStyleStrategy() {
81
-        // 设置表头字体样式
82
-        WriteFont headFont = new WriteFont();
83
-        headFont.setFontHeightInPoints((short) 12);
84
-        headFont.setFontName("Arial");
85
-        headFont.setBold(true);
86
-
87
-        // 设置表头单元格样式
88
-        WriteCellStyle headCellStyle = new WriteCellStyle();
89
-        headCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
90
-        headCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
91
-        headCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
92
-        headCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
93
-        headCellStyle.setBorderLeft(BorderStyle.THIN);
94
-        headCellStyle.setBorderRight(BorderStyle.THIN);
95
-        headCellStyle.setBorderTop(BorderStyle.THIN);
96
-        headCellStyle.setBorderBottom(BorderStyle.THIN);
97
-        headCellStyle.setWriteFont(headFont);
98
-
99
-        // 创建并返回水平单元格样式策略
100
-        return new HorizontalCellStyleStrategy(headCellStyle, (List<WriteCellStyle>) null);
101
-    }
102
-
103
-    /**
104
-     * 获取带有@Excel注解的属性集合
105
-     *
106
-     * @param clazz 实体类的Class对象
107
-     * @return 带有@Excel注解的Field集合
108
-     */
109
-    public static Field[] getExcelPropertyAnnotatedFields(Class<?> clazz) {
110
-        Field[] fields = clazz.getDeclaredFields();
111
-        List<Field> annotatedFields = new ArrayList<>();
112
-
113
-        for (Field field : fields) {
114
-            if (field.isAnnotationPresent(ExcelProperty.class)) {
115
-                annotatedFields.add(field);
116
-            }
117
-        }
118
-        return annotatedFields.toArray(new Field[0]);
119
-    }
120
-
121
-    /**
122
-     * 查询类需要导出的列名
123
-     *
124
-     * @param clazz
125
-     * @return
126
-     */
127
-    public static Set<String> getIncludeFields(Class<?> clazz) {
128
-        Field[] excelPropertyAnnotatedFields = getExcelPropertyAnnotatedFields(AppSceneCostStandardDetail.class);
129
-        Set<String> includeColumnFiledNames = new HashSet<String>();
130
-        for (int i = 0; i < excelPropertyAnnotatedFields.length; i++) {
131
-            includeColumnFiledNames.add(excelPropertyAnnotatedFields[i].getName());
132
-        }
133
-        return includeColumnFiledNames;
134
-    }
135
-}