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
74256bb3
Commit
74256bb3
authored
Sep 08, 2019
by
=
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hungtt-commit update campaignCustomer service follow template version 1.6
parent
71b19cab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
...aign/repository/ccms_full/CampaignCustomerRepository.java
+4
-5
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
...ign/repository/ccms_full/impl/CampaignRepositoryImpl.java
+2
-2
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+6
-1
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
View file @
74256bb3
...
...
@@ -69,7 +69,7 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
List
<
CampaignCustomer
>
findCustomerNoContact
(
@Param
(
"campaignId"
)
Long
campaignId
,
@Param
(
"companySiteId"
)
Long
companySiteId
,
@Param
(
"customerListId"
)
Long
customerListId
);
@Query
(
value
=
"SELECT * FROM CAMPAIGN_CUSTOMER CC "
+
"WHERE CC.STATUS IN (SELECT COMPLETE_VALUE from CAMPAIGN_COMPLETE_CODE where STATUS = 1 and
IS_FINISH = 0 and IS_RECALL = 0
)"
+
"WHERE CC.STATUS IN (SELECT COMPLETE_VALUE from CAMPAIGN_COMPLETE_CODE where STATUS = 1 and
COMPLETE_TYPE=1
)"
+
"AND CC.CAMPAIGN_ID = :campaignId "
+
"AND CC.COMPANY_SITE_ID = :companySiteId "
+
"AND CC.CUSTOMER_LIST_ID = :customerListId"
,
nativeQuery
=
true
)
...
...
@@ -78,9 +78,8 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
@Query
(
value
=
"with status_customer as (\n"
+
"select complete_value \n"
+
"from campaign_complete_code\n"
+
"where complete_value <> 4\n"
+
" and is_finish <> 1\n"
+
" and campaign_type = 1\n"
+
"where status = 1\n"
+
" and complete_type = 1\n"
+
" and company_site_id = :p_company_site_id\n"
+
")\n"
+
"select * from campaign_customer\n"
+
...
...
@@ -93,6 +92,6 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
List
<
CampaignCustomer
>
findCampaignCustomersByCampaignIdAndCompanySiteIdAndCustomerIdAndInCampaignStatus
(
Long
campaignId
,
Long
companySiteId
,
Long
customerId
,
Short
inCampaingStatus
);
@Query
(
value
=
"select complete_value from campaign_complete_code where status = 1 and
is_finish = 0 and is_recall = 0
"
,
nativeQuery
=
true
)
@Query
(
value
=
"select complete_value from campaign_complete_code where status = 1 and
complete_type = 1
"
,
nativeQuery
=
true
)
List
<
Short
>
getStatus
();
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
View file @
74256bb3
...
...
@@ -624,7 +624,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
"),\n"
+
"customer_interactive_table as (\n"
+
" select count(a.customer_id) campaignCustomerCalled, a.customer_list_id customerListId, a.campaign_id from campaign_customer a\n"
+
" where a.status <> 0 and a.campaign_id = :p_campaign_id
and in_campaign_status = 1
\n"
+
" where a.status <> 0 and a.campaign_id = :p_campaign_id\n"
+
" group by a.customer_list_id, a.campaign_id\n"
+
"),\n"
+
"customer_not_interactive_table as (\n"
+
...
...
@@ -833,7 +833,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
"),\n"
+
"customer_filter_table as (\n"
+
" select count(a.customer_id) customerFilter, a.customer_list_id customerListId from campaign_customer a\n"
+
" where a.campaign_id = :p_campaign_id\n"
+
" where a.campaign_id = :p_campaign_id
and a.in_campaign_status = 1
\n"
+
" group by a.customer_list_id\n"
+
"),\n"
+
"data_temp as (\n"
+
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
74256bb3
...
...
@@ -674,7 +674,12 @@ public class CampaignServiceImpl implements CampaignService {
// Lay ra danh sach khach hang can loai bo
List
<
CampaignCustomer
>
listCustomerToDelete
=
campaignCustomerRepository
.
findListCustomerToDel
(
companySiteId
,
campaignId
,
customerListDTO
.
getCustomerListId
());
for
(
int
j
=
0
;
j
<
custToDel
;
j
++)
{
campaignCustomerRepository
.
delete
(
listCustomerToDelete
.
get
(
j
));
if
(
listCustomerToDelete
.
get
(
j
).
getStatus
()
==
0
)
{
campaignCustomerRepository
.
delete
(
listCustomerToDelete
.
get
(
j
));
}
else
{
listCustomerToDelete
.
get
(
j
).
setInCampaignStatus
((
short
)
0
);
campaignCustomerRepository
.
save
(
listCustomerToDelete
.
get
(
j
));
}
}
}
}
...
...
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