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
090ef7e8
Commit
090ef7e8
authored
Sep 11, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tubn campaign execute update
parent
74441932
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
40 deletions
+68
-40
src/main/java/com/viettel/campaign/repository/ccms_full/ContactQuestResultRepository.java
...gn/repository/ccms_full/ContactQuestResultRepository.java
+4
-0
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+2
-2
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
.../com/viettel/campaign/service/CampaignExecuteService.java
+3
-3
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+49
-27
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
...va/com/viettel/campaign/web/dto/ContactCustResultDTO.java
+1
-0
src/main/java/com/viettel/campaign/web/rest/CampaignExecuteController.java
.../viettel/campaign/web/rest/CampaignExecuteController.java
+9
-8
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/ContactQuestResultRepository.java
View file @
090ef7e8
...
@@ -12,5 +12,9 @@ import java.util.List;
...
@@ -12,5 +12,9 @@ import java.util.List;
@Repository
@Repository
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
interface
ContactQuestResultRepository
extends
JpaRepository
<
ContactQuestResult
,
Long
>
{
public
interface
ContactQuestResultRepository
extends
JpaRepository
<
ContactQuestResult
,
Long
>
{
List
<
ContactQuestResultDTO
>
findByCompanySiteIdAndCampaignId
(
Long
companySiteId
,
Long
campaignId
);
List
<
ContactQuestResultDTO
>
findByCompanySiteIdAndCampaignId
(
Long
companySiteId
,
Long
campaignId
);
List
<
ContactQuestResult
>
findByContactCustResultId
(
Long
contactCustResultId
);
}
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
090ef7e8
...
@@ -123,7 +123,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -123,7 +123,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql
.
append
(
" CCR.PHONE_NUMBER AS phoneNumber, "
);
sql
.
append
(
" CCR.PHONE_NUMBER AS phoneNumber, "
);
sql
.
append
(
" CUS.NAME AS customerName, "
);
sql
.
append
(
" CUS.NAME AS customerName, "
);
sql
.
append
(
" CCR.START_CALL AS startCall, "
);
sql
.
append
(
" CCR.START_CALL AS startCall, "
);
sql
.
append
(
" CC1.COMPLETE_NAME AS con
ta
ctStatus, "
);
sql
.
append
(
" CC1.COMPLETE_NAME AS con
ne
ctStatus, "
);
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, "
);
...
@@ -291,7 +291,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -291,7 +291,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
item
.
setPhoneNumber
((
String
)
obj
[
5
]);
item
.
setPhoneNumber
((
String
)
obj
[
5
]);
item
.
setCustomerName
((
String
)
obj
[
6
]);
item
.
setCustomerName
((
String
)
obj
[
6
]);
item
.
setStartCall
(
obj
[
7
]
==
null
?
null
:
(
Date
)
obj
[
7
]);
item
.
setStartCall
(
obj
[
7
]
==
null
?
null
:
(
Date
)
obj
[
7
]);
item
.
setCon
tactStatus
((
Short
)
obj
[
8
]);
item
.
setCon
nectStatus
((
String
)
obj
[
8
]);
item
.
setSurveyStatus
((
String
)
obj
[
9
]);
item
.
setSurveyStatus
((
String
)
obj
[
9
]);
item
.
setStatus
(
obj
[
10
]
==
null
?
0
:
((
BigDecimal
)
obj
[
10
]).
shortValueExact
());
item
.
setStatus
(
obj
[
10
]
==
null
?
0
:
((
BigDecimal
)
obj
[
10
]).
shortValueExact
());
item
.
setRecordStatus
(
obj
[
11
]
==
null
?
0
:
((
BigDecimal
)
obj
[
11
]).
shortValueExact
());
item
.
setRecordStatus
(
obj
[
11
]
==
null
?
0
:
((
BigDecimal
)
obj
[
11
]).
shortValueExact
());
...
...
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
View file @
090ef7e8
...
@@ -32,8 +32,6 @@ public interface CampaignExecuteService {
...
@@ -32,8 +32,6 @@ public interface CampaignExecuteService {
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallStatus
(
CampaignRequestDTO
dto
);
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
);
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
);
ResultDTO
updateContactCustResult
(
ContactCustResultDTO
dto
,
UserSession
userSession
);
ResultDTO
updateContactCustResult
(
ContactCustResultDTO
dto
,
UserSession
userSession
);
...
@@ -50,7 +48,9 @@ public interface CampaignExecuteService {
...
@@ -50,7 +48,9 @@ public interface CampaignExecuteService {
ResultDTO
getCustomerInfor
(
Long
companySiteId
,
Long
customerId
,
Long
campaignId
);
ResultDTO
getCustomerInfor
(
Long
companySiteId
,
Long
customerId
,
Long
campaignId
);
ResultDTO
createListContacQuestResult
(
List
<
ContactQuestResultDTO
>
dtoList
);
ResultDTO
createListContactQuestResult
(
List
<
ContactQuestResultDTO
>
dtoList
);
ResultDTO
updateListContactQuestResult
(
ContactQuestResultDTO
dto
);
String
getDialModeAtCurrent
(
Long
campaignId
,
Long
companySiteId
);
String
getDialModeAtCurrent
(
Long
campaignId
,
Long
companySiteId
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
090ef7e8
...
@@ -5,7 +5,6 @@ import com.viettel.campaign.model.acd_full.Agents;
...
@@ -5,7 +5,6 @@ import com.viettel.campaign.model.acd_full.Agents;
import
com.viettel.campaign.model.ccms_full.*
;
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.CampaignCfgService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.utils.*
;
import
com.viettel.campaign.utils.*
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.*
;
...
@@ -504,24 +503,6 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -504,24 +503,6 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
result
;
return
result
;
}
}
@Override
public
ResultDTO
getCallStatus
(
CampaignRequestDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
// Random r = new Random();
String
[]
arr
=
{
"ACCEPT"
,
"REJECT"
,
"MISSING"
};
if
(
dto
!=
null
)
{
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
arr
[
this
.
rand
.
nextInt
(
arr
.
length
)]);
}
else
{
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
return
result
;
}
@Override
@Override
public
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
)
{
public
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
...
@@ -554,14 +535,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -554,14 +535,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try
{
try
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"call"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"call"
))
{
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
}
else
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
}
if
(
dto
.
getContactCustResultId
()
!=
null
)
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ringing"
))
{
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ringing"
))
{
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
);
}
else
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ended"
))
{
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"ended"
))
{
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setDurationCall
(
dto
.
getDurationCall
());
ccr
.
setStartCall
(
dto
.
getStartCall
());
ccr
.
setStartCall
(
dto
.
getStartCall
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
ccr
.
setReceiveTime
(
dto
.
getReceiveTime
());
...
@@ -576,6 +562,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -576,6 +562,19 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ag
.
setSystemStatus
(
"AVAILABLE"
);
ag
.
setSystemStatus
(
"AVAILABLE"
);
ag
=
agentsRepository
.
save
(
ag
);
ag
=
agentsRepository
.
save
(
ag
);
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedBeforeTen"
))
{
ccr
.
setStatus
((
short
)
0
);
ccr
.
setUpdateBy
(
userSession
.
getUserId
());
ccr
.
setUpdateTime
(
new
Date
());
ccr
=
ccResultRepository
.
save
(
ccr
);
}
}
if
(
dto
.
getEventCall
().
equalsIgnoreCase
(
"endedAfterTen"
))
{
ccr
=
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
);
ccr
.
setPreEndTime
(
ccResultRepository
.
getMaxCreateTime
(
dto
.
getCampaignId
(),
dto
.
getAgentId
()));
ccr
=
ccResultRepository
.
save
(
ccr
);
}
}
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
...
@@ -763,15 +762,15 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -763,15 +762,15 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Override
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
createListContacQuestResult
(
List
<
ContactQuestResultDTO
>
dtoList
)
{
public
ResultDTO
createListContac
t
QuestResult
(
List
<
ContactQuestResultDTO
>
dtoList
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
List
<
ContactQuestResult
>
lstContactQuestResult
=
new
ArrayList
<>();
List
<
ContactQuestResult
>
lstContactQuestResult
=
new
ArrayList
<>();
for
(
ContactQuestResultDTO
item
:
dtoList
)
{
lstContactQuestResult
.
add
(
modelMapper
.
map
(
item
,
ContactQuestResult
.
class
));
}
try
{
try
{
for
(
ContactQuestResultDTO
item
:
dtoList
)
{
lstContactQuestResult
.
add
(
modelMapper
.
map
(
item
,
ContactQuestResult
.
class
));
}
List
<
ContactQuestResult
>
dataReturn
=
new
ArrayList
<>();
List
<
ContactQuestResult
>
dataReturn
=
new
ArrayList
<>();
dataReturn
=
contactQuestResultRepository
.
saveAll
(
lstContactQuestResult
);
dataReturn
=
contactQuestResultRepository
.
saveAll
(
lstContactQuestResult
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
...
@@ -785,6 +784,29 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -785,6 +784,29 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
resultDTO
;
return
resultDTO
;
}
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
updateListContactQuestResult
(
ContactQuestResultDTO
dto
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
List
<
ContactQuestResult
>
lstContactQuestResult
=
new
ArrayList
<>();
try
{
lstContactQuestResult
=
contactQuestResultRepository
.
findByContactCustResultId
(
dto
.
getContactCustResultId
());
for
(
ContactQuestResult
item
:
lstContactQuestResult
)
{
item
.
setStatus
((
short
)
0
);
}
lstContactQuestResult
=
contactQuestResultRepository
.
saveAll
(
lstContactQuestResult
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setListData
(
lstContactQuestResult
);
}
catch
(
Exception
e
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
return
resultDTO
;
}
@Override
@Override
public
String
getDialModeAtCurrent
(
Long
campaignId
,
Long
companySiteId
)
{
public
String
getDialModeAtCurrent
(
Long
campaignId
,
Long
companySiteId
)
{
// 0: manual, 1- Preview, 2-Progressive, 3-Super Progressive, 4- Predictive
// 0: manual, 1- Preview, 2-Progressive, 3-Super Progressive, 4- Predictive
...
@@ -798,7 +820,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -798,7 +820,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
lstTimeZone
.
getDialMode
().
toString
();
return
lstTimeZone
.
getDialMode
().
toString
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
"-1"
;
return
"-1"
;
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
090ef7e8
...
@@ -52,6 +52,7 @@ public class ContactCustResultDTO extends BaseDTO {
...
@@ -52,6 +52,7 @@ public class ContactCustResultDTO extends BaseDTO {
private
String
campaignCode
;
private
String
campaignCode
;
private
String
userName
;
private
String
userName
;
private
String
surveyStatus
;
private
String
surveyStatus
;
private
String
connectStatus
;
private
Boolean
enableEdit
;
private
Boolean
enableEdit
;
private
Integer
totalRow
;
private
Integer
totalRow
;
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignExecuteController.java
View file @
090ef7e8
...
@@ -68,13 +68,6 @@ public class CampaignExecuteController {
...
@@ -68,13 +68,6 @@ public class CampaignExecuteController {
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
@PostMapping
(
"/getCallStatus"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
getCallStatus
(
@RequestBody
CampaignRequestDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
getCallStatus
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@GetMapping
(
"/countRecallCustomer"
)
@GetMapping
(
"/countRecallCustomer"
)
@ResponseBody
@ResponseBody
public
ResponseEntity
countRecallCustomer
(
@RequestParam
(
"companySiteId"
)
Long
companySiteId
,
@RequestParam
(
"agentId"
)
Long
agentId
)
{
public
ResponseEntity
countRecallCustomer
(
@RequestParam
(
"companySiteId"
)
Long
companySiteId
,
@RequestParam
(
"agentId"
)
Long
agentId
)
{
...
@@ -169,7 +162,15 @@ public class CampaignExecuteController {
...
@@ -169,7 +162,15 @@ public class CampaignExecuteController {
@ResponseBody
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
createListContactQuestResult
(
@RequestBody
List
<
ContactQuestResultDTO
>
dtoList
)
{
public
ResponseEntity
<
ResultDTO
>
createListContactQuestResult
(
@RequestBody
List
<
ContactQuestResultDTO
>
dtoList
)
{
ResultDTO
result
=
null
;
ResultDTO
result
=
null
;
result
=
campaignExecuteService
.
createListContacQuestResult
(
dtoList
);
result
=
campaignExecuteService
.
createListContactQuestResult
(
dtoList
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@PutMapping
(
"/updateListContactQuestResult"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
updateListContactQuestResult
(
@RequestBody
ContactQuestResultDTO
dto
)
{
ResultDTO
result
=
null
;
result
=
campaignExecuteService
.
updateListContactQuestResult
(
dto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
...
...
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