Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
1d3e256a
Commit
1d3e256a
authored
Jan 20, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:跳过登录修改
parent
db9f4627
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
269 additions
and
261 deletions
+269
-261
ControllerException.java
.../gic/haoban/manage/web/exception/ControllerException.java
+0
-10
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+16
-7
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+248
-239
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+5
-5
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/exception/ControllerException.java
deleted
100644 → 0
View file @
db9f4627
package
com
.
gic
.
haoban
.
manage
.
web
.
exception
;
/**
* Created 2018/7/24.
*
* @author hua
*/
public
class
ControllerException
extends
Exception
{
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
1d3e256a
...
...
@@ -186,9 +186,13 @@ public class ClerkController extends WebBaseController {
}
//获取后台认证配置
@RequestMapping
(
"/get-audit-setting"
)
/**
* 会员小程序-获取后台认证配置
* @param wxEnterpriseId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"/get-audit-setting"
)
public
HaobanResponse
getAuditSetting
(
String
wxEnterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
...
@@ -200,9 +204,14 @@ public class ClerkController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
auditSettingVO
);
}
//获取后台认证配置
@RequestMapping
(
"/get-user-setting"
)
/**
* 会员小程序-获取后台认证配置
* @param wxEnterpriseId
* @param staffId
* @return
*/
@IgnoreLogin
@RequestMapping
(
"/get-user-setting"
)
public
HaobanResponse
getUserSetting
(
String
wxEnterpriseId
,
String
staffId
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
...
@@ -244,8 +253,8 @@ public class ClerkController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
auditSettingVO
);
}
@RequestMapping
(
"/get-operation-setting"
)
@IgnoreLogin
@RequestMapping
(
"/get-operation-setting"
)
public
HaobanResponse
getOperatorSetting
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
// 查询操作配置
OperationSettingDTO
dto
=
operationSettingApiService
.
getByWxEnterpriseId
(
wxEnterpriseId
);
...
...
@@ -1155,12 +1164,12 @@ public class ClerkController extends WebBaseController {
}
/**
* 外部联系人需要发送的好友
*
会员小程序-
外部联系人需要发送的好友
*
* @return
*/
@RequestMapping
(
"push-friend"
)
@IgnoreLogin
@RequestMapping
(
"push-friend"
)
public
HaobanResponse
friendList
(
String
relationKey
)
{
externalClerkRelatedApiService
.
pushExternalByRelationKey
(
relationKey
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
1d3e256a
...
...
@@ -38,138 +38,146 @@ import java.util.stream.Collectors;
@RestController
public
class
StoreController
extends
WebBaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StoreController
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StoreController
.
class
);
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
HaobanDataApiService
haobanDataApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
AuditApiService
auditApiService
;
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
@Autowired
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
StaffDepartmentRelatedApiService
staffDepartmentRelatedApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
private
HaobanDataApiService
haobanDataApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
private
AuditApiService
auditApiService
;
@Autowired
private
AuditSettingApiService
auditSettingApiService
;
@Autowired
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
StaffApiService
staffApiService
;
//门店列表
@RequestMapping
(
"/store-list"
)
@IgnoreLogin
public
HaobanResponse
storeList
(
String
staffId
,
String
wxEnterpriseId
,
String
version
)
{
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
StaffStoreVO
>
list
=
new
ArrayList
<>();
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseList
))
{
logger
.
info
(
"没有关联任何商户:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
Map
<
String
,
EnterpriseDetailDTO
>
enterpriseTypeMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getEnterpriseId
(),
dto
->
dto
));
/**
* 会员小程序-门店列表
*
* @param staffId
* @param wxEnterpriseId
* @param version
* @return
*/
@IgnoreLogin
@RequestMapping
(
"/store-list"
)
public
HaobanResponse
storeList
(
String
staffId
,
String
wxEnterpriseId
,
String
version
)
{
if
(
StringUtils
.
isAnyBlank
(
staffId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
StaffStoreVO
>
list
=
new
ArrayList
<>();
List
<
EnterpriseDetailDTO
>
enterpriseList
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseList
))
{
logger
.
info
(
"没有关联任何商户:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
Map
<
String
,
EnterpriseDetailDTO
>
enterpriseTypeMap
=
enterpriseList
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getEnterpriseId
(),
dto
->
dto
));
List
<
String
>
enterpriseIdList
=
enterpriseList
.
stream
().
map
(
EnterpriseDetailDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
enterpriseIdList
,
staffId
);
if
(
CollectionUtils
.
isEmpty
(
bindRelationList
))
{
logger
.
info
(
"没有关联任何商户导购:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//主门店
ClerkMainStoreRelatedDTO
mainDTO
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
String
storeId
=
mainDTO
==
null
?
""
:
mainDTO
.
getStoreId
();
List
<
String
>
enterpriseIdList
=
enterpriseList
.
stream
().
map
(
EnterpriseDetailDTO:
:
getEnterpriseId
).
collect
(
Collectors
.
toList
());
List
<
StaffClerkRelationDTO
>
bindRelationList
=
staffClerkRelationApiService
.
listBindCodeByStaffId
(
enterpriseIdList
,
staffId
);
if
(
CollectionUtils
.
isEmpty
(
bindRelationList
))
{
logger
.
info
(
"没有关联任何商户导购:{}"
,
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//主门店
ClerkMainStoreRelatedDTO
mainDTO
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
String
storeId
=
mainDTO
==
null
?
""
:
mainDTO
.
getStoreId
();
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
bindRelationList
)
{
boolean
enterpriseOver
=
isEnterpriseOver
(
staffClerkRelationDTO
.
getStoreId
());
if
(
enterpriseOver
)
{
logger
.
info
(
"该企业过期了:{},{},{}"
,
staffId
,
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getStoreId
());
continue
;
}
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getClerkCode
());
if
(
clerk
==
null
)
{
continue
;
}
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
if
(
store
==
null
)
{
continue
;
}
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
continue
;
}
//主门店标志
int
mainStoreFlag
=
0
;
if
(
storeId
.
equals
(
store
.
getStoreId
()))
{
mainStoreFlag
=
1
;
}
EnterpriseDetailDTO
enterpriseDetailDTO
=
enterpriseTypeMap
.
get
(
clerk
.
getEnterpriseId
());
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
StaffStoreVO
vo
=
new
StaffStoreVO
();
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setWxEnterpriseType
(
enterpriseDetailDTO
!=
null
?
enterpriseDetailDTO
.
getWxEnterpriseType
()
:
null
);
vo
.
setMemberOpenCardFlag
(
enterpriseDetailDTO
!=
null
?
enterpriseDetailDTO
.
getMemberOpenCardFlag
()
:
null
);
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkType
(
clerk
.
getClerkType
());
vo
.
setEnterpriseId
(
clerk
.
getEnterpriseId
());
vo
.
setMainStoreFlag
(
mainStoreFlag
);
vo
.
setPhoneNumber
(
clerk
.
getPhoneNumber
());
vo
.
setStaffId
(
staffId
);
vo
.
setStoreId
(
clerk
.
getStoreId
());
vo
.
setStoreImg
(
store
.
getStoreImage
());
vo
.
setStoreName
(
store
.
getStoreName
());
vo
.
setWxEnterpriseId
(
wxEnterpriseId
);
vo
.
setClerkName
(
clerk
.
getClerkName
());
vo
.
setHeadImg
(
staffDTO
.
getHeadImg
());
vo
.
setBindFlag
(
1
);
list
.
add
(
vo
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
for
(
StaffClerkRelationDTO
staffClerkRelationDTO
:
bindRelationList
)
{
boolean
enterpriseOver
=
isEnterpriseOver
(
staffClerkRelationDTO
.
getStoreId
());
if
(
enterpriseOver
)
{
logger
.
info
(
"该企业过期了:{},{},{}"
,
staffId
,
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getStoreId
());
continue
;
}
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
staffClerkRelationDTO
.
getClerkCode
());
if
(
clerk
==
null
)
{
continue
;
}
StoreDTO
store
=
storeService
.
getStore
(
clerk
.
getStoreId
());
if
(
store
==
null
)
{
continue
;
}
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
staffId
);
if
(
staffDTO
==
null
)
{
continue
;
}
//主门店标志
int
mainStoreFlag
=
0
;
if
(
storeId
.
equals
(
store
.
getStoreId
()))
{
mainStoreFlag
=
1
;
}
EnterpriseDetailDTO
enterpriseDetailDTO
=
enterpriseTypeMap
.
get
(
clerk
.
getEnterpriseId
());
staffDepartmentRelatedApiService
.
listByStaffId
(
staffId
);
StaffStoreVO
vo
=
new
StaffStoreVO
();
vo
.
setClerkCode
(
clerk
.
getClerkCode
());
vo
.
setWxEnterpriseType
(
enterpriseDetailDTO
!=
null
?
enterpriseDetailDTO
.
getWxEnterpriseType
()
:
null
);
vo
.
setMemberOpenCardFlag
(
enterpriseDetailDTO
!=
null
?
enterpriseDetailDTO
.
getMemberOpenCardFlag
()
:
null
);
vo
.
setClerkId
(
clerk
.
getClerkId
());
vo
.
setClerkType
(
clerk
.
getClerkType
());
vo
.
setEnterpriseId
(
clerk
.
getEnterpriseId
());
vo
.
setMainStoreFlag
(
mainStoreFlag
);
vo
.
setPhoneNumber
(
clerk
.
getPhoneNumber
());
vo
.
setStaffId
(
staffId
);
vo
.
setStoreId
(
clerk
.
getStoreId
());
vo
.
setStoreImg
(
store
.
getStoreImage
());
vo
.
setStoreName
(
store
.
getStoreName
());
vo
.
setWxEnterpriseId
(
wxEnterpriseId
);
vo
.
setClerkName
(
clerk
.
getClerkName
());
vo
.
setHeadImg
(
staffDTO
.
getHeadImg
());
vo
.
setBindFlag
(
1
);
list
.
add
(
vo
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
//获取首页销售数据
@RequestMapping
(
"/sale-date"
)
public
HaobanResponse
saleDate
(
String
storeId
,
String
clerkType
,
String
clerkId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerkType
,
clerkId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_111146
);
}
String
enterpriseId
=
store
.
getEnterpriseId
();
String
date
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
if
(
"0"
.
equals
(
clerkType
))
{
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDateByClerkId
(
enterpriseId
,
storeId
,
clerkId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDate
(
enterpriseId
,
storeId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
}
//获取首页销售数据
@RequestMapping
(
"/sale-date"
)
public
HaobanResponse
saleDate
(
String
storeId
,
String
clerkType
,
String
clerkId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerkType
,
clerkId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_111146
);
}
String
enterpriseId
=
store
.
getEnterpriseId
();
String
date
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
if
(
"0"
.
equals
(
clerkType
)){
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDateByClerkId
(
enterpriseId
,
storeId
,
clerkId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
HaobanDataDTO
HaobanDataDTO
=
haobanDataApiService
.
getSaleDataByDate
(
enterpriseId
,
storeId
,
date
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
HaobanDataDTO
);
}
//获取省市区
@IgnoreLogin
@RequestMapping
(
"/get-area-list"
)
public
HaobanResponse
getArea
(
Integer
type
,
String
id
)
{
if
(
type
==
null
)
{
//获取省市区
@IgnoreLogin
@RequestMapping
(
"/get-area-list"
)
public
HaobanResponse
getArea
(
Integer
type
,
String
id
)
{
if
(
type
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
ProvinceDTO
>
provinceList
=
new
ArrayList
<
ProvinceDTO
>();
List
<
CityDTO
>
cityList
=
new
ArrayList
<
CityDTO
>();
List
<
CountyDTO
>
countyList
=
new
ArrayList
<
CountyDTO
>();
List
<
ProvinceDTO
>
provinceList
=
new
ArrayList
<
ProvinceDTO
>();
List
<
CityDTO
>
cityList
=
new
ArrayList
<
CityDTO
>();
List
<
CountyDTO
>
countyList
=
new
ArrayList
<
CountyDTO
>();
switch
(
type
)
{
// 省
case
1
:
for
(
String
key
:
GlobalDictMap
.
provinceMap
.
keySet
())
{
provinceList
.
add
(
GlobalDictMap
.
provinceMap
.
get
(
key
));
}
for
(
String
key
:
GlobalDictMap
.
provinceMap
.
keySet
())
{
provinceList
.
add
(
GlobalDictMap
.
provinceMap
.
get
(
key
));
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
provinceList
);
// 市
case
2
:
...
...
@@ -182,7 +190,7 @@ public class StoreController extends WebBaseController {
}
}
for
(
String
key
:
cityMap
.
keySet
())
{
cityList
.
add
(
cityMap
.
get
(
key
));
cityList
.
add
(
cityMap
.
get
(
key
));
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
cityList
);
case
3
:
...
...
@@ -195,139 +203,140 @@ public class StoreController extends WebBaseController {
}
}
for
(
String
key
:
countyMap
.
keySet
())
{
countyList
.
add
(
countyMap
.
get
(
key
));
}
countyList
.
add
(
countyMap
.
get
(
key
));
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
countyList
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_8
);
}
//修改门店数据
@RequestMapping
(
"/change-store-detail"
)
public
HaobanResponse
changeStoreDetail
(
String
wxEnterpriseId
,
String
storeId
,
String
staffId
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
storeId
,
changeField
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
StringUtils
.
isBlank
(
oldValue
)){
oldValue
=
""
;
}
if
(
StringUtils
.
isBlank
(
newValue
)){
newValue
=
""
;
}
//增加判断是否是门店面积数字合法
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
)){
try
{
Double
.
parseDouble
(
newValue
);
}
catch
(
Exception
e
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400019
);
}
}
//门店图片修改判断
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
)){
//修改门店图片,不能为空
if
(
StringUtils
.
isBlank
(
newValue
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_400020
);
}
}
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
String
enterpriseId
=
store
.
getEnterpriseId
();
logger
.
info
(
"==================aaaa"
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
logger
.
info
(
"==================bbb"
);
//默认开启审核
int
auditFlag
=
1
;
if
(
auditSettingDTO
!=
null
){
auditFlag
=
auditSettingDTO
.
getAuditFlag
();
}
logger
.
info
(
"==================auditFlag={}"
,
auditFlag
);
if
(
auditFlag
==
1
){
//要审核
logger
.
info
(
"==================11111"
);
AuditDTO
auditDTO
=
auditApiService
.
findByStoreIdAndChangeField
(
storeId
,
changeField
);
if
(
auditDTO
==
null
){
//为空,可继续提交审核
int
i
=
auditApiService
.
save
(
1
,
wxEnterpriseId
,
enterpriseId
,
staffId
,
storeId
,
changeField
,
oldValue
,
newValue
);
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400018
);
}
}
else
{
logger
.
info
(
"==================22222"
);
auditApiService
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
//修改门店数据
@RequestMapping
(
"/change-store-detail"
)
public
HaobanResponse
changeStoreDetail
(
String
wxEnterpriseId
,
String
storeId
,
String
staffId
,
String
changeField
,
String
oldValue
,
String
newValue
)
{
if
(
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
storeId
,
changeField
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
StringUtils
.
isBlank
(
oldValue
))
{
oldValue
=
""
;
}
if
(
StringUtils
.
isBlank
(
newValue
))
{
newValue
=
""
;
}
//增加判断是否是门店面积数字合法
if
(
StoreFieldEnum
.
STORE_AREA
.
getValue
().
equals
(
changeField
))
{
try
{
Double
.
parseDouble
(
newValue
);
}
catch
(
Exception
e
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400019
);
}
}
//门店图片修改判断
if
(
StoreFieldEnum
.
STORE_IMAG
.
getValue
().
equals
(
changeField
))
{
//修改门店图片,不能为空
if
(
StringUtils
.
isBlank
(
newValue
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400020
);
}
}
//获取门店详情
@RequestMapping
(
"/store-detail"
)
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
String
enterpriseId
=
store
.
getEnterpriseId
();
logger
.
info
(
"==================aaaa"
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
logger
.
info
(
"==================bbb"
);
//默认开启审核
int
auditFlag
=
1
;
if
(
auditSettingDTO
!=
null
)
{
auditFlag
=
auditSettingDTO
.
getAuditFlag
();
}
logger
.
info
(
"==================auditFlag={}"
,
auditFlag
);
if
(
auditFlag
==
1
)
{
//要审核
logger
.
info
(
"==================11111"
);
AuditDTO
auditDTO
=
auditApiService
.
findByStoreIdAndChangeField
(
storeId
,
changeField
);
if
(
auditDTO
==
null
)
{
//为空,可继续提交审核
int
i
=
auditApiService
.
save
(
1
,
wxEnterpriseId
,
enterpriseId
,
staffId
,
storeId
,
changeField
,
oldValue
,
newValue
);
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_400018
);
}
}
else
{
logger
.
info
(
"==================22222"
);
auditApiService
.
editStoreInfo
(
storeId
,
changeField
,
oldValue
,
newValue
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//获取门店详情
@RequestMapping
(
"/store-detail"
)
public
HaobanResponse
storeDetail
(
String
enterpriseId
,
String
storeId
,
String
wxEnterpriseId
,
String
staffId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
if
(
StringUtils
.
isAnyBlank
(
storeId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
List
<
AuditDTO
>
list
=
auditApiService
.
listByStoreId
(
storeId
);
List
<
StorePhotoDTO
>
imgDTOList
=
storeService
.
getStoreImages
(
storeId
);
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
StoreDetailVO
vo
=
EntityUtil
.
changeEntity
(
StoreDetailVO
.
class
,
store
);
if
(
CollectionUtil
.
isNotEmpty
(
imgDTOList
))
{
List
<
String
>
imgList
=
imgDTOList
.
stream
().
map
(
s
->
s
.
getQcloudImageUrl
()).
collect
(
Collectors
.
toList
());
vo
.
setImgList
(
imgList
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
if
(
vo
.
getOpenTime
()!=
null
)
{
vo
.
setOpenTimeStr
(
sdf
.
format
(
vo
.
getOpenTime
()));
}
if
(
vo
.
getCloseTime
()!=
null
)
{
vo
.
setCloseTimeStr
(
sdf
.
format
(
vo
.
getCloseTime
()));
}
vo
.
setAreaId
(
store
.
getAreaId
());
vo
.
setStoreAddress
(
store
.
getFullArea
()+
" "
+
store
.
getStoreAddress
());
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
StoreDetailVO
vo
=
EntityUtil
.
changeEntity
(
StoreDetailVO
.
class
,
store
);
if
(
CollectionUtil
.
isNotEmpty
(
imgDTOList
))
{
List
<
String
>
imgList
=
imgDTOList
.
stream
().
map
(
s
->
s
.
getQcloudImageUrl
()).
collect
(
Collectors
.
toList
());
vo
.
setImgList
(
imgList
);
}
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"HH:mm"
);
if
(
vo
.
getOpenTime
()
!=
null
)
{
vo
.
setOpenTimeStr
(
sdf
.
format
(
vo
.
getOpenTime
()));
}
if
(
vo
.
getCloseTime
()
!=
null
)
{
vo
.
setCloseTimeStr
(
sdf
.
format
(
vo
.
getCloseTime
()));
}
vo
.
setAreaId
(
store
.
getAreaId
());
vo
.
setStoreAddress
(
store
.
getFullArea
()
+
" "
+
store
.
getStoreAddress
());
// StaffDepartmentRelatedDTO staffDepartmentRelatedDTO = staffDepartmentRelatedApiService.getByStaffDepartmentRelatedId(staffDepartmentRelatedId);
// vo.setClerkCode(staffDepartmentRelatedDTO.getClerkCode());
// vo.setBindFlag(StringUtils.isEmpty(staffDepartmentRelatedDTO.getClerkCode())?0:1);
vo
.
setAuditDetail
(
list
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
vo
.
setAuditFlag
(
auditSettingDTO
==
null
?
0
:
auditSettingDTO
.
getAuditFlag
());
if
(
vo
.
getStoreArea
()
==
null
||
vo
.
getStoreArea
()==-
1
)
{
vo
.
setStoreArea
(-
1
d
);
}
ClerkMainStoreRelatedDTO
mainStore
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
if
(
mainStore
!=
null
&&
mainStore
.
getStoreId
().
equals
(
storeId
))
{
vo
.
setMainStoreFlag
(
1
);
}
else
{
vo
.
setMainStoreFlag
(
0
);
}
vo
.
setAuditDetail
(
list
);
AuditSettingDTO
auditSettingDTO
=
auditSettingApiService
.
findSettingByWxEnterpriseId
(
wxEnterpriseId
);
vo
.
setAuditFlag
(
auditSettingDTO
==
null
?
0
:
auditSettingDTO
.
getAuditFlag
());
if
(
vo
.
getStoreArea
()
==
null
||
vo
.
getStoreArea
()
==
-
1
)
{
vo
.
setStoreArea
(-
1
d
);
}
ClerkMainStoreRelatedDTO
mainStore
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staffId
);
if
(
mainStore
!=
null
&&
mainStore
.
getStoreId
().
equals
(
storeId
))
{
vo
.
setMainStoreFlag
(
1
);
}
else
{
vo
.
setMainStoreFlag
(
0
);
}
WxEnterpriseRelationDetailDTO
enterpriseBindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
enterpriseId
);
if
(
null
!=
enterpriseBindInfo
)
{
vo
.
setMemberOpenCardFlag
(
enterpriseBindInfo
.
getMemberOpenCardFlag
());
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
vo
);
}
//获取门店详情
public
boolean
isEnterpriseOver
(
String
storeId
)
{
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
return
true
;
}
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
store
.
getEnterpriseId
());
if
(
enterprise
==
null
||
enterprise
.
getStatus
()
!=
1
)
{
return
true
;
}
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
return
false
;
}
else
{
return
enterprise
.
getEnabledState
()
!=
1
;
}
}
else
{
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
//获取门店详情
public
boolean
isEnterpriseOver
(
String
storeId
)
{
StoreDTO
store
=
storeService
.
getStore
(
storeId
);
if
(
store
==
null
)
{
return
true
;
}
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
store
.
getEnterpriseId
());
if
(
enterprise
==
null
||
enterprise
.
getStatus
()
!=
1
)
{
return
true
;
}
if
(
enterprise
.
getExpireTime
()
==
null
)
{
if
(
enterprise
.
getEnabledState
()
==
null
)
{
return
false
;
}
else
{
return
enterprise
.
getEnabledState
()
!=
1
;
}
}
else
{
return
enterprise
.
getExpireTime
().
getTime
()
<=
System
.
currentTimeMillis
()
||
enterprise
.
getEnabledState
()
!=
1
;
}
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
1d3e256a
...
...
@@ -246,8 +246,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
* @param qo
* @return
*/
@RequestMapping
(
"get-user-by-member-code"
)
@IgnoreLogin
@RequestMapping
(
"get-user-by-member-code"
)
public
HaobanResponse
getInfoByMemberCode
(
GetUserByMemberCodeQo
qo
)
{
WxEnterpriseDTO
enterpriseDetailDTO
=
null
;
if
(
StringUtils
.
isNotBlank
(
qo
.
getCorpId
()))
{
...
...
@@ -395,15 +395,15 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
/**
*
获取绑定信息(会员小程序用)
*
会员小程序-获取绑定信息
*
* @param externalUserid
* @param wxUserId
* @param wxEnterpriseId
* @return
*/
@RequestMapping
(
"get-send-message-info"
)
@IgnoreLogin
@RequestMapping
(
"get-send-message-info"
)
public
HaobanResponse
getMessageMember
(
String
externalUserid
,
String
wxUserId
,
String
wxEnterpriseId
,
String
gicEnterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
externalUserid
,
wxUserId
,
wxEnterpriseId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
...
...
@@ -443,7 +443,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
/**
*
绑定好友(会员小程序调用)
*
会员小程序-绑定好友
*
* @param memberId
* @param enterpriseId
...
...
@@ -451,8 +451,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
* @param relationKey
* @return
*/
@RequestMapping
(
"member-bind-friend"
)
@IgnoreLogin
@RequestMapping
(
"member-bind-friend"
)
public
HaobanResponse
memberBindFriend
(
String
memberId
,
String
enterpriseId
,
String
unionid
,
String
relationKey
)
{
if
(
StringUtils
.
isAnyBlank
(
memberId
,
enterpriseId
,
relationKey
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_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