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
ad5b82a9
Commit
ad5b82a9
authored
Aug 26, 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
438c812c
8890ea24
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
121 additions
and
48 deletions
+121
-48
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+10
-10
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
...ign/repository/ccms_full/impl/CampaignRepositoryImpl.java
+3
-3
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
.../com/viettel/campaign/service/CampaignExecuteService.java
+7
-4
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+64
-3
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+0
-24
src/main/java/com/viettel/campaign/web/rest/CampaignExecuteController.java
.../viettel/campaign/web/rest/CampaignExecuteController.java
+36
-3
src/main/resources/application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
ad5b82a9
...
@@ -7,20 +7,20 @@ import com.viettel.campaign.repository.ccms_full.TimeZoneDialModeRepository;
...
@@ -7,20 +7,20 @@ import com.viettel.campaign.repository.ccms_full.TimeZoneDialModeRepository;
import
com.viettel.campaign.utils.Constants
;
import
com.viettel.campaign.utils.Constants
;
import
com.viettel.campaign.utils.DataUtil
;
import
com.viettel.campaign.utils.DataUtil
;
import
com.viettel.campaign.utils.HibernateUtil
;
import
com.viettel.campaign.utils.HibernateUtil
;
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.CampaignRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.hibernate.SQLQuery
;
import
org.hibernate.SQLQuery
;
import
org.hibernate.Session
;
import
org.hibernate.Session
;
import
org.hibernate.SessionFactory
;
import
org.hibernate.SessionFactory
;
import
org.hibernate.transform.Transformers
;
import
org.hibernate.transform.Transformers
;
import
org.hibernate.type.*
;
import
org.hibernate.type.DateType
;
import
org.hibernate.type.IntegerType
;
import
org.hibernate.type.LongType
;
import
org.hibernate.type.StringType
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
;
import
org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
;
...
@@ -109,7 +109,6 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -109,7 +109,6 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
session
.
beginTransaction
();
try
{
try
{
// String sql = SQLBuilder.getSqlQueryById(Constants.SQL_MODULES.MODULE_EXECUTE, "get-execute-interactive");
StringBuilder
sql
=
new
StringBuilder
();
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"with campaign_type_list as ("
);
sql
.
append
(
"with campaign_type_list as ("
);
...
@@ -150,7 +149,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -150,7 +149,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql
.
append
(
" f.complete_name surveyStatus,"
);
sql
.
append
(
" f.complete_name surveyStatus,"
);
sql
.
append
(
" g.status status,"
);
sql
.
append
(
" g.status status,"
);
sql
.
append
(
" a.status recordStatus,"
);
sql
.
append
(
" a.status recordStatus,"
);
sql
.
append
(
"
(a.end_time - a.start_call)*24*60
callTime"
);
sql
.
append
(
"
nvl((a.end_time - a.start_call)*24*60, 0)
callTime"
);
sql
.
append
(
" from contact_cust_result a"
);
sql
.
append
(
" from contact_cust_result a"
);
sql
.
append
(
" left join campaign b on a.campaign_id = b.campaign_id"
);
sql
.
append
(
" left join campaign b on a.campaign_id = b.campaign_id"
);
sql
.
append
(
" left join vsa_users c on a.agent_id = c.user_id"
);
sql
.
append
(
" left join vsa_users c on a.agent_id = c.user_id"
);
...
@@ -176,6 +175,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -176,6 +175,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
sql
.
append
(
" select a.*, rownum row_ from data_temp a"
);
sql
.
append
(
" select a.*, rownum row_ from data_temp a"
);
sql
.
append
(
" where a.callTime >= :p_call_time_from"
);
sql
.
append
(
" where a.callTime >= :p_call_time_from"
);
sql
.
append
(
" and a.callTime <= :p_call_time_to"
);
sql
.
append
(
" and a.callTime <= :p_call_time_to"
);
sql
.
append
(
" order by a.createTime desc"
);
sql
.
append
(
" ),"
);
sql
.
append
(
" ),"
);
sql
.
append
(
" count_total as ("
);
sql
.
append
(
" count_total as ("
);
sql
.
append
(
" select count(*) totalRow from data"
);
sql
.
append
(
" select count(*) totalRow from data"
);
...
@@ -196,8 +196,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -196,8 +196,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
query
.
setParameter
(
"p_list_campaign_code"
,
dto
.
getCampaignCode
());
query
.
setParameter
(
"p_list_campaign_code"
,
dto
.
getCampaignCode
());
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_campaign_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
())
?
null
:
dto
.
getCampaignName
().
toUpperCase
());
query
.
setParameter
(
"p_campaign_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
())
?
null
:
dto
.
getCampaignName
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_user_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
())
?
null
:
dto
.
getAgentId
().
toUpperCase
());
query
.
setParameter
(
"p_user_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
())
?
null
:
dto
.
getAgentId
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
query
.
setParameter
(
"p_page_size"
,
dto
.
getPageSize
());
query
.
setParameter
(
"p_page_size"
,
dto
.
getPageSize
());
...
@@ -343,8 +343,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
...
@@ -343,8 +343,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
query
.
setParameter
(
"p_list_campaign_code"
,
dto
.
getCampaignCode
());
query
.
setParameter
(
"p_list_campaign_code"
,
dto
.
getCampaignCode
());
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_campaign_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
())
?
null
:
dto
.
getCampaignName
().
toUpperCase
());
query
.
setParameter
(
"p_campaign_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
())
?
null
:
dto
.
getCampaignName
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_user_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
())
?
null
:
dto
.
getAgentId
().
toUpperCase
());
query
.
setParameter
(
"p_user_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
())
?
null
:
dto
.
getAgentId
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
query
.
setParameter
(
"p_page_size"
,
dto
.
getPageSize
());
query
.
setParameter
(
"p_page_size"
,
dto
.
getPageSize
());
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
View file @
ad5b82a9
...
@@ -309,7 +309,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -309,7 +309,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
"ORDER BY START_TIME DESC"
);
"ORDER BY START_TIME DESC"
);
SQLQuery
query
=
session
.
createSQLQuery
(
sb
.
toString
());
SQLQuery
query
=
session
.
createSQLQuery
(
sb
.
toString
());
query
.
setParameter
(
"p_company_site_id"
,
requestDto
.
getCompanySiteId
());
query
.
setParameter
(
"p_company_site_id"
,
requestDto
.
getCompanySiteId
());
query
.
setParameter
(
"p_code"
,
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCampaignCode
())
?
null
:
requestDto
.
getCampaignCode
().
toUpperCase
());
query
.
setParameter
(
"p_code"
,
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCampaignCode
())
?
null
:
requestDto
.
getCampaignCode
().
t
rim
().
t
oUpperCase
());
query
.
addScalar
(
"campaignId"
,
new
LongType
());
query
.
addScalar
(
"campaignId"
,
new
LongType
());
query
.
addScalar
(
"campaignCode"
,
new
StringType
());
query
.
addScalar
(
"campaignCode"
,
new
StringType
());
...
@@ -742,8 +742,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
...
@@ -742,8 +742,8 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
SQLQuery
query
=
session
.
createSQLQuery
(
sb
.
toString
());
SQLQuery
query
=
session
.
createSQLQuery
(
sb
.
toString
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_campaign_id"
,
dto
.
getCampaignId
());
query
.
setParameter
(
"p_campaign_id"
,
dto
.
getCampaignId
());
query
.
setParameter
(
"p_cus_list_code"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCustListCode
().
toUpperCase
());
query
.
setParameter
(
"p_cus_list_code"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCustListCode
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_cus_list_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListName
())
?
null
:
dto
.
getCustListName
().
toUpperCase
());
query
.
setParameter
(
"p_cus_list_name"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListName
())
?
null
:
dto
.
getCustListName
().
t
rim
().
t
oUpperCase
());
query
.
setParameter
(
"p_to_date"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCreateTimeTo
());
query
.
setParameter
(
"p_to_date"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCreateTimeTo
());
query
.
setParameter
(
"p_from_date"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCreateTimeFr
());
query
.
setParameter
(
"p_from_date"
,
DataUtil
.
isNullOrEmpty
(
dto
.
getCustListCode
())
?
null
:
dto
.
getCreateTimeFr
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
query
.
setParameter
(
"p_page_number"
,
dto
.
getPage
());
...
...
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
View file @
ad5b82a9
package
com.viettel.campaign.service
;
package
com.viettel.campaign.service
;
import
com.viettel.campaign.web.dto.CampaignCustomerDTO
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.ContactCustResultDTO
;
import
com.viettel.campaign.web.dto.ReceiveCustLogDTO
;
import
com.viettel.campaign.web.dto.ResultDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -36,10 +33,16 @@ public interface CampaignExecuteService {
...
@@ -36,10 +33,16 @@ public interface CampaignExecuteService {
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallLog
(
ReceiveCustLogDTO
dto
);
ResultDTO
getCallStatus
(
CampaignRequestDTO
dto
);
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
);
ResultDTO
getAgentLogout
(
CampaignRequestDTO
dto
);
ResultDTO
callCustomer
(
ContactCustResultDTO
dto
);
ResultDTO
callCustomer
(
ContactCustResultDTO
dto
);
ResultDTO
recallCustomer
(
ContactCustResultDTO
dto
);
ResultDTO
callCustomerEnd
(
ContactCustResultDTO
dto
);
ResultDTO
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
);
ResultDTO
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
);
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
);
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
ad5b82a9
...
@@ -247,7 +247,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -247,7 +247,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
if
(
agents
.
getUserStatus
()
!=
null
&&
agents
.
getCampaignSystemStatus
()
!=
null
)
{
if
(
agents
.
getUserStatus
()
!=
null
&&
agents
.
getCampaignSystemStatus
()
!=
null
)
{
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"AVAILABLE"
))
{
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"AVAILABLE"
))
{
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
data
.
put
(
"dialModeManual"
,
"1"
);
data
.
put
(
"dialModeManual"
,
"1"
);
}
}
...
@@ -269,7 +269,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -269,7 +269,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
Agents
agents
=
agentsRepository
.
findByAgentId
(
requestDto
.
getAgentId
());
Agents
agents
=
agentsRepository
.
findByAgentId
(
requestDto
.
getAgentId
());
//TimeZoneDialMode zoneDialMode = zoneDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeZoneDialMode zoneDialMode = zoneDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
//TimeRangeDialMode rangeDialMode = rangeDialModeRepository.findDialModeAtCurrent(Long.parseLong(requestDto.getCampaignId()), Long.parseLong(requestDto.getCompanySiteId()));
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"LOGOUT"
))
{
if
(
agents
.
getUserStatus
().
equalsIgnoreCase
(
"CALLOUT"
)
&&
agents
.
getCampaignSystemStatus
().
equalsIgnoreCase
(
"LOGOUT"
))
{
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
//if (zoneDialMode != null && zoneDialMode.getDialMode().equals(0) || rangeDialMode != null && rangeDialMode.getDialMode().equals(0))
// update acd_full.agents table
// update acd_full.agents table
Agents
a
=
new
Agents
();
Agents
a
=
new
Agents
();
...
@@ -481,6 +481,24 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -481,6 +481,24 @@ 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
[
r
.
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
();
...
@@ -519,6 +537,47 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -519,6 +537,47 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
result
;
return
result
;
}
}
@Override
public
ResultDTO
recallCustomer
(
ContactCustResultDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
try
{
ccResultRepository
.
deleteById
(
dto
.
getContactCustResultId
());
ContactCustResult
ccr
=
ccResultRepository
.
save
(
modelMapper
.
map
(
dto
,
ContactCustResult
.
class
));
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
return
result
;
}
@Override
public
ResultDTO
callCustomerEnd
(
ContactCustResultDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
ContactCustResult
ccr
=
new
ContactCustResult
();
try
{
ccr
=
ccResultRepository
.
getOne
(
dto
.
getContactCustResultId
());
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
setData
(
ccr
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
return
result
;
}
@Override
@Override
public
ResultDTO
updateCustomerResult
(
ContactCustResultDTO
dto
)
{
public
ResultDTO
updateCustomerResult
(
ContactCustResultDTO
dto
)
{
ResultDTO
result
=
new
ResultDTO
();
ResultDTO
result
=
new
ResultDTO
();
...
@@ -564,8 +623,10 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -564,8 +623,10 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
)
{
public
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
)
{
Long
count
=
campaignCustomerRepository
.
getCustomerRecall
(
campaignId
,
customerId
);
ResultDTO
resultDTO
=
new
ResultDTO
();
ResultDTO
resultDTO
=
new
ResultDTO
();
Long
count
=
campaignCustomerRepository
.
getCustomerRecall
(
campaignId
,
customerId
);
if
(
count
!=
null
)
{
if
(
count
!=
null
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
ad5b82a9
...
@@ -41,16 +41,6 @@ public class CampaignController {
...
@@ -41,16 +41,6 @@ public class CampaignController {
@Autowired
@Autowired
CampaignService
campaignService
;
CampaignService
campaignService
;
@Autowired
CampaignExecuteService
campaignExecuteService
;
@PostMapping
(
"/callCustomer"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
callCustomer
(
@RequestBody
ContactCustResultDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
callCustomer
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/search"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<
ResultDTO
>
search
(
@RequestBody
CampaignRequestDTO
requestDto
)
{
public
ResponseEntity
<
ResultDTO
>
search
(
@RequestBody
CampaignRequestDTO
requestDto
)
{
ResultDTO
result
=
campaignService
.
search
(
requestDto
);
ResultDTO
result
=
campaignService
.
search
(
requestDto
);
...
@@ -166,13 +156,6 @@ public class CampaignController {
...
@@ -166,13 +156,6 @@ public class CampaignController {
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
}
}
@GetMapping
(
"/getCustomerRecall"
)
@ResponseBody
public
ResponseEntity
getCustomerRecall
(
@RequestParam
(
"campaignId"
)
Long
campaignId
,
@RequestParam
(
"customerId"
)
Long
customerId
)
{
ResultDTO
result
=
campaignExecuteService
.
getCustomerRecall
(
campaignId
,
customerId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/getCampaignCustomerList"
)
@PostMapping
(
"/getCampaignCustomerList"
)
@ResponseBody
@ResponseBody
public
ResponseEntity
getCampaignCustomerList
(
@RequestBody
CampaignRequestDTO
campaignRequestDTO
)
{
public
ResponseEntity
getCampaignCustomerList
(
@RequestBody
CampaignRequestDTO
campaignRequestDTO
)
{
...
@@ -244,13 +227,6 @@ public class CampaignController {
...
@@ -244,13 +227,6 @@ public class CampaignController {
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
@GetMapping
(
"/getCustomerInfor"
)
@ResponseBody
public
ResponseEntity
getCustomerInfor
(
@RequestParam
(
"companySiteId"
)
Long
companySiteId
,
@RequestParam
(
"customerId"
)
Long
customerId
,
@RequestParam
(
"campaignId"
)
Long
campaignId
)
{
ResultDTO
result
=
campaignExecuteService
.
getCustomerInfor
(
companySiteId
,
customerId
,
campaignId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/import-file"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/import-file"
,
method
=
RequestMethod
.
POST
)
public
ResponseEntity
<?>
importFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
public
ResponseEntity
<?>
importFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestHeader
(
"X-Auth-Token"
)
String
authToken
)
{
@RequestHeader
(
"X-Auth-Token"
)
String
authToken
)
{
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignExecuteController.java
View file @
ad5b82a9
package
com.viettel.campaign.web.rest
;
package
com.viettel.campaign.web.rest
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.web.dto.CampaignCustomerDTO
;
import
com.viettel.campaign.web.dto.*
;
import
com.viettel.campaign.web.dto.ReceiveCustLogDTO
;
import
com.viettel.campaign.web.dto.ResultDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -67,6 +65,13 @@ public class CampaignExecuteController {
...
@@ -67,6 +65,13 @@ 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
)
{
...
@@ -126,4 +131,32 @@ public class CampaignExecuteController {
...
@@ -126,4 +131,32 @@ public class CampaignExecuteController {
ResultDTO
result
=
campaignExecuteService
.
getCustomerInfor
(
companySiteId
,
customerId
,
campaignId
);
ResultDTO
result
=
campaignExecuteService
.
getCustomerInfor
(
companySiteId
,
customerId
,
campaignId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
@PostMapping
(
"/callCustomer"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
callCustomer
(
@RequestBody
ContactCustResultDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
callCustomer
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/recallCustomer"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
recallCustomer
(
@RequestBody
ContactCustResultDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
recallCustomer
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/callCustomerEnd"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
callCustomerEnd
(
@RequestBody
ContactCustResultDTO
requestDto
)
{
ResultDTO
result
=
campaignExecuteService
.
callCustomerEnd
(
requestDto
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@GetMapping
(
"/getCustomerRecall"
)
@ResponseBody
public
ResponseEntity
getCustomerRecall
(
@RequestParam
(
"campaignId"
)
Long
campaignId
,
@RequestParam
(
"customerId"
)
Long
customerId
)
{
ResultDTO
result
=
campaignExecuteService
.
getCustomerRecall
(
campaignId
,
customerId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
}
}
src/main/resources/application.yml
View file @
ad5b82a9
server
:
server
:
port
:
9999
port
:
1111
spring
:
spring
:
application
:
application
:
name
:
campaign
name
:
campaign
...
...
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