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
b8bd8545
Commit
b8bd8545
authored
Sep 03, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.myitsol.com/hanv/service-campaign
parents
b3ffd0ad
8fa16e94
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
32 deletions
+43
-32
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
...aign/repository/ccms_full/CampaignCustomerRepository.java
+2
-0
src/main/java/com/viettel/campaign/service/impl/AgentsServiceImpl.java
.../com/viettel/campaign/service/impl/AgentsServiceImpl.java
+26
-20
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+14
-11
src/main/java/com/viettel/campaign/service/impl/ScenarioServiceImpl.java
...om/viettel/campaign/service/impl/ScenarioServiceImpl.java
+1
-1
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignCustomerRepository.java
View file @
b8bd8545
...
...
@@ -91,6 +91,8 @@ public interface CampaignCustomerRepository extends JpaRepository<CampaignCustom
CampaignCustomer
findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId
(
Long
campaignId
,
Long
companySiteId
,
Long
customerId
);
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
)
List
<
Short
>
getStatus
();
}
src/main/java/com/viettel/campaign/service/impl/AgentsServiceImpl.java
View file @
b8bd8545
...
...
@@ -301,32 +301,39 @@ public class AgentsServiceImpl implements AgentsService {
StringBuilder
sqlStrBuilder
=
new
StringBuilder
();
sqlStrBuilder
.
append
(
"SELECT"
);
sqlStrBuilder
.
append
(
" a.USER_ID userId,"
);
sqlStrBuilder
.
append
(
" a.USER_NAME userName,"
);
sqlStrBuilder
.
append
(
" a.STATUS status,"
);
sqlStrBuilder
.
append
(
" a.FULL_NAME fullName,"
);
sqlStrBuilder
.
append
(
" a.COMPANY_SITE_ID companySiteId,"
);
sqlStrBuilder
.
append
(
" b.FILTER_TYPE filterType,"
);
sqlStrBuilder
.
append
(
" b.CAMPAIGN_AGENT_ID campaignAgentId"
);
sqlStrBuilder
.
append
(
" FROM VSA_USERS a"
);
sqlStrBuilder
.
append
(
" LEFT JOIN CAMPAIGN_AGENT b on a.USER_ID = b.AGENT_ID"
);
sqlStrBuilder
.
append
(
" INNER JOIN USER_ROLE c on a.USER_ID = c.USER_ID"
);
sqlStrBuilder
.
append
(
" INNER JOIN ROLE d on c.ROLE_ID = d.ROLE_ID"
);
sqlStrBuilder
.
append
(
" vu.USER_ID userId,"
);
sqlStrBuilder
.
append
(
" vu.USER_NAME userName,"
);
sqlStrBuilder
.
append
(
" vu.STATUS status,"
);
sqlStrBuilder
.
append
(
" vu.FULL_NAME fullName,"
);
sqlStrBuilder
.
append
(
" vu.COMPANY_SITE_ID companySiteId,"
);
sqlStrBuilder
.
append
(
" r.ROLE_CODE roleCode"
);
sqlStrBuilder
.
append
(
" FROM VSA_USERS vu"
);
sqlStrBuilder
.
append
(
" INNER JOIN USER_ROLE ur on vu.USER_ID = ur.USER_ID"
);
sqlStrBuilder
.
append
(
" INNER JOIN ROLE r on ur.ROLE_ID = r.ROLE_ID"
);
sqlStrBuilder
.
append
(
" WHERE 1 = 1"
);
sqlStrBuilder
.
append
(
" AND a.COMPANY_SITE_ID = :p_company_site_id"
);
sqlStrBuilder
.
append
(
" AND vu.COMPANY_SITE_ID = :p_company_site_id"
);
sqlStrBuilder
.
append
(
" AND vu.STATUS = 1"
);
sqlStrBuilder
.
append
(
" AND r.ROLE_CODE IN ('AGENT', 'SUPERVISOR')"
);
sqlStrBuilder
.
append
(
" AND vu.USER_ID NOT IN (SELECT vu.USER_ID userId"
);
sqlStrBuilder
.
append
(
" FROM VSA_USERS vu"
);
sqlStrBuilder
.
append
(
" LEFT JOIN CAMPAIGN_AGENT ca on vu.USER_ID = ca.AGENT_ID"
);
sqlStrBuilder
.
append
(
" INNER JOIN USER_ROLE ur on vu.USER_ID = ur.USER_ID"
);
sqlStrBuilder
.
append
(
" INNER JOIN ROLE r on ur.ROLE_ID = r.ROLE_ID"
);
sqlStrBuilder
.
append
(
" WHERE 1 = 1"
);
sqlStrBuilder
.
append
(
" AND vu.COMPANY_SITE_ID = :p_company_site_id"
);
sqlStrBuilder
.
append
(
" AND vu.STATUS = 1"
);
sqlStrBuilder
.
append
(
" AND ca.CAMPAIGN_ID = :p_campaign_id"
);
sqlStrBuilder
.
append
(
" AND r.ROLE_CODE IN ('AGENT', 'SUPERVISOR'))"
);
if
(!
DataUtil
.
isNullOrEmpty
(
userName
))
{
sqlStrBuilder
.
append
(
" AND UPPER(
a
.USER_NAME) LIKE UPPER(:p_user_name)"
);
sqlStrBuilder
.
append
(
" AND UPPER(
vu
.USER_NAME) LIKE UPPER(:p_user_name)"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
fullName
))
{
sqlStrBuilder
.
append
(
" AND UPPER(
a
.FULL_NAME) LIKE UPPER(:p_full_name)"
);
sqlStrBuilder
.
append
(
" AND UPPER(
vu
.FULL_NAME) LIKE UPPER(:p_full_name)"
);
}
sqlStrBuilder
.
append
(
" AND d.ROLE_CODE IN ('AGENT', 'SUPERVISOR')"
);
sqlStrBuilder
.
append
(
" AND a.STATUS = 1"
);
sqlStrBuilder
.
append
(
" AND (b.CAMPAIGN_ID IS NULL OR b.CAMPAIGN_ID <> :p_campaign_id)"
);
sqlStrBuilder
.
append
(
" ORDER BY UPPER(a.FULL_NAME)"
);
sqlStrBuilder
.
append
(
" ORDER BY UPPER(vu.FULL_NAME)"
);
SQLQuery
query
=
session
.
createSQLQuery
(
sqlStrBuilder
.
toString
());
...
...
@@ -356,8 +363,7 @@ public class AgentsServiceImpl implements AgentsService {
query
.
addScalar
(
"status"
,
new
ShortType
());
query
.
addScalar
(
"fullName"
,
new
StringType
());
query
.
addScalar
(
"companySiteId"
,
new
LongType
());
query
.
addScalar
(
"filterType"
,
new
ShortType
());
query
.
addScalar
(
"campaignAgentId"
,
new
LongType
());
query
.
addScalar
(
"roleCode"
,
new
StringType
());
query
.
setResultTransformer
(
Transformers
.
aliasToBean
(
VSAUsersDTO
.
class
));
int
count
=
0
;
...
...
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
b8bd8545
...
...
@@ -1414,10 +1414,10 @@ public class CustomerServiceImpl implements CustomerService {
//<editor-fold desc="Cho những trường tĩnh" defaultstate="collapsed">
DataValidationConstraint
cusTypeConstraint
=
dataValidationHelper
.
createExplicitListConstraint
(
new
String
[]{
BundleUtils
.
getLangString
(
"customer.cusType.normal"
,
locale
),
BundleUtils
.
getLangString
(
"customer.cusType.vip"
,
locale
),
BundleUtils
.
getLangString
(
"customer.cusType.blacklist"
,
locale
)});
DataValidationConstraint
isAllowConstraint
=
dataValidationHelper
.
createExplicitListConstraint
(
new
String
[]{
BundleUtils
.
getLangString
(
"customer.yes"
,
locale
),
BundleUtils
.
getLangString
(
"customer.not"
,
locale
)});
CellRangeAddressList
cusTypeCellRangeAddressList
=
new
CellRangeAddressList
(
3
,
9999
,
6
,
6
);
CellRangeAddressList
callCellRangeAddressList
=
new
CellRangeAddressList
(
3
,
9999
,
9
,
9
);
CellRangeAddressList
emailCellRangeAddressList
=
new
CellRangeAddressList
(
3
,
9999
,
10
,
10
);
CellRangeAddressList
smsCellRangeAddressList
=
new
CellRangeAddressList
(
3
,
9999
,
11
,
11
);
CellRangeAddressList
cusTypeCellRangeAddressList
=
new
CellRangeAddressList
(
4
,
9999
,
6
,
6
);
CellRangeAddressList
callCellRangeAddressList
=
new
CellRangeAddressList
(
4
,
9999
,
9
,
9
);
CellRangeAddressList
emailCellRangeAddressList
=
new
CellRangeAddressList
(
4
,
9999
,
10
,
10
);
CellRangeAddressList
smsCellRangeAddressList
=
new
CellRangeAddressList
(
4
,
9999
,
11
,
11
);
DataValidation
cusTypeValidation
=
dataValidationHelper
.
createValidation
(
cusTypeConstraint
,
cusTypeCellRangeAddressList
);
DataValidation
callValidation
=
dataValidationHelper
.
createValidation
(
isAllowConstraint
,
callCellRangeAddressList
);
DataValidation
emailValidation
=
dataValidationHelper
.
createValidation
(
isAllowConstraint
,
emailCellRangeAddressList
);
...
...
@@ -1653,12 +1653,14 @@ public class CustomerServiceImpl implements CustomerService {
List
<
Short
>
lstStatus
=
campaignCustomerRepository
.
getStatus
();
try
{
for
(
String
cusId
:
lstCusId
)
{
CampaignCustomer
entity
=
campaignCustomerRepository
.
findCampaignCustomerByCampaignIdAndCompanySiteIdAndCustomerId
(
campaignId
,
companySiteId
,
Long
.
parseLong
(
cusId
));
if
(
entity
.
getStatus
()
==
0
)
{
campaignCustomerRepository
.
delete
(
entity
);
}
else
if
(
lstStatus
.
contains
(
entity
.
getStatus
()))
{
entity
.
setInCampaignStatus
((
short
)
0
);
campaignCustomerRepository
.
save
(
entity
);
List
<
CampaignCustomer
>
listEntity
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCompanySiteIdAndCustomerIdAndInCampaignStatus
(
campaignId
,
companySiteId
,
Long
.
parseLong
(
cusId
),
(
short
)
1
);
for
(
CampaignCustomer
entity
:
listEntity
)
{
if
(
entity
.
getStatus
()
==
0
)
{
campaignCustomerRepository
.
delete
(
entity
);
}
else
if
(
lstStatus
.
contains
(
entity
.
getStatus
()))
{
entity
.
setInCampaignStatus
((
short
)
0
);
campaignCustomerRepository
.
save
(
entity
);
}
}
}
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
...
...
@@ -1888,7 +1890,6 @@ public class CustomerServiceImpl implements CustomerService {
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
searchCustomizeFields
(
CampaignCustomerDTO
campaignCustomerDTO
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
CustomerDTO
customerDTO
=
new
CustomerDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
...
...
@@ -2025,6 +2026,7 @@ public class CustomerServiceImpl implements CustomerService {
}
Pageable
pageable
=
PageRequest
.
of
(
campaignCustomerDTO
.
getPage
(),
campaignCustomerDTO
.
getPageSize
());
if
(
pageable
!=
null
)
{
query
.
setFirstResult
(
pageable
.
getPageNumber
()
*
pageable
.
getPageSize
());
query
.
setMaxResults
(
pageable
.
getPageSize
());
...
...
@@ -2033,6 +2035,7 @@ public class CustomerServiceImpl implements CustomerService {
List
<
CustomerDTO
>
data
=
query
.
list
();
Page
<
CustomerDTO
>
dataPage
=
new
PageImpl
<>(
data
,
pageable
,
count
);
resultDTO
.
setData
(
dataPage
);
resultDTO
.
setTotalRow
(
count
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/viettel/campaign/service/impl/ScenarioServiceImpl.java
View file @
b8bd8545
...
...
@@ -240,7 +240,7 @@ public class ScenarioServiceImpl implements ScenarioService {
logger
.
error
(
e
.
getMessage
());
return
null
;
}
finally
{
if
(
workbook
!=
null
)
workbook
.
close
();
//
if (workbook != null) workbook.close();
}
}
...
...
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