Commit 3fd18d2b by 刘鑫

Merge branch 'develop' of https://gitlab.dituhui.com/bsh/project/project into develop

2 parents d6dafe7c 770086c4
...@@ -145,6 +145,8 @@ public enum StatusCodeEnum { ...@@ -145,6 +145,8 @@ public enum StatusCodeEnum {
TEAM_UNMATCHED("029", "工程师没有匹配到工作队", false), TEAM_UNMATCHED("029", "工程师没有匹配到工作队", false),
ORDER_FINISHED("030", "订单已结束,请勿操作", false), ORDER_FINISHED("030", "订单已结束,请勿操作", false),
FENDAN_IS_TRANSCEND_AND_SPECIAL("031", "分单超派和特殊时间", false),
; ;
/** /**
......
...@@ -19,6 +19,8 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS ...@@ -19,6 +19,8 @@ public interface OrderInfoDao extends JpaRepository<OrderInfoEntity, Long>, JpaS
List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes); List<OrderInfoEntity> findByDtAndEngineerCodeIn(LocalDate date, List<String> engineerCodes);
List<OrderInfoEntity> findByDtAndServiceStatusNotAndEngineerCodeIn(LocalDate date, String serviceSatus, List<String> engineerCodes);
List<OrderInfoEntity> findByDtAndEngineerCode(LocalDate date, String engineerCode); List<OrderInfoEntity> findByDtAndEngineerCode(LocalDate date, String engineerCode);
@Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId and o.dt = :dt") @Query("SELECT o.orderId, s.skillCategory as skillCaption FROM OrderInfoEntity o JOIN SkillInfoEntity s on o.brand=s.brand and o.type=s.type and o.skill=s.skill WHERE o.orderId = :orderId and o.dt = :dt")
......
...@@ -43,6 +43,7 @@ public interface OrgTeamDao extends JpaRepository<OrgTeamEntity, Integer>, JpaSp ...@@ -43,6 +43,7 @@ public interface OrgTeamDao extends JpaRepository<OrgTeamEntity, Integer>, JpaSp
@Query("UPDATE OrgTeamEntity tt SET tt.status = :status WHERE tt.teamId = :teamId") @Query("UPDATE OrgTeamEntity tt SET tt.status = :status WHERE tt.teamId = :teamId")
void updateStatusByTeamId(String teamId, int status); void updateStatusByTeamId(String teamId, int status);
@Query("select t from OrgTeamEntity t where t.teamId in :ids and t.status=1")
public List<OrgTeamEntity> findByTeamIdIn(List<String> ids); public List<OrgTeamEntity> findByTeamIdIn(List<String> ids);
public List<OrgTeamEntity> findByClusterIdIn(List<String> ids); public List<OrgTeamEntity> findByClusterIdIn(List<String> ids);
......
...@@ -10,6 +10,7 @@ import com.dituhui.pea.order.dto.EngineersGanttDTO; ...@@ -10,6 +10,7 @@ import com.dituhui.pea.order.dto.EngineersGanttDTO;
import com.dituhui.pea.order.dto.LabelValueDTO; import com.dituhui.pea.order.dto.LabelValueDTO;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.enums.OrderFlowEnum; import com.dituhui.pea.order.enums.OrderFlowEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.order.service.EngineerGanttService; import com.dituhui.pea.order.service.EngineerGanttService;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -61,7 +62,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService { ...@@ -61,7 +62,7 @@ public class EngineerGanttServiceImpl implements EngineerGanttService {
} }
LocalDate localDate = LocalDate.parse(reqDTO.getDate()); LocalDate localDate = LocalDate.parse(reqDTO.getDate());
List<OrderInfoEntity> orders = orderInfoDao.findByDtAndEngineerCodeIn(localDate, engineerCodes); List<OrderInfoEntity> orders = orderInfoDao.findByDtAndServiceStatusNotAndEngineerCodeIn(localDate, ServiceStatusEnum.CANCELED.getCode(), engineerCodes);
HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>(); HashMap<String, List<EngineersGanttDTO.Slot>> mapEngineers = new HashMap<>();
for (OrderInfoEntity order : orders) { for (OrderInfoEntity order : orders) {
// 服务工单本体 // 服务工单本体
......
...@@ -13,6 +13,7 @@ import com.dituhui.pea.order.dto.param.OrgTeamInfo; ...@@ -13,6 +13,7 @@ import com.dituhui.pea.order.dto.param.OrgTeamInfo;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.CapacityQueryService; import com.dituhui.pea.order.service.CapacityQueryService;
import com.dituhui.pea.order.service.FendanService; import com.dituhui.pea.order.service.FendanService;
import com.dituhui.pea.order.utils.CommonUtil;
import com.dituhui.pea.pojo.fendan.FendanDTO; import com.dituhui.pea.pojo.fendan.FendanDTO;
import com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq; import com.dituhui.pea.pojo.saas.req.AdministrativeDistrictReq;
import com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp; import com.dituhui.pea.pojo.saas.resp.AdministrativeDistrictResp;
...@@ -311,6 +312,13 @@ public class FendanServiceImpl implements FendanService { ...@@ -311,6 +312,13 @@ public class FendanServiceImpl implements FendanService {
return Result.success(orgGroupInfo.getTeamInfos().get(0)); return Result.success(orgGroupInfo.getTeamInfos().get(0));
} }
} }
// 超派情况判断特殊时间
//特殊时间段
Integer special = CommonUtil.isSpecial(startTime, endTime, orgGroupTeamInfos.get(0).getTeamInfos().get(0).getWorkOn(),
orgGroupTeamInfos.get(0).getTeamInfos().get(0).getWorkOff());
if (special == 1) {
return Result.failed(StatusCodeEnum.FENDAN_IS_TRANSCEND_AND_SPECIAL);
}
return Result.failed(StatusCodeEnum.FENDAN_IS_TRANSCEND); return Result.failed(StatusCodeEnum.FENDAN_IS_TRANSCEND);
} }
......
...@@ -355,6 +355,11 @@ public class OrderCreateServiceImpl implements OrderCreateService { ...@@ -355,6 +355,11 @@ public class OrderCreateServiceImpl implements OrderCreateService {
// 处理超派 // 处理超派
entity.setTranscend(1); entity.setTranscend(1);
} }
if (fendanResult.getCode().equals(StatusCodeEnum.FENDAN_IS_TRANSCEND_AND_SPECIAL.getCode())) {
// 处理超派和特殊时间
entity.setTranscend(1);
entity.setIsSpecialTime(1);
}
OrgBranchEntity branchEntity = orgBranchDao.findByCitycodeListLike("%" + adminDistrict.getResult().getSubNames().getCity() + "%"); OrgBranchEntity branchEntity = orgBranchDao.findByCitycodeListLike("%" + adminDistrict.getResult().getSubNames().getCity() + "%");
entity.setOrgClusterId(branchEntity.getClusterId()); entity.setOrgClusterId(branchEntity.getClusterId());
entity.setOrgBranchId(branchEntity.getBranchId()); entity.setOrgBranchId(branchEntity.getBranchId());
......
...@@ -418,6 +418,11 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -418,6 +418,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
} else { } else {
cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), null); cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), null);
} }
// 当日单指派策略为人工指派,次日单动态排班自动批量
if (isToday || cutoff == 1) {
order.setAppointmentMethod(AppointmentMethodEnum.MANUAL.name());
order.setAppointmentStatus(OrderFlowEnum.INIT.name());
}
order.setIsCutoff(cutoff); order.setIsCutoff(cutoff);
order.setIsSpecialTime(special); order.setIsSpecialTime(special);
order.setOrgClusterId(clusterId); order.setOrgClusterId(clusterId);
...@@ -684,6 +689,26 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -684,6 +689,26 @@ public class OrderInfoServiceImpl implements OrderInfoService {
//处理超派,特殊时间段 //处理超派,特殊时间段
// order.setIsSpecialTime(CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(), // order.setIsSpecialTime(CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(),
// order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff())); // order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff()));
//特殊时间段
Integer special = CommonUtil.isSpecial(order.getExpectTimeBegin().toLocalTime(),
order.getExpectTimeEnd().toLocalTime(), teamInfo.getWorkOn(), teamInfo.getWorkOff());
Integer cutoff = CommonUtil.isCutoff(order.getExpectTimeBegin(), teamInfo.getWorkOff());
// 处理cutoff 动态排班结束后创建的当日单和次日单
boolean isTomorrow = DateUtil.judgeTimeIsisTomorrow(order.getExpectTimeBegin());
//次日单自动批量
if (isTomorrow) {
order.setAppointmentMethod(AppointmentMethodEnum.AUTO_BATCH.name());
}
// 特殊时间段,当天单,cutoff需要人工处理
if (cutoff == 1 || special == 1) {
//判断是否在今天cutoff之后
order.setIsCutoff(cutoff);
order.setIsSpecialTime(special);
order.setAppointmentMethod(AppointmentMethodEnum.MANUAL.name());
order.setAppointmentStatus(OrderFlowEnum.INIT.name());
//发送通知分部消息
sendMsg(order.getOrgBranchId(), order.getOrderId(), req.getExpectBegin());
}
} }
return order; return order;
} }
......
...@@ -356,7 +356,7 @@ public class WorkbenchServiceImpl implements WorkbenchService { ...@@ -356,7 +356,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
Long started = summary.getOrDefault("STARTED", 0L); Long started = summary.getOrDefault("STARTED", 0L);
Long finished = summary.getOrDefault("FINISHED", 0L) + summary.getOrDefault("UNFINISHED", 0L); Long finished = summary.getOrDefault("FINISHED", 0L) + summary.getOrDefault("UNFINISHED", 0L);
Long cancel = summary.getOrDefault("1", 0L); Long cancel = summary.getOrDefault("CANCELED", 0L);
// 服务状态:INIT-初始化/PENDING待服务/CONTACTED已排期/STARTED-已开始/FINISHED已完成/UNFINISHED-已上门未完成 // 服务状态:INIT-初始化/PENDING待服务/CONTACTED已排期/STARTED-已开始/FINISHED已完成/UNFINISHED-已上门未完成
// - 待上门:服务状态为“待服务、已排期”的工单. // - 待上门:服务状态为“待服务、已排期”的工单.
HashMap<String, List<String>> p1 = this.packParams("appointmentStatus", "CONTACTED", "PENDING"); HashMap<String, List<String>> p1 = this.packParams("appointmentStatus", "CONTACTED", "PENDING");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!