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
2110d1e0
Commit
2110d1e0
authored
Aug 21, 2019
by
=
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hungtt-commit campaign-mng customer list
parent
4b201f38
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
457 additions
and
8 deletions
+457
-8
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignRepositoryCustom.java
...mpaign/repository/ccms_full/CampaignRepositoryCustom.java
+10
-5
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
...ign/repository/ccms_full/impl/CampaignRepositoryImpl.java
+271
-1
src/main/java/com/viettel/campaign/service/CampaignService.java
...in/java/com/viettel/campaign/service/CampaignService.java
+4
-0
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+12
-0
src/main/java/com/viettel/campaign/web/dto/CustomerListDTO.java
...in/java/com/viettel/campaign/web/dto/CustomerListDTO.java
+6
-0
src/main/java/com/viettel/campaign/web/dto/request_dto/CampaignRequestDTO.java
...ttel/campaign/web/dto/request_dto/CampaignRequestDTO.java
+4
-0
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+14
-0
src/main/resources/sql/campaign-mng/get-customer-list-choosen.sql
.../resources/sql/campaign-mng/get-customer-list-choosen.sql
+59
-0
src/main/resources/sql/campaign-mng/get-customer-list.sql
src/main/resources/sql/campaign-mng/get-customer-list.sql
+60
-0
src/main/resources/sql/campaign-mng/get-list-campaign-customer.sql
...resources/sql/campaign-mng/get-list-campaign-customer.sql
+17
-2
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignRepositoryCustom.java
View file @
2110d1e0
...
...
@@ -18,14 +18,19 @@ public interface CampaignRepositoryCustom {
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
);
//
hungtt
//
<editor-fold: hungtt>
ResultDTO
findCustomerListReallocation
(
CampaignRequestDTO
dto
);
//hungtt
ResultDTO
reallocationCustomer
(
CampaignRequestDTO
dto
);
//hungtt
ResultDTO
getListFieldsNotShow
(
CampaignRequestDTO
dto
);
//hungtt
ResultDTO
getListFieldsToShow
(
CampaignRequestDTO
dto
);
//hungtt
ResultDTO
getCampaignCustomerList
(
CampaignRequestDTO
dto
);
ResultDTO
getCustomerList
(
CampaignRequestDTO
dto
);
ResultDTO
getCustomerChoosenList
(
CampaignRequestDTO
dto
);
//</editor-fold>
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignRepositoryImpl.java
View file @
2110d1e0
This diff is collapsed.
Click to expand it.
src/main/java/com/viettel/campaign/service/CampaignService.java
View file @
2110d1e0
...
...
@@ -56,6 +56,10 @@ public interface CampaignService {
ResultDTO
getListFieldsToShow
(
CampaignRequestDTO
dto
);
ResultDTO
getCampaignCustomerList
(
CampaignRequestDTO
dto
);
ResultDTO
getCustomerList
(
CampaignRequestDTO
dto
);
ResultDTO
getCustomerChoosenList
(
CampaignRequestDTO
dto
);
//</editor-fold>
}
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
2110d1e0
...
...
@@ -487,6 +487,18 @@ public class CampaignServiceImpl implements CampaignService {
return
campaignRepositoryCustom
.
getCampaignCustomerList
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerList
(
CampaignRequestDTO
dto
)
{
return
campaignRepositoryCustom
.
getCustomerList
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerChoosenList
(
CampaignRequestDTO
dto
)
{
return
campaignRepositoryCustom
.
getCustomerChoosenList
(
dto
);
}
// hungtt
private
Map
<
String
,
String
>
setMapData
(
Map
<
String
,
String
>
mapColumn
,
Locale
locale
)
{
mapColumn
.
put
(
"CUSTOMER_ID"
,
BundleUtils
.
getLangString
(
"CUSTOMER_ID"
,
locale
));
...
...
src/main/java/com/viettel/campaign/web/dto/CustomerListDTO.java
View file @
2110d1e0
...
...
@@ -27,4 +27,10 @@ public class CustomerListDTO extends BaseDTO {
private
Long
totalCusList
;
private
Long
totalCusCampaign
;
private
Long
totalCusCalled
;
private
Long
totalCusActive
;
private
Long
totalCusLock
;
private
Long
totalCusDnc
;
private
Long
totalCusAddRemove
;
private
Long
totalCusFilter
;
private
Integer
totalRow
;
}
src/main/java/com/viettel/campaign/web/dto/request_dto/CampaignRequestDTO.java
View file @
2110d1e0
...
...
@@ -46,5 +46,9 @@ public class CampaignRequestDTO extends BaseDTO {
String
roleUser
;
String
contactCustId
;
List
<
CustomerCustomDTO
>
customerCustomDTOList
;
String
custListCode
;
String
custListName
;
String
createTimeTo
;
String
createTimeFr
;
}
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
2110d1e0
...
...
@@ -254,4 +254,18 @@ public class CampaignController {
ResultDTO
resultDTO
=
campaignService
.
getCampaignCustomerList
(
campaignRequestDTO
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/getCustomerList"
)
@ResponseBody
public
ResponseEntity
getCustomerList
(
@RequestBody
CampaignRequestDTO
campaignRequestDTO
)
{
ResultDTO
resultDTO
=
campaignService
.
getCustomerList
(
campaignRequestDTO
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/getCustomerChoosenList"
)
@ResponseBody
public
ResponseEntity
getCustomerChoosenList
(
@RequestBody
CampaignRequestDTO
campaignRequestDTO
)
{
ResultDTO
resultDTO
=
campaignService
.
getCustomerChoosenList
(
campaignRequestDTO
);
return
new
ResponseEntity
<>(
resultDTO
,
HttpStatus
.
OK
);
}
}
src/main/resources/sql/campaign-mng/get-customer-list-choosen.sql
0 → 100644
View file @
2110d1e0
with
campaign_customer_id
as
(
select
ccl
.
CUSTOMER_LIST_ID
from
campaign_customerlist
ccl
where
ccl
.
campaign_id
=
:
p_campaign_id
and
ccl
.
company_site_id
=
:
p_company_site_id
),
customer_table
as
(
select
count
(
a
.
customer_id
)
totalCustomer
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
group
by
a
.
customer_list_id
),
customer_active_table
as
(
select
count
(
a
.
customer_id
)
customerActive
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
ipcc_status
=
'active'
group
by
a
.
customer_list_id
),
customer_lock_table
as
(
select
count
(
a
.
customer_id
)
customerLock
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
ipcc_status
=
'locked'
group
by
a
.
customer_list_id
),
customer_dnc_table
as
(
select
count
(
a
.
customer_id
)
customerDnc
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
call_allowed
=
0
group
by
a
.
customer_list_id
),
customer_filter_table
as
(
select
count
(
a
.
customer_id
)
customerFilter
,
a
.
customer_list_id
customerListId
from
campaign_customer
a
where
a
.
campaign_id
=
:
p_campaign_id
group
by
a
.
customer_list_id
),
data_temp
as
(
select
a
.
customer_list_id
customerListId
,
a
.
customer_list_code
customerListCode
,
a
.
customer_list_name
customerListName
,
nvl
(
b
.
totalCustomer
,
0
)
totalCusList
,
nvl
(
c
.
customerActive
,
0
)
totalCusActive
,
nvl
(
d
.
customerLock
,
0
)
totalCusLock
,
nvl
(
e
.
customerDnc
,
0
)
totalCusDnc
,
nvl
(
null
,
0
)
totalCusAddRemove
,
nvl
(
f
.
customerFilter
,
0
)
totalCusFilter
from
customer_list
a
left
join
customer_table
b
on
a
.
customer_list_id
=
b
.
customerListId
left
join
customer_active_table
c
on
a
.
customer_list_id
=
c
.
customerListId
left
join
customer_lock_table
d
on
a
.
customer_list_id
=
d
.
customerListId
left
join
customer_dnc_table
e
on
a
.
customer_list_id
=
e
.
customerListId
left
join
customer_filter_table
f
on
a
.
customer_list_id
=
f
.
customerListId
where
a
.
customer_list_id
in
(
select
CUSTOMER_LIST_ID
from
campaign_customer_id
)
),
data
as
(
select
a
.
*
,
rownum
row_
from
data_temp
a
),
count_data
as
(
select
count
(
*
)
totalRow
from
data_temp
)
select
a
.
customerListId
,
a
.
customerListCode
,
a
.
customerListName
,
a
.
totalCusList
,
a
.
totalCusActive
,
a
.
totalCusLock
,
a
.
totalCusDnc
,
a
.
totalCusAddRemove
,
a
.
totalCusFilter
totalRow
from
data
a
,
count_data
where
row_
>=
((:
p_page_number
-
1
)
*
:
p_page_size
+
1
)
and
row_
<
(:
p_page_number
*
:
p_page_size
+
1
)
src/main/resources/sql/campaign-mng/get-customer-list.sql
0 → 100644
View file @
2110d1e0
with
campaign_customer_id
as
(
select
ccl
.
CUSTOMER_LIST_ID
from
campaign_customerlist
ccl
where
ccl
.
campaign_id
=
:
p_campaign_id
and
ccl
.
company_site_id
=
:
p_company_site_id
),
customer_table
as
(
select
count
(
a
.
customer_id
)
totalCustomer
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
group
by
a
.
customer_list_id
),
customer_active_table
as
(
select
count
(
a
.
customer_id
)
customerActive
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
ipcc_status
=
'active'
group
by
a
.
customer_list_id
),
customer_lock_table
as
(
select
count
(
a
.
customer_id
)
customerLock
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
ipcc_status
=
'locked'
group
by
a
.
customer_list_id
),
customer_dnc_table
as
(
select
count
(
a
.
customer_id
)
customerDnc
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
and
b
.
call_allowed
=
0
group
by
a
.
customer_list_id
),
data_temp
as
(
select
a
.
customer_list_id
customerListId
,
a
.
customer_list_code
customerListCode
,
a
.
customer_list_name
customerListName
,
nvl
(
b
.
totalCustomer
,
0
)
totalCusList
,
nvl
(
c
.
customerActive
,
0
)
totalCusActive
,
nvl
(
d
.
customerLock
,
0
)
totalCusLock
,
nvl
(
e
.
customerDnc
,
0
)
totalCusDnc
,
a
.
create_at
createAt
,
a
.
company_site_id
companySiteId
,
a
.
status
status
from
customer_list
a
left
join
customer_table
b
on
a
.
customer_list_id
=
b
.
customerListId
left
join
customer_active_table
c
on
a
.
customer_list_id
=
c
.
customerListId
left
join
customer_lock_table
d
on
a
.
customer_list_id
=
d
.
customerListId
left
join
customer_dnc_table
e
on
a
.
customer_list_id
=
e
.
customerListId
where
a
.
status
=
1
and
(:
p_cus_list_code
is
null
or
upper
(
a
.
customer_list_code
)
like
'%'
||
:
p_cus_list_code
||
'%'
)
and
(:
p_cus_list_name
is
null
or
upper
(
a
.
customer_list_name
)
like
'%'
||
:
p_cus_list_name
||
'%'
)
and
(
a
.
create_at
<=
to_date
(:
p_to_date
,
'DD/MM/YYYY'
))
and
(
a
.
create_at
>=
to_date
(:
p_from_date
,
'DD/MM/YYYY'
))
and
(
a
.
company_site_id
=
:
p_company_site_id
)
and
(
a
.
customer_list_id
not
in
(
select
CUSTOMER_LIST_ID
from
campaign_customer_id
))
),
data
as
(
select
a
.
*
,
rownum
row_
from
data_temp
a
),
count_data
as
(
select
count
(
*
)
totalRow
from
data_temp
)
select
a
.
customerListId
,
a
.
customerListCode
,
a
.
customerListName
,
a
.
totalCusList
,
a
.
totalCusActive
,
a
.
totalCusLock
,
a
.
totalCusDnc
,
totalRow
from
data
a
,
count_data
where
row_
>=
((:
p_page_number
-
1
)
*
:
p_page_size
+
1
)
and
row_
<
(:
p_page_number
*
:
p_page_size
+
1
)
src/main/resources/sql/campaign-mng/get-list-campaign-customer.sql
View file @
2110d1e0
with
customer_table
as
(
with
campaign_customer_id
as
(
select
ccl
.
CUSTOMER_LIST_ID
from
campaign_customerlist
ccl
where
ccl
.
campaign_id
=
:
p_campaign_id
and
ccl
.
company_site_id
=
:
p_company_site_id
),
customer_table
as
(
select
count
(
a
.
customer_id
)
totalCustomer
,
a
.
customer_list_id
customerListId
from
customer_list_mapping
a
left
join
customer
b
on
a
.
customer_id
=
b
.
customer_id
where
b
.
status
=
1
...
...
@@ -18,7 +22,8 @@ customer_not_interactive_table as (
select
count
(
a
.
customer_id
)
cusNotInteractive
,
a
.
customer_list_id
customerListId
,
a
.
campaign_id
from
campaign_customer
a
where
a
.
status
=
0
and
a
.
campaign_id
=
:
p_campaign_id
and
a
.
in_campaign_status
=
1
group
by
a
.
customer_list_id
,
a
.
campaign_id
)
),
data_temp
as
(
select
a
.
customer_list_id
customerListId
,
a
.
customer_list_code
customerListCode
,
a
.
customer_list_name
customerListName
,
...
...
@@ -31,3 +36,13 @@ left join customer_table b on a.customer_list_id = b.customerListId
left
join
campaign_customer_table
c
on
a
.
customer_list_id
=
c
.
customerListId
left
join
customer_interactive_table
d
on
a
.
customer_list_id
=
d
.
customerListId
left
join
customer_not_interactive_table
e
on
a
.
customer_list_id
=
e
.
customerListId
where
a
.
customer_list_id
in
(
select
CUSTOMER_LIST_ID
from
campaign_customer_id
)
),
data
as
(
select
a
.
*
,
rownum
row_
from
data_temp
a
),
count_data
as
(
select
count
(
*
)
totalRow
from
data_temp
)
select
a
.
customerListId
,
a
.
customerListCode
,
a
.
customerListName
,
a
.
totalCusList
,
a
.
totalCusCampaign
,
a
.
totalCusCalled
,
a
.
totalCusNotInteract
,
totalRow
from
data
a
,
count_data
where
row_
>=
((:
p_page_number
-
1
)
*
:
p_page_size
+
1
)
and
row_
<
(:
p_page_number
*
:
p_page_size
+
1
)
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