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
a66d2070
Commit
a66d2070
authored
Sep 24, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tubn campaign execute update
parent
2f4944a3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
30 deletions
+46
-30
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignRepository.java
...tel/campaign/repository/ccms_full/CampaignRepository.java
+1
-1
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+7
-2
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
...viettel/campaign/service/impl/CampaignCfgServiceImpl.java
+1
-1
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+21
-7
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+16
-19
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignRepository.java
View file @
a66d2070
...
...
@@ -10,7 +10,7 @@ import java.util.Date;
import
java.util.List
;
@Repository
public
interface
CampaignRepository
extends
JpaRepository
<
Campaign
,
Long
>
{
public
interface
CampaignRepository
extends
JpaRepository
<
Campaign
,
Long
>
,
CampaignRepositoryCustom
{
List
<
Campaign
>
findAllByCompanySiteId
(
Long
companyId
);
...
...
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
a66d2070
...
...
@@ -252,8 +252,13 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
+
"%"
);
}
query
.
setParameter
(
"p_call_time_from"
,
dto
.
getCallTimeFrom
());
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCallTimeFrom
()))
{
query
.
setParameter
(
"p_call_time_from"
,
dto
.
getCallTimeFrom
());
}
if
(!
DataUtil
.
isNullOrEmpty
(
dto
.
getCallTimeTo
()))
{
query
.
setParameter
(
"p_call_time_to"
,
dto
.
getCallTimeTo
());
}
// add data to parameter
/*query.addScalar("contactCustResultId", new LongType());
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignCfgServiceImpl.java
View file @
a66d2070
...
...
@@ -388,7 +388,7 @@ public class CampaignCfgServiceImpl implements CampaignCfgService {
try
{
if
(
completeValue
==
null
||
completeValue
.
equalsIgnoreCase
(
"null"
))
list
=
completeCodeRepository
.
getCustomerStatusByType
(
completeType
,
companySiteId
);
else
if
(
completeType
==
null
)
else
if
(
completeType
==
-
1
)
cfg
=
completeCodeRepository
.
findByCompanySiteIdAndCompleteValue
(
companySiteId
,
completeValue
);
else
list
=
completeCodeRepository
.
getCustomerStatus
(
completeValue
,
completeType
,
companySiteId
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
a66d2070
...
...
@@ -44,7 +44,7 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
ReceiveCustLogRepository
custLogRepository
;
@Autowired
CampaignRepository
Custom
campaignRepositoryCustom
;
CampaignRepository
campaignRepository
;
@Autowired
CampaignExecuteRepository
campaignExecuteRepository
;
...
...
@@ -960,12 +960,15 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
try
{
ContactCustResult
ccr
=
ccResultRepository
.
findByContactCustResultId
(
contactCustResultId
);
ContactCustResultDTO
dtoCCR
=
modelMapper
.
map
(
ccr
,
ContactCustResultDTO
.
class
);
// if (dtoCCR.getCreateTime().)
// dtoCCR.setCheckUpdate(true);
Calendar
createTimeAfter24h
=
Calendar
.
getInstance
();
createTimeAfter24h
.
setTime
(
dtoCCR
.
getCreateTime
());
createTimeAfter24h
.
add
(
Calendar
.
HOUR_OF_DAY
,
4
);
if
(
new
Date
().
after
(
dtoCCR
.
getCreateTime
())
&&
new
Date
().
before
(
createTimeAfter24h
.
getTime
()))
dtoCCR
.
setCheckUpdate
(
true
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setData
(
ccr
);
resultDTO
.
setData
(
dtoCCR
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
...
...
@@ -979,16 +982,27 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
public
ResultDTO
updateCampaignCustomer
(
CampaignCustomerDTO
dto
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
TimeZone
tzClient
=
TimeZoneUtils
.
getZoneMinutes
(
dto
.
getTimezone
());
Campaign
c
=
new
Campaign
();
CampaignCustomer
cc
=
new
CampaignCustomer
();
try
{
CampaignCustomer
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
cc
.
setStatus
(
dto
.
getStatus
());
cc
.
setAgentId
(
dto
.
getAgentId
());
cc
=
campaignCustomerRepository
.
findCampaignCustomersByCampaignIdAndCustomerId
(
dto
.
getCampaignId
(),
dto
.
getCustomerId
());
if
(
dto
.
getContactStatus
().
equals
(
1
))
{
cc
.
setStatus
(
dto
.
getCallStatus
().
shortValue
());
}
else
if
(
dto
.
getContactStatus
().
equals
(
2
))
{
c
=
campaignRepository
.
findByCampaignId
(
dto
.
getCampaignId
());
if
(
cc
.
getRecallCount
().
equals
(
c
.
getMaxRecall
()))
{
cc
.
setStatus
((
short
)
4
);
}
else
{
cc
.
setStatus
(
dto
.
getContactStatus
());
}
}
if
(
dto
.
getRecallTime
()
!=
null
)
{
cc
.
setRecallTime
(
dto
.
getRecallTime
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
dto
.
getRecallTime
(),
0L
));
cc
.
setRecallCount
(
cc
.
getRecallCount
()
+
1
);
}
cc
.
setCallTime
(
dto
.
getCallTimeL
()
==
null
?
null
:
TimeZoneUtils
.
changeTimeZone
(
new
Date
(
dto
.
getCallTimeL
()
*
1000
),
0L
));
cc
.
setAgentId
(
dto
.
getAgentId
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
a66d2070
...
...
@@ -36,9 +36,6 @@ public class CampaignServiceImpl implements CampaignService {
@Autowired
CampaignRepository
campaignRepository
;
@Autowired
CampaignRepositoryCustom
campaignRepositoryCustom
;
@Autowired
TimeZoneDialModeRepository
timeZoneDialModeRepository
;
...
...
@@ -72,13 +69,13 @@ public class CampaignServiceImpl implements CampaignService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
search
(
CampaignRequestDTO
requestDto
)
{
return
campaignRepository
Custom
.
search
(
requestDto
);
return
campaignRepository
.
search
(
requestDto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
findByCampaignCode
(
CampaignRequestDTO
requestDTO
)
{
return
campaignRepository
Custom
.
findByCampaignCode
(
requestDTO
);
return
campaignRepository
.
findByCampaignCode
(
requestDTO
);
}
@Override
...
...
@@ -255,14 +252,14 @@ public class CampaignServiceImpl implements CampaignService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
)
{
return
campaignRepository
Custom
.
checkAllowStatusToPrepare
(
campaignId
);
return
campaignRepository
.
checkAllowStatusToPrepare
(
campaignId
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
XSSFWorkbook
exportCampaigns
(
CampaignRequestDTO
dto
)
{
Locale
locale
=
Locale
.
forLanguageTag
(
"vi"
);
ResultDTO
resultDTO
=
campaignRepository
Custom
.
search
(
dto
);
ResultDTO
resultDTO
=
campaignRepository
.
search
(
dto
);
List
<
CampaignDTO
>
listData
=
(
List
<
CampaignDTO
>)
resultDTO
.
getData
();
List
<
ApParam
>
lstType
=
apParamRepository
.
findParamByParType
(
CAMPAIGN_TYPE
);
...
...
@@ -449,14 +446,14 @@ public class CampaignServiceImpl implements CampaignService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
findCustomerListReallocation
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
findCustomerListReallocation
(
dto
);
return
campaignRepository
.
findCustomerListReallocation
(
dto
);
}
// hungtt
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
reallocationCustomer
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
reallocationCustomer
(
dto
);
return
campaignRepository
.
reallocationCustomer
(
dto
);
}
// hungtt
...
...
@@ -466,7 +463,7 @@ public class CampaignServiceImpl implements CampaignService {
Locale
locale
=
Locale
.
forLanguageTag
(
"vi"
);
Map
<
String
,
String
>
mapColumn
=
new
HashMap
<>();
mapColumn
=
setMapData
(
mapColumn
,
locale
);
ResultDTO
resultDTO
=
campaignRepository
Custom
.
getListFieldsNotShow
(
dto
);
ResultDTO
resultDTO
=
campaignRepository
.
getListFieldsNotShow
(
dto
);
List
<
FieldsToShowDTO
>
list
=
(
List
<
FieldsToShowDTO
>)
resultDTO
.
getListData
();
for
(
FieldsToShowDTO
fieldsToShowDTO
:
list
)
{
if
(
fieldsToShowDTO
.
getIsFix
())
{
...
...
@@ -487,7 +484,7 @@ public class CampaignServiceImpl implements CampaignService {
Locale
locale
=
Locale
.
forLanguageTag
(
"vi"
);
Map
<
String
,
String
>
mapColumn
=
new
HashMap
<>();
mapColumn
=
setMapData
(
mapColumn
,
locale
);
ResultDTO
resultDTO
=
campaignRepository
Custom
.
getListFieldsToShow
(
dto
);
ResultDTO
resultDTO
=
campaignRepository
.
getListFieldsToShow
(
dto
);
List
<
FieldsToShowDTO
>
list
=
(
List
<
FieldsToShowDTO
>)
resultDTO
.
getListData
();
for
(
FieldsToShowDTO
fieldsToShowDTO
:
list
)
{
if
(
fieldsToShowDTO
.
getIsFix
())
{
...
...
@@ -503,19 +500,19 @@ public class CampaignServiceImpl implements CampaignService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCampaignCustomerList
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCampaignCustomerList
(
dto
);
return
campaignRepository
.
getCampaignCustomerList
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerList
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCustomerList
(
dto
);
return
campaignRepository
.
getCustomerList
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerChoosenList
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCustomerChoosenList
(
dto
);
return
campaignRepository
.
getCustomerChoosenList
(
dto
);
}
@Override
...
...
@@ -626,19 +623,19 @@ public class CampaignServiceImpl implements CampaignService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCampaignCustomerInformation
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCampaignCustomerInformation
(
dto
);
return
campaignRepository
.
getCampaignCustomerInformation
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCustomerListInformation
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCustomerListInformation
(
dto
);
return
campaignRepository
.
getCustomerListInformation
(
dto
);
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
getCountIndividualOnList
(
CampaignRequestDTO
dto
)
{
return
campaignRepository
Custom
.
getCountIndividualOnList
(
dto
);
return
campaignRepository
.
getCountIndividualOnList
(
dto
);
}
@Override
...
...
@@ -706,7 +703,7 @@ public class CampaignServiceImpl implements CampaignService {
public
ResultDTO
getConnectStatus
(
Long
companySiteId
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
try
{
List
<
ApParamDTO
>
list
=
campaignRepository
Custom
.
getConnectStatus
(
companySiteId
);
List
<
ApParamDTO
>
list
=
campaignRepository
.
getConnectStatus
(
companySiteId
);
resultDTO
.
setListData
(
list
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
...
...
@@ -750,7 +747,7 @@ public class CampaignServiceImpl implements CampaignService {
}
private
String
generateCampaignCode
(
String
campaignType
,
Short
chanel
)
{
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
String
maxIndexStr
=
campaignRepository
Custom
.
getMaxCampaignIndex
();
String
maxIndexStr
=
campaignRepository
.
getMaxCampaignIndex
();
if
(
maxIndexStr
!=
null
)
{
Long
maxIndex
=
Long
.
valueOf
(
maxIndexStr
)
+
1
;
String
result
=
campaignType
+
"_"
+
chanel
+
"_"
+
year
+
"_"
+
maxIndex
.
toString
();
...
...
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