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
9be2fb1c
Commit
9be2fb1c
authored
Aug 30, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull code
parent
92653d95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
76 deletions
+27
-76
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
...om/viettel/campaign/service/impl/CustomerServiceImpl.java
+27
-76
No files found.
src/main/java/com/viettel/campaign/service/impl/CustomerServiceImpl.java
View file @
9be2fb1c
...
@@ -1870,50 +1870,8 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1870,50 +1870,8 @@ public class CustomerServiceImpl implements CustomerService {
datafill
.
setCustomizeFieldId
(
Long
.
parseLong
(
cf
[
x
][
0
]));
datafill
.
setCustomizeFieldId
(
Long
.
parseLong
(
cf
[
x
][
0
]));
datafill
.
setTitle
(
cf
[
x
][
1
]);
datafill
.
setTitle
(
cf
[
x
][
1
]);
datafill
.
setType
(
cf
[
x
][
2
]);
datafill
.
setType
(
cf
[
x
][
2
]);
lstCustomizeFields
.
add
(
datafill
);
lstCustomizeFields
.
add
(
datafill
);
}
}
// try {
// stringBuilder.append(" with column_name_temp as (");
// stringBuilder.append(" select 'CUSTOMER_ID customerId' , from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'CUSTOMER_NAME customerName' , from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'CUSTOMER_TYPE customerType' , from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'NAME name' , from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'CURRENT_ADDRESS currentAddress', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'PLACE_OF_BIRTH placeOfBirth', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'DATE_OF_BIRTH dateOfBirth', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'MOBILE_NUMBER mobileNumber', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'EMAIL email', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'USERNAME username', from user_tab_columns, dual");
// stringBuilder.append(" union all");
// stringBuilder.append(" select 'CUSTOMER_TYPE customerType', from user_tab_columns, dual");
// stringBuilder.append(" where table_name = 'CUSTOMER'");
// stringBuilder.append(" )");
//
// stringBuilder.append(" select * from column_name_temp");
// stringBuilder.append(" union all");
// stringBuilder.append(" select title columnName, 0 isFix ");
// stringBuilder.append(" from customize_fields, dual");
// stringBuilder.append(" where function_code = 'CUSTOMER'");
// stringBuilder.append(" and site_id = :p_company_site_id");
// stringBuilder.append(" and STATUS = 1");
// stringBuilder.append(" and active = 1 ");
// params.put("p_company_site_id", customizeFields.getSiteId());
// params.put("p_customer_id", customizeFields.getCustomerId());
// LOGGER.info("SQL statement: " + stringBuilder);
// list = namedParameterJdbcTemplate.query(stringBuilder.toString(), params, BeanPropertyRowMapper.newInstance(CustomizeFielObjectDTO.class));
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setErrorCode
(
Constants
.
ApiErrorCode
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setDescription
(
Constants
.
ApiErrorDesc
.
SUCCESS
);
resultDTO
.
setListData
(
lstCustomizeFields
);
resultDTO
.
setListData
(
lstCustomizeFields
);
...
@@ -1936,12 +1894,6 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1936,12 +1894,6 @@ public class CustomerServiceImpl implements CustomerService {
Session
session
=
sessionFactory
.
openSession
();
Session
session
=
sessionFactory
.
openSession
();
session
.
beginTransaction
();
session
.
beginTransaction
();
// if (DataUtil.isNullOrZero(SiteId)) {
// resultDTO.setErrorCode(Constants.ApiErrorCode.ERROR);
// resultDTO.setDescription(Constants.ApiErrorDesc.ERROR);
// return resultDTO;
// }
try
{
try
{
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
...
@@ -1965,9 +1917,9 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1965,9 +1917,9 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
" FROM CUSTOMER C"
);
sb
.
append
(
" FROM CUSTOMER C"
);
sb
.
append
(
" INNER JOIN CUSTOMIZE_FIELD_OBJECT CFO ON C.CUSTOMER_ID = CFO.OBJECT_ID"
);
sb
.
append
(
" INNER JOIN CUSTOMIZE_FIELD_OBJECT CFO ON C.CUSTOMER_ID = CFO.OBJECT_ID"
);
sb
.
append
(
" INNER JOIN CUSTOMIZE_FIELDS CF ON CF.CUSTOMIZE_FIELD_ID = CFO.CUSTOMIZE_FIELDS_ID\n"
+
sb
.
append
(
" INNER JOIN CUSTOMIZE_FIELDS CF ON CF.CUSTOMIZE_FIELD_ID = CFO.CUSTOMIZE_FIELDS_ID\n"
+
" WHERE
1 = 1
"
);
" WHERE "
);
sb
.
append
(
"
AND
CFO.STATUS = 1"
);
sb
.
append
(
" CFO.STATUS = 1"
);
sb
.
append
(
" AND ACTIVE = 1 "
);
sb
.
append
(
" AND
CF.
ACTIVE = 1 "
);
sb
.
append
(
" AND CF.FUNCTION_CODE = 'CUSTOMER' "
);
sb
.
append
(
" AND CF.FUNCTION_CODE = 'CUSTOMER' "
);
List
<
CustomerQueryDTO
>
customerDTOList
=
campaignCustomerDTO
.
getListQuery
();
List
<
CustomerQueryDTO
>
customerDTOList
=
campaignCustomerDTO
.
getListQuery
();
...
@@ -1979,23 +1931,23 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -1979,23 +1931,23 @@ public class CustomerServiceImpl implements CustomerService {
// sb.append(campaignCustomerDTO.getListQuery().get(i).getJoin() + " "
// sb.append(campaignCustomerDTO.getListQuery().get(i).getJoin() + " "
// + campaignCustomerDTO.getListQuery().get(i).getField() + " "
// + campaignCustomerDTO.getListQuery().get(i).getField() + " "
// + campaignCustomerDTO.getListQuery().get(i).getOperator() + " "
// + campaignCustomerDTO.getListQuery().get(i).getOperator() + " "
//
//
+ campaignCustomerDTO.getListQuery().get(i).getCondition() + " ");
// + campaignCustomerDTO.getListQuery().get(i).getCondition() + " ");
Map
<
String
,
String
>
requestCustomer
=
new
HashMap
<>();
//
Map<String, String> requestCustomer = new HashMap<>();
requestCustomer
.
put
(
"-1"
,
"Mã Khách Hàng"
);
//
requestCustomer.put("-1" ,"Mã Khách Hàng");
requestCustomer
.
put
(
"-2"
,
"Tên khách hàng"
);
//
requestCustomer.put("-2" ,"Tên khách hàng");
requestCustomer
.
put
(
"-3"
,
"Tên công ty"
);
//
requestCustomer.put("-3" ,"Tên công ty");
requestCustomer
.
put
(
"-4"
,
"Giới tính"
);
//
requestCustomer.put("-4" ,"Giới tính");
requestCustomer
.
put
(
"-5"
,
"Địa chỉ"
);
//
requestCustomer.put("-5" ,"Địa chỉ");
requestCustomer
.
put
(
"-6"
,
"Nơi sinh"
);
//
requestCustomer.put("-6" ,"Nơi sinh");
requestCustomer
.
put
(
"-7"
,
"Ngày sinh"
);
//
requestCustomer.put("-7" ,"Ngày sinh");
requestCustomer
.
put
(
"-8"
,
"Số điện thoại"
);
//
requestCustomer.put("-8" ,"Số điện thoại");
requestCustomer
.
put
(
"-9"
,
"email"
);
//
requestCustomer.put("-9" ,"email");
requestCustomer
.
put
(
"-10"
,
"Tên đăng nhập"
);
//
requestCustomer.put("-10" ,"Tên đăng nhập");
requestCustomer
.
put
(
"-11"
,
"Loại Khách hàng"
);
//
requestCustomer.put("-11" ,"Loại Khách hàng");
sb
.
append
(
"and "
+
customerDTOList
.
get
(
0
).
getField
());
//
sb.append("and "+customerDTOList.get(0).getField());
for
(
int
i
=
1
;
i
<
customerDTOList
.
size
();
i
++)
{
//
for (int i = 1; i < customerDTOList.size(); i++) {
//
}
//
}
for
(
CustomerQueryDTO
query
:
customerDTOList
)
{
for
(
CustomerQueryDTO
query
:
customerDTOList
)
{
...
@@ -2003,7 +1955,6 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -2003,7 +1955,6 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
"AND "
);
sb
.
append
(
"AND "
);
}
else
{
}
else
{
sb
.
append
(
query
.
getJoin
()
+
" "
);
sb
.
append
(
query
.
getJoin
()
+
" "
);
// sb.append(query.getOperator() + " ");
// if ("like".equals(query.getOperator()) || "not like".equals(query.getOperator())) {
// if ("like".equals(query.getOperator()) || "not like".equals(query.getOperator())) {
// sb.append("%"+ query.getCondition() + "% ");
// sb.append("%"+ query.getCondition() + "% ");
// } else {
// } else {
...
@@ -2013,7 +1964,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -2013,7 +1964,7 @@ public class CustomerServiceImpl implements CustomerService {
switch
(
query
.
getField
()
+
""
)
{
switch
(
query
.
getField
()
+
""
)
{
case
"-1"
:
case
"-1"
:
sb
.
append
(
" C.CUSTOMER_ID "
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
sb
.
append
(
" C.CUSTOMER_ID "
+
query
.
getOperator
()
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
break
;
break
;
case
"-2"
:
case
"-2"
:
sb
.
append
(
" C.NAME "
+
query
.
getOperator
()
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
sb
.
append
(
" C.NAME "
+
query
.
getOperator
()
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
...
@@ -2028,7 +1979,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -2028,7 +1979,7 @@ public class CustomerServiceImpl implements CustomerService {
sb
.
append
(
" C.CURRENT_ADDRESS "
+
query
.
getOperator
()
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
sb
.
append
(
" C.CURRENT_ADDRESS "
+
query
.
getOperator
()
+
" '%"
+
query
.
getCondition
()
+
"%' "
);
break
;
break
;
case
"-6"
:
case
"-6"
:
sb
.
append
(
query
.
getJoin
()
+
" C.PLACE_OF_BIRTH "
+
query
.
getOperator
()
+
"to_date("
+
query
.
getCondition
()
+
", 'dd/mm/yyyy')"
);
sb
.
append
(
" C.PLACE_OF_BIRTH "
+
query
.
getOperator
()
+
"to_date("
+
query
.
getCondition
()
+
", 'dd/mm/yyyy')"
);
break
;
break
;
case
"-7"
:
case
"-7"
:
sb
.
append
(
" C.DATE_OF_BIRTH "
+
query
.
getOperator
()
+
"to_date("
+
query
.
getCondition
()
+
", 'dd/mm/yyyy')"
);
sb
.
append
(
" C.DATE_OF_BIRTH "
+
query
.
getOperator
()
+
"to_date("
+
query
.
getCondition
()
+
", 'dd/mm/yyyy')"
);
...
@@ -2047,7 +1998,7 @@ public class CustomerServiceImpl implements CustomerService {
...
@@ -2047,7 +1998,7 @@ public class CustomerServiceImpl implements CustomerService {
break
;
break
;
}
}
//
// if (query.getField() == -1) {
// if (query.getField() == -1) {
// sb.append(query.getJoin() + " C.CUSTOMER_ID " + query.getOperator() + " %" + query.getCondition() + "% ");
// sb.append(query.getJoin() + " C.CUSTOMER_ID " + query.getOperator() + " %" + query.getCondition() + "% ");
// } else if (query.getField() == -2) {
// } else if (query.getField() == -2) {
...
...
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