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
80a0a4ad
Commit
80a0a4ad
authored
Aug 12, 2019
by
=
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hungtt-commit conflict campaignController
parent
e4b1cb40
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
49 additions
and
11 deletions
+49
-11
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignExecuteRepository.java
...paign/repository/ccms_full/CampaignExecuteRepository.java
+2
-0
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
...pository/ccms_full/impl/CampaignExecuteRepositoryImp.java
+15
-3
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
.../com/viettel/campaign/service/CampaignExecuteService.java
+5
-0
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
...ttel/campaign/service/impl/CampaignExecuteServiceImp.java
+6
-0
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
...va/com/viettel/campaign/web/dto/ContactCustResultDTO.java
+1
-1
src/main/java/com/viettel/campaign/web/dto/request_dto/CampaignRequestDTO.java
...ttel/campaign/web/dto/request_dto/CampaignRequestDTO.java
+1
-0
src/main/java/com/viettel/campaign/web/rest/CampaignCompleteCodeController.java
...tel/campaign/web/rest/CampaignCompleteCodeController.java
+1
-1
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
...ava/com/viettel/campaign/web/rest/CampaignController.java
+10
-2
src/main/java/com/viettel/campaign/web/rest/CustomerController.java
...ava/com/viettel/campaign/web/rest/CustomerController.java
+1
-0
src/main/resources/sql/campaign-execute/get-combo-campaign-type.sql
...esources/sql/campaign-execute/get-combo-campaign-type.sql
+3
-1
src/main/resources/sql/campaign-execute/get-combo-status.sql
src/main/resources/sql/campaign-execute/get-combo-status.sql
+1
-1
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
...esources/sql/campaign-execute/get-execute-interactive.sql
+3
-2
No files found.
src/main/java/com/viettel/campaign/repository/ccms_full/CampaignExecuteRepository.java
View file @
80a0a4ad
...
...
@@ -20,5 +20,7 @@ public interface CampaignExecuteRepository {
ResultDTO
getInteractiveResult
(
CampaignRequestDTO
dto
);
List
<
ContactCustResultDTO
>
getExcelInteractiveResult
(
CampaignRequestDTO
dto
);
List
<
ContactCustResultDTO
>
getContactCustById
(
CampaignRequestDTO
dto
);
//</editor-fold: hungtt>
}
src/main/java/com/viettel/campaign/repository/ccms_full/impl/CampaignExecuteRepositoryImp.java
View file @
80a0a4ad
package
com.viettel.campaign.repository.impl
;
package
com.viettel.campaign.repository.
ccms_full.
impl
;
import
com.viettel.campaign.repository.CampaignExecuteRepository
;
import
com.viettel.campaign.config.DataSourceQualify
;
import
com.viettel.campaign.repository.ccms_full.CampaignExecuteRepository
;
import
com.viettel.campaign.utils.Constants
;
import
com.viettel.campaign.utils.DataUtil
;
import
com.viettel.campaign.utils.HibernateUtil
;
...
...
@@ -17,6 +18,7 @@ import org.hibernate.type.*;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -25,18 +27,21 @@ import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import
org.springframework.stereotype.Repository
;
import
javax.persistence.EntityManager
;
import
javax.persistence.PersistenceContext
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
@Repository
public
class
CampaignExecuteRepositoryImp
implements
CampaignExecuteRepository
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Campaign
RepositoryImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Campaign
ExecuteRepositoryImp
.
class
);
@Autowired
@Qualifier
(
DataSourceQualify
.
NAMED_JDBC_PARAMETER_TEMPLATE_CCMS_FULL
)
NamedParameterJdbcTemplate
namedParameterJdbcTemplate
;
@Autowired
@PersistenceContext
(
unitName
=
DataSourceQualify
.
JPA_UNIT_NAME_CCMS_FULL
)
EntityManager
entityManager
;
@Override
...
...
@@ -152,6 +157,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query
.
addScalar
(
"surveyStatus"
,
new
StringType
());
query
.
addScalar
(
"status"
,
new
ShortType
());
query
.
addScalar
(
"recordStatus"
,
new
ShortType
());
query
.
addScalar
(
"callTime"
,
new
LongType
());
query
.
setResultTransformer
(
Transformers
.
aliasToBean
(
ContactCustResultDTO
.
class
));
...
...
@@ -276,6 +282,7 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
query
.
addScalar
(
"surveyStatus"
,
new
StringType
());
query
.
addScalar
(
"status"
,
new
ShortType
());
query
.
addScalar
(
"recordStatus"
,
new
ShortType
());
query
.
addScalar
(
"callTime"
,
new
LongType
());
query
.
setResultTransformer
(
Transformers
.
aliasToBean
(
ContactCustResultDTO
.
class
));
...
...
@@ -288,6 +295,11 @@ public class CampaignExecuteRepositoryImp implements CampaignExecuteRepository {
}
}
@Override
public
List
<
ContactCustResultDTO
>
getContactCustById
(
CampaignRequestDTO
dto
)
{
return
null
;
}
private
boolean
isLower24Hour
(
Date
createTime
)
{
Date
currTime
=
new
Date
();
long
diffMilSec
=
currTime
.
getTime
()
-
createTime
.
getTime
();
...
...
src/main/java/com/viettel/campaign/service/CampaignExecuteService.java
View file @
80a0a4ad
package
com.viettel.campaign.service
;
import
com.viettel.campaign.web.dto.ContactCustResultDTO
;
import
com.viettel.campaign.web.dto.ResultDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
interface
CampaignExecuteService
{
//<editor-fold: hungtt>
...
...
@@ -15,5 +18,7 @@ public interface CampaignExecuteService {
ResultDTO
searchInteractiveResult
(
CampaignRequestDTO
dto
);
XSSFWorkbook
exportInteractiveResult
(
CampaignRequestDTO
dto
);
List
<
ContactCustResultDTO
>
getContactCustById
(
CampaignRequestDTO
dto
);
//</editor-fold>
}
src/main/java/com/viettel/campaign/service/impl/CampaignExecuteServiceImp.java
View file @
80a0a4ad
...
...
@@ -178,6 +178,12 @@ public class CampaignExecuteServiceImp implements CampaignExecuteService {
return
workbook
;
}
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
List
<
ContactCustResultDTO
>
getContactCustById
(
CampaignRequestDTO
dto
)
{
return
campaignExecuteRepository
.
getContactCustById
(
dto
);
}
private
void
writeCellContent
(
Row
row
,
CellStyle
rowStyle
,
int
colNo
,
Object
content
)
{
Cell
cell
=
row
.
createCell
(
colNo
);
if
(
content
==
null
)
{
...
...
src/main/java/com/viettel/campaign/web/dto/ContactCustResultDTO.java
View file @
80a0a4ad
...
...
@@ -19,7 +19,7 @@ public class ContactCustResultDTO extends BaseDTO{
private
Short
recordStatus
;
private
String
description
;
private
Date
createTime
;
private
Stri
ng
callTime
;
private
Lo
ng
callTime
;
private
Long
agentId
;
private
Long
campaignId
;
private
String
campaignName
;
...
...
src/main/java/com/viettel/campaign/web/dto/request_dto/CampaignRequestDTO.java
View file @
80a0a4ad
...
...
@@ -41,4 +41,5 @@ public class CampaignRequestDTO extends BaseDTO {
String
campaignId
;
String
surveyStatus
;
String
roleUser
;
String
contactCustId
;
}
src/main/java/com/viettel/campaign/web/rest/CampaignCompleteCodeController.java
View file @
80a0a4ad
...
...
@@ -108,7 +108,7 @@ public class CampaignCompleteCodeController {
@GetMapping
(
"/getListStatusWithoutType"
)
@ResponseBody
public
ResponseEntity
<
ResultDTO
>
getListStatusWithoutType
(
@RequestParam
(
"completeValue"
)
String
completeValue
,
@RequestParam
(
"completeType"
)
Short
completeType
,
@RequestParam
(
"companySiteId"
)
Long
companySiteId
)
{
ResultDTO
result
=
completeCodeService
.
getListStatusWithout
Valu
e
(
completeValue
,
completeType
,
companySiteId
);
ResultDTO
result
=
completeCodeService
.
getListStatusWithout
Typ
e
(
completeValue
,
completeType
,
companySiteId
);
return
new
ResponseEntity
(
result
,
HttpStatus
.
OK
);
}
...
...
src/main/java/com/viettel/campaign/web/rest/CampaignController.java
View file @
80a0a4ad
package
com.viettel.campaign.web.rest
.controller
;
package
com.viettel.campaign.web.rest
;
import
com.viettel.campaign.service.CampaignExecuteService
;
import
com.viettel.campaign.service.CampaignService
;
import
com.viettel.campaign.web.dto.CampaignDTO
;
import
com.viettel.campaign.web.dto.ContactCustResultDTO
;
import
com.viettel.campaign.web.dto.ResultDTO
;
import
com.viettel.campaign.web.dto.request_dto.CampaignRequestDTO
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.MediaType
;
...
...
@@ -21,6 +21,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.util.List
;
import
java.util.Map
;
@RestController
...
...
@@ -111,6 +112,13 @@ public class CampaignController {
return
new
ResponseEntity
<
byte
[]>(
contentReturn
,
headers
,
HttpStatus
.
OK
);
}
@PostMapping
(
"/getContactCustById"
)
@ResponseBody
public
ResponseEntity
<?>
getContactCustById
(
@RequestBody
CampaignRequestDTO
campaignRequestDTO
)
{
List
<
ContactCustResultDTO
>
list
=
campaignExecuteService
.
getContactCustById
(
campaignRequestDTO
);
return
new
ResponseEntity
<>(
null
,
null
,
HttpStatus
.
OK
);
}
@RequestMapping
(
value
=
"/changeCampaignStatus"
,
method
=
RequestMethod
.
PUT
)
public
ResultDTO
changeCampaignStatus
(
@RequestBody
CampaignDTO
dto
,
HttpServletRequest
request
)
{
dto
.
setSessionId
(
request
.
getSession
().
getId
());
...
...
src/main/java/com/viettel/campaign/web/rest/CustomerController.java
View file @
80a0a4ad
...
...
@@ -243,6 +243,7 @@ public class CustomerController {
}
@RequestMapping
(
value
=
"/searchCustomerListInfoFromCustomerList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultDTO
searchCustomerListInfoFromCustomerList
(
@RequestParam
(
"page"
)
int
page
,
@RequestParam
(
"pageSize"
)
int
pageSize
,
@RequestParam
(
"sort"
)
String
sort
,
...
...
src/main/resources/sql/campaign-execute/get-combo-campaign-type.sql
View file @
80a0a4ad
select
PAR_VALUE
apParamId
,
PAR_NAME
parName
from
AP_PARAM
where
PAR_TYPE
=
'CAMPAIGN_TYPE'
and
COMPANY_SITE_ID
=
:
p_company_site_id
where
PAR_TYPE
=
'CAMPAIGN_TYPE'
and
COMPANY_SITE_ID
=
:
p_company_site_id
and
IS_DELETE
=
0
src/main/resources/sql/campaign-execute/get-combo-status.sql
View file @
80a0a4ad
select
COMPLETE_VALUE
apParamId
,
select
distinct
COMPLETE_VALUE
apParamId
,
COMPLETE_NAME
parName
from
CAMPAIGN_COMPLETE_CODE
where
to_char
(
COMPLETE_TYPE
)
=
:
p_complete_type
and
STATUS
=
1
and
COMPANY_SITE_ID
=
:
p_company_site_id
src/main/resources/sql/campaign-execute/get-execute-interactive.sql
View file @
80a0a4ad
...
...
@@ -3,11 +3,12 @@ select b.campaign_code campaignCode,
c
.
user_name
userName
,
a
.
phone_number
phoneNumber
,
d
.
name
customerName
,
a
.
create_time
createTime
,
to_date
(
a
.
start_call
,
'DD/MM/YYYY'
)
startCall
,
e
.
complete_name
contactStatus
,
f
.
complete_name
surveyStatus
,
g
.
status
status
,
a
.
status
recordStatus
a
.
status
recordStatus
,
(
a
.
end_time
-
a
.
start_call
)
*
24
*
60
callTime
from
contact_cust_result
a
left
join
campaign
b
on
a
.
campaign_id
=
b
.
campaign_id
left
join
vsa_users
c
on
a
.
agent_id
=
c
.
user_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