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
33f54075
Commit
33f54075
authored
Aug 20, 2019
by
=
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
71c639f7
dfc637fe
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
49 deletions
+70
-49
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
...aign/repository/ccms_full/CampaignCustomerRepository.java
+17
-19
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
.../com/viettel/campaign/service/CampaignExecuteService.java
+3
-0
src/main/java/com/viettel/campaign/service/CampaignService.java
...in/java/com/viettel/campaign/service/CampaignService.java
+1
-2
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+34
-0
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+0
-20
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+14
-7
src/main/resources/application.yml
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
View file @
33f54075
...
@@ -13,28 +13,26 @@ import java.util.List;
...
@@ -13,28 +13,26 @@ import java.util.List;
@Repository
@Repository
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
interface
CampaignCustomerRepository
extends
JpaRepository
<
CampaignCustomer
,
Long
>,
CampaignCustomerRepositoryCustom
{
public
interface
CampaignCustomerRepository
extends
JpaRepository
<
CampaignCustomer
,
Long
>,
CampaignCustomerRepositoryCustom
{
@Query
(
value
=
"SELECT COUNT(*) "
+
" FROM CAMPAIGN_CUSTOMER CC "
+
" JOIN CAMPAIGN C ON CC.CAMPAIGN_ID = C.CAMPAIGN_ID "
+
" LEFT JOIN CAMPAIGN_COMPLETE_CODE CCC ON CC.STATUS = CCC.COMPLETE_VALUE"
+
" WHERE CC.COMPANY_SITE_ID = :companySiteId "
+
" AND CC.AGENT_ID = :agentId"
+
" AND C.STATUS = 2 "
+
" AND CC.RECALL_TIME <= SYSDATE "
+
" AND CCC.IS_RECALL = 1"
,
nativeQuery
=
true
)
Long
countRecallCustomer
(
@Param
(
"companySiteId"
)
Long
pCompanySiteId
,
@Param
(
"agentId"
)
Long
agentId
);
@Query
(
value
=
"SELECT COUNT(*) "
+
@Query
(
value
=
"SELECT COUNT(*) "
+
"FROM CAMPAIGN_CUSTOMER CC JOIN CAMPAIGN_COMPLETE_CODE CCC ON CC.CAMPAIGN_ID = CCC.CAMPAIGN_ID "
+
"FROM CAMPAIGN_CUSTOMER CC JOIN CAMPAIGN_COMPLETE_CODE CCC ON CC.CAMPAIGN_ID = CCC.CAMPAIGN_ID "
+
"WHERE CC.STATUS = 3 AND CC.CAMPAIGN_ID = :campaignId AND CC.CUSTOMER_ID = :customerId AND CCC.IS_RECALL = 1 AND CCC.STATUS = 1 "
,
"WHERE CC.CAMPAIGN_ID = :campaignId "
+
nativeQuery
=
true
)
"AND CC.CUSTOMER_ID = :customerId "
+
"AND CC.STATUS = 3 "
+
"AND CCC.IS_RECALL = 1 "
+
"AND CCC.STATUS = 1 "
,
nativeQuery
=
true
)
Long
getCustomerRecall
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"customerId"
)
Long
customerId
);
Long
getCustomerRecall
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"customerId"
)
Long
customerId
);
@Query
(
value
=
"SELECT cc.customer_id \n"
+
"FROM campaign_customer cc LEFT JOIN receive_cust_log cl ON cc.customer_id = cl.customer_id\n"
+
"WHERE cc.campaign_id = :campaignId \n"
+
" AND cc.agent_id = :agentId \n"
+
" AND cc.in_campaign_status = 1 \n"
+
" AND cl.customer_id IS NULL \n"
+
" AND EXISTS(SELECT 1 \n"
+
" FROM campaign_complete_code ccc \n"
+
" WHERE cc.status = ccc.complete_value \n"
+
" AND ccc.status = 1 \n"
+
" AND ccc.is_recall = 1 \n"
+
" AND ccc.complete_type = 2 \n"
+
" AND ccc.company_site_id = :companySiteId) \n"
+
" AND cc.recall_time <= SYSDATE\n"
+
" AND cc.recall_time + interval :apParam MINUTE >= SYSDATE"
,
nativeQuery
=
true
)
List
<
CampaignCustomer
>
getCustomerRecallDate
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"agentId"
)
Long
agentId
,
@Param
(
"companySiteId"
)
Long
companySiteId
,
@Param
(
"apParam"
)
String
apParam
);
CampaignCustomer
findCampaignCustomerByCampaignCustomerId
(
Long
id
);
CampaignCustomer
findCampaignCustomerByCampaignCustomerId
(
Long
id
);
}
}
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
View file @
33f54075
...
@@ -36,4 +36,7 @@ public interface CampaignExecuteService {
...
@@ -36,4 +36,7 @@ public interface CampaignExecuteService {
ResultDTO
callCustomer
(
ContactCustResultDTO
dto
);
ResultDTO
callCustomer
(
ContactCustResultDTO
dto
);
ResultDTO
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
);
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
);
}
}
src/main/java/com/viettel/campaign/service/CampaignService.java
View file @
33f54075
...
@@ -30,8 +30,6 @@ public interface CampaignService {
...
@@ -30,8 +30,6 @@ public interface CampaignService {
ResultDTO
addNewCampaign
(
CampaignDTO
campaignDTO
);
ResultDTO
addNewCampaign
(
CampaignDTO
campaignDTO
);
Map
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
);
ResultDTO
findCampaignById
(
Long
campaignId
);
ResultDTO
findCampaignById
(
Long
campaignId
);
ResultDTO
changeCampaignStatus
(
CampaignDTO
dto
);
ResultDTO
changeCampaignStatus
(
CampaignDTO
dto
);
...
@@ -57,4 +55,5 @@ public interface CampaignService {
...
@@ -57,4 +55,5 @@ public interface CampaignService {
ResultDTO
getListFieldsToShow
(
CampaignRequestDTO
dto
);
ResultDTO
getListFieldsToShow
(
CampaignRequestDTO
dto
);
//</editor-fold>
//</editor-fold>
}
}
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
33f54075
...
@@ -495,4 +495,38 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
...
@@ -495,4 +495,38 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
result
;
return
result
;
}
}
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
)
{
Long
count
=
campaignCustomerRepository
.
countRecallCustomer
(
companySiteId
,
agentId
);
ResultDTO
resultDTO
=
new
ResultDTO
();
if
(
count
!=
null
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
count
);
}
else
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setData
(
0
);
}
return
resultDTO
;
}
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerRecall
(
Long
campaignId
,
Long
customerId
)
{
Long
count
=
campaignCustomerRepository
.
getCustomerRecall
(
campaignId
,
customerId
);
ResultDTO
resultDTO
=
new
ResultDTO
();
if
(
count
!=
null
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
count
);
}
else
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
resultDTO
.
setData
(
0
);
}
return
resultDTO
;
}
}
}
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
33f54075
...
@@ -171,26 +171,6 @@ public class CampaignServiceImpl implements CampaignService {
...
@@ -171,26 +171,6 @@ public class CampaignServiceImpl implements CampaignService {
return
resultDTO
;
return
resultDTO
;
}
}
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
Map
countRecallCustomer
(
Long
companySiteId
,
Long
agentId
)
{
Map
result
=
new
HashMap
();
Long
count
=
campaignRepository
.
countRecallCustomer
(
companySiteId
,
agentId
);
ResultDTO
resultDTO
=
new
ResultDTO
();
if
(
count
!=
null
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
result
.
put
(
"info"
,
resultDTO
);
result
.
put
(
"result"
,
count
);
}
else
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
result
.
put
(
"info"
,
resultDTO
);
result
.
put
(
"result"
,
0
);
}
return
result
;
}
@Override
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
findCampaignById
(
Long
campaignId
)
{
public
ResultDTO
findCampaignById
(
Long
campaignId
)
{
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
33f54075
...
@@ -96,13 +96,6 @@ public class CampaignController {
...
@@ -96,13 +96,6 @@ public class CampaignController {
return
campaignService
.
addNewCampaign
(
dto
);
return
campaignService
.
addNewCampaign
(
dto
);
}
}
@GetMapping
(
"/countRecallCustomer"
)
@ResponseBody
public
ResponseEntity
countRecallCustomer
(
@RequestParam
(
"companySiteId"
)
Long
companySiteId
,
@RequestParam
(
"agentId"
)
Long
agentId
)
{
Map
result
=
campaignService
.
countRecallCustomer
(
companySiteId
,
agentId
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
@GetMapping
(
"/findByCampaignId"
)
@GetMapping
(
"/findByCampaignId"
)
@ResponseBody
@ResponseBody
public
ResponseEntity
findByCampaignId
(
@RequestParam
(
"campaignId"
)
Long
campaignId
)
{
public
ResponseEntity
findByCampaignId
(
@RequestParam
(
"campaignId"
)
Long
campaignId
)
{
...
@@ -240,4 +233,18 @@ public class CampaignController {
...
@@ -240,4 +233,18 @@ public class CampaignController {
ResultDTO
resultDTO
=
campaignService
.
getListFieldsToShow
(
dto
);
ResultDTO
resultDTO
=
campaignService
.
getListFieldsToShow
(
dto
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
}
}
@GetMapping
(
"/countRecallCustomer"
)
@ResponseBody
public
ResponseEntity
countRecallCustomer
(
@RequestParam
(
"companySiteId"
)
Long
companySiteId
,
@RequestParam
(
"agentId"
)
Long
agentId
)
{
ResultDTO
result
=
campaignExecuteService
.
countRecallCustomer
(
companySiteId
,
agentId
);
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 @
33f54075
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