Ver código fonte

设备数量

xuzhancheng 2 dias atrás
pai
commit
8b8dec368b

+ 4 - 1
build-uat/update.sql

@@ -1491,4 +1491,7 @@ COMMENT ON COLUMN "PRESSURE2_EQUIPMENT_RETURN_RECORD"."EQUIP_STATUS_NAME" IS '
 ALTER TABLE "PRESSURE2_REPORT_CITY_RECORD" ADD COLUMN "CHECK_TYPE_NAME" VARCHAR(50);
 ALTER TABLE "PRESSURE2_REPORT_CITY_RECORD" ADD COLUMN "EQUIP_STATUS_NAME" VARCHAR(32);
 COMMENT ON COLUMN "PRESSURE2_REPORT_CITY_RECORD"."CHECK_TYPE_NAME" IS '检验类型文本';
-COMMENT ON COLUMN "PRESSURE2_REPORT_CITY_RECORD"."EQUIP_STATUS_NAME" IS '运行状态文本';
+COMMENT ON COLUMN "PRESSURE2_REPORT_CITY_RECORD"."EQUIP_STATUS_NAME" IS '运行状态文本';
+
+
+-- 0522以上已加

+ 29 - 8
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/appointmentconfirmorder/AppointmentConfirmOrderServiceImpl.java

@@ -28,6 +28,7 @@ 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.dal.dataobject.equipboilerscheduling.EquipBoilerSchedulingDO;
 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;
@@ -490,6 +491,14 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
             }).toList();
 
             appointmentConfirmOrderItemMapper.insertBatch(list);
+
+            Long count = appointmentConfirmOrderItemMapper.selectCount(BoilerAppointmentConfirmOrderItemDO::getOrderId, equipUpdateVO.getOrderId());
+            if (count != null){
+                AppointmentConfirmOrderDO updateObj = new AppointmentConfirmOrderDO();
+                updateObj.setId(equipUpdateVO.getOrderId());
+                updateObj.setEquipNumBoiler(Math.toIntExact(count));
+                appointmentConfirmOrderMapper.updateById(updateObj);
+            }
         }
 
         AppointmentConfirmOrderDO appointmentConfirmOrderDO = appointmentConfirmOrderMapper.selectById(equipUpdateVO.getOrderId());
@@ -526,12 +535,16 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
 
             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){
-                    AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
-                    updateOrder.setId(appointmentRefuseVO.getOrderId());
                     updateOrder.setStatus(500);
-                    appointmentConfirmOrderMapper.updateById(updateOrder);
+                    updateOrder.setEquipNumBoiler(0);
                 }
+                if (count != null){
+                    updateOrder.setEquipNumBoiler(Math.toIntExact(count));
+                }
+                appointmentConfirmOrderMapper.updateById(updateOrder);
             }
             return;
         }
@@ -577,14 +590,18 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
                     in(BoilerAppointmentConfirmOrderItemDO::getEquipId, appointmentRefuseVO.getEquipIds())
             );
 
