Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
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
胡懿
warehouse
Commits
44111b1e
Commit
44111b1e
authored
Jul 19, 2023
by
胡懿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改出库报错的问题,升级poi,
parent
e88c9986
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
11 deletions
+58
-11
LedgerService.java
...eplus/modules/warehouse/ledger/service/LedgerService.java
+58
-10
SqlSessionFactoryBean.java
src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java
+0
-1
No files found.
src/main/java/com/jeeplus/modules/warehouse/ledger/service/LedgerService.java
View file @
44111b1e
...
...
@@ -178,11 +178,14 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
typeId
=
"4657ffc36fcf4feb922eb571231234b0"
;
beginTime
=
"2023-01-01 00:00:00"
;
endTime
=
"2023-12-01 00:00:00"
;
Date
bTime
=
DateUtil
.
parseStrToDate
(
beginTime
,
"yyyy-MM-dd HH:mm:ss"
);
Date
eTime
=
DateUtil
.
parseStrToDate
(
endTime
,
"yyyy-MM-dd HH:mm:ss"
);
MaterialType
materialType
=
materialTypeMapper
.
get
(
typeId
);
StorageInfo
temSi
=
new
StorageInfo
();
temSi
.
setType
(
materialType
);
temSi
.
setBeginTime
(
DateUtil
.
parseStrToDate
(
beginTime
,
"yyyy-MM-dd HH:mm:ss"
)
);
temSi
.
setEndTime
(
DateUtil
.
parseStrToDate
(
endTime
,
"yyyy-MM-dd HH:mm:ss"
)
);
temSi
.
setBeginTime
(
bTime
);
temSi
.
setEndTime
(
eTime
);
List
<
StorageInfo
>
storageInfoList
=
storageInfoMapper
.
findList
(
temSi
);
...
...
@@ -192,8 +195,8 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
OutboundInfo
outboundInfo
=
new
OutboundInfo
();
outboundInfo
.
setLedgerInfo
(
temLi
);
outboundInfo
.
setBeginTime
(
DateUtil
.
parseStrToDate
(
beginTime
,
"yyyy-MM-dd HH:mm:ss"
)
);
outboundInfo
.
setEndTime
(
DateUtil
.
parseStrToDate
(
endTime
,
"yyyy-MM-dd HH:mm:ss"
)
);
outboundInfo
.
setBeginTime
(
bTime
);
outboundInfo
.
setEndTime
(
eTime
);
List
<
OutboundInfo
>
outboundInfoList
=
outboundInfoMapper
.
findList
(
outboundInfo
);
int
sunRowNum
=
5
+
storageInfoList
.
size
()
+
outboundInfoList
.
size
();
...
...
@@ -221,20 +224,65 @@ public class LedgerService extends CrudService<LedgerMapper, Ledger> {
cell
.
setCellValue
(
"品名代码:"
+
materialType
.
getCode
());
cell
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
XSSFCell
cell1
=
sheetRow
.
createCell
(
1
);
XSSFCell
cell1
=
sheetRow
.
createCell
(
4
);
cell1
.
setCellValue
(
"品名:"
+
materialType
.
getName
());
cell1
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
XSSFCell
cell2
=
sheetRow
.
createCell
(
2
);
XSSFCell
cell2
=
sheetRow
.
createCell
(
1
2
);
cell2
.
setCellValue
(
"计量单位:"
+
materialType
.
getUnit
());
cell2
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
}
if
(
2
==
row
)
{
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell
=
sheetRow
.
createCell
(
0
);
cell
.
setCellValue
(
DateUtil
.
getYear
(
eTime
)
+
" 年"
);
cell
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell1
=
sheetRow
.
createCell
(
2
);
cell1
.
setCellValue
(
"凭证批号"
);
cell1
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell2
=
sheetRow
.
createCell
(
3
);
cell2
.
setCellValue
(
"摘要"
);
cell2
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell3
=
sheetRow
.
createCell
(
4
);
cell3
.
setCellValue
(
"收入"
);
cell3
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell4
=
sheetRow
.
createCell
(
5
);
cell4
.
setCellValue
(
"支出"
);
cell4
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell5
=
sheetRow
.
createCell
(
6
);
cell5
.
setCellValue
(
"结存"
);
cell5
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
sheetRow
.
setHeightInPoints
(
20
);
XSSFCell
cell6
=
sheetRow
.
createCell
(
21
);
cell6
.
setCellValue
(
"摘要"
);
cell6
.
setCellStyle
(
ExcelStyleUtils
.
topTwoCellStyle
(
workbook
));
}
// 设置列宽 sheet.setColumnWidth(0, 16 * 256); 第一个参数为第几个单元格,第二个为16个字符宽度
}
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
0
,
0
,
0
,
22
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
0
,
4
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
5
,
12
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
13
,
22
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
0
,
0
,
0
,
21
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
0
,
3
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
4
,
11
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
12
,
21
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
3
,
0
,
1
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
4
,
2
,
2
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
4
,
3
,
3
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
4
,
4
,
4
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
4
,
5
,
5
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
2
,
6
,
20
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
2
,
4
,
21
,
21
));
FileOutputStream
out
=
null
;
try
{
out
=
new
FileOutputStream
(
new
File
(
"D:/excel.xlsx"
));
...
...
src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java
View file @
44111b1e
...
...
@@ -43,7 +43,6 @@ import org.apache.ibatis.session.SqlSessionFactory;
import
org.apache.ibatis.session.SqlSessionFactoryBuilder
;
import
org.apache.ibatis.transaction.TransactionFactory
;
import
org.apache.ibatis.type.TypeHandler
;
import
org.apache.poi.util.PackageHelper
;
import
org.mybatis.spring.transaction.SpringManagedTransactionFactory
;
import
org.springframework.beans.factory.FactoryBean
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
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