Commit c48de84e by 刘鑫

fix(ID1004109): 博西PEA_V1.0-工程师加单:工程师加单确认时,从次日单改约成当日单,需要标注当日加单标签

1 parent 61639a7f
......@@ -11,6 +11,7 @@ import com.dituhui.pea.order.dao.EngineerSkillGroupDao;
import com.dituhui.pea.order.dao.MapBlockInfoDao;
import com.dituhui.pea.order.dao.OrderInfoDao;
import com.dituhui.pea.order.dao.OrgGroupDao;
import com.dituhui.pea.order.dao.OrgTeamDao;
import com.dituhui.pea.order.dto.param.EstimateDTO;
import com.dituhui.pea.order.dto.param.Location;
import com.dituhui.pea.order.dto.param.Order;
......@@ -22,6 +23,7 @@ import com.dituhui.pea.order.entity.EngineerSkillGroupEntity;
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;
......@@ -29,7 +31,7 @@ import com.dituhui.pea.order.enums.OrderStatusEnum;
import com.dituhui.pea.order.enums.ServiceStatusEnum;
import com.dituhui.pea.order.service.CommonService;
import com.dituhui.pea.order.service.PeaOuterAPIService;
import com.dituhui.pea.order.utils.OrderUtil;
import com.dituhui.pea.order.utils.CommonUtil;
import com.dituhui.pea.pojo.fendan.FendanDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -63,6 +65,7 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
* 分部数据访问层
*/
private final OrgGroupDao orgGroupDao;
private final OrgTeamDao orgTeamDao;
private final OrderInfoDao orderInfoDao;
private final EngineerSkillGroupDao engineerSkillGroupDao;
private final SaasUtils saasUtils;
......@@ -175,6 +178,9 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
final String orderId = request.getOrderId();
OrderInfoEntity orderInfo = orderInfoDao.getByOrderId(orderId);
EngineerInfoEntity engineerInfo = engineerInfoDao.getByEngineerCode(request.getEngineerCode());
Set<OrgTeamEntity> teamEntitySet = orgTeamDao.selectTeamByEngineerCode(request.getEngineerCode());
OrgTeamEntity team = new ArrayList<>(teamEntitySet).get(0);
//confirmed预约成功;other预约失败
if (Objects.equals(request.getAppointmentResult(), "CONFIRMED")) {
orderInfo.setAppointmentStatus(String.valueOf(OrderFlowEnum.CONFIRM));
......@@ -198,8 +204,14 @@ public class PeaOuterAPIServiceImpl implements PeaOuterAPIService {
orderInfo.setExpectTimeDesc(MessageFormat.format("{0}月{1}日{2}-{3}点", date.getMonthValue(), date.getDayOfMonth(), exceptStartHour.getHour(), exceptEndHour.getHour()));
orderInfo.setApplyNote(MessageFormat.format("{0}-{1}", DateTimeUtil.formatTime(exceptStartHour), DateTimeUtil.formatTime(exceptEndHour)));
List<String> tags = OrderUtil.handleTags(orderInfo);
orderInfo.setBeanTags(String.join(",", tags));
//是否特殊时间段
Integer special = CommonUtil.isSpecial(orderInfo.getExpectTimeBegin().toLocalTime(), orderInfo.getExpectTimeEnd().toLocalTime(),
team.getWorkOn(), team.getWorkOff());
orderInfo.setIsSpecialTime(special);
//是否当日单
Integer cutoff = CommonUtil.isCutoff(orderInfo.getExpectTimeBegin(), team.getCuteOff());
orderInfo.setIsCutoff(cutoff);
}
orderInfo.setReasonForFailure(request.getReasonForFailure());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!