|
|
@@ -26,6 +26,7 @@ import cn.start.tz.module.member.api.user.dto.MemberUserReqVo;
|
|
|
import cn.start.tz.module.member.api.user.dto.MemberUserRespDTO;
|
|
|
import cn.start.tz.module.member.api.user.dto.SendAppMpMessageReqDTO;
|
|
|
import cn.start.tz.module.member.api.user.dto.WxMpTemplateDataReqDto;
|
|
|
+import cn.start.tz.module.pressure2.controller.admin.boilerorderexception.vo.BoilerOrderExceptionSaveReqVO;
|
|
|
import cn.start.tz.module.pressure2.dal.dataobject.acceptorder.AcceptOrderDO;
|
|
|
import cn.start.tz.module.pressure2.enums.RedisKeyEnums;
|
|
|
import cn.start.tz.module.pressure2.controller.admin.appointmentconfirmorder.vo.*;
|
|
|
@@ -55,6 +56,7 @@ import cn.start.tz.module.pressure2.dal.mysql.equipboiler.EquipBoilerMapper;
|
|
|
import cn.start.tz.module.pressure2.dal.mysql.equipboilerschedulingitem.EquipBoilerSchedulingCheckMapper;
|
|
|
import cn.start.tz.module.pressure2.dal.mysql.equipboilerschedulingitem.EquipBoilerSchedulingItemMapper;
|
|
|
import cn.start.tz.module.pressure2.service.acceptorder.AcceptOrderService;
|
|
|
+import cn.start.tz.module.pressure2.service.boilerorderexception.BoilerOrderExceptionService;
|
|
|
import cn.start.tz.module.pressure2.service.common.RedisService;
|
|
|
import cn.start.tz.module.pressure2.service.equipboilerschedulingcheck.EquipBoilerSchedulingCheckService;
|
|
|
import cn.start.tz.module.pressure2.service.member.MemberRemoteService;
|
|
|
@@ -722,6 +724,7 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
AppointmentConfirmOrderDO updateObj = BeanUtils.toBean(submitVO, AppointmentConfirmOrderDO.class);
|
|
|
// 设置已创建受理单标志为true
|
|
|
updateObj.setCreateAcceptOrder(true);
|
|
|
+ updateObj.setStatus(200);
|
|
|
// 执行更新操作
|
|
|
appointmentConfirmOrderMapper.updateById(updateObj);
|
|
|
} else {
|
|
|
@@ -1055,6 +1058,37 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
updateObj.setRemark(confirmOrderVO.getRemark());
|
|
|
}
|
|
|
appointmentConfirmOrderMapper.updateById(updateObj);
|
|
|
+
|
|
|
+ if (confirmOrderVO.getStatus() == 200) {
|
|
|
+ List<BoilerAppointmentConfirmOrderItemDO> boilerAppointmentConfirmOrderItemDOS = appointmentConfirmOrderItemMapper.selectList(BoilerAppointmentConfirmOrderItemDO::getOrderId, confirmOrderVO.getId());
|
|
|
+ List<BoilerAppointmentConfirmOrderUserDO> boilerAppointmentConfirmOrderUserDOS = appointmentConfirmOrderUserMapper.selectList(BoilerAppointmentConfirmOrderUserDO::getOrderId, confirmOrderVO.getId());
|
|
|
+
|
|
|
+ AppointmentSubmitVO appointmentSubmitVO = BeanUtils.toBean(orderDO, AppointmentSubmitVO.class);
|
|
|
+ appointmentSubmitVO.setEquipIds(boilerAppointmentConfirmOrderItemDOS.stream().map(BoilerAppointmentConfirmOrderItemDO::getEquipId).toList());
|
|
|
+ // 将BoilerAppointmentConfirmOrderUserDO,转为groupTeamId:将BoilerAppointmentConfirmOrderUserDO的map
|
|
|
+ List<SubmitTeamItemVO> teamItemVOS = new ArrayList<>();
|
|
|
+ Map<String, List<BoilerAppointmentConfirmOrderUserDO>> groupTeamIdMap = boilerAppointmentConfirmOrderUserDOS.stream().collect(Collectors.groupingBy(BoilerAppointmentConfirmOrderUserDO::getGroupTeamId));
|
|
|
+ groupTeamIdMap.forEach((groupTeamId, userDOS) -> {
|
|
|
+ SubmitTeamItemVO teamItemVO = new SubmitTeamItemVO();
|
|
|
+ teamItemVO.setGroupTeamId(groupTeamId);
|
|
|
+ userDOS.stream().filter(boilerAppointmentConfirmOrderUserDO -> boilerAppointmentConfirmOrderUserDO.getType() == 100)
|
|
|
+ .findFirst()
|
|
|
+ .ifPresent(leader -> teamItemVO.setLeaderId(leader.getUserId()));
|
|
|
+ teamItemVO.setUserIds(userDOS.stream().filter(boilerAppointmentConfirmOrderUserDO -> boilerAppointmentConfirmOrderUserDO.getType() == 200).map(BoilerAppointmentConfirmOrderUserDO::getUserId).toList());
|
|
|
+ teamItemVOS.add(teamItemVO);
|
|
|
+ });
|
|
|
+ appointmentSubmitVO.setTeamList(teamItemVOS);
|
|
|
+ LambdaQueryWrapperX<BoilerOrderExceptionDO> queryOrderException = new LambdaQueryWrapperX<>();
|
|
|
+ queryOrderException.eq(BoilerOrderExceptionDO::getOrderType, 100);
|
|
|
+ queryOrderException.eq(BoilerOrderExceptionDO::getOrderId, appointmentSubmitVO.getId());
|
|
|
+ List<BoilerOrderExceptionDO> orderExceptionDOS = boilerOrderExceptionMapper.selectList(queryOrderException);
|
|
|
+ if (CollUtil.isNotEmpty(orderExceptionDOS)) {
|
|
|
+ BoilerOrderExceptionSaveReqVO orderExceptionRespVO = new BoilerOrderExceptionSaveReqVO();
|
|
|
+ BeanUtils.copyProperties(orderExceptionDOS.get(0), orderExceptionRespVO);
|
|
|
+ appointmentSubmitVO.setBoilerOrderExceptionSaveReqVO(orderExceptionRespVO);
|
|
|
+ }
|
|
|
+ submitBoiler(appointmentSubmitVO);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|