Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-platform-enterprise
Commits
449b793a
Commit
449b793a
authored
Apr 24, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微盟店铺列表查询调整
parent
048f9328
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
245 additions
and
14 deletions
+245
-14
WmStoreConfigTypeEnum.java
...va/com/gic/enterprise/constant/WmStoreConfigTypeEnum.java
+23
-6
WmStoreApiService.java
...in/java/com/gic/enterprise/service/WmStoreApiService.java
+13
-1
TabWmStoreConfigMapper.java
...com/gic/enterprise/dao/mapper/TabWmStoreConfigMapper.java
+5
-0
WmStoreConfigService.java
...java/com/gic/enterprise/service/WmStoreConfigService.java
+5
-1
WmStoreConfigServiceImpl.java
...gic/enterprise/service/impl/WmStoreConfigServiceImpl.java
+6
-0
WmStoreApiServiceImpl.java
.../enterprise/service/outer/impl/WmStoreApiServiceImpl.java
+20
-2
TabWmStoreConfigMapper.xml
...vice/src/main/resources/mapper/TabWmStoreConfigMapper.xml
+9
-0
WmMallStoreController.java
...c/enterprise/web/controller/wm/WmMallStoreController.java
+39
-4
WmStoreVO.java
...src/main/java/com/gic/enterprise/web/vo/wm/WmStoreVO.java
+125
-0
No files found.
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/constant/WmStoreConfigTypeEnum.java
View file @
449b793a
...
...
@@ -8,12 +8,20 @@ package com.gic.enterprise.constant;
* @date 2019/11/25 2:42 PM
*/
public
enum
WmStoreConfigTypeEnum
{
MEMBER_CARD_CONFIG
(
1
,
"会员卡配置"
),
COUPON_CONFIG
(
2
,
"卡券配置"
),
ORDER_CONFIG
(
3
,
"订单配置"
),
GOODS_CONFIG
(
4
,
"商品配置"
);
MEMBER_CARD_CONFIG
(
1
,
"会员卡配置"
,
true
),
COUPON_CONFIG
(
2
,
"卡券配置"
,
true
),
ORDER_CONFIG
(
3
,
"订单配置"
,
true
),
GOODS_CONFIG
(
4
,
"商品配置"
,
true
),
INTEGRAL_CONFIG
(
5
,
"积分配置"
,
false
),
STORE_CLERK_CONFIG
(
6
,
"门店导购同步"
,
false
);
private
int
code
;
private
String
message
;
/**
* 是否是需要保存在tab_wm_store_config的数据
* 其他数据需要额外表
*/
private
boolean
hasConfigData
;
/**
* 是否是枚举内的code值
...
...
@@ -25,7 +33,7 @@ public enum WmStoreConfigTypeEnum {
return
false
;
}
for
(
WmStoreConfigTypeEnum
typeEnum
:
values
())
{
if
(
code
.
intValue
()
==
typeEnum
.
getCode
())
{
if
(
typeEnum
.
hasConfigData
&&
code
.
intValue
()
==
typeEnum
.
getCode
())
{
return
true
;
}
}
...
...
@@ -43,9 +51,10 @@ public enum WmStoreConfigTypeEnum {
return
"--"
;
}
private
WmStoreConfigTypeEnum
(
int
code
,
String
message
)
{
private
WmStoreConfigTypeEnum
(
int
code
,
String
message
,
boolean
hasConfigData
)
{
this
.
code
=
code
;
this
.
message
=
message
;
this
.
hasConfigData
=
hasConfigData
;
}
public
int
getCode
()
{
...
...
@@ -64,4 +73,12 @@ public enum WmStoreConfigTypeEnum {
this
.
message
=
message
;
}
public
boolean
isHasConfigData
()
{
return
hasConfigData
;
}
public
WmStoreConfigTypeEnum
setHasConfigData
(
boolean
hasConfigData
)
{
this
.
hasConfigData
=
hasConfigData
;
return
this
;
}
}
gic-platform-enterprise-api/src/main/java/com/gic/enterprise/service/WmStoreApiService.java
View file @
449b793a
...
...
@@ -7,6 +7,8 @@ import com.gic.enterprise.dto.WmStoreDTO;
import
com.gic.enterprise.dto.wm.WmStoreConfigDTO
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 微盟商城店铺
...
...
@@ -67,8 +69,18 @@ public interface WmStoreApiService {
* @Description:
* @author guojuxing
* @param wmMainAccount
* @param wmStoreConfigType 店铺配置类型
1:会员卡配置 2:卡券配置 3:订单配置 4:积分配置 5:商品同步记录 6:小程序配置 WmStoreConfigTypeEnum
枚举类
* @param wmStoreConfigType 店铺配置类型
WmStoreConfigTypeEnum
枚举类
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.wm.WmStoreConfigDTO>
*/
ServiceResponse
<
WmStoreConfigDTO
>
getWmStoreConfigByWmMainAccount
(
String
wmMainAccount
,
Integer
wmStoreConfigType
);
/**
* 查询店铺配置 key : 配置类型 WmStoreConfigTypeEnum 枚举类
* @Title: getWmStoreConfigByWmMainAccount
* @Description:
* @author guojuxing
* @param wmMainAccount
* @return com.gic.api.base.commons.ServiceResponse<java.util.Set<String>>
*/
ServiceResponse
<
Set
<
String
>>
getWmStoreConfigByWmMainAccount
(
String
wmMainAccount
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/dao/mapper/TabWmStoreConfigMapper.java
View file @
449b793a
...
...
@@ -3,6 +3,8 @@ package com.gic.enterprise.dao.mapper;
import
com.gic.enterprise.entity.TabWmStoreConfig
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
TabWmStoreConfigMapper
{
/**
* 根据主键删除
...
...
@@ -53,4 +55,6 @@ public interface TabWmStoreConfigMapper {
int
updateByPrimaryKey
(
TabWmStoreConfig
record
);
TabWmStoreConfig
getByWmMainAccount
(
@Param
(
"wmMainAccount"
)
String
wmMainAccount
,
@Param
(
"storeConfigType"
)
Integer
storeConfigType
);
List
<
TabWmStoreConfig
>
listWmStoreConfigByWmMainAccount
(
String
wmMainAccount
);
}
\ No newline at end of file
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/WmStoreConfigService.java
View file @
449b793a
...
...
@@ -3,6 +3,8 @@ package com.gic.enterprise.service;
import
com.gic.enterprise.dto.wm.WmStoreConfigDTO
;
import
com.gic.enterprise.entity.TabWmStoreConfig
;
import
java.util.List
;
public
interface
WmStoreConfigService
{
/**
...
...
@@ -23,8 +25,10 @@ public interface WmStoreConfigService {
* @Description:
* @author guojuxing
* @param wmMainAccount
* @param storeConfigType 店铺配置类型
1:会员卡配置 2:卡券配置 3:订单配置 4:积分配置 5:商品同步记录 6:小程序配置
WmStoreConfigTypeEnum枚举类
* @param storeConfigType 店铺配置类型 WmStoreConfigTypeEnum枚举类
* @return com.gic.enterprise.entity.TabWmStoreConfig
*/
TabWmStoreConfig
getByWmMainAccount
(
String
wmMainAccount
,
Integer
storeConfigType
);
List
<
TabWmStoreConfig
>
listWmStoreConfigByWmMainAccount
(
String
wmMainAccount
);
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/impl/WmStoreConfigServiceImpl.java
View file @
449b793a
...
...
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
(
"wmStoreConfigService"
)
public
class
WmStoreConfigServiceImpl
implements
WmStoreConfigService
{
...
...
@@ -37,4 +38,9 @@ public class WmStoreConfigServiceImpl implements WmStoreConfigService{
public
TabWmStoreConfig
getByWmMainAccount
(
String
wmMainAccount
,
Integer
storeConfigType
)
{
return
tabWmStoreConfigMapper
.
getByWmMainAccount
(
wmMainAccount
,
storeConfigType
);
}
@Override
public
List
<
TabWmStoreConfig
>
listWmStoreConfigByWmMainAccount
(
String
wmMainAccount
)
{
return
tabWmStoreConfigMapper
.
listWmStoreConfigByWmMainAccount
(
wmMainAccount
);
}
}
gic-platform-enterprise-service/src/main/java/com/gic/enterprise/service/outer/impl/WmStoreApiServiceImpl.java
View file @
449b793a
package
com
.
gic
.
enterprise
.
service
.
outer
.
impl
;
import
java.util.
List
;
import
java.util.
Optional
;
import
java.util.
*
;
import
java.util.
stream.Collectors
;
import
com.gic.commons.util.StringUtil
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -115,6 +115,24 @@ public class WmStoreApiServiceImpl implements WmStoreApiService {
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
WmStoreConfigDTO
.
class
,
record
));
}
@Override
public
ServiceResponse
<
Set
<
String
>>
getWmStoreConfigByWmMainAccount
(
String
wmMainAccount
)
{
Set
<
String
>
result
;
List
<
TabWmStoreConfig
>
wmStoreConfigList
=
wmStoreConfigService
.
listWmStoreConfigByWmMainAccount
(
wmMainAccount
);
//基本配置
result
=
Optional
.
ofNullable
(
wmStoreConfigList
).
orElse
(
new
ArrayList
<>())
.
stream
()
.
map
(
e
->
e
.
getStoreConfigType
().
toString
())
.
collect
(
Collectors
.
toSet
());
//积分配置查询会员组接口,默认已配置
result
.
add
(
String
.
valueOf
(
WmStoreConfigTypeEnum
.
INTEGRAL_CONFIG
.
getCode
()));
//todo 查询是否有门店导购同步记录
result
.
add
(
String
.
valueOf
(
WmStoreConfigTypeEnum
.
STORE_CLERK_CONFIG
.
getCode
()));
return
ServiceResponse
.
success
(
result
);
}
private
ServiceResponse
validWmMemberCardConfig
(
WmMemberCardConfigDTO
dto
)
{
if
(
dto
.
getEnterpriseId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"商户ID不能为空"
);
...
...
gic-platform-enterprise-service/src/main/resources/mapper/TabWmStoreConfigMapper.xml
View file @
449b793a
...
...
@@ -134,4 +134,12 @@
and status = 1
and store_config_type = #{storeConfigType}
</select>
<select
id=
"listWmStoreConfigByWmMainAccount"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
></include>
from tab_wm_store_config
where wm_main_account = #{wmMainAccount}
and status = 1
order by store_config_type
</select>
</mapper>
\ No newline at end of file
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/controller/wm/WmMallStoreController.java
View file @
449b793a
package
com
.
gic
.
enterprise
.
web
.
controller
.
wm
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.web.vo.wm.WmStoreDetailVO
;
import
com.gic.enterprise.web.vo.wm.WmStoreVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -44,13 +51,39 @@ public class WmMallStoreController {
@RequestMapping
(
"/get-wm-store-detail"
)
public
RestResponse
getDetail
(
Integer
wmMallStoreId
)
{
return
ResultControllerUtils
.
commonResultOne
(
wmStoreApiService
.
getWmStoreByWmMallStoreId
(
wmMallStoreId
),
WmStoreDetailVO
.
class
);
return
ResultControllerUtils
.
commonResultOne
(
wmStoreApiService
.
getWmStoreByWmMallStoreId
(
wmMallStoreId
),
WmStoreDetailVO
.
class
);
}
@RequestMapping
(
"/list-wm-store"
)
public
RestResponse
listWmStore
()
{
return
ResultControllerUtils
.
commonResult
(
wmStoreApiService
.
listWmStore
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
()));
ServiceResponse
<
List
<
WmStoreDTO
>>
listResponse
=
wmStoreApiService
.
listWmStore
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
listResponse
.
isSuccess
())
{
List
<
WmStoreDTO
>
list
=
listResponse
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
List
<
WmStoreVO
>
voList
=
list
.
stream
()
.
map
(
e
->
{
WmStoreVO
vo
=
EntityUtil
.
changeEntityNew
(
WmStoreVO
.
class
,
e
);
ServiceResponse
<
Set
<
String
>>
configSet
=
wmStoreApiService
.
getWmStoreConfigByWmMainAccount
(
e
.
getWmMainAccount
());
if
(
configSet
.
isSuccess
())
{
Set
<
String
>
set
=
configSet
.
getResult
();
if
(
set
.
contains
(
String
.
valueOf
(
WmStoreConfigTypeEnum
.
COUPON_CONFIG
.
getCode
())))
{
vo
.
setHasBindCoupon
(
1
);
}
boolean
isAllConfig
=
Stream
.
of
(
WmStoreConfigTypeEnum
.
values
())
.
allMatch
(
configType
->
set
.
contains
(
String
.
valueOf
(
configType
.
getCode
())));
if
(
isAllConfig
){
vo
.
setHasCompleteConfig
(
1
);
}
}
return
vo
;
})
.
collect
(
Collectors
.
toList
());
return
RestResponse
.
success
(
voList
);
}
}
return
RestResponse
.
failure
(
listResponse
.
getCode
(),
listResponse
.
getMessage
());
}
/**
...
...
@@ -81,7 +114,9 @@ public class WmMallStoreController {
public
RestResponse
listWmStoreConfig
()
{
Map
<
String
,
String
>
result
=
new
HashMap
<>(
16
);
for
(
WmStoreConfigTypeEnum
modeEnum
:
WmStoreConfigTypeEnum
.
values
())
{
result
.
put
(
String
.
valueOf
(
modeEnum
.
getCode
()),
modeEnum
.
getMessage
());
if
(
modeEnum
.
isHasConfigData
())
{
result
.
put
(
String
.
valueOf
(
modeEnum
.
getCode
()),
modeEnum
.
getMessage
());
}
}
return
RestResponse
.
success
(
result
);
}
...
...
gic-platform-enterprise-web/src/main/java/com/gic/enterprise/web/vo/wm/WmStoreVO.java
0 → 100644
View file @
449b793a
package
com
.
gic
.
enterprise
.
web
.
vo
.
wm
;
import
java.io.Serializable
;
/**
* 微盟店铺列表
* @ClassName: WmStoreVO
* @Description:
* @author guojuxing
* @date 2020/4/24 2:33 PM
*/
public
class
WmStoreVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
8992915235298409360L
;
/**
* 微盟主账号
*/
private
String
wmMainAccount
;
/**
* 微盟pid
*/
private
String
wmPid
;
/**
* 微盟store_id
*/
private
String
wmStoreId
;
/**
* 店铺名称
*/
private
String
wmPidName
;
/**
* 商城模式 1:微商城模式 2:智慧零售模式
*/
private
Integer
mallMode
;
/**
* 授权状态 0:未授权 1:已授权
*/
private
Integer
authStatus
;
/**
* 是否已经绑定过卡券 1:是
*/
private
Integer
hasBindCoupon
;
/**
* 是否应配置完成 1:是
*/
private
Integer
hasCompleteConfig
;
public
String
getWmMainAccount
()
{
return
wmMainAccount
;
}
public
WmStoreVO
setWmMainAccount
(
String
wmMainAccount
)
{
this
.
wmMainAccount
=
wmMainAccount
;
return
this
;
}
public
String
getWmPid
()
{
return
wmPid
;
}
public
WmStoreVO
setWmPid
(
String
wmPid
)
{
this
.
wmPid
=
wmPid
;
return
this
;
}
public
String
getWmStoreId
()
{
return
wmStoreId
;
}
public
WmStoreVO
setWmStoreId
(
String
wmStoreId
)
{
this
.
wmStoreId
=
wmStoreId
;
return
this
;
}
public
String
getWmPidName
()
{
return
wmPidName
;
}
public
WmStoreVO
setWmPidName
(
String
wmPidName
)
{
this
.
wmPidName
=
wmPidName
;
return
this
;
}
public
Integer
getAuthStatus
()
{
return
authStatus
;
}
public
WmStoreVO
setAuthStatus
(
Integer
authStatus
)
{
this
.
authStatus
=
authStatus
;
return
this
;
}
public
Integer
getHasBindCoupon
()
{
return
hasBindCoupon
;
}
public
WmStoreVO
setHasBindCoupon
(
Integer
hasBindCoupon
)
{
this
.
hasBindCoupon
=
hasBindCoupon
;
return
this
;
}
public
Integer
getHasCompleteConfig
()
{
return
hasCompleteConfig
;
}
public
WmStoreVO
setHasCompleteConfig
(
Integer
hasCompleteConfig
)
{
this
.
hasCompleteConfig
=
hasCompleteConfig
;
return
this
;
}
public
Integer
getMallMode
()
{
return
mallMode
;
}
public
WmStoreVO
setMallMode
(
Integer
mallMode
)
{
this
.
mallMode
=
mallMode
;
return
this
;
}
}
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