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
44479e60
Commit
44479e60
authored
Oct 15, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer_bw' into developer_bw
parents
0f4afbff
0cc2e7c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
10 deletions
+45
-10
CommonServiceImpl.java
.../boot/module/hygf/biz/service/impl/CommonServiceImpl.java
+45
-10
informationTemp.xlsx
...ygf-biz/src/main/resources/templates/informationTemp.xlsx
+0
-0
No files found.
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 @
44479e60
...
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.google.common.net.HttpHeaders
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
...
...
@@ -12,10 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.CommonEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAuditingMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingAuditingMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfWorkOrderStationAuditingMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient
;
...
...
@@ -100,6 +98,8 @@ public class CommonServiceImpl {
@Autowired
BasicGridAuditingMapper
basicGridAuditingMapper
;
@Autowired
ConstructionRecordsMapper
constructionRecordsMapper
;
@Autowired
FinancingAuditingMapper
financingAuditingMapper
;
private
static
final
String
TEMP_DIR_NAME
=
"temp"
;
private
static
final
String
TEMPLATE_FILE_PATH
=
"templates/informationTemp.xlsx"
;
// 模版文件路径
...
...
@@ -510,15 +510,14 @@ public class CommonServiceImpl {
String
basicGridInstanceId
=
basicGridAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
financingInstanceId
=
financingAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
List
<
LinkedHashMap
>
powerStationWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
workOrderStationWorkLog
=
new
ArrayList
<>();
List
<
ConstructionRecords
>
workOrderStationWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
basicGridWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
financingWorkLog
=
new
ArrayList
<>();
List
<
LinkedHashMap
>
accptWorkLog
=
new
ArrayList
<>();
workOrderStationWorkLog
=
this
.
getConstructionRecords
(
peasantHouseholdId
);
try
{
powerStationWorkLog
=
this
.
getWorkLog
(
powerStationInstanceId
);
workOrderStationWorkLog
=
this
.
getWorkLog
(
workOrderStationInstanceId
);
basicGridWorkLog
=
this
.
getWorkLog
(
basicGridInstanceId
);
financingWorkLog
=
this
.
getWorkLog
(
financingInstanceId
);
accptWorkLog
=
this
.
getWorkLog
(
returnDto
.
getAcceptanceCheck
().
getInstanceId
());
...
...
@@ -1121,6 +1120,23 @@ public class CommonServiceImpl {
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
(
List
<
Map
<
String
,
Object
>>)
data
);
}
}
if
(
sheet
.
getSheetName
().
contains
(
"操作记录"
))
{
int
startRowNum
=
1
;
if
(
null
!=
data
){
int
headerRow
=
startRowNum
+
1
;
// 表头所在的行
int
headerOneRow
=
startRowNum
;
// 表头所在的行
int
dataStartRow
=
startRowNum
+
2
;
// 数据开始的行
startRowNum
=
dataStartRow
+
1
;
// 假设表头内容如下:
String
headerOne
=
"施工完工操作记录"
;
String
[]
headersNames
=
{
"操作人"
,
"操作内容"
,
"操作时间"
,
"备注"
,};
String
[]
headers
=
{
"operator"
,
"operationContent"
,
"operationTime"
,
"notes"
};
List
<
Map
<
String
,
Object
>>
maps
=
convertListToMap
((
List
<
ConstructionRecords
>)
data
);
documentSpecialProcessing
(
sheet
,
headerRow
,
headerOneRow
,
dataStartRow
,
headersNames
,
headers
,
headerOne
,
maps
);
}
}
}
private
String
removePlaceholders
(
String
fieldValue
)
{
...
...
@@ -1401,7 +1417,13 @@ public class CommonServiceImpl {
// 从第四行开始填充数据
for
(
int
dataIndex
=
0
;
dataIndex
<
data
.
size
();
dataIndex
++)
{
Row
dataRow
=
sheet
.
createRow
(
dataStartRow
+
dataIndex
);
Map
<
String
,
Object
>
rowData
=
(
Map
<
String
,
Object
>)
data
.
get
(
dataIndex
).
get
(
"map"
);
Map
<
String
,
Object
>
result
=
(
Map
<
String
,
Object
>)
data
.
get
(
dataIndex
);
Map
<
String
,
Object
>
rowData
=
new
HashMap
<>();
if
(
result
.
containsKey
(
"map"
)){
rowData
=
(
Map
<
String
,
Object
>)
result
.
get
(
"map"
);
}
else
{
rowData
=
result
;
}
for
(
int
i
=
0
;
i
<
headersNames
.
length
;
i
++)
{
Cell
dataCell
=
dataRow
.
createCell
(
i
);
if
(
rowData
.
containsKey
(
headers
[
i
]))
{
...
...
@@ -1466,7 +1488,11 @@ public class CommonServiceImpl {
}
else
{
dataCell
.
setCellValue
(
""
);
// 假设所有数据都是字符串格式
}
}
else
{
}
else
if
(
value
instanceof
Date
)
{
String
s
=
DateUtils
.
date2LongStr
((
Date
)
value
);
dataCell
.
setCellValue
(
s
);
}
else
{
dataCell
.
setCellValue
(
null
==
value
?
""
:
value
.
toString
());
// 假设所有数据都是字符串格式
}
}
else
{
...
...
@@ -1566,7 +1592,7 @@ public class CommonServiceImpl {
}
List
<
LinkedHashMap
>
getWorkLog
(
String
processInstanceId
){
if
(
!
StringUtils
.
isEmpty
(
processInstanceId
))
{
if
(
StringUtils
.
isEmpty
(
processInstanceId
))
{
return
null
;
}
List
<
LinkedHashMap
>
flowLoggernew
=
new
ArrayList
<>();
...
...
@@ -1600,6 +1626,15 @@ public class CommonServiceImpl {
return
flowLoggernew
;
}
List
<
ConstructionRecords
>
getConstructionRecords
(
String
peasantHouseholdId
)
{
// 施工自审操作记录
LambdaQueryWrapper
<
ConstructionRecords
>
up5
=
new
LambdaQueryWrapper
<
ConstructionRecords
>();
up5
.
eq
(
ConstructionRecords:
:
getPeasantHouseholdId
,
peasantHouseholdId
);
up5
.
orderByAsc
(
ConstructionRecords:
:
getRecDate
);
return
constructionRecordsMapper
.
selectList
(
up5
);
}
public
Object
getSchedule
(
String
peasantHouseholdId
)
{
if
(!
redisUtils
.
hasKey
(
peasantHouseholdId
)){
return
null
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/templates/informationTemp.xlsx
View file @
44479e60
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