Commit 16743816 by huangjinxin

fix:枚举迁移,方便使用

1 parent 2021b667
Showing with 85 additions and 61 deletions
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum AppointmentMethodEnum {
// 指派方式(MANUAL人工/AUTO_NOW 自动立即/AUTO_BATCH/PROTECTION 自保点)
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
import cn.hutool.core.util.ObjectUtil;
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
import cn.hutool.core.util.ObjectUtil;
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum OrderEventEnum {
// 建单,首次指派,改派,取消,改约,放回工单池
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum OrderGroupEnum {
// 0:工单优先级,1:耗时,2:意向时间,3:分站/网点,4:技能,5:一家多单
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum OrderPeaTagsEnum {
// 特殊时段, 一家多台, 当日加单, 紧急
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum OrderStatusEnum {
CREATE("创建订单", "CREATE"),
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
public enum ServiceStatusEnum {
// 服务状态:INIT-初始化/PENDING待服务/CONTACTED已排期/STARTED-已开始/FINISHED已完成/UNFINISHED-已上门未完成
......
package com.dituhui.pea.order.enums;
package com.dituhui.pea.enums;
import cn.hutool.core.util.ObjectUtil;
......
......@@ -2,7 +2,7 @@ package com.dituhui.pea.order.common;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......
......@@ -10,12 +10,17 @@ public class OrderAppointmentListResp {
private List<OrderAppointment> orders;
@Data
public static class OrderAppointment{
public static class OrderAppointment {
private String title;
private String engineerCode;
private String expectTime;
private List<KV> items;
private List<KV> timelines;
/**
* 是否是辅助单
*/
private Boolean isSub = false;
}
}
package com.dituhui.pea.order.dto;
import com.dituhui.pea.order.dto.param.TLocation;
import com.dituhui.pea.order.enums.TestimonialsEngineerTag;
import com.dituhui.pea.enums.TestimonialsEngineerTag;
import lombok.Data;
import java.util.List;
......
package com.dituhui.pea.order.dto.param;
import com.dituhui.pea.order.enums.LocationType;
import com.dituhui.pea.enums.LocationType;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
......
package com.dituhui.pea.order.entity;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import lombok.Data;
import javax.persistence.*;
......
......@@ -6,8 +6,8 @@ import cn.hutool.core.util.StrUtil;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.MsgDTO;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.MsgTagEnum;
import com.dituhui.pea.order.enums.MsgTypeEnum;
import com.dituhui.pea.enums.MsgTagEnum;
import com.dituhui.pea.enums.MsgTypeEnum;
import com.dituhui.pea.order.service.MsgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
......
......@@ -4,14 +4,13 @@ import cn.hutool.core.util.ObjectUtil;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.common.ResultEnum;
import com.dituhui.pea.enums.StatusCodeEnum;
import com.dituhui.pea.enums.*;
import com.dituhui.pea.order.common.ListUtils;
import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.common.jackson.JsonUtil;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.*;
import com.dituhui.pea.order.service.CommonService;
import com.dituhui.pea.order.service.DispatchService;
import com.dituhui.pea.order.service.EngineerCalendarService;
......
......@@ -4,7 +4,7 @@ import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.EngineerBusinessDTO;
import com.dituhui.pea.order.dto.param.TLocation;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.LocationType;
import com.dituhui.pea.enums.LocationType;
import com.dituhui.pea.order.service.EngineerBusinessService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......
package com.dituhui.pea.order.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.common.EngineerUtils;
......@@ -9,12 +8,10 @@ import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.EngineersGanttDTO;
import com.dituhui.pea.order.dto.LabelValueDTO;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.order.enums.OrderPeaTagsEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import com.dituhui.pea.order.service.EngineerGanttService;
import com.dituhui.pea.order.utils.OrderUtil;
import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......
......@@ -12,7 +12,7 @@ import com.dituhui.pea.order.entity.OrderEventEntity;
import com.dituhui.pea.order.entity.OrderInfoEntity;
import com.dituhui.pea.order.entity.OrgGroupEntity;
import com.dituhui.pea.order.entity.OrgWarehouseInfoEntity;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.order.service.EngineerTimelineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......
......@@ -14,8 +14,8 @@ import com.dituhui.pea.order.entity.MsgEntity;
import com.dituhui.pea.order.entity.MsgReceiverEntity;
import com.dituhui.pea.order.entity.OrgBranchEntity;
import com.dituhui.pea.order.entity.OrgGroupEntity;
import com.dituhui.pea.order.enums.MsgTagEnum;
import com.dituhui.pea.order.enums.MsgTypeEnum;
import com.dituhui.pea.enums.MsgTagEnum;
import com.dituhui.pea.enums.MsgTypeEnum;
import com.dituhui.pea.order.service.MsgService;
import com.dituhui.pea.order.utils.AssertUtil;
import lombok.extern.slf4j.Slf4j;
......
......@@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.common.ResultEnum;
import com.dituhui.pea.enums.StatusCodeEnum;
import com.dituhui.pea.enums.*;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.common.OrderAssignCheck;
import com.dituhui.pea.order.common.Stapial4jUtil;
......@@ -16,7 +16,6 @@ import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.dto.param.RecommendEngineersReq;
import com.dituhui.pea.order.dto.param.TLocation;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.*;
import com.dituhui.pea.order.service.*;
import com.dituhui.pea.order.utils.CommonUtil;
import com.dituhui.pea.order.utils.OrderUtil;
......
......@@ -51,10 +51,9 @@ import com.dituhui.pea.order.entity.OrgBranchEntity;
import com.dituhui.pea.order.entity.OrgTeamEngineerEntity;
import com.dituhui.pea.order.entity.OrgTeamEntity;
import com.dituhui.pea.order.entity.SkillInfoEntity;
import com.dituhui.pea.order.enums.AppointmentMethodEnum;
import com.dituhui.pea.order.enums.OrderEventEnum;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.order.enums.OrderPeaTagsEnum;
import com.dituhui.pea.enums.AppointmentMethodEnum;
import com.dituhui.pea.enums.OrderEventEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.order.service.CommonService;
import com.dituhui.pea.order.service.FendanService;
import com.dituhui.pea.order.service.MsgService;
......@@ -81,7 +80,6 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
@Slf4j
......
......@@ -7,7 +7,7 @@ import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.common.ResultEnum;
import com.dituhui.pea.dispatch.IPath;
import com.dituhui.pea.enums.StatusCodeEnum;
import com.dituhui.pea.enums.*;
import com.dituhui.pea.order.common.OccupyInfoDetail;
import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.common.jackson.JsonUtil;
......@@ -22,7 +22,6 @@ import com.dituhui.pea.order.dto.param.Location;
import com.dituhui.pea.order.dto.param.OrderDTO;
import com.dituhui.pea.order.dto.param.OrgTeamInfo;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.*;
import com.dituhui.pea.bean.Rescheduled;
import com.dituhui.pea.order.service.*;
import com.dituhui.pea.order.utils.CommonUtil;
......@@ -264,7 +263,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
public Result<?> orderReschedule(OrderReschedule req) throws BusinessException {
log.info("[orderReschedule] orderId:{}, req: {}", req.getOrderId(), JSONObject.toJSONString(req));
// 判断是否分配到人和是否是今天
LocalDateTime expectBegin = TimeUtils.IsoDateTime2LocalDateTime(req.getExpectBegin());
LocalDateTime expectBegin = TimeUtils.IsoDateTime2LocalDateTime(req.getExpectEnd());
if (expectBegin.isBefore(LocalDateTime.now())) {
return Result.failed(StatusCodeEnum.ORDER_RESCHEDULE_BEFORE_TIME);
}
......
......@@ -205,6 +205,37 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
item.setItems(this.packEngineerItems(eg, skill, groups.get(eg.getGroupId())));
items.add(item);
if (StringUtils.isNotBlank(o.getEngineerCodeSub())) {
EngineerInfoEntity egSub = egInfo.getOrDefault(o.getEngineerCodeSub(), null);
if (egSub == null) {
log.warn("未获得工程师{}基础信息, 订单:{}", o.getEngineerCodeSub(), o.getOrderId());
continue;
}
String skillSub = egSkill.getOrDefault(o.getEngineerCodeSub(), null);
if (skillSub == null) {
log.warn("未获得工程师{}基础技能, 订单:{}", o.getEngineerCodeSub(), o.getOrderId());
}
// 获取工程师姓名
String engineerNameSub = (egSub != null) ? egSub.getName() : o.getEngineerCodeSub();
// 获取title
String titleSUb = engineerNameSub;
if (o.getDt().isBefore(lastDt)) {
titleSUb = String.format("%s_%s", engineerNameSub, TimeUtils.IsoLocalDate2String(o.getDt()));
}
OrderAppointmentListResp.OrderAppointment itemSub = new OrderAppointmentListResp.OrderAppointment();
itemSub.setTitle(titleSUb);
itemSub.setEngineerCode(o.getEngineerCodeSub());
itemSub.setExpectTime(TimeUtils.IsoLocalDateTime2String(o.getExpectTimeBegin()));
itemSub.setTimelines(null); // TODO
itemSub.setIsSub(true);
itemSub.setItems(this.packEngineerItems(egSub, skillSub, groups.get(egSub.getGroupId())));
items.add(itemSub);
}
}
res.setOrderId(orderId);
......
......@@ -8,12 +8,11 @@ import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.ListUtils;
import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.EngineerBusinessListResp;
import com.dituhui.pea.order.dto.OrderServiceList;
import com.dituhui.pea.order.dto.OrderServiceListReq;
import com.dituhui.pea.order.dto.OrderServiceListResp;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import com.dituhui.pea.order.service.OrderServiceListService;
import com.dituhui.pea.order.utils.OrderUtil;
import org.apache.commons.lang3.StringUtils;
......@@ -21,7 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
......
......@@ -5,7 +5,7 @@ import com.dituhui.pea.order.common.EngineerUtils;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.OrganizationType;
import com.dituhui.pea.enums.OrganizationType;
import com.dituhui.pea.order.service.OrganizationService;
import com.dituhui.pea.pojo.OrganizationDTO;
import com.google.common.collect.Lists;
......
......@@ -24,11 +24,11 @@ import com.dituhui.pea.order.entity.MapBlockInfoEntity;
import com.dituhui.pea.order.entity.OrderInfoEntity;
import com.dituhui.pea.order.entity.OrgGroupEntity;
import com.dituhui.pea.order.entity.OrgTeamEntity;
import com.dituhui.pea.order.enums.AppointmentMethodEnum;
import com.dituhui.pea.order.enums.OrderEventEnum;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.order.enums.OrderStatusEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.AppointmentMethodEnum;
import com.dituhui.pea.enums.OrderEventEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.enums.OrderStatusEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import com.dituhui.pea.bean.Reason;
import com.dituhui.pea.bean.Rescheduled;
import com.dituhui.pea.order.service.CommonService;
......
......@@ -3,7 +3,6 @@ package com.dituhui.pea.order.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
......@@ -13,10 +12,10 @@ import com.dituhui.pea.order.common.TimeUtils;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.order.enums.OrderStatusEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.order.enums.VehicleEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.enums.OrderStatusEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.VehicleEnum;
import com.dituhui.pea.order.service.EngineerCalendarService;
import com.dituhui.pea.order.service.ScheduleService;
import com.dituhui.pea.order.utils.CommonUtil;
......
......@@ -2,7 +2,6 @@ package com.dituhui.pea.order.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.dao.OrderEventDao;
......@@ -11,8 +10,8 @@ import com.dituhui.pea.order.dto.OrderChangeListDTO;
import com.dituhui.pea.order.dto.WorkbenchSummaryResp;
import com.dituhui.pea.order.entity.OrderEventEntity;
import com.dituhui.pea.order.entity.OrderInfoEntity;
import com.dituhui.pea.order.enums.AppointmentMethodEnum;
import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.enums.AppointmentMethodEnum;
import com.dituhui.pea.enums.OrderFlowEnum;
import com.dituhui.pea.order.service.WorkbenchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -3,8 +3,8 @@ package com.dituhui.pea.order.utils;
import cn.hutool.core.util.ObjectUtil;
import com.dituhui.pea.order.entity.OrderInfo;
import com.dituhui.pea.order.entity.OrderInfoEntity;
import com.dituhui.pea.order.enums.OrderPeaTagsEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.enums.OrderPeaTagsEnum;
import com.dituhui.pea.enums.ServiceStatusEnum;
import org.apache.commons.lang3.StringUtils;
import java.time.LocalDate;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!