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
Show 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 "
);
...
@@ -136,8 +137,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -136,8 +137,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
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
...
@@ -6,10 +6,7 @@ import com.viettel.campaign.model.ccms_full.*;
...
@@ -6,10 +6,7 @@ import com.viettel.campaign.model.ccms_full.*;
import
com.viettel.campaign.repository.acd_full.AgentsRepository
;
import
com.viettel.campaign.repository.acd_full.AgentsRepository
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.repository.ccms_full.*
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
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.SQLBuilder
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.request_dto.CampaignCustomerListColumnRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignCustomerListColumnRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
...
@@ -88,6 +85,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -88,6 +85,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Autowired
@Autowired
VSAUsersRepository
vsaUsersRepository
;
VSAUsersRepository
vsaUsersRepository
;
@Autowired
CustomerTimeRepository
customerTimeRepository
;
public
CampaignExecuteServiceImp
()
throws
NoSuchAlgorithmException
{
public
CampaignExecuteServiceImp
()
throws
NoSuchAlgorithmException
{
}
}
...
@@ -102,6 +102,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -102,6 +102,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
lst
);
resultDTO
.
setData
(
lst
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
return
resultDTO
;
return
resultDTO
;
...
@@ -117,6 +118,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -117,6 +118,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
lst
);
resultDTO
.
setData
(
lst
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
}
}
return
resultDTO
;
return
resultDTO
;
...
@@ -134,6 +136,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -134,6 +136,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
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
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
...
@@ -244,7 +247,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -244,7 +247,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
++
count
;
++
count
;
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
finally
{
}
finally
{
if
(
workbook
!=
null
)
workbook
.
close
();
if
(
workbook
!=
null
)
workbook
.
close
();
}
}
...
@@ -301,6 +304,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -301,6 +304,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setData
(
data
);
result
.
setData
(
data
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -335,7 +339,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -335,7 +339,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -372,7 +376,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -372,7 +376,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -544,7 +548,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -544,7 +548,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
rclResult
);
result
.
setData
(
rclResult
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -578,7 +582,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -578,7 +582,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -593,14 +597,14 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -593,14 +597,14 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try
{
try
{
agentsRepository
.
updateAgentLogoutFromCampaign
(
dto
.
getAgentId
().
toString
(),
"AVAILABLE"
);
agentsRepository
.
updateAgentLogoutFromCampaign
(
dto
.
getAgentId
().
toString
(),
"AVAILABLE"
);
// update receive customer log
// update receive customer log
ReceiveCustLog
rcl
=
custLogRepository
.
get
One
(
dto
.
getReceiveCustLogId
());
ReceiveCustLog
rcl
=
custLogRepository
.
get
ByReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
rcl
.
setEndTime
(
new
Date
());
rcl
.
setEndTime
(
new
Date
());
rcl
=
custLogRepository
.
save
(
rcl
);
rcl
=
custLogRepository
.
save
(
rcl
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -612,10 +616,23 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -612,10 +616,23 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
public
ResultDTO
updateContactCustResult
(
ContactCustResultDTO
dto
,
UserSession
userSession
)
{
public
ResultDTO
updateContactCustResult
(
ContactCustResultDTO
dto
,
UserSession
userSession
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
ContactCustResult
ccr
=
new
ContactCustResult
();
ContactCustResult
ccr
=
new
ContactCustResult
();
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
(
dto
.
getTimezone
());
try
{
try
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"call"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"call"
))
{
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
ccr
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
ccr
.
setContactStatus
((
short
)
2
);
ccr
.
setStatus
((
short
)
2
);
ccr
.
setCreateTime
(
new
Date
());
ccr
.
setAgentId
(
dto
.
getAgentId
());
ccr
.
setCampaignId
(
dto
.
getCampaignId
());
ccr
.
setCustomerId
(
dto
.
getCustomerId
());
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
ccr
.
setReceiveTime
(
new
Date
());
ccr
.
setIsFinalRecall
((
short
)
1
);
ccr
.
setDialMode
(
"MANUAL"
);
ccr
=
ccResultRepository
.
save
(
ccr
);
}
}
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
...
@@ -630,17 +647,17 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -630,17 +647,17 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ended"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ended"
))
{
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setStartCall
(
dto
.
getStartCallL
()
==
null
?
null
:
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
new
Date
(
dto
.
getStartCallL
()
*
1000
),
tzClient
)
));
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
(
));
ccr
.
setReceiveTime
(
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
dto
.
getReceiveTime
(),
tzClient
)
));
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
ccr
.
setEndTime
(
dto
.
getEndTimeL
()
==
null
?
null
:
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
new
Date
(
dto
.
getEndTimeL
()
*
1000
),
tzClient
)
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateTime
(
new
Date
());
ccr
.
setUpdateTime
(
new
Date
());
ccr
=
ccResultRepository
.
save
(
ccr
);
ccr
=
ccResultRepository
.
save
(
ccr
);
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
cc
.
setCallTime
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
cc
.
setCallTime
(
dto
.
getStartCallL
()
==
null
?
null
:
DateTimeUtil
.
parseDate
(
"dd/MM/yyyy HH:mm:ss"
,
TimeZoneUtils
.
toDateStringWithTimeZone
(
new
Date
(
dto
.
getStartCallL
()
*
1000
),
tzClient
)
));
cc
=
campaignCustomerRepository
.
save
(
cc
);
cc
=
campaignCustomerRepository
.
save
(
cc
);
Agents
ag
=
agentsRepository
.
findByAgentId
(
dto
.
getAgentId
().
toString
());
Agents
ag
=
agentsRepository
.
findByAgentId
(
dto
.
getAgentId
().
toString
());
ag
.
setSystemStatus
(
"AVAILABLE"
);
ag
.
setSystemStatus
(
"AVAILABLE"
);
...
@@ -649,12 +666,37 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -649,12 +666,37 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBeforeTen"
)
||
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfterTen"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBeforeTen"
)
||
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfterTen"
))
{
// update old contact customer result
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getOldContactCustResultId
());
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getOldContactCustResultId
());
ccr
.
setStatus
(
Short
.
parseShort
(
"0"
));
ccr
.
setStatus
(
Short
.
parseShort
(
"0"
));
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateTime
(
new
Date
());
ccr
.
setUpdateTime
(
new
Date
());
ccResultRepository
.
save
(
ccr
);
ccResultRepository
.
save
(
ccr
);
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
// insert new contact customer result
ccr
=
new
ContactCustResult
();
ccr
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
ccr
.
setCallStatus
(
dto
.
getCallStatus
());
ccr
.
setContactStatus
(
dto
.
getContactStatus
());
ccr
.
setStatus
((
short
)
1
);
ccr
.
setDescription
(
dto
.
getDescription
());
ccr
.
setAgentId
(
dto
.
getAgentId
());
ccr
.
setCreateTime
(
new
Date
());
ccr
.
setOldContactCustResultId
(
dto
.
getOldContactCustResultId
());
ccr
.
setCampaignId
(
dto
.
getCampaignId
());
ccr
.
setCustomerId
(
dto
.
getCustomerId
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
dto
.
getStartCallL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getStartCallL
()
*
1000
),
0L
));
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setEndTime
(
dto
.
getEndTimeL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getEndTimeL
()
*
1000
),
0L
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getReceiveTime
(),
0L
));
ccr
.
setRecallTime
(
dto
.
getRecallTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getRecallTime
(),
0L
));
ccr
.
setIsFinalRecall
((
short
)
1
);
ccr
.
setIsSendEmail
((
short
)
0
);
ccr
.
setDialMode
(
"MANUAL"
);
ccr
=
ccResultRepository
.
save
(
ccr
);
}
}
/*if (dto.getEventCall().equalsIgnoreCase("endedAfterTen")) {
/*if (dto.getEventCall().equalsIgnoreCase("endedAfterTen")) {
...
@@ -667,7 +709,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -667,7 +709,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -679,6 +721,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -679,6 +721,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
public
ResultDTO
draftAtTen
(
ContactCustResultDTO
dto
,
UserSession
userSession
)
{
public
ResultDTO
draftAtTen
(
ContactCustResultDTO
dto
,
UserSession
userSession
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
ContactCustResult
ccr
=
new
ContactCustResult
();
ContactCustResult
ccr
=
new
ContactCustResult
();
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
(
dto
.
getTimezone
());
try
{
try
{
ccResultRepository
.
deleteById
(
dto
.
getContactCustResultId
());
ccResultRepository
.
deleteById
(
dto
.
getContactCustResultId
());
...
@@ -686,7 +729,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -686,7 +729,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ccr
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
ccr
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
ccr
.
setCallStatus
(
dto
.
getCallStatus
());
ccr
.
setCallStatus
(
dto
.
getCallStatus
());
ccr
.
setContactStatus
(
dto
.
getContactStatus
());
ccr
.
setContactStatus
(
dto
.
getContactStatus
());
ccr
.
setStatus
(
dto
.
getStatus
()
);
ccr
.
setStatus
(
(
short
)
2
);
ccr
.
setDescription
(
dto
.
getDescription
());
ccr
.
setDescription
(
dto
.
getDescription
());
ccr
.
setCreateTime
(
new
Date
());
ccr
.
setCreateTime
(
new
Date
());
ccr
.
setAgentId
(
dto
.
getAgentId
());
ccr
.
setAgentId
(
dto
.
getAgentId
());
...
@@ -694,18 +737,18 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -694,18 +737,18 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setCustomerId
(
dto
.
getCustomerId
());
ccr
.
setCustomerId
(
dto
.
getCustomerId
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setStartCall
(
dto
.
getStartCallL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getStartCallL
()
*
1000
),
0L
));
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getReceiveTime
(),
0L
)
);
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setRecallTime
(
dto
.
getRecallTime
());
ccr
.
setRecallTime
(
dto
.
getRecallTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getRecallTime
(),
0L
)
);
ccr
.
setIsFinalRecall
(
dto
.
getIsFinalRecall
()
);
ccr
.
setIsFinalRecall
(
(
short
)
1
);
ccr
.
setIsSendEmail
(
dto
.
getIsSendEmail
()
);
ccr
.
setIsSendEmail
(
(
short
)
0
);
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
ccr
.
setEndTime
(
dto
.
getEndTimeL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getEndTimeL
()
*
1000
),
0L
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setDialMode
(
dto
.
getDialMode
()
);
ccr
.
setDialMode
(
"MANUAL"
);
ccr
=
ccResultRepository
.
save
(
ccr
);
ccr
=
ccResultRepository
.
save
(
ccr
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
...
@@ -713,7 +756,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -713,7 +756,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setData
(
ccr
);
result
.
setData
(
ccr
);
System
.
out
.
println
(
"remove:"
+
dto
.
getContactCustResultId
()
+
"|new:"
+
ccr
.
getContactCustResultId
());
System
.
out
.
println
(
"remove:"
+
dto
.
getContactCustResultId
()
+
"|new:"
+
ccr
.
getContactCustResultId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -734,7 +777,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -734,7 +777,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -748,13 +791,13 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -748,13 +791,13 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ContactCustResult
ccr
=
new
ContactCustResult
();
ContactCustResult
ccr
=
new
ContactCustResult
();
try
{
try
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getContactCustResultId
());
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -767,7 +810,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -767,7 +810,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
try
{
try
{
ContactCustResult
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
ContactCustResult
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getContactCustResultId
());
ccr
.
setDurationCall
(
0L
);
ccr
.
setDurationCall
(
0L
);
ccr
.
setStartCall
(
new
Date
());
ccr
.
setStartCall
(
new
Date
());
ccr
.
setReceiveTime
(
new
Date
());
ccr
.
setReceiveTime
(
new
Date
());
...
@@ -780,7 +823,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -780,7 +823,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
resultUpdate
);
result
.
setData
(
resultUpdate
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// e.printStackTrace(
);
logger
.
error
(
e
.
getMessage
()
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -841,6 +884,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -841,6 +884,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
data
);
resultDTO
.
setData
(
data
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -864,6 +908,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -864,6 +908,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setListData
(
dataReturn
);
resultDTO
.
setListData
(
dataReturn
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -887,6 +932,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -887,6 +932,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setListData
(
lstContactQuestResult
);
resultDTO
.
setListData
(
lstContactQuestResult
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -907,7 +953,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -907,7 +953,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
lstTimeZone
.
getDialMode
().
toString
();
return
lstTimeZone
.
getDialMode
().
toString
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
logger
.
error
(
e
.
getMessage
()
);
}
}
return
"-1"
;
return
"-1"
;
...
@@ -918,10 +964,16 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -918,10 +964,16 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
try
{
try
{
ContactCustResult
ccr
=
ccResultRepository
.
findByContactCustResultId
(
contactCustResultId
);
ContactCustResultDTO
dtoCCR
=
modelMapper
.
map
(
ccr
,
ContactCustResultDTO
.
class
);
// if (dtoCCR.getCreateTime().)
// dtoCCR.setCheckUpdate(true);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
cc
ResultRepository
.
findById
(
contactCustResultId
)
);
resultDTO
.
setData
(
cc
r
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -932,18 +984,23 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -932,18 +984,23 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Override
@Override
public
ResultDTO
updateCampaignCustomer
(
CampaignCustomerDTO
dto
)
{
public
ResultDTO
updateCampaignCustomer
(
CampaignCustomerDTO
dto
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
(
dto
.
getTimezone
());
try
{
try
{
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
cc
.
setStatus
(
dto
.
getStatus
());
cc
.
setStatus
(
dto
.
getStatus
());
cc
.
setAgentId
(
dto
.
getAgentId
());
cc
.
setAgentId
(
dto
.
getAgentId
());
cc
.
setRecallTime
(
dto
.
getRecallTime
());
if
(
dto
.
getRecallTime
()
!=
null
)
{
cc
.
setRecallTime
(
dto
.
getRecallTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getRecallTime
(),
0L
));
cc
.
setRecallCount
(
cc
.
getRecallCount
()
+
1
);
cc
.
setRecallCount
(
cc
.
getRecallCount
()
+
1
);
cc
.
setCallTime
(
dto
.
getCallTime
());
}
cc
.
setCallTime
(
dto
.
getCallTimeL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getCallTimeL
()
*
1000
),
0L
));
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
cc
);
resultDTO
.
setData
(
cc
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -956,29 +1013,42 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -956,29 +1013,42 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try
{
try
{
CampaignCfg
cfg
=
cfgRepository
.
findByCompanySiteIdAndCompleteValue
(
dto
.
getCompanySiteId
(),
dto
.
getCompleteValue
());
CampaignCfg
cfg
=
cfgRepository
.
findByCompanySiteIdAndCompleteValue
(
dto
.
getCompanySiteId
(),
dto
.
getCompleteValue
());
if
(
cfg
.
getIsLock
()
==
1
)
{
if
(
cfg
!=
null
&&
cfg
.
getIsLock
()
==
1
)
{
Customer
c
=
customerRepository
.
get
One
(
dto
.
getCustomerId
());
Customer
c
=
customerRepository
.
get
ByCustomerId
(
dto
.
getCustomerId
());
c
.
setIpccStatus
(
"locked"
);
c
.
setIpccStatus
(
"locked"
);
c
=
customerRepository
.
save
(
c
);
c
=
customerRepository
.
save
(
c
);
}
else
{
// insert CustomerTime
CustomerTime
c
=
new
CustomerTime
();
CustomerTime
c
t
=
new
CustomerTime
();
c
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
c
t
.
setCompanySiteId
(
dto
.
getCompanySiteId
());
c
.
setCustomerId
(
dto
.
getCustomerId
());
c
t
.
setCustomerId
(
dto
.
getCustomerId
());
c
.
setStartTime
(
dto
.
getStartTime
());
c
t
.
setStartTime
(
dto
.
getStartTime
());
LocalDateTime
ldt
=
dto
.
getStartTime
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDateTime
().
plusDays
(
cfg
.
getDurationLock
());
LocalDateTime
ldt
=
dto
.
getStartTime
().
toInstant
().
atZone
(
ZoneId
.
systemDefault
()).
toLocalDateTime
().
plusDays
(
cfg
.
getDurationLock
());
c
.
setEndTime
(
Date
.
from
(
ldt
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()));
ct
.
setEndTime
(
Date
.
from
(
ldt
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
()));
c
.
setStatus
((
short
)
1
);
ct
.
setStatus
((
short
)
1
);
c
.
setCreateTime
(
new
Date
());
ct
.
setCreateTime
(
new
Date
());
c
.
setCreateBy
(
userSession
.
getUserId
());
ct
.
setCreateBy
(
userSession
.
getUserId
());
c
.
setUpdateTime
(
new
Date
());
ct
.
setUpdateTime
(
new
Date
());
c
.
setUpdateBy
(
userSession
.
getUserId
());
ct
.
setUpdateBy
(
userSession
.
getUserId
());
c
.
setContactCustResultId
(
dto
.
getContactCustResultId
());
ct
.
setContactCustResultId
(
dto
.
getContactCustResultId
());
customerTimeRepository
.
save
(
ct
);
}
if
(
cfg
!=
null
&&
cfg
.
getIsLock
()
==
0
)
{
Customer
c
=
customerRepository
.
getByCustomerId
(
dto
.
getCustomerId
());
c
.
setIpccStatus
(
"active"
);
c
=
customerRepository
.
save
(
c
);
// insert CustomerTime
CustomerTime
ct
=
customerTimeRepository
.
findByCompanySiteIdAndCustomerId
(
dto
.
getCompanySiteId
(),
dto
.
getCustomerId
());
ct
.
setStatus
((
short
)
0
);
ct
.
setUpdateTime
(
new
Date
());
ct
.
setUpdateBy
(
userSession
.
getUserId
());
customerTimeRepository
.
save
(
ct
);
}
}
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
null
);
resultDTO
.
setData
(
null
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
...
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