Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lwby_ad_data
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
maliang
lwby_ad_data
Commits
679978c3
Commit
679978c3
authored
Apr 26, 2020
by
maliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限控制
parent
2c346e48
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
FileServiceImpl.java
...om/boot/security/server/service/impl/FileServiceImpl.java
+18
-15
AdvertMapper.xml
src/main/resources/mybatis-mappers/AdvertMapper.xml
+1
-6
No files found.
src/main/java/com/boot/security/server/service/impl/FileServiceImpl.java
View file @
679978c3
...
...
@@ -4,6 +4,7 @@ import java.io.IOException;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
com.boot.security.server.dao.AdvertDao
;
...
...
@@ -108,8 +109,10 @@ public class FileServiceImpl implements FileService {
row
=
sheet
.
getRow
(
i
);
if
(
row
!=
null
){
Cell
cell
=
row
.
getCell
(
0
);
if
(
cell
.
getDateCellValue
()!=
null
){
AdvertiserData
advertiserData
=
new
AdvertiserData
();
advertiserData
.
setReportDate
(
simpleDateFormat
.
format
(
cell
.
getDateCellValue
()));
Date
date
=
cell
.
getDateCellValue
();
advertiserData
.
setReportDate
(
simpleDateFormat
.
format
(
date
));
cell
=
row
.
getCell
(
1
);
if
(
cell
.
getCellType
().
equals
(
CellType
.
STRING
)){
advertiserData
.
setCodeId
(
cell
.
getStringCellValue
());
...
...
@@ -119,6 +122,8 @@ public class FileServiceImpl implements FileService {
cell
=
row
.
getCell
(
2
);
advertiserData
.
setIncome
(
cell
.
getNumericCellValue
());
list
.
add
(
advertiserData
);
}
}
else
{
break
;
}
...
...
@@ -131,14 +136,12 @@ public class FileServiceImpl implements FileService {
advertiserData
.
setCpc
(
Double
.
valueOf
(
df
.
format
(
advertiserData
.
getIncome
()/
cliExExcel
.
getClick
())));
advertiserData
.
setAdvertiserId
(
cliExExcel
.
getAdvertiserId
());
advertiserData
.
setAdvertiserName
(
cliExExcel
.
getAdvertiserName
());
advertiserData
.
setExposure
(
cliExExcel
.
getExposure
());
advertiserData
.
setClick
(
cliExExcel
.
getClick
());
}
}
for
(
AdvertiserData
advertiserData
:
list
)
{
System
.
out
.
println
(
advertiserData
.
getCpc
()+
":"
+
advertiserData
.
getEcpm
());
System
.
out
.
println
(
advertiserData
.
getAdvertiserId
()+
":"
+
advertiserData
.
getAdvertiserName
());
}
advertDao
.
insertAdvertDataCount
(
list
);
}
...
...
src/main/resources/mybatis-mappers/AdvertMapper.xml
View file @
679978c3
...
...
@@ -17,11 +17,6 @@
report_date = VALUES(report_date),
advertiser_id = VALUES(advertiser_id),
advertiser_name = VALUES(advertiser_name),
code_id = VALUES(code_id),
exposure = VALUES(exposure),
click = VALUES(click),
ecpm = VALUES(ecpm),
cpc = VALUES(cpc),
income = VALUES(income)
code_id = VALUES(code_id)
</insert>
</mapper>
\ No newline at end of file
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