Commit 942ae4d6 by 王力

Merge branch 'dev_engineer_work_dynamics' into 'develop'

Dev engineer work dynamics

See merge request !236
2 parents 41c54266 d802dc65
...@@ -3,7 +3,7 @@ package com.dituhui.pea.order.dto; ...@@ -3,7 +3,7 @@ package com.dituhui.pea.order.dto;
import lombok.Data; import lombok.Data;
@Data @Data
public class EnginnerTimelineReq { public class EngineerTimelineReq {
private String enginnerCode; private String engineerCode;
private String date; private String date;
} }
...@@ -5,7 +5,7 @@ import lombok.Data; ...@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.List; import java.util.List;
@Data @Data
public class EnginnerTimelineResp { public class EngineerTimelineResp {
private String engineerCode; private String engineerCode;
private String engineerName; private String engineerName;
......
...@@ -3,7 +3,7 @@ package com.dituhui.pea.order.service.impl; ...@@ -3,7 +3,7 @@ package com.dituhui.pea.order.service.impl;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.TimeUtils; import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.dao.*; import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.EnginnerTimelineResp; import com.dituhui.pea.order.dto.EngineerTimelineResp;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.EngineerTimelineService; import com.dituhui.pea.order.service.EngineerTimelineService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -64,9 +64,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService { ...@@ -64,9 +64,9 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
String branchId = this.getEngineerBranchId(engineerCode); String branchId = this.getEngineerBranchId(engineerCode);
String warehouseLocation = this.getWarehouseLocation(branchId); String warehouseLocation = this.getWarehouseLocation(branchId);
List<EnginnerTimelineResp.DynamicItem> dynamics = this.packItems(timelines, orders, orderLocations, warehouseLocation); List<EngineerTimelineResp.DynamicItem> dynamics = this.packItems(timelines, orders, orderLocations, warehouseLocation);
EnginnerTimelineResp res = new EnginnerTimelineResp(); EngineerTimelineResp res = new EngineerTimelineResp();
res.setEngineerCode(engineerCode); res.setEngineerCode(engineerCode);
res.setEngineerName(engineerInfo.getName()); res.setEngineerName(engineerInfo.getName());
res.setDynamics(dynamics); res.setDynamics(dynamics);
...@@ -122,15 +122,15 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService { ...@@ -122,15 +122,15 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
} }
private List<EnginnerTimelineResp.DynamicItem> packItems(List<OrderEvent> timelines, List<OrderAppointment> orders, HashMap<String, String> locations, String warehouseLocation) { private List<EngineerTimelineResp.DynamicItem> packItems(List<OrderEvent> timelines, List<OrderAppointment> orders, HashMap<String, String> locations, String warehouseLocation) {
int index = 0; int index = 0;
String order_id, title, type, text, location; String order_id, title, type, text, location;
List<EnginnerTimelineResp.DynamicItem> items = new ArrayList<>(); List<EngineerTimelineResp.DynamicItem> items = new ArrayList<>();
Set<String> s = new HashSet<>(); Set<String> s = new HashSet<>();
for (OrderEvent t: timelines){ for (OrderEvent t: timelines){
EnginnerTimelineResp.DynamicItem item = new EnginnerTimelineResp.DynamicItem(); EngineerTimelineResp.DynamicItem item = new EngineerTimelineResp.DynamicItem();
if (t.getEvent().equals("分站取还配件")) { if (t.getEvent().equals("分站取还配件")) {
title = t.getEvent(); title = t.getEvent();
...@@ -167,7 +167,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService { ...@@ -167,7 +167,7 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
continue; continue;
} }
index += 1; index += 1;
EnginnerTimelineResp.DynamicItem item = new EnginnerTimelineResp.DynamicItem(); EngineerTimelineResp.DynamicItem item = new EngineerTimelineResp.DynamicItem();
item.setTitle(String.format("第%d单出发", index)); item.setTitle(String.format("第%d单出发", index));
item.setTime(TimeUtils.IsoTimestamp2DateTime(o.getExpectStartTime())); item.setTime(TimeUtils.IsoTimestamp2DateTime(o.getExpectStartTime()));
item.setStatus(0); item.setStatus(0);
...@@ -177,6 +177,6 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService { ...@@ -177,6 +177,6 @@ public class EngineerTimelineServiceImpl implements EngineerTimelineService {
items.add(item); items.add(item);
} }
// 根据items的time升序排序 // 根据items的time升序排序
return items.stream().sorted(Comparator.comparing(EnginnerTimelineResp.DynamicItem::getTime)).collect(Collectors.toList()); return items.stream().sorted(Comparator.comparing(EngineerTimelineResp.DynamicItem::getTime)).collect(Collectors.toList());
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!