|
|
@@ -23,6 +23,7 @@ import cn.start.tz.module.member.api.templatesendlog.dto.TemplateSendLogDto;
|
|
|
import cn.start.tz.module.member.api.templatesendlog.dto.TemplateSendLogRespDto;
|
|
|
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.dal.mysql.equipboilerscheduling.EquipBoilerSchedulingMapper;
|
|
|
import cn.start.tz.module.pressure2.enums.RedisKeyEnums;
|
|
|
import cn.start.tz.module.pressure2.controller.admin.appointmentconfirmorder.vo.*;
|
|
|
import cn.start.tz.module.pressure2.controller.app.appointmentconfirmorder.vo.AppAppointmentRefuseVO;
|
|
|
@@ -68,11 +69,13 @@ import cn.start.tz.module.system.api.dict.dto.DictDataRespDTO;
|
|
|
import cn.start.tz.module.system.api.orgcontact.OrgContactApi;
|
|
|
import cn.start.tz.module.system.api.user.AdminUserApi;
|
|
|
import cn.start.tz.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -180,6 +183,10 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
@Resource
|
|
|
private OrderReportService orderReportService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ @Lazy
|
|
|
+ private EquipBoilerSchedulingMapper equipBoilerSchedulingMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public String create(AppointmentConfirmOrderDO appointmentConfirmOrderDO) {
|
|
|
|
|
|
@@ -215,10 +222,10 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
// 校验存在
|
|
|
validateAppointmentConfirmOrderExists(updateReqVO.getId());
|
|
|
|
|
|
- // 删除现有组员
|
|
|
- appointmentConfirmOrderUserMapper.delete(BoilerAppointmentConfirmOrderUserDO::getOrderId, updateReqVO.getId());
|
|
|
- List<BoilerAppointmentConfirmOrderUserDO> acceptOrderUserList = new ArrayList<>();
|
|
|
if (CollUtil.isNotEmpty(updateReqVO.getTeamList())) {
|
|
|
+ // 删除现有组员
|
|
|
+ appointmentConfirmOrderUserMapper.delete(BoilerAppointmentConfirmOrderUserDO::getOrderId, updateReqVO.getId());
|
|
|
+ List<BoilerAppointmentConfirmOrderUserDO> acceptOrderUserList = new ArrayList<>();
|
|
|
updateReqVO.getTeamList().forEach(team -> {
|
|
|
BoilerAppointmentConfirmOrderUserDO leader = new BoilerAppointmentConfirmOrderUserDO();
|
|
|
leader.setOrderId(updateReqVO.getId());
|
|
|
@@ -577,6 +584,28 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
eq(EquipBoilerSchedulingItemDO::getSchedulingId, appointmentConfirmOrderDO.getSchedulingId()).
|
|
|
in(EquipBoilerSchedulingItemDO::getEquipId, appointmentRefuseVO.getEquipIds())
|
|
|
);
|
|
|
+ Long count = equipBoilerSchedulingItemMapper.selectCount(EquipBoilerSchedulingItemDO::getSchedulingId, appointmentConfirmOrderDO.getSchedulingId());
|
|
|
+ if (count == null || count == 0) {
|
|
|
+ equipBoilerSchedulingMapper.deleteById(appointmentConfirmOrderDO.getSchedulingId());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 恢复设备状态
|
|
|
+ if (appointmentConfirmOrderDO.getCheckType() == 100){
|
|
|
+ equipBoilerMapper.update(new LambdaUpdateWrapper<EquipBoilerDO>().
|
|
|
+ in(EquipBoilerDO::getId, appointmentRefuseVO.getEquipIds()).
|
|
|
+ set(EquipBoilerDO::getHasInternal, false)
|
|
|
+ );
|
|
|
+ }else if (appointmentConfirmOrderDO.getCheckType() == 200){
|
|
|
+ equipBoilerMapper.update(new LambdaUpdateWrapper<EquipBoilerDO>().
|
|
|
+ in(EquipBoilerDO::getId, appointmentRefuseVO.getEquipIds()).
|
|
|
+ set(EquipBoilerDO::getHasExternal, false)
|
|
|
+ );
|
|
|
+ }else if (appointmentConfirmOrderDO.getCheckType() == 300){
|
|
|
+ equipBoilerMapper.update(new LambdaUpdateWrapper<EquipBoilerDO>().
|
|
|
+ in(EquipBoilerDO::getId, appointmentRefuseVO.getEquipIds()).
|
|
|
+ set(EquipBoilerDO::getHasPressure, false)
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
if (300 == appointmentRefuseVO.getType()) {
|
|
|
@@ -602,63 +631,6 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
|
|
|
return;
|
|
|
}
|
|
|
// 拒绝检验
|
|
|
-/* if(200 == appointmentRefuseVO.getType()){
|
|
|
-
|
|
|
- List<AppointmentConfirmRefuseYearItemDO> list = equipContainerDOS.stream().map(item -> {
|
|
|
- AppointmentConfirmRefuseYearItemDO appointmentConfirmOrderRefuseItemDO = new AppointmentConfirmRefuseYearItemDO();
|
|
|
- appointmentConfirmOrderRefuseItemDO.setOrderId(appointmentRefuseVO.getOrderId());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setEquipId(item.getId());
|
|
|
- if (appointmentRefuseVO.getCheckType() == 100 && item.getNextInCheckDate() != null) {
|
|
|
- appointmentConfirmOrderRefuseItemDO.setNextCheckDate(LocalDate.from(item.getNextInCheckDate()));
|
|
|
- }
|
|
|
- if (appointmentRefuseVO.getCheckType() == 200 && item.getNextOutCheckDate() != null) {
|
|
|
- appointmentConfirmOrderRefuseItemDO.setNextCheckDate(LocalDate.from(item.getNextOutCheckDate()));
|
|
|
- }
|
|
|
- if (appointmentRefuseVO.getCheckType() == 300 && item.getNextPressureCheckDate() != null) {
|
|
|
- appointmentConfirmOrderRefuseItemDO.setNextCheckDate(LocalDate.from(item.getNextPressureCheckDate()));
|
|
|
- }
|
|
|
- appointmentConfirmOrderRefuseItemDO.setUnitCode(item.getUnitCode());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setUnitName(item.getUnitName());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setCheckType(appointmentRefuseVO.getCheckType());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setOrderNo(appointmentRefuseVO.getOrderNo());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setSubmitId(getLoginUserId());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setSubmitTime(LocalDateTime.now());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setReasonDict(appointmentRefuseVO.getReasonDict());
|
|
|
- //appointmentConfirmOrderRefuseItemDO.setBeDistrict(item.getBeDistrict());
|
|
|
- //appointmentConfirmOrderRefuseItemDO.setEquipType(item.getEquipType());
|
|
|
-
|
|
|
- if (appointmentConfirmOrderDO != null) {
|
|
|
- appointmentConfirmOrderRefuseItemDO.setCheckDate(appointmentConfirmOrderDO.getAppointmentDate());
|
|
|
- appointmentConfirmOrderRefuseItemDO.setOrderNo(appointmentConfirmOrderDO.getAppointmentNo());
|
|
|
- }
|
|
|
-
|
|
|
- appointmentConfirmOrderRefuseItemDO.setReason(appointmentRefuseVO.getReason());
|
|
|
- return appointmentConfirmOrderRefuseItemDO;
|
|
|
- }).toList();
|
|
|
-
|
|
|
- appointmentConfirmRefuseYearItemMapper.insert(list);
|
|
|
-
|
|
|
- appointmentConfirmOrderItemMapper.delete(new LambdaQueryWrapperX<BoilerAppointmentConfirmOrderItemDO>().
|
|
|
- eq(BoilerAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId()).
|
|
|
- in(BoilerAppointmentConfirmOrderItemDO::getEquipId, appointmentRefuseVO.getEquipIds())
|
|
|
- );
|
|
|
-
|
|
|
- if (StringUtils.isNotBlank(appointmentRefuseVO.getOrderId())) {
|
|
|
- Long count = appointmentConfirmOrderItemMapper.selectCount(BoilerAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
|
|
|
- AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
|
|
|
- updateOrder.setId(appointmentRefuseVO.getOrderId());
|
|
|
- if (count == null || count == 0) {
|
|
|
- updateOrder.setStatus(500);
|
|
|
- updateOrder.setEquipNumBoiler(0);
|
|
|
- }
|
|
|
- if (count != null){
|
|
|
- updateOrder.setEquipNumBoiler(Math.toIntExact(count));
|
|
|
- }
|
|
|
- appointmentConfirmOrderMapper.updateById(updateOrder);
|
|
|
- }
|
|
|
-
|
|
|
- return ;
|
|
|
- }*/
|
|
|
|
|
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
|
|
|