Commit 4a2b0172 by 墨竹

feat:打印日志

parent e40352fc
...@@ -210,14 +210,14 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -210,14 +210,14 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public Page<StaffDTO> pageStaff(List<String> departmentIds, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag,String wxEnterpriseId) { public Page<StaffDTO> pageStaff(List<String> departmentIds, Integer activeFlag, String keyword, BasePageInfo pageInfo, Integer relationFlag, String wxEnterpriseId) {
List<String> staffIds = new ArrayList<>(); List<String> staffIds = new ArrayList<>();
if (relationFlag != null) { if (relationFlag != null) {
List<TabHaobanStaffClerkRelation> relationList = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId); List<TabHaobanStaffClerkRelation> relationList = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
staffIds = relationList.stream().map(TabHaobanStaffClerkRelation::getStaffId).collect(Collectors.toList()); staffIds = relationList.stream().map(TabHaobanStaffClerkRelation::getStaffId).collect(Collectors.toList());
} }
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize()); PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
Page<StaffDTO> page = PageUtil.changePageHelperToCurrentPage(staffService.pageStaff(staffIds, activeFlag, keyword,departmentIds,wxEnterpriseId,relationFlag),StaffDTO.class); Page<StaffDTO> page = PageUtil.changePageHelperToCurrentPage(staffService.pageStaff(staffIds, activeFlag, keyword, departmentIds, wxEnterpriseId, relationFlag), StaffDTO.class);
List<StaffDTO> staffDTOList = page.getResult(); List<StaffDTO> staffDTOList = page.getResult();
if (CollectionUtils.isEmpty(staffDTOList)) { if (CollectionUtils.isEmpty(staffDTOList)) {
return new Page<>(); return new Page<>();
...@@ -1206,24 +1206,24 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1206,24 +1206,24 @@ public class StaffApiServiceImpl implements StaffApiService {
this.addDepartInfo(list); this.addDepartInfo(list);
return list; return list;
} }
private void addDepartInfo(List<StaffDTO> list) { private void addDepartInfo(List<StaffDTO> list) {
List<String> staffIdList = list.stream().map(dto->dto.getStaffId()).collect(Collectors.toList()) ; List<String> staffIdList = list.stream().map(dto -> dto.getStaffId()).collect(Collectors.toList());
List<TabHaobanStaffDepartmentRelated> deplist = staffDepartmentRelatedMapper.listStaffDepartmentByStaffIds(staffIdList); List<TabHaobanStaffDepartmentRelated> deplist = staffDepartmentRelatedMapper.listStaffDepartmentByStaffIds(staffIdList);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
Map<String, List<TabHaobanStaffDepartmentRelated>> map = deplist.stream().collect(Collectors.groupingBy(TabHaobanStaffDepartmentRelated::getStaffId)) ; Map<String, List<TabHaobanStaffDepartmentRelated>> map = deplist.stream().collect(Collectors.groupingBy(TabHaobanStaffDepartmentRelated::getStaffId));
List<String> depIdList = deplist.stream().map(dto->dto.getDepartmentId()).collect(Collectors.toList()) ; List<String> depIdList = deplist.stream().map(dto -> dto.getDepartmentId()).collect(Collectors.toList());
List<DepartmentDTO> departmentList = this.departmentService.listByIds(depIdList); List<DepartmentDTO> departmentList = this.departmentService.listByIds(depIdList);
Map<String,DepartmentDTO> depMap = departmentList.stream().collect(Collectors.toMap(DepartmentDTO::getDepartmentId, dto->dto,(k1,k2)->k1)) ; Map<String, DepartmentDTO> depMap = departmentList.stream().collect(Collectors.toMap(DepartmentDTO::getDepartmentId, dto -> dto, (k1, k2) -> k1));
for(StaffDTO dto : list) { for (StaffDTO dto : list) {
String staffId = dto.getStaffId() ; String staffId = dto.getStaffId();
List<TabHaobanStaffDepartmentRelated> relateList = map.get(staffId) ; List<TabHaobanStaffDepartmentRelated> relateList = map.get(staffId);
if(CollectionUtils.isNotEmpty(relateList)) { if (CollectionUtils.isNotEmpty(relateList)) {
List<DepartmentDTO> staffDepList = new ArrayList<>(); List<DepartmentDTO> staffDepList = new ArrayList<>();
for(TabHaobanStaffDepartmentRelated item :relateList) { for (TabHaobanStaffDepartmentRelated item : relateList) {
if(null != depMap.get(item.getDepartmentId())) { if (null != depMap.get(item.getDepartmentId())) {
staffDepList.add(depMap.get(item.getDepartmentId())) ; staffDepList.add(depMap.get(item.getDepartmentId()));
} }
} }
dto.setDepartmentList(staffDepList); dto.setDepartmentList(staffDepList);
...@@ -1309,6 +1309,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1309,6 +1309,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return Collections.emptyList(); return Collections.emptyList();
} }
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getWxEnterpriseId()); List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getWxEnterpriseId());
logger.info("好办门店id:{}", JSON.toJSONString(enterpriseIdStoreIds));
Integer superManagerFlag = staff.getSuperManagerFlag(); Integer superManagerFlag = staff.getSuperManagerFlag();
//超管 //超管
if (superManagerFlag != null && superManagerFlag == 1) { if (superManagerFlag != null && superManagerFlag == 1) {
...@@ -1325,7 +1326,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1325,7 +1326,9 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
//取交集 //取交集
Sets.SetView<String> intersection = Sets.intersection(Sets.newHashSet(enterpriseIdStoreIds), Sets.newHashSet(gicStoreIds)); Sets.SetView<String> intersection = Sets.intersection(Sets.newHashSet(enterpriseIdStoreIds), Sets.newHashSet(gicStoreIds));
return intersection.stream().collect(Collectors.toList()); List<String> storeList = intersection.stream().collect(Collectors.toList());
logger.info("该导购权限:clerkId:{},门店:{}", clerkId, JSON.toJSONString(storeList));
return storeList;
} }
@Override @Override
...@@ -1344,7 +1347,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -1344,7 +1347,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override @Override
public boolean isFlagByStoreIdAndEnterpriseId(String storeId, String enterpriseId, String wxEnterpriseId) { public boolean isFlagByStoreIdAndEnterpriseId(String storeId, String enterpriseId, String wxEnterpriseId) {
List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId ,enterpriseId); List<String> enterpriseIdStoreIds = storeRangeService.listStoreIdByWxEnterpriseId(wxEnterpriseId, enterpriseId);
if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) { if (CollectionUtils.isEmpty(enterpriseIdStoreIds)) {
return false; return false;
} }
......
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