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
27be70ec
Commit
27be70ec
authored
Sep 12, 2019
by
Vu Duy Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
anhvd commit search customer
parent
cd1a567b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+8
-3
src/main/java/com/viettel/campaign/web/dto/request_dto/SearchCustomerRequestDTO.java
...ampaign/web/dto/request_dto/SearchCustomerRequestDTO.java
+1
-0
src/main/resources/application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
27be70ec
...
...
@@ -774,6 +774,7 @@ public class CustomerServiceImpl implements CustomerService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
searchCustomerList
(
SearchCustomerRequestDTO
searchCustomerRequestDTO
)
{
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
((
long
)
searchCustomerRequestDTO
.
getTimezoneOffset
());
ResultDTO
resultDTO
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
...
...
@@ -814,7 +815,7 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
" AND a.STATUS = 1"
);
sb
.
append
(
" AND a.COMPANY_SITE_ID = :p_company_site_id"
);
sb
.
append
(
" AND
to_date(CREATE_AT, 'DD-MM-RR') >= to_date(:p_date_from, 'YYYYMMDD') AND to_date(CREATE_AT, 'DD-MM-RR') <= to_date(:p_date_to, 'YYYYMMDD
')"
);
sb
.
append
(
" AND
CREATE_AT >= to_date(:p_date_from, 'DD/MM/YYYY HH24:MI:SS') AND CREATE_AT <= to_date(:p_date_to, 'DD/MM/YYYY HH24:MI:SS
')"
);
if
(!
DataUtil
.
isNullOrEmpty
(
searchCustomerRequestDTO
.
getCustomerListCode
()))
{
sb
.
append
(
" AND UPPER(CUSTOMER_LIST_CODE) LIKE UPPER(:p_list_code)"
);
...
...
@@ -828,8 +829,8 @@ public class CustomerServiceImpl implements CustomerService {
SQLQuery
query
=
session
.
createSQLQuery
(
sb
.
toString
());
query
.
setParameter
(
"p_company_site_id"
,
searchCustomerRequestDTO
.
getCompanySiteId
());
query
.
setParameter
(
"p_date_from"
,
searchCustomerRequestDTO
.
getConvertedDateFrom
(
));
query
.
setParameter
(
"p_date_to"
,
searchCustomerRequestDTO
.
getConvertedDateTo
(
));
query
.
setParameter
(
"p_date_from"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
DateTimeUtil
.
parseDate
(
"YYYYMMdd"
,
searchCustomerRequestDTO
.
getConvertedDateFrom
()),
tzClient
));
query
.
setParameter
(
"p_date_to"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
DateTimeUtil
.
parseDate
(
"YYYYMMdd"
,
searchCustomerRequestDTO
.
getConvertedDateTo
()),
tzClient
));
if
(!
DataUtil
.
isNullOrEmpty
(
searchCustomerRequestDTO
.
getCustomerListCode
()))
{
query
.
setParameter
(
"p_list_code"
,
"%"
+
...
...
@@ -877,6 +878,10 @@ public class CustomerServiceImpl implements CustomerService {
List
<
CustomerListDTO
>
data
=
query
.
list
();
Page
<
CustomerListDTO
>
dataPage
=
new
PageImpl
<>(
data
,
pageable
,
count
);
dataPage
.
forEach
(
item
->
{
item
.
setCreateAt
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getCreateAt
(),
tzClient
)));
item
.
setUpdateAt
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
item
.
getUpdateAt
(),
tzClient
)));
});
resultDTO
.
setData
(
dataPage
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
...
...
src/main/java/com/viettel/campaign/web/dto/request_dto/SearchCustomerRequestDTO.java
View file @
27be70ec
...
...
@@ -12,4 +12,5 @@ public class SearchCustomerRequestDTO extends BaseDTO {
String
convertedDateFrom
;
String
convertedDateTo
;
String
companySiteId
;
Integer
timezoneOffset
;
}
src/main/resources/application.yml
View file @
27be70ec
server
:
port
:
1111
port
:
9999
spring
:
application
:
name
:
campaign
...
...
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