Commit 32e0c3aa by huluobin

排版支持多个

parent ce011023
...@@ -11,9 +11,9 @@ import com.gogirl.infrastructure.mapper.store.store.StoreClassesMapper; ...@@ -11,9 +11,9 @@ import com.gogirl.infrastructure.mapper.store.store.StoreClassesMapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@Service @Service
@AllArgsConstructor @AllArgsConstructor
...@@ -26,23 +26,10 @@ public class StoreClassesServiceImpl extends ServiceImpl<StoreClassesMapper, Sto ...@@ -26,23 +26,10 @@ public class StoreClassesServiceImpl extends ServiceImpl<StoreClassesMapper, Sto
List<StoreClasses> classList = this.list(new LambdaQueryWrapper<StoreClasses>() List<StoreClasses> classList = this.list(new LambdaQueryWrapper<StoreClasses>()
.eq(StoreClasses::getDepartmentId, departmentId)); .eq(StoreClasses::getDepartmentId, departmentId));
//处理一个对应关系只返回012 Map<Integer, StoreClasses> classesMap = classList.stream().collect(Collectors.toMap(StoreClasses::getId, storeClasses -> storeClasses));
Map<Integer, Integer> map = new HashMap<>();
map.put(0, 0);
for (int i = 0; i < classList.size(); i++) {
StoreClasses item = classList.get(i);
if (item.getName().equals("早班")) {
map.put(item.getId(), 1);
} else if (item.getName().equals("晚班")) {
map.put(item.getId(), 2);
}
}
List<StoreClassesTechnician> lists = storeClassesTechnicianService.listClassesTechnicianDetail(technicianId, month); List<StoreClassesTechnician> lists = storeClassesTechnicianService.listClassesTechnicianDetail(technicianId, month);
//替换排班的class lists.forEach(item -> item.setClassesManage(classesMap.get(item.getClasses())));
for (StoreClassesTechnician item : lists) {
item.setClasses(map.get(item.getClasses()));
}
return lists; return lists;
} }
} }
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