-            if(StringUtils.isNotBlank(appointmentRefuseVO.getOrderId())){
+            if (StringUtils.isNotBlank(appointmentRefuseVO.getOrderId())) {
                 Long count = appointmentConfirmOrderItemMapper.selectCount(BoilerAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
-                if(count == null || count == 0){
-                    AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
-                    updateOrder.setId(appointmentRefuseVO.getOrderId());
+                AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
+                updateOrder.setId(appointmentRefuseVO.getOrderId());
+                if (count == null || count == 0) {
                     updateOrder.setStatus(500);
-                    appointmentConfirmOrderMapper.updateById(updateOrder);
+                    updateOrder.setEquipNumBoiler(0);
+                }
+                if (count != null){
+                    updateOrder.setEquipNumBoiler(Math.toIntExact(count));
                 }
+                appointmentConfirmOrderMapper.updateById(updateOrder);
             }
 
             return ;
@@ -688,6 +705,10 @@ public class AppointmentConfirmOrderServiceImpl implements AppointmentConfirmOrd
                 eq(BoilerAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId()).
                 in(BoilerAppointmentConfirmOrderItemDO::getEquipId, appointmentRefuseVO.getEquipIds())
         );
+        Long count = appointmentConfirmOrderItemMapper.selectCount(BoilerAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
+        if (count != null) {
+            appointmentConfirmOrderMapper.updateById(new AppointmentConfirmOrderDO().setId(appointmentRefuseVO.getOrderId()).setEquipNumBoiler(count.intValue()));
+        }
     }
 
     /**

+ 32 - 8
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/appointmentconfirmorder/PipeAppointmentConfirmOrderServiceImpl.java

@@ -558,6 +558,14 @@ public class PipeAppointmentConfirmOrderServiceImpl implements PipeAppointmentCo
                 }).toList();
                 appointmentConfirmOrderItemDetailMapper.insert(appointmentConfirmOrderItemDetailDOS);
             });
+
+            Long count = appointmentConfirmOrderItemMapper.selectCount(PipeAppointmentConfirmOrderItemDO::getOrderId, equipUpdateVO.getOrderId());
+            if (count != null){
+                AppointmentConfirmOrderDO updateObj = new AppointmentConfirmOrderDO();
+                updateObj.setId(equipUpdateVO.getOrderId());
+                updateObj.setEquipNumBoiler(Math.toIntExact(count));
+                appointmentConfirmOrderMapper.updateById(updateObj);
+            }
         }
 
         AppointmentConfirmOrderDO appointmentConfirmOrderDO = appointmentConfirmOrderMapper.selectById(equipUpdateVO.getOrderId());
@@ -612,12 +620,15 @@ public class PipeAppointmentConfirmOrderServiceImpl implements PipeAppointmentCo
             }
             if(StringUtils.isNotBlank(appointmentRefuseVO.getOrderId())){
                 Long count = appointmentConfirmOrderItemMapper.selectCount(PipeAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
-                if(count == null || count == 0){
-                    AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
-                    updateOrder.setId(appointmentRefuseVO.getOrderId());
+                AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
+                updateOrder.setId(appointmentRefuseVO.getOrderId());
+                if (count == null || count == 0) {
                     updateOrder.setStatus(500);
-                    appointmentConfirmOrderMapper.updateById(updateOrder);
                 }
+                if (count != null) {
+                    updateOrder.setEquipNumBoiler(Math.toIntExact(count));
+                }
+                appointmentConfirmOrderMapper.updateById(updateOrder);
             }
             return;
         }
@@ -660,12 +671,15 @@ public class PipeAppointmentConfirmOrderServiceImpl implements PipeAppointmentCo
 
             if(StringUtils.isNotBlank(appointmentRefuseVO.getOrderId())){
                 Long count = appointmentConfirmOrderItemMapper.selectCount(PipeAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
-                if(count == null || count == 0){
-                    AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
-                    updateOrder.setId(appointmentRefuseVO.getOrderId());
+                AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
+                updateOrder.setId(appointmentRefuseVO.getOrderId());
+                if (count == null || count == 0) {
                     updateOrder.setStatus(500);
-                    appointmentConfirmOrderMapper.updateById(updateOrder);
                 }
+                if (count != null) {
+                    updateOrder.setEquipNumBoiler(Math.toIntExact(count));
+                }
+                appointmentConfirmOrderMapper.updateById(updateOrder);
             }
 
             return ;
@@ -770,6 +784,16 @@ public class PipeAppointmentConfirmOrderServiceImpl implements PipeAppointmentCo
                 .in(PipeAppointmentConfirmOrderItemDetailDO::getItemId, pipeTaskOrderItemDOS.stream().map(PipeAppointmentConfirmOrderItemDO::getId).toList())
         );
         }
+        Long count = appointmentConfirmOrderItemMapper.selectCount(PipeAppointmentConfirmOrderItemDO::getOrderId, appointmentRefuseVO.getOrderId());
+        AppointmentConfirmOrderDO updateOrder = new AppointmentConfirmOrderDO();
+        updateOrder.setId(appointmentRefuseVO.getOrderId());
+        if (count == null || count == 0) {
+            updateOrder.setStatus(500);
+        }
+        if (count != null) {
+            updateOrder.setEquipNumBoiler(Math.toIntExact(count));
+        }
+        appointmentConfirmOrderMapper.updateById(updateOrder);
     }
 
     /**