Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
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-webapp-plug
Commits
9700dbf8
Commit
9700dbf8
authored
Jan 14, 2020
by
何文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品列表
parent
3319d65b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
9 deletions
+68
-9
AppletConfigGoodsController.java
...lug/web/controller/goods/AppletConfigGoodsController.java
+68
-9
No files found.
src/main/java/com/gic/plug/web/controller/goods/AppletConfigGoodsController.java
View file @
9700dbf8
...
...
@@ -75,8 +75,64 @@ public class AppletConfigGoodsController {
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
Long
areaId
=
shopDTOServiceResponse
.
getResult
().
getAreaId
();
JSONObject
cordJSON
=
null
;
if
(
cordId
!=
null
)
{
cordJSON
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"cordId"
,
OperateEnum
.
OPERATE_CONTAIN
,
search
);
}
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
areaId
,
search
,
Constant
.
CHANNEL_CODE_MALL
,
cordId
);
Constant
.
CHANNEL_CODE_MALL
,
cordJSON
);
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
return
RestResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
/**
* 商城组对内的渠道商品组件
* @param currentPage
* @param pageSize
* @param search
* @return
*/
@RequestMapping
(
"list-channel-goods-selector"
)
public
RestResponse
listGoodsChannel
(
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"1"
)
Integer
currentPage
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
String
search
,
Double
startPrice
,
Double
endPrice
,
Integer
startStock
,
Integer
endStock
,
String
channelCode
)
{
JSONObject
queryObject
=
null
;
if
(
startPrice
!=
null
)
{
queryObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsPrice"
,
OperateEnum
.
OPERATE_GTE
,
startPrice
);
}
if
(
endPrice
!=
null
)
{
if
(
queryObject
==
null
)
{
queryObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsPrice"
,
OperateEnum
.
OPERATE_LTE
,
endPrice
);
}
else
{
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
"goodsPrice"
,
OperateEnum
.
OPERATE_LTE
,
endPrice
,
queryObject
,
OperateEnum
.
OPERATE_AND
);
}
}
if
(
startStock
!=
null
)
{
if
(
queryObject
==
null
)
{
queryObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"stock"
,
OperateEnum
.
OPERATE_GTE
,
startStock
);
}
else
{
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
"stock"
,
OperateEnum
.
OPERATE_GTE
,
startStock
,
queryObject
,
OperateEnum
.
OPERATE_AND
);
}
}
if
(
endStock
!=
null
)
{
if
(
queryObject
==
null
)
{
queryObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"stock"
,
OperateEnum
.
OPERATE_GTE
,
endStock
);
}
else
{
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
"stock"
,
OperateEnum
.
OPERATE_LTE
,
endStock
,
queryObject
,
OperateEnum
.
OPERATE_AND
);
}
}
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
null
,
search
,
Constant
.
CHANNEL_CODE_MALL
,
queryObject
);
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
...
...
@@ -84,7 +140,7 @@ public class AppletConfigGoodsController {
}
private
ServiceResponse
<
ESResponseQueryBatchDTO
>
searchGoods
(
Integer
currentPage
,
Integer
pageSize
,
Long
goodsDomainId
,
String
search
,
String
channelCode
,
Long
cordId
)
{
Long
goodsDomainId
,
String
search
,
String
channelCode
,
JSONObject
queryObject
)
{
DynamicSearchDTO
searchDTO
=
new
DynamicSearchDTO
();
String
searchCode
=
""
;
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
...
...
@@ -97,10 +153,15 @@ public class AppletConfigGoodsController {
searchDTO
.
setType
(
"mapper_type"
);
searchDTO
.
setBegin
((
currentPage
-
1
)
*
pageSize
);
searchDTO
.
setRecordNumber
(
pageSize
);
JSONObject
jsonObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsDomainId"
,
OperateEnum
.
OPERATE_EQ
,
goodsDomainId
);
JSONObject
jsonObject
=
null
;
JSONObject
status
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"status"
,
OperateEnum
.
OPERATE_EQ
,
2
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
jsonObject
,
OperateEnum
.
OPERATE_EQ
);
if
(
goodsDomainId
==
null
)
{
jsonObject
=
status
;
}
else
{
jsonObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsDomainId"
,
OperateEnum
.
OPERATE_EQ
,
goodsDomainId
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
jsonObject
,
OperateEnum
.
OPERATE_EQ
);
}
if
(
StringUtils
.
isNotBlank
(
search
))
{
JSONObject
goodsCodeJson
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsCode"
,
OperateEnum
.
OPERATE_LIKE
,
search
);
...
...
@@ -112,10 +173,8 @@ public class AppletConfigGoodsController {
JSONObject
object
=
QueryConditionAssemblyUtil
.
createListQueryNode
(
jsonArray
,
OperateEnum
.
OPERATE_OR
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
object
,
jsonObject
,
OperateEnum
.
OPERATE_AND
);
}
if
(
cordId
!=
null
)
{
JSONObject
cordJSON
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"cordId"
,
OperateEnum
.
OPERATE_CONTAIN
,
search
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
cordJSON
,
jsonObject
,
OperateEnum
.
OPERATE_AND
);
if
(
queryObject
!=
null
)
{
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
queryObject
,
jsonObject
,
OperateEnum
.
OPERATE_AND
);
}
searchDTO
.
setSearchJson
(
jsonObject
);
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
esBusinessOperaApiService
.
queryDataBatch
(
searchDTO
,
...
...
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