Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
a8e79b14
Commit
a8e79b14
authored
Nov 08, 2021
by
tianbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改poi引用版本4.0.1
防火监督计划任务报告生成
parent
9f24cc09
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
340 additions
and
134 deletions
+340
-134
pom.xml
amos-boot-biz-common/pom.xml
+1
-1
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+1
-6
WorkFlowUriEnum.java
...com/yeejoin/amos/patrol/common/enums/WorkFlowUriEnum.java
+3
-2
pom.xml
...-boot-module-api/amos-boot-module-supervision-api/pom.xml
+6
-0
CheckReportDto.java
...join/amos/supervision/core/common/dto/CheckReportDto.java
+10
-1
FileHelper.java
...m/yeejoin/amos/latentdanger/business/util/FileHelper.java
+62
-37
pom.xml
...-boot-module-biz/amos-boot-module-maintenance-biz/pom.xml
+18
-0
FileHelper.java
...om/yeejoin/amos/maintenance/business/util/FileHelper.java
+25
-24
LatentDangerController.java
...os/patrol/business/controller/LatentDangerController.java
+17
-0
LatentDangerServiceImpl.java
...patrol/business/service/impl/LatentDangerServiceImpl.java
+11
-0
ILatentDangerService.java
...s/patrol/business/service/intfc/ILatentDangerService.java
+2
-0
FileHelper.java
...ava/com/yeejoin/amos/patrol/business/util/FileHelper.java
+28
-27
pom.xml
...-boot-module-biz/amos-boot-module-supervision-biz/pom.xml
+67
-1
CheckReportController.java
...upervision/business/controller/CheckReportController.java
+12
-5
CheckReportServiceImpl.java
...rvision/business/service/impl/CheckReportServiceImpl.java
+0
-0
ICheckReportService.java
...pervision/business/service/intfc/ICheckReportService.java
+12
-0
FileHelper.java
...om/yeejoin/amos/supervision/business/util/FileHelper.java
+28
-26
pom.xml
amos-boot-module/pom.xml
+6
-0
pom.xml
amos-boot-system-supervision/pom.xml
+18
-0
CheckReportMapper.xml
...vision/src/main/resources/db/mapper/CheckReportMapper.xml
+2
-1
check-report-template.docx
...n/src/main/resources/templates/check-report-template.docx
+0
-0
pom.xml
pom.xml
+11
-3
No files found.
amos-boot-biz-common/pom.xml
View file @
a8e79b14
...
...
@@ -99,7 +99,7 @@
<dependency>
<groupId>
cn.afterturn
</groupId>
<artifactId>
easypoi-base
</artifactId>
<version>
3.0.3
</version>
<version>
4.0.0
</version>
</dependency>
<dependency>
<groupId>
cn.afterturn
</groupId>
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
a8e79b14
...
...
@@ -26,6 +26,7 @@ public class DateUtils {
public
static
final
String
DATE_PATTERN_NUM
=
"yyyyMMdd"
;
public
static
final
String
CHN_DATE_PATTERN_YEAR
=
"yyyy年"
;
public
static
final
String
CHN_DATE_PATTERN_MONTH
=
"MM月"
;
public
static
final
String
CHN_DATE_PATTERN
=
"yyyy年MM月dd日"
;
/**
* 获取 当前年、半年、季度、月、日、小时 开始结束时间
...
...
@@ -799,12 +800,6 @@ public class DateUtils {
return
getDate
(
calendar
.
getTime
());
}
public
static
String
getWeekDate
(
Date
date
)
throws
ParseException
{
String
month
=
dateFormat
(
date
,
CHN_DATE_PATTERN_MONTH
);
String
weekDateStr
=
getWeekBeginDate
(
date
)
+
"-"
+
getWeekEndDate
(
date
);
return
month
+
weekDateStr
+
"日"
;
}
/**
* 将秒数转换为时分秒格式
* @param times
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/common/enums/WorkFlowUriEnum.java
View file @
a8e79b14
...
...
@@ -13,11 +13,12 @@ public enum WorkFlowUriEnum {
已执行任务有
ID
(
"已执行任务有ID"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
启动免登录流程
(
"启动免登录流程"
,
"/processes/{appKey}"
,
"appKey"
),
当前节点
(
"当前节点"
,
"/wf/taskstodo?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
执行流程
(
"执行流程"
,
"/workflow/task/pickupAndCompleteTask/{taskId}"
,
"taskId"
),
执行流程
(
"执行流程"
,
"/workflow/task/pickupAndCom
task/{processInstanceId}
pleteTask/{taskId}"
,
"taskId"
),
终止流程
(
"终止流程"
,
"/wf/processes/{processInstanceId}?deleteReason={deleteReason}"
,
"processInstanceId,deleteReason"
),
当前子节点
(
"当前子节点"
,
"/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}"
,
"processInstanceId,taskDefinitionKey"
),
工作流流水
(
"工作流流水"
,
"/wf/processes/{processInstanceId}/tasks"
,
"processInstanceId"
),
子节点信息
(
"子节点信息"
,
"/workflow/task/list/all/{instanceId}"
,
"instanceId"
);
子节点信息
(
"子节点信息"
,
"/workflow/task/list/all/{instanceId}"
,
"instanceId"
),
当前任务
(
"子节点信息"
,
"/workflow/task/{processInstanceId}"
,
"processInstanceId"
);
private
String
desc
;
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/pom.xml
View file @
a8e79b14
...
...
@@ -22,6 +22,12 @@
<groupId>
cn.afterturn
</groupId>
<artifactId>
easypoi-base
</artifactId>
<version>
3.0.3
</version>
<exclusions>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
cn.afterturn
</groupId>
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-supervision-api/src/main/java/com/yeejoin/amos/supervision/core/common/dto/CheckReportDto.java
View file @
a8e79b14
...
...
@@ -68,7 +68,7 @@ public class CheckReportDto implements Serializable {
Integer
reviewReformingCount
;
@ApiModelProperty
(
value
=
"剩余隐患数量"
)
Integer
remain
der
DangerCount
;
Integer
remain
ing
DangerCount
;
@ApiModelProperty
(
value
=
"机构代码"
)
String
orgCode
;
...
...
@@ -90,4 +90,13 @@ public class CheckReportDto implements Serializable {
@ApiModelProperty
(
value
=
"本次复查隐患id"
)
String
reviewDangerIds
;
@ApiModelProperty
(
value
=
"计划执行频次"
)
String
planCheckFrequencyType
;
@ApiModelProperty
(
value
=
"报告时期"
)
String
reportDate
;
@ApiModelProperty
(
value
=
"当前日期"
)
String
nowDate
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-latentdanger-biz/src/main/java/com/yeejoin/amos/latentdanger/business/util/FileHelper.java
View file @
a8e79b14
...
...
@@ -5,18 +5,26 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import
cn.afterturn.easypoi.excel.entity.ExportParams
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
com.google.zxing.BarcodeFormat
;
import
com.google.zxing.MultiFormatWriter
;
import
com.google.zxing.client.j2se.MatrixToImageWriter
;
import
com.google.zxing.common.BitMatrix
;
import
com.yeejoin.amos.latentdanger.exception.YeeException
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.poi.hslf.usermodel.HSLFSlideShow
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.hssf.usermodel.DVConstraint
;
import
org.apache.poi.hssf.usermodel.HSSFCell
;
import
org.apache.poi.hssf.usermodel.HSSFCellStyle
;
import
org.apache.poi.hssf.usermodel.HSSFDataValidation
;
import
org.apache.poi.hssf.usermodel.HSSFFont
;
import
org.apache.poi.hssf.usermodel.HSSFRow
;
import
org.apache.poi.hssf.usermodel.HSSFSheet
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
import
org.apache.poi.hwpf.HWPFDocument
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.usermodel.DataValidation
;
import
org.apache.poi.ss.usermodel.DataValidationConstraint
;
import
org.apache.poi.ss.usermodel.DataValidationHelper
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.util.CellRangeAddressList
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbookFactory
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
org.jsoup.Jsoup
;
import
org.jsoup.nodes.Document
;
...
...
@@ -28,18 +36,35 @@ import org.springframework.util.ObjectUtils;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.awt.image.BufferedImage
;
import
java.io.*
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
import
java.io.BufferedReader
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.io.OutputStreamWriter
;
import
java.io.UnsupportedEncodingException
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.URLEncoder
;
import
java.nio.ByteBuffer
;
import
java.nio.channels.Channel
;
import
java.nio.channels.FileChannel
;
import
java.util.*
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.NoSuchElementException
;
import
java.util.TreeSet
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
...
...
@@ -62,33 +87,33 @@ public class FileHelper {
* @param file
* @return
*/
public
static
boolean
isExcel2003
(
File
file
)
{
InputStream
is
=
null
;
Workbook
wb
=
null
;
try
{
is
=
new
FileInputStream
(
file
);
wb
=
WorkbookFactory
.
create
(
is
);
if
(
wb
instanceof
XSSFWorkbook
)
{
return
false
;
}
else
if
(
wb
instanceof
HSSFWorkbook
)
{
return
true
;
}
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
try
{
if
(
null
!=
is
)
{
is
.
close
();
}
if
(
null
!=
wb
)
{
wb
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
true
;
}
//
public static boolean isExcel2003(File file) {
//
InputStream is = null;
//
Workbook wb = null;
//
try {
//
is = new FileInputStream(file);
// wb = XSSFWorkbookFactory.createWorkbook
(is);
//
if (wb instanceof XSSFWorkbook) {
//
return false;
//
} else if (wb instanceof HSSFWorkbook) {
//
return true;
//
}
//
} catch (Exception e) {
//
return false;
//
} finally {
//
try {
//
if (null != is) {
//
is.close();
//
}
//
if (null != wb) {
//
wb.close();
//
}
//
} catch (IOException e) {
//
e.printStackTrace();
//
}
//
}
//
return true;
//
}
/**
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/pom.xml
View file @
a8e79b14
...
...
@@ -15,6 +15,12 @@
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-maintenance-api
</artifactId>
<version>
${amos-biz-boot.version}
</version>
<exclusions>
<exclusion>
<artifactId>
easypoi-base
</artifactId>
<groupId>
cn.afterturn
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
...
...
@@ -71,6 +77,12 @@
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
3.15
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
...
...
@@ -87,6 +99,12 @@
<groupId>
org.apache.tika
</groupId>
<artifactId>
tika-parsers
</artifactId>
<version>
1.13
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/util/FileHelper.java
View file @
a8e79b14
...
...
@@ -139,28 +139,28 @@ public class FileHelper {
* @param file
* @return
*/
public
static
boolean
isPPT2003
(
File
file
)
{
InputStream
is
=
null
;
HSLFSlideShow
ppt
=
null
;
try
{
is
=
new
FileInputStream
(
file
);
ppt
=
new
HSLFSlideShow
(
is
);
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
try
{
if
(
null
!=
is
)
{
is
.
close
();
}
if
(
null
!=
ppt
)
{
ppt
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
true
;
}
//
public static boolean isPPT2003(File file) {
//
InputStream is = null;
//
HSLFSlideShow ppt = null;
//
try {
//
is = new FileInputStream(file);
//
ppt = new HSLFSlideShow(is);
//
} catch (Exception e) {
//
return false;
//
} finally {
//
try {
//
if (null != is) {
//
is.close();
//
}
//
if (null != ppt) {
//
ppt.close();
//
}
//
} catch (IOException e) {
//
e.printStackTrace();
//
}
//
}
//
return true;
//
}
/**
*
...
...
@@ -1109,12 +1109,13 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
//表头样式
HSSFCellStyle
style
=
wb
.
createCellStyle
();
style
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
// 创建一个居中格式
// style.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 创建一个居中格式
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// 创建一个居中格式poi 4.0.0+
//字体样式
HSSFFont
fontStyle
=
wb
.
createFont
();
fontStyle
.
setFontName
(
"微软雅黑"
);
fontStyle
.
setFontHeightInPoints
((
short
)
12
);
fontStyle
.
setBoldweight
(
HSSFFont
.
BOLDWEIGHT_BOLD
);
//
fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style
.
setFont
(
fontStyle
);
//新建sheet
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/LatentDangerController.java
View file @
a8e79b14
...
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.data.domain.Page
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -311,4 +312,20 @@ public class LatentDangerController extends AbstractBaseController {
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
@ApiOperation
(
value
=
"隐患当前任务"
,
notes
=
"隐患当前任务"
)
@GetMapping
(
value
=
"/detail/task/{processInstanceId}"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
public
CommonResponse
detail
(
@PathVariable
String
processInstanceId
)
{
try
{
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
}
return
CommonResponseUtil
.
success
(
iLatentDangerService
.
queryTaskByInstanceId
(
processInstanceId
));
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取隐患任务出错"
,
e
.
getMessage
());
return
CommonResponseUtil
.
failure
(
"系统繁忙,请稍后再试"
);
}
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/LatentDangerServiceImpl.java
View file @
a8e79b14
...
...
@@ -1666,4 +1666,15 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
}
return
informerList
;
}
@Override
public
String
queryTaskByInstanceId
(
String
processInstanceId
)
{
String
taskId
=
null
;
JSONObject
taskJson
=
remoteWorkFlowService
.
queryTask
(
processInstanceId
);
if
(
null
!=
taskJson
)
{
JSONObject
dataJson
=
(
JSONObject
)
taskJson
.
get
(
"data"
);
taskId
=
(
String
)
dataJson
.
get
(
"id"
);
}
return
taskId
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/ILatentDangerService.java
View file @
a8e79b14
...
...
@@ -81,4 +81,6 @@ public interface ILatentDangerService {
List
<
DangerListResponse
>
export
(
PageParam
pageParam
);
List
<
DangerTimeAxisVo
>
queryExecuteLog
(
Integer
dateTime
);
String
queryTaskByInstanceId
(
String
processInstanceId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/util/FileHelper.java
View file @
a8e79b14
...
...
@@ -18,6 +18,7 @@ import org.apache.poi.hwpf.HWPFDocument;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.ss.util.CellRangeAddressList
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbookFactory
;
import
org.apache.poi.xwpf.usermodel.XWPFDocument
;
import
org.jsoup.Jsoup
;
import
org.jsoup.nodes.Document
;
...
...
@@ -63,33 +64,33 @@ public class FileHelper {
* @param file
* @return
*/
public
static
boolean
isExcel2003
(
File
file
)
{
InputStream
is
=
null
;
Workbook
wb
=
null
;
try
{
is
=
new
FileInputStream
(
file
);
wb
=
WorkbookFactory
.
create
(
is
);
if
(
wb
instanceof
XSSFWorkbook
)
{
return
false
;
}
else
if
(
wb
instanceof
HSSFWorkbook
)
{
return
true
;
}
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
try
{
if
(
null
!=
is
)
{
is
.
close
();
}
if
(
null
!=
wb
)
{
wb
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
true
;
}
//
public static boolean isExcel2003(File file) {
//
InputStream is = null;
//
Workbook wb = null;
//
try {
//
is = new FileInputStream(file);
// wb = XSSFWorkbookFactory.createWorkbook
(is);
//
if (wb instanceof XSSFWorkbook) {
//
return false;
//
} else if (wb instanceof HSSFWorkbook) {
//
return true;
//
}
//
} catch (Exception e) {
//
return false;
//
} finally {
//
try {
//
if (null != is) {
//
is.close();
//
}
//
if (null != wb) {
//
wb.close();
//
}
//
} catch (IOException e) {
//
e.printStackTrace();
//
}
//
}
//
return true;
//
}
/**
*
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/pom.xml
View file @
a8e79b14
...
...
@@ -68,6 +68,12 @@
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
3.15
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.tika
</groupId>
...
...
@@ -78,7 +84,17 @@
<groupId>
org.apache.tika
</groupId>
<artifactId>
tika-parsers
</artifactId>
<version>
1.13
</version>
</dependency>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-mail
</artifactId>
...
...
@@ -96,6 +112,56 @@
<artifactId>
amos-boot-module-supervision-api
</artifactId>
<version>
1.0.0
</version>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
com.deepoove
</groupId>
<artifactId>
poi-tl
</artifactId>
<version>
1.6.0
</version>
<scope>
compile
</scope>
<exclusions>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
<version>
4.0.1
</version>
</dependency>
</dependencies>
</project>
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/CheckReportController.java
View file @
a8e79b14
...
...
@@ -3,14 +3,11 @@ package com.yeejoin.amos.supervision.business.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.supervision.business.feign.DangerFeignClient
;
import
com.yeejoin.amos.supervision.business.service.intfc.ICheckReportService
;
import
com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -24,7 +21,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Date
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.UnsupportedEncodingException
;
import
java.text.ParseException
;
@RestController
@RequestMapping
(
value
=
"/check/report"
)
...
...
@@ -48,7 +47,8 @@ public class CheckReportController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"分页查询检查报告"
,
notes
=
"分页查询检查报告"
)
@PostMapping
(
value
=
"/page"
)
public
ResponseModel
queryPage
(
@RequestParam
(
value
=
"当前页"
)
int
current
,
@RequestParam
(
value
=
"分页大小"
)
int
size
,
@RequestBody
(
required
=
false
)
CheckReportParamDto
queryParam
)
{
public
ResponseModel
queryPage
(
@RequestParam
int
current
,
@RequestParam
int
size
,
@RequestBody
(
required
=
false
)
CheckReportParamDto
queryParam
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
if
(
loginOrgCode
.
contains
(
"-"
))
{
...
...
@@ -70,4 +70,11 @@ public class CheckReportController extends BaseController {
public
ResponseModel
getDetailById
(
@PathVariable
(
value
=
"id"
)
String
id
)
{
return
ResponseHelper
.
buildResponse
(
iCheckReportService
.
getDetailById
(
id
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"获取检查报告文档"
,
notes
=
"获取检查报告文档"
)
@GetMapping
(
value
=
"/docx/{id}"
)
public
ResponseModel
getCheckReportDocx
(
HttpServletResponse
response
,
@PathVariable
(
name
=
"id"
)
String
reportId
)
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
iCheckReportService
.
getCheckReportDocx
(
response
,
reportId
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/CheckReportServiceImpl.java
View file @
a8e79b14
This diff is collapsed.
Click to expand it.
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/ICheckReportService.java
View file @
a8e79b14
...
...
@@ -7,6 +7,9 @@ import com.yeejoin.amos.supervision.core.common.dto.CheckReportParamDto;
import
com.yeejoin.amos.supervision.core.common.request.CommonPageable
;
import
com.yeejoin.amos.supervision.dao.entity.PlanTask
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.text.ParseException
;
public
interface
ICheckReportService
{
...
...
@@ -27,4 +30,13 @@ public interface ICheckReportService {
* @return
*/
CheckReportDto
getDetailById
(
String
id
);
/**
* 生成指定报告的word文档
*
* @param response
* @param reportId
* @return
*/
Object
getCheckReportDocx
(
HttpServletResponse
response
,
String
reportId
)
throws
Exception
;
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/util/FileHelper.java
View file @
a8e79b14
...
...
@@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.ExcelImportUtil;
import
cn.afterturn.easypoi.excel.entity.ExportParams
;
import
cn.afterturn.easypoi.excel.entity.ImportParams
;
import
cn.afterturn.easypoi.excel.entity.enmus.ExcelType
;
import
com.alibaba.excel.metadata.Sheet
;
import
com.google.zxing.BarcodeFormat
;
import
com.google.zxing.MultiFormatWriter
;
import
com.google.zxing.client.j2se.MatrixToImageWriter
;
...
...
@@ -139,28 +140,28 @@ public class FileHelper {
* @param file
* @return
*/
public
static
boolean
isPPT2003
(
File
file
)
{
InputStream
is
=
null
;
HSLFSlideShow
ppt
=
null
;
try
{
is
=
new
FileInputStream
(
file
);
ppt
=
new
HSLFSlideShow
(
is
);
}
catch
(
Exception
e
)
{
return
false
;
}
finally
{
try
{
if
(
null
!=
is
)
{
is
.
close
();
}
if
(
null
!=
ppt
)
{
ppt
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
true
;
}
//
public static boolean isPPT2003(File file) {
//
InputStream is = null;
//
HSLFSlideShow ppt = null;
//
try {
//
is = new FileInputStream(file);
//
ppt = new HSLFSlideShow(is);
//
} catch (Exception e) {
//
return false;
//
} finally {
//
try {
//
if (null != is) {
//
is.close();
//
}
//
if (null != ppt) {
//
ppt.close();
//
}
//
} catch (IOException e) {
//
e.printStackTrace();
//
}
//
}
//
return true;
//
}
/**
*
...
...
@@ -1109,12 +1110,14 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
//表头样式
HSSFCellStyle
style
=
wb
.
createCellStyle
();
style
.
setAlignment
(
HSSFCellStyle
.
ALIGN_CENTER
);
// 创建一个居中格式
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// 创建一个居中格式
//字体样式
HSSFFont
fontStyle
=
wb
.
createFont
();
fontStyle
.
setFontName
(
"微软雅黑"
);
fontStyle
.
setFontHeightInPoints
((
short
)
12
);
fontStyle
.
setBold
weight
(
HSSFFont
.
BOLDWEIGHT_BOLD
);
fontStyle
.
setBold
(
true
);
style
.
setFont
(
fontStyle
);
//新建sheet
...
...
@@ -1225,8 +1228,7 @@ private static void defaultExport(List<Map<String, Object>> list, String fileNam
* @return DataValidation
* @throws
*/
private
static
DataValidation
setDataValidation
(
Sheet
sheet
,
String
[]
textList
,
int
firstRow
,
int
endRow
,
int
firstCol
,
int
endCol
)
{
private
static
DataValidation
setDataValidation
(
HSSFSheet
sheet
,
String
[]
textList
,
int
firstRow
,
int
endRow
,
int
firstCol
,
int
endCol
)
{
DataValidationHelper
helper
=
sheet
.
getDataValidationHelper
();
//加载下拉列表内容
DataValidationConstraint
constraint
=
helper
.
createExplicitListConstraint
(
textList
);
...
...
amos-boot-module/pom.xml
View file @
a8e79b14
...
...
@@ -18,6 +18,12 @@
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-biz-common
</artifactId>
<version>
${amos-biz-boot.version}
</version>
<exclusions>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
...
...
amos-boot-system-supervision/pom.xml
View file @
a8e79b14
...
...
@@ -14,6 +14,24 @@
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-supervision-biz
</artifactId>
<version>
${amos-biz-boot.version}
</version>
<exclusions>
<exclusion>
<artifactId>
easypoi-base
</artifactId>
<groupId>
cn.afterturn
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-ooxml-schemas
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
<exclusion>
<artifactId>
poi-scratchpad
</artifactId>
<groupId>
org.apache.poi
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
...
...
amos-boot-system-supervision/src/main/resources/db/mapper/CheckReportMapper.xml
View file @
a8e79b14
...
...
@@ -67,7 +67,8 @@
p.check_type_name planCheckType,
p.check_level planCheckLevel,
DATE_FORMAT(pt.begin_time, '%Y-%m-%d') startPlanTaskDate,
DATE_FORMAT(pt.end_time, '%Y-%m-%d') endPlanTaskDate
DATE_FORMAT(pt.end_time, '%Y-%m-%d') endPlanTaskDate,
p.plan_type planCheckFrequencyType
from p_check_report cr
LEFT JOIN p_plan_task pt on pt.id = cr.plan_task_id
left join p_plan p on p.id = pt.plan_id
...
...
amos-boot-system-supervision/src/main/resources/templates/check-report-template.docx
0 → 100644
View file @
a8e79b14
File added
pom.xml
View file @
a8e79b14
...
...
@@ -79,6 +79,14 @@
<groupId>
org.ow2.asm
</groupId>
<artifactId>
asm
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi
</artifactId>
</exclusion>
<exclusion>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
...
...
@@ -94,7 +102,7 @@
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-scratchpad
</artifactId>
<version>
3.17
</version>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
...
...
@@ -106,7 +114,7 @@
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
3.17
</version>
<version>
4.0.1
</version>
<exclusions>
<exclusion>
<artifactId>
poi
</artifactId>
...
...
@@ -127,7 +135,7 @@
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml-schemas
</artifactId>
<version>
3.17
</version>
<version>
4.0.1
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment