Commit 085f1aea by 刘鑫

feat: 容量返回类型支持根据分部配置返回

1 parent 53cbc50b
......@@ -44,6 +44,12 @@ public class OrgBranchEntity {
private String memo;
/**
* 容量类型,0:返回所有类型 1:只返全天, 2:返全天/半天
*/
@Column(name = "capacity_type", nullable = false)
private Integer capacityType = 0;
private LocalDateTime createTime = LocalDateTime.now();
......
......@@ -15,6 +15,7 @@ import com.dituhui.pea.order.dao.EngineerInfoDao;
import com.dituhui.pea.order.dao.EngineerSkillDao;
import com.dituhui.pea.order.dao.EngineerSliceUsedCapacityDao;
import com.dituhui.pea.order.dao.MapBlockInfoDao;
import com.dituhui.pea.order.dao.OrgBranchDao;
import com.dituhui.pea.order.dao.OrgTeamDao;
import com.dituhui.pea.order.dao.SkillInfoDao;
import com.dituhui.pea.order.dao.TimeSliceDao;
......@@ -26,6 +27,7 @@ import com.dituhui.pea.order.entity.CapacityEngineerStatEntity;
import com.dituhui.pea.order.entity.EngineerInfoEntity;
import com.dituhui.pea.order.entity.EngineerSkillEntity;
import com.dituhui.pea.order.entity.MapBlockInfoEntity;
import com.dituhui.pea.order.entity.OrgBranchEntity;
import com.dituhui.pea.order.entity.OrgTeamEntity;
import com.dituhui.pea.order.entity.SkillInfoEntity;
import com.dituhui.pea.order.entity.TimeSliceEntity;
......@@ -83,6 +85,8 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
@Autowired
private OrgTeamDao orgTeamDao;
@Autowired
private OrgBranchDao orgBranchDao;
@Autowired
ISaaSRemoteService saasRemoteService;
@Autowired
......@@ -125,7 +129,10 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.collect(Collectors.toList());
List<String> groupList = mapBlockInBlockIdsList.stream().map(MapBlockInfoEntity::getGroupId).distinct()
.collect(Collectors.toList());
List<String> branchList = mapBlockInBlockIdsList.stream().map(MapBlockInfoEntity::getBranchId).distinct()
.collect(Collectors.toList());
final String teamId = teamIdList.get(0);
final String branchId = branchList.get(0);
//3. 查询分站下拥有对应技能的工程师(排重) 技能码转换为对应的技能汉字
List<SkillInfoEntity> querySkillGroup = new ArrayList<>();
......@@ -153,10 +160,17 @@ public class CapacityQueryServiceImpl implements CapacityQueryService {
.mapToInt(SkillInfoEntity::getTakeTime)
.sum();
//查询单个工程师日期范围内的技能容量信息 后加和汇总
OrgBranchEntity branchInfo = orgBranchDao.getByBranchId(branchId);
CopyOnWriteArrayList<TimeSliceEntity> halfDayTypeTimeSlice = new CopyOnWriteArrayList<>(timeSliceDao.findByType("HALF_DAY"));
CopyOnWriteArrayList<TimeSliceEntity> allDayTypeTimeSlice = new CopyOnWriteArrayList<>(timeSliceDao.findByType("ALL_DAY"));
CopyOnWriteArrayList<TimeSliceEntity> allDayTypeTimeSlice = new CopyOnWriteArrayList<>();
if (branchInfo.getCapacityType() == 0 || branchInfo.getCapacityType() == 2) {
allDayTypeTimeSlice.addAll(timeSliceDao.findByType("ALL_DAY"));
}
CopyOnWriteArrayList<TimeSliceEntity> timeSliceEntities = new CopyOnWriteArrayList<>();
if (branchInfo.getCapacityType() == 0) {
timeSliceEntities.addAll(getTimeSliceEntities(teamId));
}
CopyOnWriteArrayList<TimeSliceEntity> timeSliceEntities = getTimeSliceEntities(teamId);
//定义返回值
CapacityQueryDTO.Result result = new CapacityQueryDTO.Result();
result.setGroupId(groupList.get(0));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!