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
bc6c4f74
Commit
bc6c4f74
authored
Sep 23, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tubn campaign execute update
parent
ae734b93
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
143 additions
and
58 deletions
+143
-58
src/main/java/com/viettel/campaign/repository/ccms_full/CustomerRepository.java
...tel/campaign/repository/ccms_full/CustomerRepository.java
+2
-0
src/main/java/com/viettel/campaign/repository/ccms_full/CustomerTimeRepository.java
...campaign/repository/ccms_full/CustomerTimeRepository.java
+2
-0
src/main/java/com/viettel/campaign/repository/ccms_full/ReceiveCustLogRepository.java
...mpaign/repository/ccms_full/ReceiveCustLogRepository.java
+1
-0
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+9
-6
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
...viettel/campaign/service/impl/CampaignCfgServiceImpl.java
+4
-0
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+121
-51
src/main/java/com/viettel/campaign/web/dto/CampaignCustomerDTO.java
...ava/com/viettel/campaign/web/dto/CampaignCustomerDTO.java
+1
-0
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
...va/com/viettel/campaign/web/dto/ContactCustResultDTO.java
+3
-1
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CustomerRepository.java
View file @
bc6c4f74
...
@@ -19,6 +19,8 @@ public interface CustomerRepository extends JpaRepository<Customer, Long> {
...
@@ -19,6 +19,8 @@ public interface CustomerRepository extends JpaRepository<Customer, Long> {
Page
<
Customer
>
findAll
(
Pageable
pageable
);
Page
<
Customer
>
findAll
(
Pageable
pageable
);
Customer
getByCustomerId
(
Long
customerId
);
List
<
Customer
>
findByCustomerId
(
Long
customerId
);
List
<
Customer
>
findByCustomerId
(
Long
customerId
);
@Query
(
"FROM Customer WHERE name = ?1"
)
@Query
(
"FROM Customer WHERE name = ?1"
)
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/CustomerTimeRepository.java
View file @
bc6c4f74
...
@@ -15,4 +15,6 @@ import java.util.List;
...
@@ -15,4 +15,6 @@ import java.util.List;
public
interface
CustomerTimeRepository
extends
JpaRepository
<
CustomerTime
,
Long
>
{
public
interface
CustomerTimeRepository
extends
JpaRepository
<
CustomerTime
,
Long
>
{
List
<
CustomerTime
>
findByCustomerId
(
Long
customerId
);
List
<
CustomerTime
>
findByCustomerId
(
Long
customerId
);
CustomerTime
findByCompanySiteIdAndCustomerId
(
Long
companySiteId
,
Long
customerId
);
}
}
src/main/java/com/viettel/campaign/repository/ccms_full/ReceiveCustLogRepository.java
View file @
bc6c4f74
...
@@ -4,4 +4,5 @@ import com.viettel.campaign.model.ccms_full.ReceiveCustLog;
...
@@ -4,4 +4,5 @@ import com.viettel.campaign.model.ccms_full.ReceiveCustLog;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
ReceiveCustLogRepository
extends
JpaRepository
<
ReceiveCustLog
,
Long
>
{
public
interface
ReceiveCustLogRepository
extends
JpaRepository
<
ReceiveCustLog
,
Long
>
{
ReceiveCustLog
getByReceiveCustLogId
(
Long
receiveCustLogId
);
}
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
bc6c4f74
...
@@ -105,6 +105,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -105,6 +105,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
public
List
<
ContactCustResultDTO
>
getInteractiveResult
(
CampaignRequestDTO
dto
,
Pageable
pageable
)
{
public
List
<
ContactCustResultDTO
>
getInteractiveResult
(
CampaignRequestDTO
dto
,
Pageable
pageable
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
List
<
ContactCustResultDTO
>
list
=
new
ArrayList
<>();
List
<
ContactCustResultDTO
>
list
=
new
ArrayList
<>();
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
(
dto
.
getTimezone
());
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
sessionFactory
.
openSession
();
...
@@ -125,7 +126,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -125,7 +126,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql
.
append
(
" CC2.COMPLETE_NAME AS surveyStatus, "
);
sql
.
append
(
" CC2.COMPLETE_NAME AS surveyStatus, "
);
sql
.
append
(
" C.STATUS AS status, "
);
sql
.
append
(
" C.STATUS AS status, "
);
sql
.
append
(
" CCR.STATUS AS recordStatus, "
);
sql
.
append
(
" CCR.STATUS AS recordStatus, "
);
sql
.
append
(
" (( CCR.END_TIME - CCR.START_CALL ) * 24 * 60 * 60) AS callTime, "
);
sql
.
append
(
"
ROUND
(( CCR.END_TIME - CCR.START_CALL ) * 24 * 60 * 60) AS callTime, "
);
sql
.
append
(
" C.CAMPAIGN_ID AS campaignId, "
);
sql
.
append
(
" C.CAMPAIGN_ID AS campaignId, "
);
sql
.
append
(
" CUS.CUSTOMER_ID AS customerId "
);
sql
.
append
(
" CUS.CUSTOMER_ID AS customerId "
);
sql
.
append
(
"FROM CONTACT_CUST_RESULT CCR "
);
sql
.
append
(
"FROM CONTACT_CUST_RESULT CCR "
);
...
@@ -133,11 +134,11 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -133,11 +134,11 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql
.
append
(
" INNER JOIN VSA_USERS VU ON CCR.AGENT_ID = VU.USER_ID "
);
sql
.
append
(
" INNER JOIN VSA_USERS VU ON CCR.AGENT_ID = VU.USER_ID "
);
sql
.
append
(
" INNER JOIN CUSTOMER CUS ON CCR.CUSTOMER_ID = CUS.CUSTOMER_ID "
);
sql
.
append
(
" INNER JOIN CUSTOMER CUS ON CCR.CUSTOMER_ID = CUS.CUSTOMER_ID "
);
sql
.
append
(
" INNER JOIN CAMPAIGN_COMPLETE_CODE CC1 ON CCR.CONTACT_STATUS = CC1.COMPLETE_VALUE "
);
sql
.
append
(
" INNER JOIN CAMPAIGN_COMPLETE_CODE CC1 ON CCR.CONTACT_STATUS = CC1.COMPLETE_VALUE "
);
sql
.
append
(
" LEFT JOIN CAMPAIGN_COMPLETE_CODE CC2 ON CCR.CALL_STATUS = CC2.COMPLETE_VALUE "
);
sql
.
append
(
" LEFT JOIN CAMPAIGN_COMPLETE_CODE
CC2 ON CCR.CALL_STATUS = CC2.COMPLETE_VALUE "
);
sql
.
append
(
"WHERE CCR.STATUS <> 0 "
);
sql
.
append
(
"WHERE CCR.STATUS <> 0 "
);
sql
.
append
(
" AND CCR.COMPANY_SITE_ID = :p_company_site_id "
);
sql
.
append
(
" AND CCR.COMPANY_SITE_ID = :p_company_site_id "
);
sql
.
append
(
" AND to_date(CCR.CREATE_TIME, 'DD/MM/RR') >= to_date(:p_date_from, 'DD/MM/
RR
') "
);
sql
.
append
(
" AND to_date(CCR.CREATE_TIME, 'DD/MM/RR') >= to_date(:p_date_from, 'DD/MM/
YYYY HH24:MI:SS
') "
);
sql
.
append
(
" AND to_date(CCR.CREATE_TIME, 'DD/MM/RR') <= to_date(:p_date_to, 'DD/MM/
RR
') "
);
sql
.
append
(
" AND to_date(CCR.CREATE_TIME, 'DD/MM/RR') <= to_date(:p_date_to, 'DD/MM/
YYYY HH24:MI:SS
') "
);
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCustomerId
()))
{
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCustomerId
()))
{
sql
.
append
(
" AND CCR.CUSTOMER_ID LIKE (:p_customer_id) "
);
sql
.
append
(
" AND CCR.CUSTOMER_ID LIKE (:p_customer_id) "
);
...
@@ -185,8 +186,10 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -185,8 +186,10 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
SQLQuery
query
=
session
.
createSQLQuery
(
sql
.
toString
());
SQLQuery
query
=
session
.
createSQLQuery
(
sql
.
toString
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_date_from"
,
dto
.
getFromDate
());
//query.setParameter("p_date_from", dto.getFromDate());
query
.
setParameter
(
"p_date_to"
,
dto
.
getToDate
());
query
.
setParameter
(
"p_date_from"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy"
,
dto
.
getFromDate
()),
tzClient
));
//query.setParameter("p_date_to", dto.getToDate());
query
.
setParameter
(
"p_date_to"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy"
,
dto
.
getToDate
()),
tzClient
));
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCustomerId
()))
{
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCustomerId
()))
{
query
.
setParameter
(
"p_customer_id"
,
"%"
+
query
.
setParameter
(
"p_customer_id"
,
"%"
+
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
View file @
bc6c4f74
...
@@ -383,14 +383,18 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
...
@@ -383,14 +383,18 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
public
ResultDTO
getListStatus
(
String
completeValue
,
Short
completeType
,
Long
companySiteId
)
{
public
ResultDTO
getListStatus
(
String
completeValue
,
Short
completeType
,
Long
companySiteId
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
List
<
CampaignCfg
>
list
=
new
ArrayList
<>();
List
<
CampaignCfg
>
list
=
new
ArrayList
<>();
CampaignCfg
cfg
=
new
CampaignCfg
();
try
{
try
{
if
(
completeValue
==
null
||
completeValue
.
equalsIgnoreCase
(
"null"
))
if
(
completeValue
==
null
||
completeValue
.
equalsIgnoreCase
(
"null"
))
list
=
completeCodeRepository
.
getCustomerStatusByType
(
completeType
,
companySiteId
);
list
=
completeCodeRepository
.
getCustomerStatusByType
(
completeType
,
companySiteId
);
else
if
(
completeType
==
null
)
cfg
=
completeCodeRepository
.
findByCompanySiteIdAndCompleteValue
(
companySiteId
,
completeValue
);
else
else
list
=
completeCodeRepository
.
getCustomerStatus
(
completeValue
,
completeType
,
companySiteId
);
list
=
completeCodeRepository
.
getCustomerStatus
(
completeValue
,
completeType
,
companySiteId
);
resultDTO
.
setListData
(
list
);
resultDTO
.
setListData
(
list
);
resultDTO
.
setData
(
cfg
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
bc6c4f74
This diff is collapsed.
Click to expand it.
src/main/java/com/viettel/campaign/web/dto/CampaignCustomerDTO.java
View file @
bc6c4f74
...
@@ -18,6 +18,7 @@ public class CampaignCustomerDTO extends BaseDTO{
...
@@ -18,6 +18,7 @@ public class CampaignCustomerDTO extends BaseDTO{
private
Date
recallTime
;
private
Date
recallTime
;
private
Long
recallCount
=
0L
;
private
Long
recallCount
=
0L
;
private
Date
callTime
;
private
Date
callTime
;
private
Long
callTimeL
;
private
Long
customerListId
;
private
Long
customerListId
;
private
Short
inCampaignStatus
;
private
Short
inCampaignStatus
;
private
Date
sendTime
;
private
Date
sendTime
;
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
bc6c4f74
...
@@ -40,7 +40,8 @@ public class ContactCustResultDTO extends BaseDTO {
...
@@ -40,7 +40,8 @@ public class ContactCustResultDTO extends BaseDTO {
private
Short
isFinalRecall
;
private
Short
isFinalRecall
;
private
Short
isSendEmail
=
0
;
private
Short
isSendEmail
=
0
;
private
Long
saledOnTpin
;
private
Long
saledOnTpin
;
private
Long
endTime
;
// api get call return Long
private
Long
endTimeL
;
// api get call return Long
private
Date
endTime
;
// private Date endTime;
// private Date endTime;
private
Long
waitTime
;
private
Long
waitTime
;
private
String
dialMode
;
private
String
dialMode
;
...
@@ -59,4 +60,5 @@ public class ContactCustResultDTO extends BaseDTO {
...
@@ -59,4 +60,5 @@ public class ContactCustResultDTO extends BaseDTO {
private
Integer
totalRow
;
private
Integer
totalRow
;
private
String
eventCall
;
private
String
eventCall
;
private
Boolean
checkUpdate
=
false
;
}
}
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