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
fdb0ef94
Commit
fdb0ef94
authored
Aug 09, 2019
by
Nguyen Ha
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.myitsol.com/hanv/service-campaign
parents
a38cb377
b18de655
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
28 deletions
+90
-28
campaign.iml
campaign.iml
+0
-17
src/main/java/com/viettel/campaign/repository/CampaignRepositoryCustom.java
...viettel/campaign/repository/CampaignRepositoryCustom.java
+2
-0
src/main/java/com/viettel/campaign/repository/impl/CampaignRepositoryImpl.java
...ttel/campaign/repository/impl/CampaignRepositoryImpl.java
+42
-2
src/main/java/com/viettel/campaign/service/CampaignService.java
...in/java/com/viettel/campaign/service/CampaignService.java
+2
-0
src/main/java/com/viettel/campaign/service/CustomerService.java
...in/java/com/viettel/campaign/service/CustomerService.java
+0
-4
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
...om/viettel/campaign/service/impl/CampaignServiceImpl.java
+14
-1
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+5
-3
src/main/resources/sql/campaign-mng/check-allow-campaign-status-to-prepare.sql
...l/campaign-mng/check-allow-campaign-status-to-prepare.sql
+16
-0
src/main/resources/sql/campaign-mng/search-campaign-by-params.sql
.../resources/sql/campaign-mng/search-campaign-by-params.sql
+9
-1
No files found.
campaign.iml
deleted
100644 → 0
View file @
a38cb377
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
</facet>
<facet
type=
"web"
name=
"Web"
>
<configuration>
<webroots
/>
<sourceRoots>
<root
url=
"file://$MODULE_DIR$/src/main/java"
/>
<root
url=
"file://$MODULE_DIR$/src/main/resources"
/>
</sourceRoots>
</configuration>
</facet>
</component>
</module>
\ No newline at end of file
src/main/java/com/viettel/campaign/repository/CampaignRepositoryCustom.java
View file @
fdb0ef94
...
...
@@ -13,4 +13,6 @@ public interface CampaignRepositoryCustom {
ResultDTO
findByCampaignCode
(
CampaignRequestDTO
requestDTO
);
String
getMaxCampaignIndex
();
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
);
}
src/main/java/com/viettel/campaign/repository/impl/CampaignRepositoryImpl.java
View file @
fdb0ef94
...
...
@@ -192,7 +192,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
if
(!
DataUtil
.
isNullOrEmpty
(
requestDto
.
getCampaignName
()))
{
sqlStr
.
append
(
" AND UPPER(a.CAMPAIGN_NAME) LIKE :p_name"
);
}
if
(
requestDto
.
getStatus
()
!=
null
&&
requestDto
.
getStatus
()
>
0
)
{
if
(
requestDto
.
getStatus
()
!=
null
&&
requestDto
.
getStatus
()
>
=
0
)
{
sqlStr
.
append
(
" AND a.STATUS = :p_status"
);
}
if
(!
DataUtil
.
isNullOrEmpty
(
requestDto
.
getFromDateFr
()))
{
...
...
@@ -245,7 +245,7 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
query
.
setParameter
(
"p_company_site_id"
,
requestDto
.
getCompanySiteId
());
if
(
requestDto
.
getStatus
()
!=
null
&&
requestDto
.
getStatus
()
>
0
)
{
if
(
requestDto
.
getStatus
()
!=
null
&&
requestDto
.
getStatus
()
>
=
0
)
{
query
.
setParameter
(
"p_status"
,
requestDto
.
getStatus
());
}
if
(!
DataUtil
.
isNullOrEmpty
(
requestDto
.
getFromDateFr
()))
{
...
...
@@ -287,6 +287,14 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
query
.
addScalar
(
"numOfJoinedCus"
,
new
LongType
());
query
.
addScalar
(
"numOfNotJoinedCus"
,
new
LongType
());
query
.
addScalar
(
"numOfLockCus"
,
new
LongType
());
query
.
addScalar
(
"companySiteId"
,
new
LongType
());
query
.
addScalar
(
"content"
,
new
StringType
());
query
.
addScalar
(
"maxRecall"
,
new
IntegerType
());
query
.
addScalar
(
"recallType"
,
new
IntegerType
());
query
.
addScalar
(
"recallDuration"
,
new
IntegerType
());
query
.
addScalar
(
"currentTimeMode"
,
new
LongType
());
query
.
addScalar
(
"wrapupTimeConnect"
,
new
LongType
());
query
.
addScalar
(
"wrapupTimeDisconnect"
,
new
LongType
());
query
.
setResultTransformer
(
Transformers
.
aliasToBean
(
CampaignDTO
.
class
));
int
count
=
0
;
...
...
@@ -407,4 +415,36 @@ public class CampaignRepositoryImpl implements CampaignRepositoryCustom {
return
null
;
}
@Override
public
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
)
{
logger
.
info
(
"Start check allow campaign status to prepare::"
);
ResultDTO
result
=
new
ResultDTO
();
if
(
DataUtil
.
isNullOrZero
(
campaignId
))
{
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
return
result
;
}
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
Session
session
=
sessionFactory
.
openSession
();
try
{
StringBuilder
sqlStr
=
new
StringBuilder
();
sqlStr
.
append
(
SQLBuilder
.
getSqlQueryById
(
SQLBuilder
.
SQL_MODULE_CAMPAIGN_MNG
,
"check-allow-campaign-status-to-prepare"
));
SQLQuery
query
=
session
.
createSQLQuery
(
sqlStr
.
toString
());
query
.
setParameter
(
"p_campaignId"
,
campaignId
);
List
<
Object
[]>
list
=
query
.
list
();
if
(
list
.
size
()
>
0
)
{
result
.
setData
(
list
.
get
(
0
));
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
}
catch
(
Exception
ex
)
{
logger
.
error
(
ex
.
getMessage
(),
ex
);
result
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
result
.
setDescription
(
Constants
.
ApiErrorDesc
.
ERROR
);
}
finally
{
session
.
close
();
}
return
result
;
}
}
src/main/java/com/viettel/campaign/service/CampaignService.java
View file @
fdb0ef94
...
...
@@ -34,4 +34,6 @@ public interface CampaignService {
ResultDTO
findCampaignById
(
Long
campaignId
);
ResultDTO
changeCampaignStatus
(
CampaignDTO
dto
);
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
);
}
src/main/java/com/viettel/campaign/service/CustomerService.java
View file @
fdb0ef94
...
...
@@ -40,11 +40,7 @@ public interface CustomerService {
// ------------ customer contact ------------ //
<<<<<<<
HEAD
=======
ResultDTO
getCustomerContact
(
CustomerContactDTO
customer
);
>>>>>>>
1
e6b797350a4aab62031bb2ede27d0beb4dc3bb3
// danh sach khach hang cua chien dich //
ResultDTO
searchCustomerListInfoFromCustomerList
(
int
page
,
int
pageSize
,
String
sort
,
Long
campaignId
,
Long
companySiteId
);
...
...
src/main/java/com/viettel/campaign/service/impl/CampaignServiceImpl.java
View file @
fdb0ef94
...
...
@@ -204,6 +204,14 @@ public class CampaignServiceImpl implements CampaignService {
userActionLog
.
setObjectId
(
entity
.
getCampaignId
());
if
(
dto
.
getStatus
().
equals
((
short
)
-
1
))
{
userActionLog
.
setActionType
((
short
)
2
);
}
else
if
(
dto
.
getStatus
().
equals
((
short
)
4
))
{
userActionLog
.
setActionType
((
short
)
7
);
}
else
if
(
dto
.
getStatus
().
equals
((
short
)
3
))
{
userActionLog
.
setActionType
((
short
)
4
);
}
else
if
(
dto
.
getStatus
().
equals
((
short
)
2
))
{
}
else
if
(
dto
.
getStatus
().
equals
((
short
)
5
))
{
userActionLog
.
setActionType
((
short
)
7
);
}
else
if
(
dto
.
getStatus
().
equals
((
short
)
4
))
{
...
...
@@ -228,12 +236,17 @@ public class CampaignServiceImpl implements CampaignService {
return
result
;
}
@Override
public
ResultDTO
checkAllowStatusToPrepare
(
Long
campaignId
)
{
return
campaignRepository
.
checkAllowStatusToPrepare
(
campaignId
);
}
private
String
generateCampaignCode
(
String
campaignType
,
Short
chanel
)
{
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
String
maxIndexStr
=
campaignRepository
.
getMaxCampaignIndex
();
if
(
maxIndexStr
!=
null
)
{
Long
maxIndex
=
Long
.
valueOf
(
maxIndexStr
)
+
1
;
String
result
=
campaignType
+
"_"
+
String
.
valueOf
(
chanel
)
+
"_"
+
String
.
valueOf
(
year
)
+
"_"
+
maxIndex
.
toString
();
String
result
=
campaignType
+
"_"
+
chanel
+
"_"
+
year
+
"_"
+
maxIndex
.
toString
();
return
result
;
}
return
null
;
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
fdb0ef94
...
...
@@ -9,10 +9,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
<<<<<<<
HEAD:
src
/
main
/
java
/
com
/
viettel
/
campaign
/
web
/
rest
/
controller
/
CampaignController
.
java
import
org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth
;
=======
>>>>>>>
1
e6b797350a4aab62031bb2ede27d0beb4dc3bb3:
src
/
main
/
java
/
com
/
viettel
/
campaign
/
web
/
rest
/
CampaignController
.
java
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
...
...
@@ -120,4 +117,9 @@ public class CampaignController {
dto
.
setSessionId
(
request
.
getSession
().
getId
());
return
campaignService
.
changeCampaignStatus
(
dto
);
}
@RequestMapping
(
value
=
"/check-allow-status-to-prepare"
,
method
=
RequestMethod
.
GET
)
public
ResultDTO
checkAllowStatusToPrepare
(
@RequestParam
(
"campaignId"
)
Long
campaignId
)
{
return
campaignService
.
checkAllowStatusToPrepare
(
campaignId
);
}
}
src/main/resources/sql/campaign-mng/check-allow-campaign-status-to-prepare.sql
0 → 100644
View file @
fdb0ef94
WITH
COUNT_LIST
AS
(
SELECT
(
SELECT
COUNT
(
1
)
FROM
CAMPAIGN_CUSTOMER
WHERE
CAMPAIGN_ID
=
:
p_campaignId
)
countCamp
,
(
SELECT
COUNT
(
1
)
FROM
CAMPAIGN_AGENT
WHERE
CAMPAIGN_ID
=
:
p_campaignId
)
countAgent
,
(
select
COUNT
(
1
)
FROM
SCENARIO
s
INNER
JOIN
SCENARIO_QUESTION
sq
ON
s
.
SCENARIO_ID
=
sq
.
SCENARIO_ID
INNER
JOIN
SCENARIO_ANSWER
sa
ON
sq
.
SCENARIO_QUESTION_ID
=
sa
.
SCENARIO_QUESTION_ID
WHERE
s
.
CAMPAIGN_ID
=
:
p_campaignId
)
countScenario
FROM
DUAL
)
SELECT
c
.
countCamp
countCamp
,
c
.
countAgent
countAgent
,
c
.
countScenario
countScenario
,
CASE
WHEN
(
c
.
countCamp
IS
NOT
NULL
AND
c
.
countAgent
IS
NOT
NULL
AND
c
.
countScenario
IS
NOT
NULL
)
THEN
'00'
ELSE
'01'
END
as
code
FROM
COUNT_LIST
c
src/main/resources/sql/campaign-mng/search-campaign-by-params.sql
View file @
fdb0ef94
...
...
@@ -12,7 +12,15 @@ SELECT
a
.
CUSTOMER_NUMBER
cusNum
,
b
.
SLKHThamgiaCD
numOfJoinedCus
,
c
.
SLKHChuaTuongTac
numOfNotJoinedCus
,
d
.
SLKHDoNotCall_Khoa
numOfLockCus
d
.
SLKHDoNotCall_Khoa
numOfLockCus
,
a
.
COMPANY_SITE_ID
companySiteId
,
a
.
CONTENT
content
,
a
.
MAX_RECALL
maxRecall
,
a
.
RECALL_TYPE
recallType
,
a
.
RECALL_DURATION
recallDuration
,
a
.
CURRENT_TIME_MODE
currentTimeMode
,
a
.
WRAPUP_TIME_CONNECT
wrapupTimeConnect
,
a
.
WRAPUP_TIME_DISCONNECT
wrapupTimeDisconnect
FROM
CAMPAIGN
a
LEFT
JOIN
(
SELECT
campaign_id
,
COUNT
(
*
)
AS
SLKHThamgiaCD
FROM
campaign_customer
cc
INNER
JOIN
CUSTOMER
cus
ON
cc
.
CUSTOMER_ID
=
cus
.
CUSTOMER_ID
...
...
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