Commit 4a2b0172 by 墨竹

feat:打印日志

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