Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsk-cr20g
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
Administrator
dsk-cr20g
Commits
e39f5ae5
Commit
e39f5ae5
authored
Jul 20, 2023
by
danfuman
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev20230707' of
http://192.168.60.201/root/dsk-operate-sys
into dev20230707
parents
43d95c3b
0dab0b88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
ReadBusinessInfoExcel.java
...va/com/dsk/system/service/impl/ReadBusinessInfoExcel.java
+16
-12
BusinessInfoMapper.xml
...src/main/resources/mapper/business/BusinessInfoMapper.xml
+3
-3
No files found.
dsk-system/src/main/java/com/dsk/system/service/impl/ReadBusinessInfoExcel.java
View file @
e39f5ae5
package
com
.
dsk
.
system
.
service
.
impl
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.dsk.system.domain.BusinessExcelDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.hssf.usermodel.HSSFWorkbook
;
...
...
@@ -13,6 +8,11 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author lxl
* @Description:
...
...
@@ -120,28 +120,32 @@ public class ReadBusinessInfoExcel {
for
(
int
c
=
0
;
c
<
this
.
totalCells
;
c
++)
{
Cell
cell
=
row
.
getCell
(
c
);
if
(
null
!=
cell
)
{
//项目名称
if
(
c
==
0
)
{
//如果是纯数字,比如你写的是25,cell.getNumericCellValue()获得是25.0,通过截取字符串去掉.0获得25
if
(
cell
.
getCellType
()
==
CellType
.
NUMERIC
)
{
String
name
=
String
.
valueOf
(
cell
.
getNumericCellValue
());
businessExcelDto
.
setProjectName
(
name
.
substring
(
0
,
name
.
length
()
-
2
>
0
?
name
.
length
()
-
2
:
1
));
//项目名称
businessExcelDto
.
setProjectName
(
name
.
substring
(
0
,
name
.
length
()
-
2
>
0
?
name
.
length
()
-
2
:
1
));
}
else
{
businessExcelDto
.
setProjectName
(
cell
.
getStringCellValue
());
//名称
businessExcelDto
.
setProjectName
(
cell
.
getStringCellValue
());
}
//业主单位
}
else
if
(
c
==
1
)
{
if
(
cell
.
getCellType
()
==
CellType
.
NUMERIC
)
{
String
company
=
String
.
valueOf
(
cell
.
getNumericCellValue
());
businessExcelDto
.
setOwnerCompany
(
company
.
substring
(
0
,
company
.
length
()
-
2
>
0
?
company
.
length
()
-
2
:
1
));
//业主单位
businessExcelDto
.
setOwnerCompany
(
company
.
substring
(
0
,
company
.
length
()
-
2
>
0
?
company
.
length
()
-
2
:
1
));
}
else
{
businessExcelDto
.
setOwnerCompany
(
cell
.
getStringCellValue
());
//性别
businessExcelDto
.
setOwnerCompany
(
cell
.
getStringCellValue
());
}
//投资估算(万元)
}
else
if
(
c
==
2
)
{
if
(
cell
.
getCellType
()
==
CellType
.
NUMERIC
)
{
businessExcelDto
.
setInvestmentAmount
(
cell
.
getStringCellValue
());
/* if (cell.getCellType() == CellType.NUMERIC) {
String amount = String.valueOf(cell.getNumericCellValue());
businessExcelDto
.
setInvestmentAmount
(
amount
.
substring
(
0
,
amount
.
length
()
-
2
>
0
?
amount
.
length
()
-
2
:
1
));
//投资估算(万元)
businessExcelDto.setInvestmentAmount(amount.substring(0, amount.length() - 2 > 0 ? amount.length() - 2 : 1));
} else {
businessExcelDto.setInvestmentAmount(cell.getStringCellValue());
}
}
*/
}
}
}
...
...
dsk-system/src/main/resources/mapper/business/BusinessInfoMapper.xml
View file @
e39f5ae5
...
...
@@ -110,15 +110,15 @@
#{projectType}
</foreach>
</if>
<if
test=
"minAmount != null and minAmount != '' and minAmount !=
0
and maxAmount != minAmount"
>
<if
test=
"minAmount != null and minAmount != '' and minAmount !=
'0'
and maxAmount != minAmount"
>
and i.investment_amount
>
#{minAmount}
</if>
<if
test=
"minAmount ==
0
and maxAmount != minAmount"
>
<if
test=
"minAmount ==
'0'
and maxAmount != minAmount"
>
and ((i.investment_amount
>
#{minAmount}
and i.investment_amount
<
= #{maxAmount})
or i.investment_amount is null)
</if>
<if
test=
"maxAmount != null and maxAmount != '' and maxAmount != minAmount and minAmount !=
0
"
>
<if
test=
"maxAmount != null and maxAmount != '' and maxAmount != minAmount and minAmount !=
'0'
"
>
and i.investment_amount
<
= #{maxAmount}
</if>
<if
test=
"minAmount != null and minAmount != '' and maxAmount != null and maxAmount != '' and maxAmount == minAmount"
>
...
...
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