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
9f02f523
Commit
9f02f523
authored
Sep 23, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:查询数量接口调整
parent
06ff44cc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
20 deletions
+102
-20
StoreRoleDTO.java
...java/com/gic/haoban/manage/api/dto/role/StoreRoleDTO.java
+29
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+16
-12
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+1
-1
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+7
-3
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+16
-3
StoreRoleVO.java
...c/main/java/com/gic/haoban/manage/web/vo/StoreRoleVO.java
+31
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/role/StoreRoleDTO.java
0 → 100644
View file @
9f02f523
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
role
;
import
java.io.Serializable
;
/**
* @author xuwenqian
* @date 2022/9/23 4:57 下午
*/
public
class
StoreRoleDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
598102622663116081L
;
private
Integer
storeCount
;
private
String
storeId
;
public
Integer
getStoreCount
()
{
return
storeCount
;
}
public
void
setStoreCount
(
Integer
storeCount
)
{
this
.
storeCount
=
storeCount
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
9f02f523
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
...
@@ -4,6 +4,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
import
java.util.List
;
import
java.util.List
;
...
@@ -269,6 +270,6 @@ public interface StaffApiService {
...
@@ -269,6 +270,6 @@ public interface StaffApiService {
* @param clerkId 职员id
* @param clerkId 职员id
* @return int
* @return int
*/
*/
int
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
StoreRoleDTO
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
9f02f523
...
@@ -23,6 +23,7 @@ import com.gic.haoban.common.utils.PageUtil;
...
@@ -23,6 +23,7 @@ import com.gic.haoban.common.utils.PageUtil;
import
com.gic.haoban.common.utils.RolesListUtils
;
import
com.gic.haoban.common.utils.RolesListUtils
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.common.utils.UuidUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
...
@@ -908,20 +909,23 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -908,20 +909,23 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
@Override
@Override
public
int
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
)
{
public
StoreRoleDTO
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
,
String
wxEnterpriseId
)
{
ClerkDTO
clerkDTO
=
clerkService
.
getClerkByClerkId
(
clerkId
);
List
<
String
>
storeIds
=
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
wxEnterpriseId
);
if
(
clerkDTO
==
null
)
{
StoreRoleDTO
storeRoleDTO
=
new
StoreRoleDTO
();
logger
.
info
(
"导购不存在:clerkId:{}"
,
clerkId
);
if
(
CollectionUtils
.
isEmpty
(
storeIds
))
{
return
0
;
storeRoleDTO
.
setStoreCount
(
0
);
}
return
storeRoleDTO
;
String
enterpriseId
=
clerkDTO
.
getEnterpriseId
();
int
haobanStoreCount
=
storeRangeService
.
getCountStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
if
(
haobanStoreCount
==
0
)
{
logger
.
info
(
"好办门店空,eid={}"
,
enterpriseId
);
return
0
;
}
}
if
(
storeIds
.
contains
(
"-1"
))
{
int
gicStoreCount
=
storeWidgetService
.
getClerkWidgetStore
(
clerkId
);
int
gicStoreCount
=
storeWidgetService
.
getClerkWidgetStore
(
clerkId
);
return
Math
.
min
(
haobanStoreCount
,
gicStoreCount
);
storeRoleDTO
.
setStoreCount
(
gicStoreCount
);
}
int
size
=
storeIds
.
size
();
storeRoleDTO
.
setStoreCount
(
size
);
if
(
size
==
1
)
{
storeRoleDTO
.
setStoreId
(
storeIds
.
get
(
0
));
}
return
storeRoleDTO
;
}
}
/**
/**
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
9f02f523
...
@@ -266,7 +266,7 @@ public class StaffController extends WebBaseController {
...
@@ -266,7 +266,7 @@ public class StaffController extends WebBaseController {
}
}
}
}
if
(
dto
.
getManageFlag
()
!=
null
&&
dto
.
getManageFlag
()
==
1
)
{
if
(
dto
.
getManageFlag
()
!=
null
&&
dto
.
getManageFlag
()
==
1
)
{
dto
.
setManageStoreCount
(
staffApiService
.
getCountHaoBanStoreIdsByClerkId
(
dto
.
getClerkId
(),
staff
.
getWxEnterpriseId
()));
dto
.
setManageStoreCount
(
staffApiService
.
getCountHaoBanStoreIdsByClerkId
(
dto
.
getClerkId
(),
staff
.
getWxEnterpriseId
())
.
getStoreCount
()
);
}
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
9f02f523
...
@@ -29,6 +29,7 @@ import com.gic.haoban.common.utils.HaobanResponse;
...
@@ -29,6 +29,7 @@ import com.gic.haoban.common.utils.HaobanResponse;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.role.HaobanRoleDTO
;
import
com.gic.haoban.manage.api.dto.role.HaobanRoleDTO
;
import
com.gic.haoban.manage.api.dto.role.StoreRoleDTO
;
import
com.gic.haoban.manage.api.enums.*
;
import
com.gic.haoban.manage.api.enums.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.role.HaobanRoleApiService
;
import
com.gic.haoban.manage.api.service.role.HaobanRoleApiService
;
...
@@ -1275,9 +1276,12 @@ public class ClerkController extends WebBaseController {
...
@@ -1275,9 +1276,12 @@ public class ClerkController extends WebBaseController {
* @return
* @return
*/
*/
@RequestMapping
(
value
=
"/getCountHaoBanStoreIdsByClerkId"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getCountHaoBanStoreIdsByClerkId"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
Integer
>
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
)
{
public
RestResponse
<
StoreRoleVO
>
getCountHaoBanStoreIdsByClerkId
(
String
clerkId
)
{
int
count
=
staffApiService
.
getCountHaoBanStoreIdsByClerkId
(
clerkId
,
this
.
getLoginUser
().
getWxEnterpriseId
());
StoreRoleDTO
storeRoleDTO
=
staffApiService
.
getCountHaoBanStoreIdsByClerkId
(
clerkId
,
this
.
getLoginUser
().
getWxEnterpriseId
());
return
RestResponse
.
successResult
(
count
);
StoreRoleVO
storeRoleVO
=
new
StoreRoleVO
();
storeRoleVO
.
setStoreCount
(
storeRoleDTO
.
getStoreCount
());
storeRoleVO
.
setStoreDTO
(
storeService
.
getStore
(
storeRoleDTO
.
getStoreId
()));
return
RestResponse
.
successResult
(
storeRoleVO
);
}
}
/**
/**
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
9f02f523
...
@@ -65,6 +65,13 @@ public class StoreController extends WebBaseController {
...
@@ -65,6 +65,13 @@ public class StoreController extends WebBaseController {
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
/**
* 好办小程序-绑定的门店列表
* @param staffId
* @param wxEnterpriseId
* @param gicEnterpriseId
* @return
*/
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"/store-list"
)
@RequestMapping
(
"/store-list"
)
public
HaobanResponse
storeList
(
String
staffId
,
String
wxEnterpriseId
,
String
gicEnterpriseId
)
{
public
HaobanResponse
storeList
(
String
staffId
,
String
wxEnterpriseId
,
String
gicEnterpriseId
)
{
...
@@ -166,11 +173,17 @@ public class StoreController extends WebBaseController {
...
@@ -166,11 +173,17 @@ public class StoreController extends WebBaseController {
//获取首页销售数据
//获取首页销售数据
@RequestMapping
(
"/sale-date"
)
@RequestMapping
(
"/sale-date"
)
public
HaobanResponse
saleDate
(
String
storeId
,
String
clerkType
,
String
clerkId
,
String
enterpriseId
,
List
<
String
>
storeIds
)
{
public
HaobanResponse
saleDate
(
String
storeId
,
Integer
clerkType
,
String
clerkId
,
String
enterpriseId
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerk
Type
,
clerk
Id
))
{
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerkId
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
if
(
StringUtils
.
isNotBlank
(
storeId
))
{
List
<
String
>
storeIds
=
new
ArrayList
<>();
if
(
clerkType
==
2
)
{
List
<
String
>
haobanStoreIds
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
clerkId
,
this
.
getLoginUser
().
getWxEnterpriseId
());
if
(!
haobanStoreIds
.
contains
(
"-1"
))
{
storeIds
.
addAll
(
haobanStoreIds
);
}
}
else
{
storeIds
.
add
(
storeId
);
storeIds
.
add
(
storeId
);
}
}
String
date
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
String
date
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/StoreRoleVO.java
0 → 100644
View file @
9f02f523
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
java.io.Serializable
;
/**
* @author xuwenqian
* @date 2022/9/23 4:57 下午
*/
public
class
StoreRoleVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
598102622663116081L
;
private
Integer
storeCount
;
private
StoreDTO
storeDTO
;
public
Integer
getStoreCount
()
{
return
storeCount
;
}
public
void
setStoreCount
(
Integer
storeCount
)
{
this
.
storeCount
=
storeCount
;
}
public
StoreDTO
getStoreDTO
()
{
return
storeDTO
;
}
public
void
setStoreDTO
(
StoreDTO
storeDTO
)
{
this
.
storeDTO
=
storeDTO
;
}
}
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