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
037ba794
Commit
037ba794
authored
Aug 09, 2019
by
=
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hungtt-commit service camp-exe-interactive
parent
55a6b806
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
41 deletions
+99
-41
src/main/java/com/viettel/campaign/repository/impl/CampaignExecuteRepositoryImp.java
...ampaign/repository/impl/CampaignExecuteRepositoryImp.java
+82
-19
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
...va/com/viettel/campaign/web/dto/ContactCustResultDTO.java
+1
-1
src/main/resources/i18n/language_en.properties
src/main/resources/i18n/language_en.properties
+14
-14
src/main/resources/sql/campaign-execute/get-combo-campaign-type.sql
...esources/sql/campaign-execute/get-combo-campaign-type.sql
+1
-1
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
...esources/sql/campaign-execute/get-execute-interactive.sql
+1
-6
No files found.
src/main/java/com/viettel/campaign/repository/impl/CampaignExecuteRepositoryImp.java
View file @
037ba794
...
...
@@ -43,12 +43,11 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
public
List
<
ApParamDTO
>
getComboBoxStatus
(
String
companySiteId
,
String
completeType
)
{
List
<
ApParamDTO
>
list
=
new
ArrayList
<>();
Map
<
String
,
String
>
params
=
new
HashMap
<>();
String
sql
=
SQLBuilder
.
getSqlQueryById
(
Constants
.
SQL_MODULES
.
MODULE_EXECUTE
,
"get-combo-
connect-
status"
);
String
sql
=
SQLBuilder
.
getSqlQueryById
(
Constants
.
SQL_MODULES
.
MODULE_EXECUTE
,
"get-combo-status"
);
try
{
params
.
put
(
"p_company_site_id"
,
companySiteId
);
params
.
put
(
"p_complete_type"
,
completeType
);
list
=
namedParameterJdbcTemplate
.
query
(
sql
,
params
,
BeanPropertyRowMapper
.
newInstance
(
ApParamDTO
.
class
));
// list = namedParameterJdbcTemplate.getJdbcTemplate().query(sql, (PreparedStatementSetter) params, BeanPropertyRowMapper.newInstance(ComboBoxDTO.class));
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
...
...
@@ -82,37 +81,69 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
String
sql
=
SQLBuilder
.
getSqlQueryById
(
Constants
.
SQL_MODULES
.
MODULE_EXECUTE
,
"get-execute-interactive"
);
sqlBuilder
.
append
(
sql
);
sqlBuilder
.
append
(
" and to_char(a.customer_id) like :p_customer_id"
);
sqlBuilder
.
append
(
" and to_char(a.contact_status) in (:p_list_contact_status)"
);
sqlBuilder
.
append
(
" and to_char(a.call_status) in (:p_list_survey_status)"
);
sqlBuilder
.
append
(
" and to_char(a.status) in (:p_list_record_status)"
);
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getPhoneNumber
()))
{
sqlBuilder
.
append
(
" and a.phone_number like :p_phone_number"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignId
()))
{
sqlBuilder
.
append
(
" and b.campaign_code in (:p_list_campaign_id) "
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
()))
{
sqlBuilder
.
append
(
" and upper(
campaignName) like upper(:p_campaign_name)
"
);
sqlBuilder
.
append
(
" and upper(
b.campaign_name) like :p_campaign_name
"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
()))
{
sqlBuilder
.
append
(
" and upper(
userName) like upper(:p_user_name)
"
);
sqlBuilder
.
append
(
" and upper(
c.user_name) like :p_user_name
"
);
}
SQLQuery
query
=
session
.
createSQLQuery
(
sqlBuilder
.
toString
());
query
.
setParameterList
(
"p_list_campaign_id"
,
dto
.
getCampaignId
().
split
(
","
));
query
.
setParameter
(
"p_customer_id"
,
dto
.
getCustomerId
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_customer_id"
,
"%"
+
dto
.
getCustomerId
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
query
.
setParameter
(
"p_date_from"
,
dto
.
getFromDate
());
query
.
setParameter
(
"p_date_to"
,
dto
.
getToDate
());
query
.
setParameterList
(
"p_list_contact_status"
,
dto
.
getContactStatus
().
split
(
","
));
query
.
setParameterList
(
"p_list_survey_status"
,
dto
.
getSurveyStatus
().
split
(
","
));
query
.
setParameterList
(
"p_list_record_status"
,
dto
.
getRecordStatus
().
split
(
","
));
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_call_time_from"
,
dto
.
getCallTimeFrom
());
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignId
()))
{
query
.
setParameterList
(
"p_list_campaign_id"
,
dto
.
getCampaignId
().
split
(
","
));
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getPhoneNumber
()))
{
query
.
setParameter
(
"p_phone_number"
,
"%"
+
dto
.
getPhoneNumber
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
()))
{
query
.
setParameter
(
"p_campaign_name"
,
dto
.
getCampaignName
().
trim
());
query
.
setParameter
(
"p_campaign_name"
,
"%"
+
dto
.
getCampaignName
().
toUpperCase
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
()))
{
query
.
setParameter
(
"p_user_name"
,
dto
.
getAgentId
().
trim
());
query
.
setParameter
(
"p_user_name"
,
"%"
+
dto
.
getAgentId
().
toUpperCase
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
query
.
addScalar
(
"campaignCode"
,
new
StringType
());
query
.
addScalar
(
"campaignName"
,
new
StringType
());
query
.
addScalar
(
"userName"
,
new
StringType
());
query
.
addScalar
(
"phoneNumber"
,
new
Lo
ngType
());
query
.
addScalar
(
"phoneNumber"
,
new
Stri
ngType
());
query
.
addScalar
(
"customerName"
,
new
StringType
());
query
.
addScalar
(
"createTime"
,
new
DateType
());
query
.
addScalar
(
"contactStatus"
,
new
StringType
());
...
...
@@ -156,8 +187,8 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
session
.
close
();
return
resultDTO
;
}
return
resultDTO
;
}
@Override
...
...
@@ -172,37 +203,69 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
String
sql
=
SQLBuilder
.
getSqlQueryById
(
Constants
.
SQL_MODULES
.
MODULE_EXECUTE
,
"get-execute-interactive"
);
sqlBuilder
.
append
(
sql
);
sqlBuilder
.
append
(
" and to_char(a.customer_id) like :p_customer_id"
);
sqlBuilder
.
append
(
" and to_char(a.contact_status) in (:p_list_contact_status)"
);
sqlBuilder
.
append
(
" and to_char(a.call_status) in (:p_list_survey_status)"
);
sqlBuilder
.
append
(
" and to_char(a.status) in (:p_list_record_status)"
);
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getPhoneNumber
()))
{
sqlBuilder
.
append
(
" and a.phone_number like :p_phone_number"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignId
()))
{
sqlBuilder
.
append
(
" and b.campaign_code in (:p_list_campaign_id) "
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
()))
{
sqlBuilder
.
append
(
" and upper(
campaignName) like upper(:p_campaign_name)
"
);
sqlBuilder
.
append
(
" and upper(
b.campaign_name) like :p_campaign_name
"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
()))
{
sqlBuilder
.
append
(
" and upper(
userName) like upper(:p_user_name)
"
);
sqlBuilder
.
append
(
" and upper(
c.user_name) like :p_user_name
"
);
}
SQLQuery
query
=
session
.
createSQLQuery
(
sqlBuilder
.
toString
());
query
.
setParameterList
(
"p_list_campaign_id"
,
dto
.
getCampaignId
().
split
(
","
));
query
.
setParameter
(
"p_customer_id"
,
dto
.
getCustomerId
());
query
.
setParameter
(
"p_company_site_id"
,
dto
.
getCompanySiteId
());
query
.
setParameter
(
"p_customer_id"
,
"%"
+
dto
.
getCustomerId
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
query
.
setParameter
(
"p_date_from"
,
dto
.
getFromDate
());
query
.
setParameter
(
"p_date_to"
,
dto
.
getToDate
());
query
.
setParameterList
(
"p_list_contact_status"
,
dto
.
getContactStatus
().
split
(
","
));
query
.
setParameterList
(
"p_list_survey_status"
,
dto
.
getSurveyStatus
().
split
(
","
));
query
.
setParameterList
(
"p_list_record_status"
,
dto
.
getRecordStatus
().
split
(
","
));
query
.
setParameter
(
"p_phone_number"
,
dto
.
getPhoneNumber
());
query
.
setParameter
(
"p_call_time_from"
,
dto
.
getCallTimeFrom
());
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignId
()))
{
query
.
setParameterList
(
"p_list_campaign_id"
,
dto
.
getCampaignId
().
split
(
","
));
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getPhoneNumber
()))
{
query
.
setParameter
(
"p_phone_number"
,
"%"
+
dto
.
getPhoneNumber
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCampaignName
()))
{
query
.
setParameter
(
"p_campaign_name"
,
dto
.
getCampaignName
().
trim
());
query
.
setParameter
(
"p_campaign_name"
,
"%"
+
dto
.
getCampaignName
().
toUpperCase
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getAgentId
()))
{
query
.
setParameter
(
"p_user_name"
,
dto
.
getAgentId
().
trim
());
query
.
setParameter
(
"p_user_name"
,
"%"
+
dto
.
getAgentId
().
toUpperCase
()
.
replace
(
"\\"
,
"\\\\"
)
.
replaceAll
(
"%"
,
"\\%"
)
.
replaceAll
(
"_"
,
"\\_"
)
+
"%"
);
}
query
.
addScalar
(
"campaignCode"
,
new
StringType
());
query
.
addScalar
(
"campaignName"
,
new
StringType
());
query
.
addScalar
(
"userName"
,
new
StringType
());
query
.
addScalar
(
"phoneNumber"
,
new
Lo
ngType
());
query
.
addScalar
(
"phoneNumber"
,
new
Stri
ngType
());
query
.
addScalar
(
"customerName"
,
new
StringType
());
query
.
addScalar
(
"createTime"
,
new
DateType
());
query
.
addScalar
(
"contactStatus"
,
new
StringType
());
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
037ba794
...
...
@@ -23,7 +23,7 @@ public class ContactCustResultDTO extends BaseDTO{
private
Long
agentId
;
private
Long
campaignId
;
private
String
campaignName
;
private
Lo
ng
phoneNumber
;
private
Stri
ng
phoneNumber
;
private
String
customerName
;
private
Long
customerId
;
private
String
contactStatus
;
...
...
src/main/resources/i18n/language_en.properties
View file @
037ba794
#Common
detail
=
Chi ti?t
stt
=
STT
detail
=
Detail
stt
=
No
#Campaign Execute Interactive
campaign.execute.interactive.title
=
Chi ti
?t k?t qu? t??ng t
c
campaign.execute.interactive.campaignCode
=
M chi?n d?ch
campaign.execute.interactive.campaignName
=
Tn chi?n d?ch
campaign.execute.interactive.agentId
=
M t? v?n vin
campaign.execute.interactive.phoneNumber
=
S? ?i?n tho?i
campaign.execute.interactive.customerId
=
M khch hng
campaign.execute.interactive.customerName
=
Tn khch hng
campaign.execute.interactive.c
allTime
=
Th?i gian lin l?c
campaign.execute.interactive.contactStatus
=
Tr?ng thi k?t n?i
campaign.execute.interactive.surveyStatus
=
Tr
?ng thi kh?o s
t
campaign.execute.interactive.status
=
Tr
?ng thi chi?n d?
ch
campaign.execute.interactive.recordStatus
=
Tr
?ng thi b?
n ghi
campaign.execute.interactive.title
=
Chi ti
ết kết quả tương tá
c
campaign.execute.interactive.campaignCode
=
Campaign code
campaign.execute.interactive.campaignName
=
Campaign name
campaign.execute.interactive.agentId
=
Agent id
campaign.execute.interactive.phoneNumber
=
Phone number
campaign.execute.interactive.customerId
=
Customer id
campaign.execute.interactive.customerName
=
Customer name
campaign.execute.interactive.c
reateTime
=
Create time
campaign.execute.interactive.contactStatus
=
Contact status
campaign.execute.interactive.surveyStatus
=
Tr
ạng thái khảo sá
t
campaign.execute.interactive.status
=
Tr
ạng thái chiến dị
ch
campaign.execute.interactive.recordStatus
=
Tr
ạng thái bả
n ghi
src/main/resources/sql/campaign-execute/get-combo-campaign-type.sql
View file @
037ba794
select
AP_PARAM_ID
apParamId
,
select
PAR_VALUE
apParamId
,
PAR_NAME
parName
from
AP_PARAM
where
PAR_TYPE
=
'CAMPAIGN_TYPE'
and
COMPANY_SITE_ID
=
:
p_company_site_id
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
View file @
037ba794
...
...
@@ -16,13 +16,8 @@ from contact_cust_result a
left
join
campaign_complete_code
f
on
a
.
call_status
=
e
.
complete_value
left
join
campaign
g
on
a
.
campaign_id
=
b
.
campaign_id
where
a
.
status
<>
0
and
a
.
campaign_id
in
(:
p_list_campaign_id
)
and
a
.
customer_id
like
'%'
||
:
p_customer_id
||
'%'
and
a
.
company_site_id
=
:
p_company_site_id
and
a
.
create_time
>=
to_date
(:
p_date_from
,
'DD/MM/YYYY'
)
and
a
.
create_time
<=
to_date
(:
p_date_to
,
'DD/MM/YYYY'
)
and
a
.
contact_status
in
(:
p_list_contact_status
)
and
a
.
call_status
in
(:
p_list_survey_status
)
and
a
.
status
in
(:
p_list_record_status
)
and
a
.
phone_number
like
'%'
||
:
p_phone_number
||
'%'
and
a
.
duration_call
>=
:
p_call_time_from
and
a
.
duration_call
<=
:
p_call_time_to
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