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
ae734b93
Commit
ae734b93
authored
Sep 19, 2019
by
Tu Bach
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into tubn
parents
a85bf6fe
a30dcde9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
12 deletions
+23
-12
src/main/java/com/viettel/campaign/service/CustomerService.java
...in/java/com/viettel/campaign/service/CustomerService.java
+1
-1
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+18
-8
src/main/java/com/viettel/campaign/service/impl/ScenarioQuestionServiceImpl.java
...el/campaign/service/impl/ScenarioQuestionServiceImpl.java
+1
-1
src/main/java/com/viettel/campaign/web/rest/CustomerController.java
...ava/com/viettel/campaign/web/rest/CustomerController.java
+3
-2
No files found.
src/main/java/com/viettel/campaign/service/CustomerService.java
View file @
ae734b93
...
...
@@ -91,6 +91,6 @@ public interface CustomerService {
//// List<CustomizeFields> searchCustomize();
ResultDTO
listCustomizeFields
(
CustomizeFieldsDTO
customizeFields
);
ResultDTO
searchCustomizeFields
(
CampaignCustomerDTO
campaignCustomerDTO
);
ResultDTO
searchCustomizeFields
(
CampaignCustomerDTO
campaignCustomerDTO
,
UserSession
userSession
);
}
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
ae734b93
...
...
@@ -831,7 +831,7 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
" AND a.STATUS = 1"
);
sb
.
append
(
" AND a.COMPANY_SITE_ID = :p_company_site_id"
);
sb
.
append
(
" AND
CREATE_AT >= to_date(:p_date_from, 'DD/MM/YYYY HH24:MI:SS') AND CREATE_AT
<= to_date(:p_date_to, 'DD/MM/YYYY HH24:MI:SS')"
);
sb
.
append
(
" AND
to_date(CREATE_AT, 'DD/MM/RR') >= to_date(:p_date_from, 'DD/MM/YYYY HH24:MI:SS') AND to_date(CREATE_AT, 'DD/MM/RR')
<= to_date(:p_date_to, 'DD/MM/YYYY HH24:MI:SS')"
);
if
(!
DataUtil
.
isNullOrEmpty
(
searchCustomerRequestDTO
.
getCustomerListCode
()))
{
sb
.
append
(
" AND UPPER(CUSTOMER_LIST_CODE) LIKE UPPER(:p_list_code)"
);
...
...
@@ -1072,7 +1072,7 @@ public class CustomerServiceImpl implements CustomerService {
//</editor-fold>
//<editor-fold desc="Đọc dữ liệu từng dòng 1" defaultstate="collapsed">
for
(
int
i
=
4
;
i
<
=
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
for
(
int
i
=
4
;
i
<
sheet
.
getPhysicalNumberOfRows
();
i
++)
{
Row
dataRow
=
sheet
.
getRow
(
i
);
if
(!
isRowEmpty
(
dataRow
))
{
Object
[]
obj
=
new
Object
[
objectSize
+
1
];
...
...
@@ -1109,7 +1109,11 @@ public class CustomerServiceImpl implements CustomerService {
&&
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])]
==
null
||
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
equals
(
""
)))
{
isMainPhoneNull
=
true
;
}
else
{
if
(
validateNumberOnly
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
()))
{
String
str
=
validateLength
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
],
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
(),
50
,
locale
);
if
(!
str
.
equals
(
""
)){
sb
.
append
(
str
);
}
else
if
(
validateNumberOnly
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
()))
{
sb
.
append
(
validateExistPhone
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.mainPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
(),
locale
,
true
));
}
else
{
sb
.
append
(
BundleUtils
.
getLangString
(
"customer.onlyNumber"
,
locale
));
...
...
@@ -1118,7 +1122,11 @@ public class CustomerServiceImpl implements CustomerService {
if
(
rawDataList
.
get
(
i
).
length
>
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])
&&
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])]
==
null
||
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
().
equals
(
""
)))
{
isSecondPhoneNull
=
true
;
}
else
{
if
(
validateNumberOnly
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
()))
{
String
str
=
validateLength
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
],
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
(),
50
,
locale
);
if
(!
str
.
equals
(
""
)){
sb
.
append
(
str
);
}
else
if
(
validateNumberOnly
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
().
trim
()))
{
sb
.
append
(
validateExistPhone
(
rawDataList
.
get
(
i
)[
headerMap
.
get
(
BundleUtils
.
getLangString
(
"customer.secondPhone"
,
locale
).
split
(
"#"
)[
0
])].
toString
(),
locale
,
false
));
}
else
{
sb
.
append
(
BundleUtils
.
getLangString
(
"customer.onlyNumber"
,
locale
));
...
...
@@ -2267,7 +2275,7 @@ public class CustomerServiceImpl implements CustomerService {
@Override
@Transactional
(
DataSourceQualify
.
CCMS_FULL
)
public
ResultDTO
searchCustomizeFields
(
CampaignCustomerDTO
campaignCustomerDTO
)
{
public
ResultDTO
searchCustomizeFields
(
CampaignCustomerDTO
campaignCustomerDTO
,
UserSession
userSession
)
{
ResultDTO
resultDTO
=
new
ResultDTO
();
SessionFactory
sessionFactory
=
HibernateUtil
.
getSessionFactory
();
...
...
@@ -2284,13 +2292,14 @@ public class CustomerServiceImpl implements CustomerService {
requestCustomer
.
put
(
"-8"
,
"cc.contact"
);
requestCustomer
.
put
(
"-9"
,
"cc2.contact"
);
requestCustomer
.
put
(
"-10"
,
"c.username"
);
requestCustomer
.
put
(
"-11"
,
"c.
area_cod
e"
);
requestCustomer
.
put
(
"-12"
,
"c.
customer_typ
e"
);
requestCustomer
.
put
(
"-11"
,
"c.
customer_typ
e"
);
requestCustomer
.
put
(
"-12"
,
"c.
area_cod
e"
);
requestCustomer
.
put
(
"-13"
,
"c.call_allowed"
);
requestCustomer
.
put
(
"-14"
,
"c.email_allowed"
);
requestCustomer
.
put
(
"-15"
,
"c.sms_allowed"
);
requestCustomer
.
put
(
"-16"
,
"c.ipcc_status"
);
try
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -2314,7 +2323,7 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
" left join customize_field_object cfo on c.customer_id = cfo.object_id and cfo.status = 1"
);
sb
.
append
(
" AND C.STATUS = 1"
);
sb
.
append
(
" AND C.customer_id not in (select customer_id from campaign_customer where campaign_id = :p_campaign_id) "
);
sb
.
append
(
" where 1 = 1 "
);
sb
.
append
(
" where 1 = 1
AND C.STATUS = 1 AND C.SITE_ID = :p_site_id
"
);
List
<
CustomerQueryDTO
>
customerDTOList
=
campaignCustomerDTO
.
getListQuery
();
if
(
customerDTOList
.
get
(
0
).
getField
()
>
0
)
{
// field dong
...
...
@@ -2437,6 +2446,7 @@ public class CustomerServiceImpl implements CustomerService {
query
.
addScalar
(
"description"
,
new
StringType
());
query
.
setParameter
(
"p_campaign_id"
,
campaignCustomerDTO
.
getCampaignId
());
query
.
setParameter
(
"p_site_id"
,
userSession
.
getSiteId
());
query
.
setResultTransformer
(
Transformers
.
aliasToBean
(
CustomerDTO
.
class
));
...
...
src/main/java/com/viettel/campaign/service/impl/ScenarioQuestionServiceImpl.java
View file @
ae734b93
...
...
@@ -80,7 +80,7 @@ public class ScenarioQuestionServiceImpl implements ScenarioQuestionService {
if
(
scenarioQuestionDTO
.
getLstAnswers
().
size
()
>
0
)
{
lstAnswers
=
scenarioQuestionDTO
.
getLstAnswers
();
lstAnswers
.
forEach
(
item
->
{
item
.
setCode
(
scenarioQuestion
.
get
ScenarioQuestionId
()
+
"_"
+
item
.
getOrderIndex
());
item
.
setCode
(
scenarioQuestion
.
get
Code
()
+
"_"
+
item
.
getOrderIndex
());
item
.
setScenarioQuestionId
(
scenarioQuestion
.
getScenarioQuestionId
());
item
.
setCreateTime
(
new
Date
());
item
.
setStatus
((
short
)
1
);
...
...
src/main/java/com/viettel/campaign/web/rest/CustomerController.java
View file @
ae734b93
...
...
@@ -310,8 +310,9 @@ public class CustomerController {
@PostMapping
(
"/searchIndividualCustomer"
)
@ResponseBody
public
ResponseEntity
searchCustomizeFields
(
@RequestBody
CampaignCustomerDTO
campaignCustomerDTO
)
{
ResultDTO
result
=
customerService
.
searchCustomizeFields
(
campaignCustomerDTO
);
public
ResponseEntity
searchCustomizeFields
(
@RequestBody
CampaignCustomerDTO
campaignCustomerDTO
,
HttpServletRequest
request
)
{
UserSession
userSession
=
(
UserSession
)
RedisUtil
.
getInstance
().
get
(
request
.
getHeader
(
"X-Auth-Token"
));
ResultDTO
result
=
customerService
.
searchCustomizeFields
(
campaignCustomerDTO
,
userSession
);
return
new
ResponseEntity
<>(
result
,
HttpStatus
.
OK
);
}
...
...
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