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
66fe55a6
Commit
66fe55a6
authored
Sep 19, 2019
by
Phạm Duy Phi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.myitsol.com/hanv/service-campaign
parents
77d9a47f
ae734b93
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
24 deletions
+40
-24
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
+24
-20
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+3
-2
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 @
66fe55a6
...
...
@@ -34,11 +34,13 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"DESCRIPTION"
)
private
String
description
;
@Column
(
name
=
"CREATE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@NotNull
private
Date
createTime
;
@Column
(
name
=
"AGENT_ID"
)
private
Long
agentId
;
@Column
(
name
=
"UPDATE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
updateTime
;
@Column
(
name
=
"UPDATE_BY"
)
private
Long
updateBy
;
...
...
@@ -53,6 +55,7 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"DURATION_CALL"
)
private
Long
durationCall
;
@Column
(
name
=
"START_CALL"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
startCall
;
@Column
(
name
=
"RECEIVE_CUST_LOG_ID"
)
@NotNull
...
...
@@ -65,15 +68,18 @@ public class ContactCustResult implements Serializable {
@NotNull
private
String
phoneNumber
;
@Column
(
name
=
"RECEIVE_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@NotNull
private
Date
receiveTime
;
@Column
(
name
=
"PRE_END_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
preEndTime
;
@Column
(
name
=
"URL_CALL"
)
private
String
urlCall
;
@Column
(
name
=
"TRANSACTION_ID"
)
private
String
transactionId
;
@Column
(
name
=
"RECALL_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
recallTime
;
@Column
(
name
=
"IS_FINAL_RECALL"
)
private
Short
isFinalRecall
;
...
...
@@ -82,6 +88,7 @@ public class ContactCustResult implements Serializable {
@Column
(
name
=
"SALED_ON_TPIN"
)
private
Long
saledOnTpin
;
@Column
(
name
=
"END_TIME"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
endTime
;
@Column
(
name
=
"WAIT_TIME"
)
private
Long
waitTime
;
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/ContactCustResultRepository.java
View file @
66fe55a6
...
...
@@ -6,11 +6,13 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
java.
sq
l.Date
;
import
java.
uti
l.Date
;
@Repository
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"
)
Date
getMaxCreateTime
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"agentId"
)
Long
agentId
);
}
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
66fe55a6
...
...
@@ -6,7 +6,10 @@ import com.viettel.campaign.model.ccms_full.*;
import
com.viettel.campaign.repository.acd_full.AgentsRepository
;
import
com.viettel.campaign.repository.ccms_full.*
;
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.request_dto.CampaignCustomerListColumnRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
...
...
@@ -608,7 +611,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
}
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getContactCustResultId
());
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ringing"
))
{
ccr
.
setCallId
(
dto
.
getCallId
());
...
...
@@ -619,44 +622,44 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ended"
))
{
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
dto
.
getStartCall
(
));
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
.
setEndTime
(
dto
.
getEndTime
(
));
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateTime
(
new
Date
());
ccr
=
ccResultRepository
.
save
(
ccr
);
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
cc
.
setCallTime
(
dto
.
getStartCall
(
));
cc
.
setCallTime
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
cc
=
campaignCustomerRepository
.
save
(
cc
);
Agents
ag
=
agentsRepository
.
findByAgentId
(
dto
.
getAgentId
().
toString
());
ag
.
setSystemStatus
(
"AVAILABLE"
);
ag
=
agentsRepository
.
save
(
ag
);
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBefore
Ten"
))
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getOldContactCustResultId
());
ccr
.
setStatus
((
short
)
0
);
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBeforeTen"
)
||
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfter
Ten"
))
{
ccr
=
ccResultRepository
.
findByContactCustResultId
(
dto
.
getOldContactCustResultId
());
ccr
.
setStatus
(
Short
.
parseShort
(
"0"
)
);
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateTime
(
new
Date
());
ccResultRepository
.
save
(
ccr
);
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfterTen"
))
{
ccr
=
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
);
/*
if (dto.getEventCall().equalsIgnoreCase("endedAfterTen")) {
ccr =
ccResultRepository.findByContactCustResultId(dto.getOldContactCustResultId()
);
ccr.setPreEndTime(ccResultRepository.getMaxCreateTime(dto.getCampaignId(), dto.getAgentId()));
ccr = ccResultRepository.save(ccr);
}
}
*/
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
//
e.printStackTrace();
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
...
...
@@ -683,7 +686,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setCustomerId
(
dto
.
getCustomerId
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
dto
.
getStartCall
(
));
ccr
.
setStartCall
(
new
Date
(
dto
.
getStartCallL
()
*
1000
));
ccr
.
setReceiveCustLogId
(
dto
.
getReceiveCustLogId
());
ccr
.
setCallId
(
dto
.
getCallId
());
ccr
.
setPhoneNumber
(
dto
.
getPhoneNumber
());
...
...
@@ -692,7 +695,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ccr
.
setRecallTime
(
dto
.
getRecallTime
());
ccr
.
setIsFinalRecall
(
dto
.
getIsFinalRecall
());
ccr
.
setIsSendEmail
(
dto
.
getIsSendEmail
());
ccr
.
setEndTime
(
dto
.
getEndTime
(
));
ccr
.
setEndTime
(
new
Date
(
dto
.
getEndTime
()
*
1000
));
ccr
.
setWaitTime
(
dto
.
getWaitTime
());
ccr
.
setDialMode
(
dto
.
getDialMode
());
ccr
=
ccResultRepository
.
save
(
ccr
);
...
...
@@ -700,8 +703,9 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
System
.
out
.
println
(
"remove:"
+
dto
.
getContactCustResultId
()
+
"|new:"
+
ccr
.
getContactCustResultId
());
}
catch
(
Exception
e
)
{
//
e.printStackTrace();
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
...
...
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
66fe55a6
...
...
@@ -2206,13 +2206,14 @@ public class CustomerServiceImpl implements CustomerService {
requestCustomer
.
put
(
"-8"
,
"cc.contact"
);
requestCustomer
.
put
(
"-9"
,
"cc2.contact"
);
requestCustomer
.
put
(
"-10"
,
"c.username"
);
requestCustomer
.
put
(
"-11"
,
"c.
area_cod
e"
);
requestCustomer
.
put
(
"-12"
,
"c.
customer_typ
e"
);
requestCustomer
.
put
(
"-11"
,
"c.
customer_typ
e"
);
requestCustomer
.
put
(
"-12"
,
"c.
area_cod
e"
);
requestCustomer
.
put
(
"-13"
,
"c.call_allowed"
);
requestCustomer
.
put
(
"-14"
,
"c.email_allowed"
);
requestCustomer
.
put
(
"-15"
,
"c.sms_allowed"
);
requestCustomer
.
put
(
"-16"
,
"c.ipcc_status"
);
try
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
66fe55a6
...
...
@@ -26,6 +26,7 @@ public class ContactCustResultDTO extends BaseDTO {
private
Long
oldContactCustResultId
;
private
Long
customerId
;
private
Long
durationCall
;
private
Long
startCallL
;
// api get call return Long
private
Date
startCall
;
private
Long
receiveCustLogId
;
private
Short
ipccCallStatus
;
...
...
@@ -39,7 +40,8 @@ public class ContactCustResultDTO extends BaseDTO {
private
Short
isFinalRecall
;
private
Short
isSendEmail
=
0
;
private
Long
saledOnTpin
;
private
Date
endTime
;
private
Long
endTime
;
// api get call return Long
// private Date endTime;
private
Long
waitTime
;
private
String
dialMode
;
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