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
c4dfdba7
Commit
c4dfdba7
authored
Aug 09, 2019
by
Đào Nhật Quang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quangdn
parent
7b1919fd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
115 deletions
+66
-115
.mvn/wrapper/MavenWrapperDownloader.java
.mvn/wrapper/MavenWrapperDownloader.java
+0
-114
.mvn/wrapper/maven-wrapper.jar
.mvn/wrapper/maven-wrapper.jar
+0
-0
.mvn/wrapper/maven-wrapper.properties
.mvn/wrapper/maven-wrapper.properties
+0
-1
src/main/java/com/viettel/campaign/repository/CustomerListRepository.java
...m/viettel/campaign/repository/CustomerListRepository.java
+1
-0
src/main/java/com/viettel/campaign/service/CustomerService.java
...in/java/com/viettel/campaign/service/CustomerService.java
+4
-0
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+18
-0
src/main/java/com/viettel/campaign/web/rest/controller/CustomerController.java
...ttel/campaign/web/rest/controller/CustomerController.java
+9
-0
src/main/resources/sql/campaign-mng/search-customer-list-info-from-customer-list.sql
...aign-mng/search-customer-list-info-from-customer-list.sql
+34
-0
No files found.
.mvn/wrapper/MavenWrapperDownloader.java
deleted
100644 → 0
View file @
7b1919fd
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.net.URL
;
import
java.nio.channels.Channels
;
import
java.nio.channels.ReadableByteChannel
;
import
java.util.Properties
;
public
class
MavenWrapperDownloader
{
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private
static
final
String
DEFAULT_DOWNLOAD_URL
=
"https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
;
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private
static
final
String
MAVEN_WRAPPER_PROPERTIES_PATH
=
".mvn/wrapper/maven-wrapper.properties"
;
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private
static
final
String
MAVEN_WRAPPER_JAR_PATH
=
".mvn/wrapper/maven-wrapper.jar"
;
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private
static
final
String
PROPERTY_NAME_WRAPPER_URL
=
"wrapperUrl"
;
public
static
void
main
(
String
args
[])
{
System
.
out
.
println
(
"- Downloader started"
);
File
baseDirectory
=
new
File
(
args
[
0
]);
System
.
out
.
println
(
"- Using base directory: "
+
baseDirectory
.
getAbsolutePath
());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File
mavenWrapperPropertyFile
=
new
File
(
baseDirectory
,
MAVEN_WRAPPER_PROPERTIES_PATH
);
String
url
=
DEFAULT_DOWNLOAD_URL
;
if
(
mavenWrapperPropertyFile
.
exists
())
{
FileInputStream
mavenWrapperPropertyFileInputStream
=
null
;
try
{
mavenWrapperPropertyFileInputStream
=
new
FileInputStream
(
mavenWrapperPropertyFile
);
Properties
mavenWrapperProperties
=
new
Properties
();
mavenWrapperProperties
.
load
(
mavenWrapperPropertyFileInputStream
);
url
=
mavenWrapperProperties
.
getProperty
(
PROPERTY_NAME_WRAPPER_URL
,
url
);
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"- ERROR loading '"
+
MAVEN_WRAPPER_PROPERTIES_PATH
+
"'"
);
}
finally
{
try
{
if
(
mavenWrapperPropertyFileInputStream
!=
null
)
{
mavenWrapperPropertyFileInputStream
.
close
();
}
}
catch
(
IOException
e
)
{
// Ignore ...
}
}
}
System
.
out
.
println
(
"- Downloading from: : "
+
url
);
File
outputFile
=
new
File
(
baseDirectory
.
getAbsolutePath
(),
MAVEN_WRAPPER_JAR_PATH
);
if
(!
outputFile
.
getParentFile
().
exists
())
{
if
(!
outputFile
.
getParentFile
().
mkdirs
())
{
System
.
out
.
println
(
"- ERROR creating output direcrory '"
+
outputFile
.
getParentFile
().
getAbsolutePath
()
+
"'"
);
}
}
System
.
out
.
println
(
"- Downloading to: "
+
outputFile
.
getAbsolutePath
());
try
{
downloadFileFromURL
(
url
,
outputFile
);
System
.
out
.
println
(
"Done"
);
System
.
exit
(
0
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
"- Error downloading"
);
e
.
printStackTrace
();
System
.
exit
(
1
);
}
}
private
static
void
downloadFileFromURL
(
String
urlString
,
File
destination
)
throws
Exception
{
URL
website
=
new
URL
(
urlString
);
ReadableByteChannel
rbc
;
rbc
=
Channels
.
newChannel
(
website
.
openStream
());
FileOutputStream
fos
=
new
FileOutputStream
(
destination
);
fos
.
getChannel
().
transferFrom
(
rbc
,
0
,
Long
.
MAX_VALUE
);
fos
.
close
();
rbc
.
close
();
}
}
.mvn/wrapper/maven-wrapper.jar
deleted
100644 → 0
View file @
7b1919fd
File deleted
.mvn/wrapper/maven-wrapper.properties
deleted
100644 → 0
View file @
7b1919fd
distributionUrl
=
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
src/main/java/com/viettel/campaign/repository/CustomerListRepository.java
View file @
c4dfdba7
package
com.viettel.campaign.repository
;
package
com.viettel.campaign.repository
;
import
com.viettel.campaign.model.CustomerList
;
import
com.viettel.campaign.model.CustomerList
;
import
com.viettel.campaign.web.dto.ResultDTO
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
...
...
src/main/java/com/viettel/campaign/service/CustomerService.java
View file @
c4dfdba7
...
@@ -37,4 +37,8 @@ public interface CustomerService {
...
@@ -37,4 +37,8 @@ public interface CustomerService {
// ------------ customer contact ------------ //
// ------------ customer contact ------------ //
ResultDTO
getCustomerContact
(
Long
customerId
,
Short
contactType
,
String
contact
);
ResultDTO
getCustomerContact
(
Long
customerId
,
Short
contactType
,
String
contact
);
// 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/CustomerServiceImpl.java
View file @
c4dfdba7
...
@@ -587,4 +587,22 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -587,4 +587,22 @@ public class CustomerServiceImpl implements CustomerService {
return
result
;
return
result
;
}
}
@Override
public
ResultDTO
searchCustomerListInfoFromCustomerList
(
int
page
,
int
pageSize
,
String
sort
,
Long
campaignId
,
Long
companySiteId
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
try
{
String
sql
=
SQLBuilder
.
getSqlQueryById
(
SQLBuilder
.
SQL_MODULE_CAMPAIGN_MNG
,
"search-customer-list-info-from-customer-list"
);
Query
query
=
entityManager
.
createNativeQuery
(
sql
);
query
.
setParameter
(
"p_campaign_id"
,
campaignId
);
query
.
setParameter
(
"p_company_site_id"
,
companySiteId
);
resultDTO
.
setListData
(
query
.
getResultList
());
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
}
catch
(
Exception
e
)
{
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
ERROR
);
resultDTO
.
setDescription
(
e
.
getMessage
());
}
return
resultDTO
;
}
}
}
src/main/java/com/viettel/campaign/web/rest/controller/CustomerController.java
View file @
c4dfdba7
...
@@ -226,4 +226,13 @@ public class CustomerController {
...
@@ -226,4 +226,13 @@ public class CustomerController {
return
new
ResponseEntity
<>(
HttpStatus
.
BAD_REQUEST
);
return
new
ResponseEntity
<>(
HttpStatus
.
BAD_REQUEST
);
}
}
}
}
@RequestMapping
(
value
=
"/searchCustomerListInfoFromCustomerList"
,
method
=
RequestMethod
.
GET
)
public
ResultDTO
searchCustomerListInfoFromCustomerList
(
@RequestParam
(
"page"
)
int
page
,
@RequestParam
(
"pageSize"
)
int
pageSize
,
@RequestParam
(
"sort"
)
String
sort
,
@RequestParam
(
"campaignId"
)
Long
campaignId
,
@RequestParam
(
"companySiteId"
)
Long
companySiteId
)
{
return
customerService
.
searchCustomerListInfoFromCustomerList
(
page
,
pageSize
,
sort
,
campaignId
,
companySiteId
);
}
}
}
src/main/resources/sql/campaign-mng/search-customer-list-info-from-customer-list.sql
0 → 100644
View file @
c4dfdba7
with
totalCustomer
as
(
select
clm
.
customer_list_id
,
clm
.
company_site_id
,
count
(
clm
.
customer_id
)
total
from
customer_list_mapping
clm
inner
join
customer
c
on
clm
.
customer_id
=
c
.
customer_id
where
c
.
status
=
1
group
by
clm
.
customer_list_id
,
clm
.
company_site_id
),
customerInteractive
as
(
select
customer_list_id
,
company_site_id
,
count
(
customer_id
)
tt
from
campaign_customer
where
campaign_id
=
:
p_campaign_id
and
status
<>
0
group
by
customer_list_id
,
company_site_id
),
customerNotInteractive
as
(
select
customer_list_id
,
company_site_id
,
count
(
customer_id
)
ktt
from
campaign_customer
where
campaign_id
=
:
p_campaign_id
and
status
=
0
and
in_campaign_status
=
1
group
by
customer_list_id
,
company_site_id
)
select
customer_list_code
ma
,
customer_list_name
ten
,
cl
.
company_site_id
,
nvl
(
total
,
0
)
tong
,
nvl
(
tt
,
0
)
tongtt
,
nvl
(
ktt
,
0
)
tongktt
from
customer_list
cl
left
join
totalCustomer
tc
on
(
cl
.
customer_list_id
=
tc
.
customer_list_id
and
cl
.
company_site_id
=
tc
.
company_site_id
)
left
join
customerInteractive
ci
on
(
cl
.
customer_list_id
=
ci
.
customer_list_id
and
cl
.
company_site_id
=
ci
.
company_site_id
)
left
join
customerNotInteractive
cni
on
(
cl
.
customer_list_id
=
cni
.
customer_list_id
and
cl
.
company_site_id
=
cni
.
company_site_id
)
where
cl
.
company_site_id
=
:
p_company_site_id
order
by
customer_list_code
\ No newline at end of file
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