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
a85bf6fe
Commit
a85bf6fe
authored
Sep 19, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tubn campaign execute update manual buisiness
parent
007fb923
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
23 deletions
+38
-23
src/main/java/com/viettel/campaign/model/ccms_full/ContactCustResult.java
...m/viettel/campaign/model/ccms_full/ContactCustResult.java
+7
-0
src/main/java/com/viettel/campaign/repository/ccms_full/ContactCustResultRepository.java
...ign/repository/ccms_full/ContactCustResultRepository.java
+3
-1
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+25
-21
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/model/ccms_full/ContactCustResult.java
View file @
a85bf6fe
...
@@ -34,11 +34,13 @@ public class ContactCustResult implements Serializable {
...
@@ -34,11 +34,13 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"DESCRIPTION"
)
@Column
(
name
=
"DESCRIPTION"
)
private
String
description
;
private
String
description
;
@Column
(
name
=
"CREATE_TIME"
)
@Column
(
name
=
"CREATE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@NotNull
@NotNull
private
Date
createTime
;
private
Date
createTime
;
@Column
(
name
=
"AGENT_ID"
)
@Column
(
name
=
"AGENT_ID"
)
private
Long
agentId
;
private
Long
agentId
;
@Column
(
name
=
"UPDATE_TIME"
)
@Column
(
name
=
"UPDATE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
updateTime
;
private
Date
updateTime
;
@Column
(
name
=
"UPDATE_BY"
)
@Column
(
name
=
"UPDATE_BY"
)
private
Long
updateBy
;
private
Long
updateBy
;
...
@@ -53,6 +55,7 @@ public class ContactCustResult implements Serializable {
...
@@ -53,6 +55,7 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"DURATION_CALL"
)
@Column
(
name
=
"DURATION_CALL"
)
private
Long
durationCall
;
private
Long
durationCall
;
@Column
(
name
=
"START_CALL"
)
@Column
(
name
=
"START_CALL"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
startCall
;
private
Date
startCall
;
@Column
(
name
=
"RECEIVE_CUST_LOG_ID"
)
@Column
(
name
=
"RECEIVE_CUST_LOG_ID"
)
@NotNull
@NotNull
...
@@ -65,15 +68,18 @@ public class ContactCustResult implements Serializable {
...
@@ -65,15 +68,18 @@ public class ContactCustResult implements Serializable {
@NotNull
@NotNull
private
String
phoneNumber
;
private
String
phoneNumber
;
@Column
(
name
=
"RECEIVE_TIME"
)
@Column
(
name
=
"RECEIVE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@NotNull
@NotNull
private
Date
receiveTime
;
private
Date
receiveTime
;
@Column
(
name
=
"PRE_END_TIME"
)
@Column
(
name
=
"PRE_END_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
preEndTime
;
private
Date
preEndTime
;
@Column
(
name
=
"URL_CALL"
)
@Column
(
name
=
"URL_CALL"
)
private
String
urlCall
;
private
String
urlCall
;
@Column
(
name
=
"TRANSACTION_ID"
)
@Column
(
name
=
"TRANSACTION_ID"
)
private
String
transactionId
;
private
String
transactionId
;
@Column
(
name
=
"RECALL_TIME"
)
@Column
(
name
=
"RECALL_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
recallTime
;
private
Date
recallTime
;
@Column
(
name
=
"IS_FINAL_RECALL"
)
@Column
(
name
=
"IS_FINAL_RECALL"
)
private
Short
isFinalRecall
;
private
Short
isFinalRecall
;
...
@@ -82,6 +88,7 @@ public class ContactCustResult implements Serializable {
...
@@ -82,6 +88,7 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"SALED_ON_TPIN"
)
@Column
(
name
=
"SALED_ON_TPIN"
)
private
Long
saledOnTpin
;
private
Long
saledOnTpin
;
@Column
(
name
=
"END_TIME"
)
@Column
(
name
=
"END_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
endTime
;
private
Date
endTime
;
@Column
(
name
=
"WAIT_TIME"
)
@Column
(
name
=
"WAIT_TIME"
)
private
Long
waitTime
;
private
Long
waitTime
;
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/ContactCustResultRepository.java
View file @
a85bf6fe
...
@@ -6,11 +6,13 @@ import org.springframework.data.jpa.repository.Query;
...
@@ -6,11 +6,13 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.
sq
l.Date
;
import
java.
uti
l.Date
;
@Repository
@Repository
public
interface
ContactCustResultRepository
extends
JpaRepository
<
ContactCustResult
,
Long
>
{
public
interface
ContactCustResultRepository
extends
JpaRepository
<
ContactCustResult
,
Long
>
{
ContactCustResult
findByContactCustResultId
(
Long
contactCustResultId
);
@Query
(
value
=
"SELECT MAX(createTime) FROM ContactCustResult WHERE campaignId = :campaignId AND agentId = :agentId AND status = 1"
)
@Query
(
value
=
"SELECT MAX(createTime) FROM ContactCustResult WHERE campaignId = :campaignId AND agentId = :agentId AND status = 1"
)
Date
getMaxCreateTime
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"agentId"
)
Long
agentId
);
Date
getMaxCreateTime
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"agentId"
)
Long
agentId
);
}
}
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
a85bf6fe
...
@@ -6,7 +6,10 @@ import com.viettel.campaign.model.ccms_full.*;
...
@@ -6,7 +6,10 @@ 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.*
;
import
com.viettel.campaign.utils.BundleUtils
;
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
;
...
@@ -347,7 +350,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -347,7 +350,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try
{
try
{
if
(
requestDto
.
getType
()
==
2
)
{
if
(
requestDto
.
getType
()
==
2
)
{
List
<
CampaignAgent
>
ca
=
campaignAgentRepository
.
findByAgentId
(
Long
.
parseLong
(
requestDto
.
getAgentId
()));
List
<
CampaignAgent
>
ca
=
campaignAgentRepository
.
findByAgentId
(
Long
.
parseLong
(
requestDto
.
getAgentId
()));
for
(
CampaignAgent
item:
ca
)
{
for
(
CampaignAgent
item
:
ca
)
{
item
.
setStatus
(
0
);
item
.
setStatus
(
0
);
}
}
ca
=
campaignAgentRepository
.
saveAll
(
ca
);
ca
=
campaignAgentRepository
.
saveAll
(
ca
);
...
@@ -616,7 +619,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -616,7 +619,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
}
}
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getContactCustResultId
());
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ringing"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ringing"
))
{
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setCallId
(
dto
.
getCallId
());
...
@@ -627,44 +630,44 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -627,44 +630,44 @@ 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
(
dto
.
getStartCall
(
));
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setEndTime
(
dto
.
getEndTime
(
));
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
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
(
dto
.
getStartCall
(
));
cc
.
setCallTime
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
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"
);
ag
=
agentsRepository
.
save
(
ag
);
ag
=
agentsRepository
.
save
(
ag
);
}
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBefore
Ten"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBeforeTen"
)
||
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfter
Ten"
))
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getOldContactCustResultId
());
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getOldContactCustResultId
());
ccr
.
setStatus
((
short
)
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
));
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
}
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfterTen"
))
{
/*
if (dto.getEventCall().equalsIgnoreCase("endedAfterTen")) {
ccr
=
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
);
ccr =
ccResultRepository.findByContactCustResultId(dto.getOldContactCustResultId()
);
ccr.setPreEndTime(ccResultRepository.getMaxCreateTime(dto.getCampaignId(), dto.getAgentId()));
ccr.setPreEndTime(ccResultRepository.getMaxCreateTime(dto.getCampaignId(), dto.getAgentId()));
ccr = ccResultRepository.save(ccr);
ccr = ccResultRepository.save(ccr);
}
}
*/
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();
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
@@ -691,7 +694,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -691,7 +694,7 @@ 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
(
dto
.
getStartCall
(
));
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
...
@@ -700,7 +703,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -700,7 +703,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ccr
.
setRecallTime
(
dto
.
getRecallTime
());
ccr
.
setRecallTime
(
dto
.
getRecallTime
());
ccr
.
setIsFinalRecall
(
dto
.
getIsFinalRecall
());
ccr
.
setIsFinalRecall
(
dto
.
getIsFinalRecall
());
ccr
.
setIsSendEmail
(
dto
.
getIsSendEmail
());
ccr
.
setIsSendEmail
(
dto
.
getIsSendEmail
());
ccr
.
setEndTime
(
dto
.
getEndTime
(
));
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setDialMode
(
dto
.
getDialMode
());
ccr
.
setDialMode
(
dto
.
getDialMode
());
ccr
=
ccResultRepository
.
save
(
ccr
);
ccr
=
ccResultRepository
.
save
(
ccr
);
...
@@ -708,8 +711,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -708,8 +711,9 @@ 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
);
result
.
setData
(
ccr
);
result
.
setData
(
ccr
);
System
.
out
.
println
(
"remove:"
+
dto
.
getContactCustResultId
()
+
"|new:"
+
ccr
.
getContactCustResultId
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
//
e.printStackTrace();
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
}
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
a85bf6fe
...
@@ -26,6 +26,7 @@ public class ContactCustResultDTO extends BaseDTO {
...
@@ -26,6 +26,7 @@ public class ContactCustResultDTO extends BaseDTO {
private
Long
oldContactCustResultId
;
private
Long
oldContactCustResultId
;
private
Long
customerId
;
private
Long
customerId
;
private
Long
durationCall
;
private
Long
durationCall
;
private
Long
startCallL
;
// api get call return Long
private
Date
startCall
;
private
Date
startCall
;
private
Long
receiveCustLogId
;
private
Long
receiveCustLogId
;
private
Short
ipccCallStatus
;
private
Short
ipccCallStatus
;
...
@@ -39,7 +40,8 @@ public class ContactCustResultDTO extends BaseDTO {
...
@@ -39,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
Date
endTime
;
private
Long
endTime
;
// api get call return Long
// private Date endTime;
private
Long
waitTime
;
private
Long
waitTime
;
private
String
dialMode
;
private
String
dialMode
;
private
Long
wrapupTime
;
private
Long
wrapupTime
;
...
...
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