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
eefd60b8
Commit
eefd60b8
authored
Aug 13, 2020
by
何文超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer'
parents
ea207e0a
6c04e6b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
36 deletions
+53
-36
pom.xml
pom.xml
+7
-0
AppletConfigGoodsController.java
...lug/web/controller/goods/AppletConfigGoodsController.java
+44
-36
dubbo-gic-webapp-plug.xml
src/main/resources/dubbo-gic-webapp-plug.xml
+2
-0
No files found.
pom.xml
View file @
eefd60b8
...
...
@@ -24,6 +24,7 @@
<gic-thirdparty-sdk>
4.0-SNAPSHOT
</gic-thirdparty-sdk>
<gic-redis-data>
4.0-SNAPSHOT
</gic-redis-data>
<gic-goods-api>
4.0-SNAPSHOT
</gic-goods-api>
<gic-mall-api>
4.0-SNAPSHOT
</gic-mall-api>
<gic-mall-share-api>
4.0-SNAPSHOT
</gic-mall-share-api>
<gic-member-config-api>
4.0-SNAPSHOT
</gic-member-config-api>
</properties>
...
...
@@ -160,6 +161,12 @@
<artifactId>
gic-platform-auth-api
</artifactId>
<version>
${gic-platform-auth-api}
</version>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-mall-api
</artifactId>
<version>
${gic-mall-api}
</version>
</dependency>
</dependencies>
<build>
...
...
src/main/java/com/gic/plug/web/controller/goods/AppletConfigGoodsController.java
View file @
eefd60b8
...
...
@@ -5,10 +5,11 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.goods.api.dto.GoodsCordDTO
;
import
com.gic.goods.api.dto.SpecCordDTO
;
import
com.gic.goods.api.service.CordApiService
;
import
com.gic.goods.api.service.MallGoodsBusinessApiService
;
import
com.gic.goods.api.util.Constant
;
import
com.gic.mall.api.dto.goods.MallGoodsCordDTO
;
import
com.gic.mall.api.service.MallCordApiService
;
import
com.gic.mall.base.api.enums.ErrorCodeEnums
;
import
com.gic.mall.share.api.dto.shop.ShopDTO
;
import
com.gic.mall.share.api.service.ShopApiService
;
...
...
@@ -46,6 +47,9 @@ public class AppletConfigGoodsController extends BaseGoodsController {
private
CordApiService
cordApiService
;
@Autowired
private
MallCordApiService
mallCordApiService
;
@Autowired
private
ShopApiService
shopApiService
;
@Autowired
...
...
@@ -65,7 +69,6 @@ public class AppletConfigGoodsController extends BaseGoodsController {
@RequestMapping
(
"get-mall-cord-list"
)
public
RestResponse
getMallCordList
(
String
appConfigId
,
Long
shopId
)
{
Long
areaId
=
null
;
if
(
StringUtils
.
isNotBlank
(
appConfigId
))
{
ServiceResponse
<
AppletsConfigSimpleOutputDTO
>
appServiceResponse
=
appletsConfigApiService
.
selectAppletsConfigIdByAppId
(
appConfigId
,
getEnterpriseId
());
if
(
appServiceResponse
.
getResult
()
==
null
)
{
...
...
@@ -75,15 +78,9 @@ public class AppletConfigGoodsController extends BaseGoodsController {
if
(
shopDTOServiceResponse
.
getResult
()
==
null
)
{
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
areaId
=
shopDTOServiceResponse
.
getResult
().
getAreaId
();
}
else
if
(
shopId
!=
null
)
{
ServiceResponse
<
ShopDTO
>
shopDTOServiceResponse
=
shopApiService
.
getShopDetailsById
(
shopId
,
getEnterpriseId
());
if
(
shopDTOServiceResponse
.
getResult
()
==
null
)
{
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
areaId
=
shopDTOServiceResponse
.
getResult
().
getAreaId
();
shopId
=
shopDTOServiceResponse
.
getResult
().
getId
();
}
ServiceResponse
<
List
<
SpecCordDTO
>>
listServiceResponse
=
cordApiService
.
listSpecCordDTO
(
area
Id
,
getEnterpriseId
());
ServiceResponse
<
List
<
MallGoodsCordDTO
>>
listServiceResponse
=
mallCordApiService
.
listSpecCordDTO
(
shop
Id
,
getEnterpriseId
());
return
RestResponse
.
success
(
EntityUtil
.
changeEntityListByOrika
(
MallGoodsCordVO
.
class
,
listServiceResponse
.
getResult
()));
}
...
...
@@ -102,7 +99,6 @@ public class AppletConfigGoodsController extends BaseGoodsController {
public
RestResponse
listGoodsByChannel
(
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"1"
)
Integer
currentPage
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
String
appConfigId
,
String
search
,
Long
cordId
,
Long
shopId
)
{
Long
areaId
=
null
;
if
(
StringUtils
.
isNotBlank
(
appConfigId
))
{
ServiceResponse
<
AppletsConfigSimpleOutputDTO
>
appServiceResponse
=
appletsConfigApiService
.
selectAppletsConfigIdByAppId
(
appConfigId
,
getEnterpriseId
());
if
(
appServiceResponse
.
getResult
()
==
null
)
{
...
...
@@ -113,13 +109,10 @@ public class AppletConfigGoodsController extends BaseGoodsController {
if
(
shopDTOServiceResponse
.
getResult
()
==
null
)
{
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
areaId
=
shopDTOServiceResponse
.
getResult
().
getAreaId
();
}
else
if
(
shopId
!=
null
)
{
ServiceResponse
<
ShopDTO
>
shopDTOServiceResponse
=
shopApiService
.
getShopDetailsById
(
shopId
,
getEnterpriseId
());
if
(
shopDTOServiceResponse
.
getResult
()
==
null
)
{
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
areaId
=
shopDTOServiceResponse
.
getResult
().
getAreaId
();
shopId
=
shopDTOServiceResponse
.
getResult
().
getId
();
}
if
(
shopId
==
null
)
{
return
RestResponse
.
failure
(
ErrorCodeEnums
.
MAll_ERR
.
getCode
(),
"不存在店铺"
);
}
JSONObject
cordJSON
=
null
;
if
(
cordId
!=
null
)
{
...
...
@@ -132,8 +125,8 @@ public class AppletConfigGoodsController extends BaseGoodsController {
cordJSON
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"cordId"
,
OperateEnum
.
OPERATE_CONTAIN
,
Joiner
.
on
(
" "
).
join
(
cordList
));
}
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
area
Id
,
search
,
Constant
.
CHANNEL_CODE_MALL
,
cordJSON
);
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
null
,
shop
Id
,
search
,
Constant
.
CHANNEL_CODE_MALL
,
cordJSON
,
1
);
if
(
serviceResponse
.
isSuccess
())
{
List
<
Long
>
goodsIds
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
serviceResponse
.
getResult
().
getRes
()))
{
...
...
@@ -202,8 +195,8 @@ public class AppletConfigGoodsController extends BaseGoodsController {
OperateEnum
.
OPERATE_LTE
,
endStock
,
queryObject
,
OperateEnum
.
OPERATE_AND
);
}
}
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
null
,
search
,
channelCode
,
queryObject
);
ServiceResponse
<
ESResponseQueryBatchDTO
>
serviceResponse
=
searchGoods
(
currentPage
,
pageSize
,
null
,
null
,
search
,
channelCode
,
queryObject
,
1
);
if
(
serviceResponse
.
isSuccess
())
{
return
RestResponse
.
success
(
serviceResponse
.
getResult
());
}
...
...
@@ -229,14 +222,29 @@ public class AppletConfigGoodsController extends BaseGoodsController {
}
//type 1商城本体 2商品资料
private
ServiceResponse
<
ESResponseQueryBatchDTO
>
searchGoods
(
Integer
currentPage
,
Integer
pageSize
,
Long
goodsDomainId
,
String
search
,
String
channelCode
,
JSONObject
queryObject
)
{
Long
goodsDomainId
,
Long
shopId
,
String
search
,
String
channelCode
,
JSONObject
queryObject
,
int
type
)
{
DynamicSearchDTO
searchDTO
=
new
DynamicSearchDTO
();
String
searchCode
=
""
;
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
searchCode
=
"gic_mall_goods"
;
}
else
if
(
Constant
.
CHANNEL_CODE_ERP
.
equals
(
channelCode
))
{
searchCode
=
"erp_goods"
;
JSONObject
status
=
new
JSONObject
();
if
(
type
==
1
)
{
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
searchCode
=
"gic_mall_goods"
;
}
else
if
(
Constant
.
CHANNEL_CODE_ERP
.
equals
(
channelCode
))
{
searchCode
=
"erp_goods"
;
}
}
else
if
(
type
==
2
)
{
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
searchCode
=
"gic_mall_goods_self"
;
}
if
(!
Objects
.
equals
(
Constant
.
CHANNEL_CODE_ERP
,
channelCode
))
{
status
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"status"
,
OperateEnum
.
OPERATE_EQ
,
2
);
}
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
status
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"upShelfTime"
,
OperateEnum
.
OPERATE_LTE
,
new
Date
().
getTime
()),
OperateEnum
.
OPERATE_AND
);
}
}
String
enterpriseId
=
getEnterpriseId
()
+
""
;
String
esName
=
esScreeningSearchService
.
getCurrentEsName
(
enterpriseId
,
searchCode
);
...
...
@@ -247,20 +255,20 @@ public class AppletConfigGoodsController extends BaseGoodsController {
searchDTO
.
setBegin
((
currentPage
-
1
)
*
pageSize
);
searchDTO
.
setRecordNumber
(
pageSize
);
JSONObject
jsonObject
=
null
;
JSONObject
status
=
new
JSONObject
();
if
(!
Objects
.
equals
(
Constant
.
CHANNEL_CODE_ERP
,
channelCode
))
{
status
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"status"
,
OperateEnum
.
OPERATE_EQ
,
2
);
}
if
(
Constant
.
CHANNEL_CODE_MALL
.
equals
(
channelCode
))
{
status
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"upShelfTime"
,
OperateEnum
.
OPERATE_LTE
,
new
Date
().
getTime
()),
OperateEnum
.
OPERATE_AND
);
}
if
(
goodsDomainId
==
null
)
{
if
(
shopId
==
null
&&
goodsDomainId
==
null
)
{
jsonObject
=
status
;
}
else
{
}
if
(
goodsDomainId
!=
null
)
{
jsonObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsDomainId"
,
OperateEnum
.
OPERATE_EQ
,
goodsDomainId
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
jsonObject
,
OperateEnum
.
OPERATE_AND
);
}
if
(
shopId
!=
null
)
{
jsonObject
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"shopId"
,
OperateEnum
.
OPERATE_EQ
,
shopId
);
jsonObject
=
QueryConditionAssemblyUtil
.
addQueryNodeForSiblin
(
status
,
jsonObject
,
OperateEnum
.
OPERATE_AND
);
}
if
(
StringUtils
.
isNotBlank
(
search
))
{
JSONObject
goodsCodeJson
=
QueryConditionAssemblyUtil
.
createSimpleQueryNode
(
"goodsCode"
,
OperateEnum
.
OPERATE_LIKE
,
search
);
...
...
src/main/resources/dubbo-gic-webapp-plug.xml
View file @
eefd60b8
...
...
@@ -60,4 +60,5 @@
<dubbo:reference
interface=
"com.gic.auth.service.UserResourceApiService"
id=
"userResourceApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.auth.service.ResourceApiService"
id=
"resourceApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.store.service.StoreTagApiService"
id=
"storeTagApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.mall.api.service.MallCordApiService"
id=
"mallCordApiService"
timeout=
"10000"
retries=
"0"
/>
</beans>
\ 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