Commit f62d0c20 by wangli

接口变更

1 parent 5b0a7a8b
......@@ -21,15 +21,34 @@ public class DispatchEngineerOrderListResp {
@Data
public static class OrderInfo{
private boolean weight;
private String orderId;
private String description;
private String intentionTime;
private Integer duration;
private String brand;
private String type;
private String skill;
private String category;
private String orderId;
private String customerName;
private String remark;
private String typeCategory;
private String skillCategory;
private String faultDescribe;
private String applyNote;
private Integer duration;
private String province;
private String city;
private String county;
private String address;
private String name;
private String phone;
private String expectTimeDesc;
private String source;
private String appointmentStatus;
private String appointmentType;
private String createTime;
private String orderStatus;
private String orderStatusDesc;
private String groupTag;
private Integer groupWeight;
private String intentionTime; // 待删除 TODO
private String customerName; // 待删除 TODO
private String category; // 待删除 TODO
private String remark; // 待删除 TODO
}
}
......@@ -11,15 +11,32 @@ public class DispatchOrderListResp {
@Data
public static class Order{
private boolean weight;
private String orderId;
private String description;
private String intentionTime;
private Integer duration;
private String brand;
private String type;
private String skill;
private String category;
private String orderId;
private String customerName;
private String remark;
private String typeCategory;
private String skillCategory;
private String faultDescribe;
private String applyNote;
private Integer duration;
private String province;
private String city;
private String county;
private String address;
private String name;
private String phone;
private String expectTimeDesc;
private String source;
private String appointmentStatus;
private String appointmentType;
private String createTime;
private String groupTag;
private Integer groupWeight;
private String intentionTime; // 待删除 TODO
private String customerName; // 待删除 TODO
private String category; // 待删除 TODO
private String remark; // 待删除 TODO
}
}
......@@ -55,8 +55,8 @@ public class DispatchServiceImpl implements DispatchService {
@Override
public Result<?> getDispatchOrderList(DispatchOrderListReq reqDTO) {
// 获取技能需要时间列表
HashMap<String, Integer> skillTakeTime = this.querySkillTakeTime();
// 获取技能信息
HashMap<String, SkillInfo> skillInfo = this.querySkillInfo();
// 获取工单列表
List<OrderRequest> orders = this.queryOrderRequests(reqDTO);
......@@ -67,27 +67,51 @@ public class DispatchServiceImpl implements DispatchService {
List<DispatchOrderListResp.Order> items = new ArrayList<>();
for (OrderRequest o : orders) {
DispatchOrderListResp.Order item = new DispatchOrderListResp.Order();
item.setOrderId(o.getOrderId());
item.setCategory(String.format("%s-%s", o.getType(), o.getBrand()));
item.setDescription(String.format("%s:%s-%s-%s\n%s:%s-%s-%s", o.getOrderId(), o.getBrand(), o.getType(),
o.getSkill(), o.getName(), o.getCity(), o.getCounty(), o.getAddress()));
item.setBrand(o.getBrand());
item.setType(o.getType());
item.setSkill(o.getSkill());
item.setRemark(o.getApplyNote());
item.setCustomerName(o.getName());
String description = String.format("%s:%s-%s-%s\n%s:%s-%s-%s", o.getOrderId(), o.getBrand(), o.getType(),
o.getSkill(), o.getName(), o.getCity(), o.getCounty(), o.getAddress());
item.setDescription(description);
item.setFaultDescribe(o.getFaultDescribe());
String key = String.format("%s%s%s", o.getBrand(), o.getType(), o.getSkill());
item.setDuration(skillTakeTime.getOrDefault(key, 30));
String time = TimeUtils.timestamp2DateTime(o.getExpectTimeBegin(), "HH:mm");
String timeSlot = this.parseTimeSlot(o.getExpectTimeBegin());
item.setIntentionTime(String.format("%s/%s", time, timeSlot));
SkillInfo skill = skillInfo.get(key);
if (skill != null) {
item.setDuration(skill.getTakeTime());
item.setSkillCategory(skill.getSkillCategory());
item.setTypeCategory(skill.getTypeCategory());
}
item.setName(o.getName());
item.setPhone(o.getPhone());
item.setCity(o.getCity());
item.setAddress(o.getAddress());
item.setProvince(o.getProvince());
item.setCity(o.getCity());
item.setCounty(o.getCounty());
item.setAddress(o.getAddress());
item.setName(o.getName());
item.setPhone(o.getPhone());
item.setExpectTimeDesc(o.getExpectTimeDesc());
item.setSource(o.getSource());
item.setAppointmentStatus(o.getAppointmentStatus());
item.setAppointmentType(o.getAppointmentMethod());
item.setCreateTime(TimeUtils.IsoTimestamp2DateTime(o.getCreateTime()));
String[] tags = gt.getGroupTag(o).split("#");
item.setGroupTag(tags[0]); // 设置tag名称
item.setGroupWeight(Integer.parseInt(tags[1])); // 设置tag权重
// 暂时兼容待删除 TODO
String time = TimeUtils.timestamp2DateTime(o.getExpectTimeBegin(), "HH:mm");
String timeSlot = this.parseTimeSlot(o.getExpectTimeBegin());
item.setIntentionTime(String.format("%s/%s", time, timeSlot));
item.setCustomerName(o.getName());
item.setRemark(o.getApplyNote());
item.setCategory(String.format("%s-%s", o.getType(), o.getBrand()));
items.add(item);
}
......@@ -103,6 +127,8 @@ public class DispatchServiceImpl implements DispatchService {
// 获取技能耗时
HashMap<String, Integer> skillTakeTime = this.querySkillTakeTime();
// 获取技能信息
HashMap<String, SkillInfo> skillInfo = this.querySkillInfo();
// 获取groupIds
List<String> groupIds = this.queryOrgGroupIds(reqDTO.getLevelType(), reqDTO.getLevelValue(), reqDTO.getBranchIds(),
......@@ -162,21 +188,44 @@ public class DispatchServiceImpl implements DispatchService {
DispatchEngineerOrderListResp.OrderInfo item = new DispatchEngineerOrderListResp.OrderInfo();
item.setOrderId(r.getOrderId());
item.setCategory(String.format("%s-%s", o.getType(), o.getBrand()));
item.setOrderId(o.getOrderId());
item.setDescription(String.format("%s:%s-%s-%s\n%s:%s-%s-%s", o.getOrderId(), o.getBrand(), o.getType(),
o.getSkill(), o.getName(), o.getCity(), o.getCounty(), o.getAddress()));
item.setBrand(o.getBrand());
item.setType(o.getType());
item.setSkill(o.getSkill());
item.setRemark(o.getApplyNote());
item.setCustomerName(o.getName());
item.setOrderStatus(r.getStatus()); // 预约单状态
item.setOrderStatusDesc(r.getStatus()); // 预约单状态描述, TODO
String description = String.format("%s:%s%s-%s\n%s:%s", o.getOrderId(), o.getSkill(),
o.getType(), o.getBrand(), o.getName(), o.getAddress());
item.setDescription(description);
item.setFaultDescribe(o.getFaultDescribe());
String key = String.format("%s%s%s", o.getBrand(), o.getType(), o.getSkill());
item.setDuration(skillTakeTime.getOrDefault(key, 30));
SkillInfo skill = skillInfo.get(key);
if (skill != null) {
item.setDuration(skill.getTakeTime());
item.setSkillCategory(skill.getSkillCategory());
item.setTypeCategory(skill.getTypeCategory());
}
item.setName(o.getName());
item.setPhone(o.getPhone());
item.setCity(o.getCity());
item.setAddress(o.getAddress());
item.setProvince(o.getProvince());
item.setCity(o.getCity());
item.setCounty(o.getCounty());
item.setAddress(o.getAddress());
item.setName(o.getName());
item.setPhone(o.getPhone());
item.setExpectTimeDesc(o.getExpectTimeDesc());
item.setSource(o.getSource());
item.setAppointmentStatus(o.getAppointmentStatus());
item.setAppointmentType(o.getAppointmentMethod());
item.setOrderStatus(r.getStatus()); // 预约单状态
item.setOrderStatusDesc(r.getStatus()); // 预约单状态描述, TODO
item.setCreateTime(TimeUtils.IsoTimestamp2DateTime(o.getCreateTime()));
// 暂时兼容待删除 TODO
item.setCategory(String.format("%s-%s", o.getType(), o.getBrand()));
item.setRemark(o.getApplyNote());
item.setCustomerName(o.getName());
String time = TimeUtils.timestamp2DateTime(r.getExpectStartTime(), "HH:mm");
String timeSlot = this.parseTimeSlot(r.getExpectStartTime());
item.setIntentionTime(String.format("%s/%s", time, timeSlot));
......@@ -381,12 +430,22 @@ public class DispatchServiceImpl implements DispatchService {
HashMap<String, Integer> map = new HashMap<>();
List<SkillInfo> records = skillInfoMPDao.selectList(null);
for (SkillInfo r : records) {
String key = String.format("%s%s%sd", r.getBrand(), r.getType(), r.getSkill());
String key = String.format("%s%s%s", r.getBrand(), r.getType(), r.getSkill());
map.put(key, r.getTakeTime());
}
return map;
}
private HashMap<String, SkillInfo> querySkillInfo() {
HashMap<String, SkillInfo> map = new HashMap<>();
List<SkillInfo> records = skillInfoMPDao.selectList(null);
for (SkillInfo r : records) {
String key = String.format("%s%s%s", r.getBrand(), r.getType(), r.getSkill());
map.put(key, r);
}
return map;
}
private HashMap<String, CapacityEngineerStat> queryCapacityEngineerStat(List<String> engineerCodes, String date) {
LambdaQueryWrapper<CapacityEngineerStat> lqw = new LambdaQueryWrapper<>();
lqw.eq(CapacityEngineerStat::getWorkday, date);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!