Commit 7f6d8705 by guojuxing

兼容店长和店员登陆

parent e4c2176b
......@@ -13,6 +13,7 @@ import com.gic.clerk.api.service.PowerService;
import com.gic.commons.util.DateUtil;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.ImageUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.*;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.enterprise.api.service.StoreGroupService;
......@@ -913,6 +914,21 @@ public class StaffApiServiceImpl implements StaffApiService {
private List<String> getHaobanStoreIdsRolesByClerkIdAndStoreStatusCommon(String clerkId, String wxEnterpriseId, List<String> storeStatusList,
boolean isMustReturnStoreIdWhenSuperAdmin, Boolean addUnassignedStore) {
//兼容店长和店员登陆
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO != null) {
if (clerkDTO.getClerkType() == null || clerkDTO.getClerkType() == 0 || clerkDTO.getClerkType() == 1) {
StoreDTO storeDTO = storeService.getStore(clerkDTO.getStoreId());
if (storeDTO != null) {
List<String> storeList = new ArrayList<>();
storeList.add(storeDTO.getStoreId());
return storeList;
} else {
return Collections.singletonList("no_store");
}
}
}
if (addUnassignedStore == null) {
addUnassignedStore = false;
}
......@@ -935,7 +951,7 @@ public class StaffApiServiceImpl implements StaffApiService {
if (!needQueryStore) {
return storeIds;
}
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
StoreSearchDTO storeSearchDTO = new StoreSearchDTO() ;
storeSearchDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
if (isSuperAdminStore) {
......
......@@ -1592,16 +1592,6 @@ public class WxStaffController extends WebBaseController {
// storeRoleVO.setStoreCount(storeRoleDTO.getStoreCount());
// storeRoleVO.setStoreDTO(storeService.getStore(storeRoleDTO.getStoreId()));
StoreRoleVO storeRoleVO = new StoreRoleVO();
//兼容店长和店员登陆
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO != null) {
if (clerkDTO.getClerkType() == null || clerkDTO.getClerkType() == 0 || clerkDTO.getClerkType() == 1) {
StoreDTO storeDTO = storeService.getStore(clerkDTO.getStoreId());
storeRoleVO.setStoreCount(storeDTO == null ? 0 : 1);
storeRoleVO.setStoreDTO(storeDTO);
return RestResponse.successResult(storeRoleVO);
}
}
List<String> list = staffApiService.getNotEmptyHaobanStoreIdsRolesByClerkIdAndStoreStatus(clerkId, wxEnterpriseId,
StoreStatusFilterUtils.getStoreStatusList(storeStatusFilter), null);
storeRoleVO.setStoreCount(list.contains("no_store") ? 0 : list.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment