Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
da30d821
Commit
da30d821
authored
Oct 16, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ziliaoxiazai bug
parent
e17cb6ea
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
51 deletions
+133
-51
CommonEnum.java
...om/yeejoin/amos/boot/module/hygf/api/Enum/CommonEnum.java
+10
-0
SurveyInformationDto.java
...n/amos/boot/module/hygf/api/dto/SurveyInformationDto.java
+2
-1
CommonController.java
...mos/boot/module/hygf/biz/controller/CommonController.java
+3
-3
CommonServiceImpl.java
.../boot/module/hygf/biz/service/impl/CommonServiceImpl.java
+118
-47
informationTemp.xlsx
...ygf-biz/src/main/resources/templates/informationTemp.xlsx
+0
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/CommonEnum.java
View file @
da30d821
...
@@ -52,6 +52,16 @@ public enum CommonEnum {
...
@@ -52,6 +52,16 @@ public enum CommonEnum {
非自然人
(
"非自然人"
,
"fzrr"
,
"商务类型"
),
非自然人
(
"非自然人"
,
"fzrr"
,
"商务类型"
),
宅基地农户屋顶
(
"宅基地农户屋顶"
,
"zjdnhw"
,
"法务类型"
),
宅基地农户屋顶
(
"宅基地农户屋顶"
,
"zjdnhw"
,
"法务类型"
),
法人私有的宅基地建筑屋顶
(
"法人私有的宅基地建筑屋顶"
,
"frsydzjd"
,
"法务类型"
),
法人私有的宅基地建筑屋顶
(
"法人私有的宅基地建筑屋顶"
,
"frsydzjd"
,
"法务类型"
),
单晶
(
"单晶"
,
"danjing"
,
"组件类型"
),
多晶
(
"多晶"
,
"duojing"
,
"组件类型"
),
不限
(
"不限"
,
"bx"
,
"逆变器系列"
),
全额上网
(
"全额上网"
,
"qesw"
,
"上网模式"
),
余电上网
(
"余电上网"
,
"ydsw"
,
"上网模式"
),
单相
(
"单相"
,
"dx"
,
"相位"
),
三相
(
"三相"
,
"ydsw"
,
"相位"
),
SMC
(
"SMC"
,
"smc"
,
"材质"
),
不锈钢
(
"不锈钢"
,
"bxg"
,
"材质"
),
钢板喷塑
(
"钢板喷塑"
,
"gbps"
,
"材质"
),
其他
(
"其他"
,
"other"
,
"公用"
);
其他
(
"其他"
,
"other"
,
"公用"
);
/**
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/SurveyInformationDto.java
View file @
da30d821
...
@@ -92,7 +92,8 @@ public class SurveyInformationDto extends BaseDto {
...
@@ -92,7 +92,8 @@ public class SurveyInformationDto extends BaseDto {
@ApiModelProperty
(
value
=
"项目地址"
)
@ApiModelProperty
(
value
=
"项目地址"
)
private
String
projectAddressName
;
private
String
projectAddressName
;
@ApiModelProperty
(
value
=
"常住地址"
)
private
String
permanentAddressName
;
@ApiModelProperty
(
value
=
"常住地址code"
)
@ApiModelProperty
(
value
=
"常住地址code"
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
@TableField
(
typeHandler
=
FastjsonTypeHandler
.
class
)
private
List
<
Integer
>
permanentAddress
;
private
List
<
Integer
>
permanentAddress
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/CommonController.java
View file @
da30d821
...
@@ -46,15 +46,15 @@ public class CommonController {
...
@@ -46,15 +46,15 @@ public class CommonController {
@GetMapping
(
value
=
"/downInformation"
)
@GetMapping
(
value
=
"/downInformation"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资料下载"
,
notes
=
"资料下载"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资料下载"
,
notes
=
"资料下载"
)
public
ResponseModel
downList
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
)
String
surveyInformationId
,
public
void
downList
(
HttpServletResponse
response
,
@RequestParam
(
required
=
false
)
String
surveyInformationId
,
@RequestParam
(
required
=
false
)
List
<
String
>
peasantHouseholdIds
,
@RequestParam
(
required
=
false
)
List
<
String
>
peasantHouseholdIds
,
@RequestParam
(
required
=
false
)
String
processInstanceId
)
throws
IOException
{
@RequestParam
(
required
=
false
)
String
processInstanceId
)
throws
IOException
{
// 设置响应头
// 设置响应头
response
.
setContentType
(
"application/zip"
);
response
.
setContentType
(
"application/zip"
);
commonService
.
downZiliao
(
surveyInformationId
,
peasantHouseholdIds
,
processInstanceId
,
response
);
return
CommonResponseNewUtil
.
success
();
commonService
.
downZiliao
(
surveyInformationId
,
peasantHouseholdIds
,
processInstanceId
,
response
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/CommonServiceImpl.java
View file @
da30d821
...
@@ -100,12 +100,16 @@ public class CommonServiceImpl {
...
@@ -100,12 +100,16 @@ public class CommonServiceImpl {
@Autowired
@Autowired
ConstructionRecordsMapper
constructionRecordsMapper
;
ConstructionRecordsMapper
constructionRecordsMapper
;
@Autowired
@Autowired
ConstructionGirdRecordsMapper
constructionGirdRecordsMapper
;
@Autowired
ConstructionAcceptanceRecordsMapper
constructionAcceptanceRecordsMapper
;
@Autowired
FinancingAuditingMapper
financingAuditingMapper
;
FinancingAuditingMapper
financingAuditingMapper
;
private
static
final
String
TEMP_DIR_NAME
=
"temp"
;
private
static
final
String
TEMP_DIR_NAME
=
"temp"
;
private
static
final
String
TEMPLATE_FILE_PATH
=
"templates/informationTemp.xlsx"
;
// 模版文件路径
private
static
final
String
TEMPLATE_FILE_PATH
=
"templates/informationTemp.xlsx"
;
// 模版文件路径
private
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
private
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
private
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
1
0
);
// 创建固定大小的线程池
private
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
3
0
);
// 创建固定大小的线程池
public
String
getRouthPath
(
String
type
,
Object
model
)
{
public
String
getRouthPath
(
String
type
,
Object
model
)
{
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
String
routhPath
=
""
;
String
routhPath
=
""
;
...
@@ -518,21 +522,20 @@ public class CommonServiceImpl {
...
@@ -518,21 +522,20 @@ public class CommonServiceImpl {
redisUtils
.
set
(
peasantHouseholdId
,
MapBuilder
.<
String
,
Object
>
create
()
redisUtils
.
set
(
peasantHouseholdId
,
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"value"
,
current
).
build
());
.
put
(
"value"
,
current
).
build
());
String
powerStationInstanceId
=
powerStationMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
powerStationInstanceId
=
powerStationMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
workOrderStationInstanceId
=
workOrderStationAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
basicGridInstanceId
=
basicGridAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
basicGridInstanceId
=
basicGridAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
financingInstanceId
=
financingAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
financingInstanceId
=
financingAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
List
<
LinkedHashMap
>
powerStationWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
powerStationWorkLog
=
new
ArrayList
<>();
List
<
ConstructionRecords
>
workOrderStationWorkLog
=
new
ArrayList
<>();
List
<
ConstructionRecords
>
workOrderStationWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
basicGridWorkLog
=
new
ArrayList
<>();
List
<
ConstructionGirdRecords
>
basicGridWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
financingWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
financingWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
accptWorkLog
=
new
ArrayList
<>();
List
<
ConstructionAcceptanceRecords
>
accptWorkLog
=
new
ArrayList
<>();
workOrderStationWorkLog
=
this
.
getConstructionRecords
(
peasantHouseholdId
);
workOrderStationWorkLog
=
this
.
getConstructionRecords
(
peasantHouseholdId
);
accptWorkLog
=
this
.
getConstructionRecordsAcc
(
peasantHouseholdId
);
basicGridWorkLog
=
this
.
getConstructionRecordsBasic
(
peasantHouseholdId
);
try
{
try
{
powerStationWorkLog
=
this
.
getWorkLog
(
powerStationInstanceId
);
powerStationWorkLog
=
this
.
getWorkLog
(
powerStationInstanceId
);
basicGridWorkLog
=
this
.
getWorkLog
(
basicGridInstanceId
);
financingWorkLog
=
this
.
getWorkLog
(
financingInstanceId
);
financingWorkLog
=
this
.
getWorkLog
(
financingInstanceId
);
accptWorkLog
=
this
.
getWorkLog
(
returnDto
.
getAcceptanceCheck
().
getInstanceId
());
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
e
.
printStackTrace
();
e
.
printStackTrace
();
...
@@ -781,14 +784,22 @@ public class CommonServiceImpl {
...
@@ -781,14 +784,22 @@ public class CommonServiceImpl {
redisUtils
.
set
(
redisKey
,
MapBuilder
.<
String
,
Object
>
create
()
redisUtils
.
set
(
redisKey
,
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"value"
,
100
).
build
());
.
put
(
"value"
,
100
).
build
());
String
encodedFilename
=
""
;
String
encodedFilename
=
""
;
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
if
(
peasantHouseholdIds
.
size
()
>
1
){
if
(
peasantHouseholdIds
.
size
()
>
1
){
fileName
=
"批量资料"
;
fileName
=
"批量资料"
;
encodedFilename
=
URLEncoder
.
encode
(
"批量资料.zip"
,
StandardCharsets
.
UTF_8
.
name
());
encodedFilename
=
URLEncoder
.
encode
(
"批量资料.zip"
,
StandardCharsets
.
UTF_8
.
name
());
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
+
".zip"
,
"UTF-8"
));
createZipFile
(
ziLiaoDir
,
fileName
,
response
);
}
else
{
}
else
{
encodedFilename
=
URLEncoder
.
encode
(
fileName
+
".zip"
,
StandardCharsets
.
UTF_8
.
name
());
encodedFilename
=
URLEncoder
.
encode
(
fileName
+
".zip"
,
StandardCharsets
.
UTF_8
.
name
());
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
+
".zip"
,
"UTF-8"
));
createZipFile
(
ziLiaoDir
,
"批量资料/"
+
fileName
,
response
);
}
}
response
.
setHeader
(
HttpHeaders
.
CONTENT_DISPOSITION
,
"attachment; filename*=UTF-8''"
+
encodedFilename
);
createZipFile
(
ziLiaoDir
,
"批量资料/"
+
fileName
,
response
);
// response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename*=UTF-8''" + encodedFilename);
cleanup
(
ziLiaoDir
);
cleanup
(
ziLiaoDir
);
}
}
...
@@ -823,7 +834,7 @@ public class CommonServiceImpl {
...
@@ -823,7 +834,7 @@ public class CommonServiceImpl {
// 假设表头内容如下:
// 假设表头内容如下:
String
headerOne
=
"组件"
;
String
headerOne
=
"组件"
;
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"电池片规格"
,
"功率"
,
"类型"
,
"边框"
,
"总功率
"
,
"单/双面"
,
"配置数量"
,
"金额
"
};
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"电池片规格"
,
"功率"
,
"类型"
,
"边框"
,
"总功率
(W)"
,
"单/双面"
,
"配置数量(块)"
,
"金额(元)
"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"dcpgg"
,
"gl"
,
"lx"
,
"bk"
,
"zgl"
,
"dsm"
,
"pzsl"
,
"price"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"dcpgg"
,
"gl"
,
"lx"
,
"bk"
,
"zgl"
,
"dsm"
,
"pzsl"
,
"price"
};
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
...
@@ -837,7 +848,7 @@ public class CommonServiceImpl {
...
@@ -837,7 +848,7 @@ public class CommonServiceImpl {
startRowNum
=
dataStartRow
+
2
+
maps
.
size
();
startRowNum
=
dataStartRow
+
2
+
maps
.
size
();
// 假设表头内容如下:
// 假设表头内容如下:
String
headerOne
=
"逆变器"
;
String
headerOne
=
"逆变器"
;
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"功率"
,
"系列"
,
"相位"
,
"配置数量
"
,
"金额
"
};
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"功率"
,
"系列"
,
"相位"
,
"配置数量
(块)"
,
"金额(元)
"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"gl"
,
"xl"
,
"xw"
,
"pzsl"
,
"price"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"gl"
,
"xl"
,
"xw"
,
"pzsl"
,
"price"
};
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
}
}
...
@@ -849,7 +860,7 @@ public class CommonServiceImpl {
...
@@ -849,7 +860,7 @@ public class CommonServiceImpl {
startRowNum
=
dataStartRow
+
2
+
maps
.
size
();
startRowNum
=
dataStartRow
+
2
+
maps
.
size
();
// 假设表头内容如下:
// 假设表头内容如下:
String
headerOne
=
"并网箱"
;
String
headerOne
=
"并网箱"
;
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"材质"
,
"功率"
,
"类型"
,
"功能"
,
"相位"
,
"上网模式"
,
"配置数量"
,
"金额"
};
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"材质"
,
"功率"
,
"类型"
,
"功能"
,
"相位"
,
"上网模式"
,
"配置数量"
,
"金额
(元)
"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"cz"
,
"gl"
,
"lx"
,
"gn"
,
"xw"
,
"swms"
,
"pzsl"
,
"price"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"cz"
,
"gl"
,
"lx"
,
"gn"
,
"xw"
,
"swms"
,
"pzsl"
,
"price"
};
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
...
@@ -863,7 +874,7 @@ public class CommonServiceImpl {
...
@@ -863,7 +874,7 @@ public class CommonServiceImpl {
// 假设表头内容如下:
// 假设表头内容如下:
String
headerOne
=
"电缆"
;
String
headerOne
=
"电缆"
;
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"型号"
,
"规格"
,
"配置数量"
};
String
[]
headersNames
=
{
"物联编码"
,
"物料名称"
,
"型号"
,
"规格"
,
"配置数量
(米)
"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"xh"
,
"gg"
,
"pzsl"
};
String
[]
headers
=
{
"wlbm"
,
"wlmc"
,
"xh"
,
"gg"
,
"pzsl"
};
...
@@ -1141,7 +1152,7 @@ public class CommonServiceImpl {
...
@@ -1141,7 +1152,7 @@ public class CommonServiceImpl {
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
}
}
}
}
if
(
sheet
.
getSheetName
().
contains
(
"审核
记录
"
))
{
if
(
sheet
.
getSheetName
().
contains
(
"审核
日志
"
))
{
int
startRowNum
=
1
;
int
startRowNum
=
1
;
if
(
null
!=
data
){
if
(
null
!=
data
){
...
@@ -1158,7 +1169,7 @@ public class CommonServiceImpl {
...
@@ -1158,7 +1169,7 @@ public class CommonServiceImpl {
}
}
}
}
if
(
sheet
.
getSheetName
().
contains
(
"
操作
记录"
))
{
if
(
sheet
.
getSheetName
().
contains
(
"
审核
记录"
))
{
int
startRowNum
=
1
;
int
startRowNum
=
1
;
if
(
null
!=
data
){
if
(
null
!=
data
){
int
headerRow
=
startRowNum
+
1
;
// 表头所在的行
int
headerRow
=
startRowNum
+
1
;
// 表头所在的行
...
@@ -1170,7 +1181,7 @@ public class CommonServiceImpl {
...
@@ -1170,7 +1181,7 @@ public class CommonServiceImpl {
String
headerOne
=
"施工完工操作记录"
;
String
headerOne
=
"施工完工操作记录"
;
String
[]
headersNames
=
{
"操作人"
,
"操作内容"
,
"操作时间"
,
"备注"
,};
String
[]
headersNames
=
{
"操作人"
,
"操作内容"
,
"操作时间"
,
"备注"
,};
String
[]
headers
=
{
"operator"
,
"operationContent"
,
"operationTime"
,
"notes"
};
String
[]
headers
=
{
"operator"
,
"operationContent"
,
"operationTime"
,
"notes"
};
List
<
Map
<
String
,
Object
>>
maps
=
convertListToMap
((
List
<
ConstructionRecords
>)
data
);
List
<
Map
<
String
,
Object
>>
maps
=
convertListToMap
((
List
<
?
>)
data
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
}
}
}
}
...
@@ -1235,26 +1246,36 @@ public class CommonServiceImpl {
...
@@ -1235,26 +1246,36 @@ public class CommonServiceImpl {
e
.
printStackTrace
();
e
.
printStackTrace
();
return
;
return
;
}
}
List
<
Field
>
listFields
=
getAllListFields
(
obj
.
getClass
());
for
(
Field
field
:
listFields
)
{
if
(
fileName
.
contains
(
"整改单附件"
)){
try
{
List
<
String
>
strings
=
extractUrls
((
List
<?>)
obj
,
urlPath
);
@SuppressWarnings
(
"unchecked"
)
for
(
String
imageUrl
:
strings
)
{
List
<
Object
>
list
=
(
List
<
Object
>)
FieldUtils
.
readField
(
field
,
obj
,
true
);
// 读取字段值
downloadAndSaveImage
(
imageUrl
,
baseInfoPath
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
}
for
(
Object
item
:
list
)
{
}
else
{
if
(
item
instanceof
Map
)
{
List
<
Field
>
listFields
=
getAllListFields
(
obj
.
getClass
());
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
item
;
for
(
Field
field
:
listFields
)
{
if
(
map
.
containsKey
(
"url"
)
&&
map
.
get
(
"url"
)
instanceof
String
)
{
try
{
String
imageUrl
=
urlPath
+(
String
)
map
.
get
(
"url"
);
@SuppressWarnings
(
"unchecked"
)
downloadAndSaveImage
(
imageUrl
,
baseInfoPath
);
List
<
Object
>
list
=
(
List
<
Object
>)
FieldUtils
.
readField
(
field
,
obj
,
true
);
// 读取字段值
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
for
(
Object
item
:
list
)
{
if
(
item
instanceof
Map
)
{
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
item
;
if
(
map
.
containsKey
(
"url"
)
&&
map
.
get
(
"url"
)
instanceof
String
)
{
String
imageUrl
=
urlPath
+(
String
)
map
.
get
(
"url"
);
downloadAndSaveImage
(
imageUrl
,
baseInfoPath
);
}
}
}
}
}
}
}
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
}
...
@@ -1359,37 +1380,69 @@ public class CommonServiceImpl {
...
@@ -1359,37 +1380,69 @@ public class CommonServiceImpl {
public
static
List
<
String
>
extractUrls
(
List
<?>
list
,
String
urlPath
)
{
public
static
List
<
String
>
extractUrls
(
SurveyInformationDto
surveyInfo
)
{
List
<
String
>
urls
=
new
ArrayList
<>();
List
<
String
>
urls
=
new
ArrayList
<>();
// 获取所有类型为List<Object>的字段
for
(
Object
obj
:
list
)
{
List
<
Field
>
listFields
=
getAllListFields
(
surveyInfo
.
getClass
());
// 获取所有类型为List<Object>的字段
List
<
Field
>
listFields
=
getAllListFields
(
obj
.
getClass
());
for
(
Field
field
:
listFields
)
{
for
(
Field
field
:
listFields
)
{
try
{
try
{
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
List
<
Object
>
list
=
(
List
<
Object
>)
FieldUtils
.
readField
(
field
,
surveyInfo
,
true
);
List
<
Object
>
urlList
=
(
List
<
Object
>)
FieldUtils
.
readField
(
field
,
obj
,
true
);
// 从List<Object>中提取url值
// 从List<Object>中提取url值
for
(
Object
item
:
list
)
{
for
(
Object
item
:
urlList
)
{
if
(
item
instanceof
Map
)
{
if
(
item
instanceof
Map
)
{
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
item
;
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
item
;
if
(
map
.
containsKey
(
"url"
)
&&
map
.
get
(
"url"
)
instanceof
String
)
{
if
(
map
.
containsKey
(
"url"
)
&&
map
.
get
(
"url"
)
instanceof
String
)
{
urls
.
add
(
"http://47.92.234.253:8088"
+(
String
)
map
.
get
(
"url"
));
urls
.
add
(
urlPath
+(
String
)
map
.
get
(
"url"
));
}
}
}
}
}
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
}
}
return
urls
;
return
urls
;
}
}
//
// public static List<String> extractUrls(SurveyInformationDto surveyInfo) {
// List<String> urls = new ArrayList<>();
//
// // 获取所有类型为List<Object>的字段
// List<Field> listFields = getAllListFields(surveyInfo.getClass());
//
// for (Field field : listFields) {
// try {
// @SuppressWarnings("unchecked")
// List<Object> list = (List<Object>) FieldUtils.readField(field, surveyInfo, true);
//
// // 从List<Object>中提取url值
// for (Object item : list) {
// if (item instanceof Map) {
// Map<String, Object> map = (Map<String, Object>) item;
// if (map.containsKey("url") && map.get("url") instanceof String) {
// urls.add("http://47.92.234.253:8088"+(String) map.get("url"));
// }
// }
// }
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// }
// }
//
// return urls;
// }
private
static
List
<
Field
>
getAllListFields
(
Class
<?>
clazz
)
{
private
static
List
<
Field
>
getAllListFields
(
Class
<?>
clazz
)
{
List
<
Field
>
fields
=
new
ArrayList
<>();
List
<
Field
>
fields
=
new
ArrayList
<>();
Class
<?>
currentClass
=
clazz
;
Class
<?>
currentClass
=
clazz
;
...
@@ -1672,6 +1725,24 @@ public class CommonServiceImpl {
...
@@ -1672,6 +1725,24 @@ public class CommonServiceImpl {
return
constructionRecordsMapper
.
selectList
(
up5
);
return
constructionRecordsMapper
.
selectList
(
up5
);
}
}
List
<
ConstructionGirdRecords
>
getConstructionRecordsBasic
(
String
peasantHouseholdId
)
{
// 施工自审操作记录
LambdaQueryWrapper
<
ConstructionGirdRecords
>
up5
=
new
LambdaQueryWrapper
<
ConstructionGirdRecords
>();
up5
.
eq
(
ConstructionGirdRecords:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
up5
.
orderByAsc
(
ConstructionGirdRecords:
:
getRecDate
);
return
constructionGirdRecordsMapper
.
selectList
(
up5
);
}
List
<
ConstructionAcceptanceRecords
>
getConstructionRecordsAcc
(
String
peasantHouseholdId
)
{
// 施工自审操作记录
LambdaQueryWrapper
<
ConstructionAcceptanceRecords
>
up5
=
new
LambdaQueryWrapper
<
ConstructionAcceptanceRecords
>();
up5
.
eq
(
ConstructionAcceptanceRecords:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
up5
.
orderByAsc
(
ConstructionAcceptanceRecords:
:
getRecDate
);
return
constructionAcceptanceRecordsMapper
.
selectList
(
up5
);
}
public
Object
getSchedule
(
String
peasantHouseholdId
)
{
public
Object
getSchedule
(
String
peasantHouseholdId
)
{
if
(!
redisUtils
.
hasKey
(
peasantHouseholdId
)){
if
(!
redisUtils
.
hasKey
(
peasantHouseholdId
)){
return
null
;
return
null
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/templates/informationTemp.xlsx
View file @
da30d821
No preview for this file type
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