Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
service-campaign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyen Ha
service-campaign
Commits
c664a0d1
Commit
c664a0d1
authored
Sep 16, 2019
by
Vu Duy Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anhvd commit fix bug
parent
f71bc50f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
...ign/repository/ccms_full/impl/CampaignRepositoryImpl.java
+4
-4
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+8
-7
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
View file @
c664a0d1
...
@@ -243,16 +243,16 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -243,16 +243,16 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
}
}
List
<
CampaignDTO
>
data
=
query
.
list
();
List
<
CampaignDTO
>
data
=
query
.
list
();
data
.
forEach
(
item
->
{
data
.
forEach
(
item
->
{
item
.
setStartTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getStartTime
(),
tzClient
)));
i
f
(
item
.
getStartTime
()
!=
null
)
i
tem
.
setStartTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getStartTime
(),
tzClient
)));
item
.
setEndTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getEndTime
(),
tzClient
)));
i
f
(
item
.
getEndTime
()
!=
null
)
i
tem
.
setEndTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getEndTime
(),
tzClient
)));
});
});
Page
<
CampaignDTO
>
dataPage
=
new
PageImpl
<>(
data
,
pageable
,
count
);
Page
<
CampaignDTO
>
dataPage
=
new
PageImpl
<>(
data
,
pageable
,
count
);
result
.
setData
(
dataPage
);
result
.
setData
(
dataPage
);
}
else
{
}
else
{
List
<
CampaignDTO
>
dataExport
=
query
.
list
();
List
<
CampaignDTO
>
dataExport
=
query
.
list
();
dataExport
.
forEach
(
item
->
{
dataExport
.
forEach
(
item
->
{
item
.
setStartTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getStartTime
(),
tzClient
)));
i
f
(
item
.
getStartTime
()
!=
null
)
i
tem
.
setStartTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getStartTime
(),
tzClient
)));
item
.
setEndTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getEndTime
(),
tzClient
)));
i
f
(
item
.
getEndTime
()
!=
null
)
i
tem
.
setEndTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getEndTime
(),
tzClient
)));
});
});
result
.
setData
(
dataExport
);
result
.
setData
(
dataExport
);
}
}
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
c664a0d1
...
@@ -4,12 +4,10 @@ import com.viettel.campaign.config.DataSourceQualify;
...
@@ -4,12 +4,10 @@ import com.viettel.campaign.config.DataSourceQualify;
import
com.viettel.campaign.model.ccms_full.*
;
import
com.viettel.campaign.model.ccms_full.*
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.service.CampaignService
;
import
com.viettel.campaign.service.CampaignService
;
import
com.viettel.campaign.utils.BundleUtils
;
import
com.viettel.campaign.utils.*
;
import
com.viettel.campaign.utils.Constants
;
import
com.viettel.campaign.utils.DataUtil
;
import
com.viettel.campaign.utils.WorkBookBuilder
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.CellStyle
;
...
@@ -275,6 +273,8 @@ public class CampaignServiceImpl implements CampaignService {
...
@@ -275,6 +273,8 @@ public class CampaignServiceImpl implements CampaignService {
CellStyle
styleRowHeader
=
WorkBookBuilder
.
buildDefaultStyleRowHeader
(
workbook
);
CellStyle
styleRowHeader
=
WorkBookBuilder
.
buildDefaultStyleRowHeader
(
workbook
);
CellStyle
styleRow
=
WorkBookBuilder
.
buildDefaultStyleRow
(
workbook
);
CellStyle
styleRow
=
WorkBookBuilder
.
buildDefaultStyleRow
(
workbook
);
styleRowHeader
.
setWrapText
(
true
);
styleRow
.
setWrapText
(
true
);
// list header
// list header
List
<
String
>
fileHeaderList
=
new
ArrayList
<>();
List
<
String
>
fileHeaderList
=
new
ArrayList
<>();
fileHeaderList
.
add
(
BundleUtils
.
getLangString
(
"stt"
,
locale
));
fileHeaderList
.
add
(
BundleUtils
.
getLangString
(
"stt"
,
locale
));
...
@@ -294,12 +294,12 @@ public class CampaignServiceImpl implements CampaignService {
...
@@ -294,12 +294,12 @@ public class CampaignServiceImpl implements CampaignService {
//
//
String
sheetName
=
BundleUtils
.
getLangString
(
"campaign"
,
locale
);
String
sheetName
=
BundleUtils
.
getLangString
(
"campaign"
,
locale
);
sheet
=
workbook
.
createSheet
(
sheetName
);
sheet
=
workbook
.
createSheet
(
sheetName
);
// Title
// Title
String
title
=
BundleUtils
.
getLangString
(
"campaign.title"
,
locale
);
String
title
=
BundleUtils
.
getLangString
(
"campaign.title"
,
locale
);
int
rowTitleStart
=
3
;
int
rowTitleStart
=
3
;
Row
rowTitle
=
sheet
.
createRow
(
rowTitleStart
);
Row
rowTitle
=
sheet
.
createRow
(
rowTitleStart
);
rowTitle
.
setHeight
((
short
)
800
);
rowTitle
.
setHeight
((
short
)
800
);
WorkBookBuilder
.
writeCellContent
(
rowTitle
,
styleTitle
,
3
,
title
);
WorkBookBuilder
.
writeCellContent
(
rowTitle
,
styleTitle
,
3
,
title
);
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
rowTitleStart
,
rowTitleStart
,
3
,
8
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
rowTitleStart
,
rowTitleStart
,
3
,
8
));
...
@@ -308,6 +308,7 @@ public class CampaignServiceImpl implements CampaignService {
...
@@ -308,6 +308,7 @@ public class CampaignServiceImpl implements CampaignService {
int
count
=
1
;
int
count
=
1
;
Row
rowHeader
=
sheet
.
createRow
(
startRowTable
);
Row
rowHeader
=
sheet
.
createRow
(
startRowTable
);
for
(
int
i
=
0
;
i
<
fileHeaderList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
fileHeaderList
.
size
();
i
++)
{
sheet
.
setColumnWidth
(
i
,
6500
);
WorkBookBuilder
.
writeCellContent
(
rowHeader
,
styleRowHeader
,
i
,
fileHeaderList
.
get
(
i
));
WorkBookBuilder
.
writeCellContent
(
rowHeader
,
styleRowHeader
,
i
,
fileHeaderList
.
get
(
i
));
}
}
// Content
// Content
...
@@ -319,8 +320,8 @@ public class CampaignServiceImpl implements CampaignService {
...
@@ -319,8 +320,8 @@ public class CampaignServiceImpl implements CampaignService {
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
listData
.
get
(
i
).
getCampaignName
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
listData
.
get
(
i
).
getCampaignName
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
getCampaignTypeName
(
lstType
,
listData
.
get
(
i
).
getCampaignType
()));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
getCampaignTypeName
(
lstType
,
listData
.
get
(
i
).
getCampaignType
()));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getChanel
())
?
""
:
BundleUtils
.
getLangString
(
"campaign.chanel."
+
listData
.
get
(
i
).
getChanel
(),
locale
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getChanel
())
?
""
:
BundleUtils
.
getLangString
(
"campaign.chanel."
+
listData
.
get
(
i
).
getChanel
(),
locale
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
listData
.
get
(
i
).
getStartTime
(
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DateTimeUtil
.
format
(
"dd/MM/yyyy"
,
listData
.
get
(
i
).
getStartTime
(),
""
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
listData
.
get
(
i
).
getEndTime
(
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DateTimeUtil
.
format
(
"dd/MM/yyyy"
,
listData
.
get
(
i
).
getEndTime
(),
""
));
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getCustomerNumber
())
?
0
:
listData
.
get
(
i
).
getCustomerNumber
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getCustomerNumber
())
?
0
:
listData
.
get
(
i
).
getCustomerNumber
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getNumOfJoinedCus
())
?
0
:
listData
.
get
(
i
).
getNumOfJoinedCus
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getNumOfJoinedCus
())
?
0
:
listData
.
get
(
i
).
getNumOfJoinedCus
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getNumOfInteractedCus
())
?
0
:
listData
.
get
(
i
).
getNumOfInteractedCus
());
WorkBookBuilder
.
writeCellContent
(
row
,
styleRow
,
col
++,
DataUtil
.
isNullOrZero
(
listData
.
get
(
i
).
getNumOfInteractedCus
())
?
0
:
listData
.
get
(
i
).
getNumOfInteractedCus
());
...
...
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