Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-store
Commits
02fc25fd
Commit
02fc25fd
authored
Jul 01, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店刷es代码修改
parent
36a86f44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
29 deletions
+35
-29
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+35
-29
No files found.
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
02fc25fd
...
@@ -1599,41 +1599,47 @@ public class StoreApiServiceImpl implements StoreApiService {
...
@@ -1599,41 +1599,47 @@ public class StoreApiServiceImpl implements StoreApiService {
logId
=
this
.
storeIndexLogService
.
saveStoreIndexLog
(
enterpriseId
,
storeId
);
logId
=
this
.
storeIndexLogService
.
saveStoreIndexLog
(
enterpriseId
,
storeId
);
}
}
boolean
isAdd
=
true
;
boolean
isAdd
=
true
;
DynamicSearchDTO
dynamicSearchDTO
=
new
DynamicSearchDTO
();
JSONObject
search
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"id"
,
OperateEnum
.
OPERATE_EQ
,
enterpriseId
+
"_"
+
storeId
);
try
{
dynamicSearchDTO
.
setEnterpriseId
(
com
.
gic
.
enterprise
.
constants
.
Constants
.
INDEX_ENTERPRISEID
);
DynamicSearchDTO
dynamicSearchDTO
=
new
DynamicSearchDTO
();
dynamicSearchDTO
.
setColumnCategoryCode
(
com
.
gic
.
enterprise
.
constants
.
Constants
.
ColumnCategoryCode
);
JSONObject
search
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"id"
,
OperateEnum
.
OPERATE_EQ
,
enterpriseId
+
"_"
+
storeId
);
dynamicSearchDTO
.
setSearchJson
(
search
);
dynamicSearchDTO
.
setEnterpriseId
(
com
.
gic
.
enterprise
.
constants
.
Constants
.
INDEX_ENTERPRISEID
);
ServiceResponse
<
Long
>
serviceResponse
=
this
.
esBusinessOperaApiService
.
queryDataCount
(
dynamicSearchDTO
);
dynamicSearchDTO
.
setColumnCategoryCode
(
com
.
gic
.
enterprise
.
constants
.
Constants
.
ColumnCategoryCode
);
if
(
serviceResponse
.
isSuccess
())
{
dynamicSearchDTO
.
setSearchJson
(
search
);
Long
result
=
serviceResponse
.
getResult
();
ServiceResponse
<
Long
>
serviceResponse
=
this
.
esBusinessOperaApiService
.
queryDataCount
(
dynamicSearchDTO
);
if
(
result
!=
null
)
{
if
(
serviceResponse
.
isSuccess
())
{
if
(
result
>
0
)
{
Long
result
=
serviceResponse
.
getResult
();
isAdd
=
false
;
if
(
result
!=
null
)
{
if
(
result
>
0
)
{
isAdd
=
false
;
}
}
}
}
}
}
DynamicDocDTO
docDTO
=
this
.
buildStoreDocDto
(
enterpriseId
,
storeId
);
DynamicDocDTO
docDTO
=
this
.
buildStoreDocDto
(
enterpriseId
,
storeId
);
logger
.
info
(
"写入es的门店数据:{}"
,
JSON
.
toJSONString
(
docDTO
,
true
));
logger
.
info
(
"写入es的门店数据:{}"
,
JSON
.
toJSONString
(
docDTO
,
true
));
String
message
=
"success"
;
String
message
=
"success"
;
if
(
docDTO
!=
null
)
{
if
(
docDTO
!=
null
)
{
ServiceResponse
esResponse
=
null
;
ServiceResponse
esResponse
=
null
;
if
(
isAdd
)
{
if
(
isAdd
)
{
esResponse
=
this
.
esBusinessOperaApiService
.
createDataSingle
(
docDTO
,
false
);
esResponse
=
this
.
esBusinessOperaApiService
.
createDataSingle
(
docDTO
,
false
);
}
else
{
}
else
{
esResponse
=
this
.
esBusinessOperaApiService
.
updateDataSingle
(
docDTO
,
false
);
esResponse
=
this
.
esBusinessOperaApiService
.
updateDataSingle
(
docDTO
,
false
);
}
}
logger
.
info
(
"门店写入es返回结果:{}"
,
JSON
.
toJSONString
(
esResponse
));
logger
.
info
(
"门店写入es返回结果:{}"
,
JSON
.
toJSONString
(
esResponse
));
if
(
esResponse
.
isSuccess
())
{
if
(
esResponse
.
isSuccess
())
{
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
return
esResponse
;
}
message
=
esResponse
.
getMessage
();
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
return
esResponse
;
return
EnterpriseServiceResponse
.
failure
(
esResponse
.
getCode
(),
esResponse
.
getMessage
())
;
}
}
message
=
esResponse
.
getMessage
()
;
message
=
"门店不存在"
;
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
return
EnterpriseServiceResponse
.
failure
(
esResponse
.
getCode
(),
esResponse
.
getMessage
());
}
catch
(
Exception
e
)
{
logger
.
info
(
"addStoreToIndexMq报错:{}"
,
e
.
getMessage
(),
e
);
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
"addStoreToIndexMq报错:"
+
e
.
getMessage
());
}
}
message
=
"门店不存在"
;
this
.
storeIndexLogService
.
updateStoreIndexLog
(
logId
,
message
);
return
null
;
return
null
;
}
}
...
...
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