Commit 8f19fc45 by 丁伟峰

Merge branch 'feature-dingwf-0715' into develop

2 parents 012f75ff 36a3fcc5
......@@ -19,6 +19,8 @@ public class BusinessTeamDetailDTO {
private ScheduleConfig scheduleConfig;
private String teamId;
private String teamName;
private String groupId;
private String groupName;
private String warehouseId;
private List<String> workdays;
}
......
......@@ -227,8 +227,14 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
Result.failed(String.format("工作队[%s]不存在", req.getTeamId()));
}
BusinessTeamDetailDTO.Result rs = new BusinessTeamDetailDTO.Result();
OrgGroupEntity g = orgGroupDao.getByGroupId(teamEntity.getGroupId());
if (g == null) {
return Result.failed("数据配置错误,工作队没有对应的站点");
}
rs.setTeamId(teamEntity.getTeamId())
.setTeamName(teamEntity.getTeamName())
.setGroupId(g.getGroupId())
.setGroupName(g.getGroupName())
.setWarehouseId(teamEntity.getWarehouseId())
.setWorkdays(Arrays.asList(teamEntity.getWorkdays().split(",")));
List<String> engineerCodes = orgTeamEngineerDao.findAllByTeamId(teamEntity.getTeamId()).stream()
......
......@@ -83,19 +83,13 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
for (LocalDate date : datesInRange) {
String sDate = LocalDateTimeUtil.format(date, PATTERN_DATE);
EngineerCalendarDTO.Calendar calander = null;
if (!configs.containsKey(sDate)) {
calander = getEmptyCalendar(teamIds.get(0), sDate);
} else {
calander = new EngineerCalendarDTO.Calendar();
calander.setDate(sDate);
int week = LocalDate.parse(sDate).getDayOfWeek().getValue();
calander.setWeek(Week.of(week).toChinese("周"));
calander = getEmptyCalendar(teamIds.get(0), sDate);
if (configs.containsKey(sDate)) {
List<EngineerCalendarDTO.Content> contents = new ArrayList<>();
// 有配置
for (CapacityEngineerCalendarEntity e : configs.get(sDate)) {
EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content();
content.setType("rest");
content.setType("leave");
content.setTitle(e.getType());
content.setValue(getCalendarDuration(e.getStartTime(), e.getEndTime()));
contents.add(content);
......@@ -135,6 +129,7 @@ public class EngineerCalendarServiceImpl implements EngineerCalendarService {
EngineerCalendarDTO.Calendar calendar = new EngineerCalendarDTO.Calendar();
calendar.setDate(date);
int week = LocalDate.parse(date).getDayOfWeek().getValue();
calendar.setWeek(Week.of(week).toChinese("周"));
EngineerCalendarDTO.Content content = new EngineerCalendarDTO.Content();
List<String> workdays = Arrays.asList(e.getWorkdays().split(","));
if (workdays.contains(String.valueOf(week))) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!