From 4e45a8252d7bccd23a1a57aa541a2ea521760572 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 21 十月 2024 15:39:04 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java |   48 ++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index cc37400..ebad326 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -27,6 +27,7 @@
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -1023,6 +1024,7 @@
                 PlatformJob job = platformJobMapper.selectJoinOne(PlatformJob.class, new MPJLambdaWrapper<PlatformJob>()
                         .selectAll(PlatformJob.class)
                         .selectAs(Platform::getName,PlatformJob::getPlatformName)
+                        .selectAs(Platform::getLedContent,PlatformJob::getLedContent)
                         .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
 //                        .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//鍓嶈溅鐗屽彿
 //                        .eq(!StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeBack,status.getPlateNo() )//鍚庤溅鐗屽彿
@@ -1054,15 +1056,21 @@
                     update.setStatus(Constants.PlatformJobStatus.DONE.getKey());//浣滀笟宸插畬鎴�
                     update.setDoneDate(update.getEditDate());*/
                     if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey()) ||
+                            Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.TRANSFERING.getKey()) ||
+                            Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.EXCEPTION.getKey()) ||
                             Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())){
                         if(((StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeFront(),status.getPlateNo()))
                                 ||(!StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeBack(),status.getPlateNo()))
                         )){
                             //璇存槑杞﹁締杩涢敊鏈堝彴 鎴栬�呰繕鏈彨鍙风姸鎬侊紝鍙戣捣璀﹀憡
 //                          dealCarsInErrorPlatformBiz(job,status);
-                            update.setInOut(Constants.ZERO);//杞﹁締宸茬粡绂诲紑
-                            platformJobMapper.updateById(update);
-                        }
+                            if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey())  ||
+                                    Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())){
+                                update.setInOut(Constants.ZERO);//杞﹁締宸茬粡绂诲紑
+                                platformJobMapper.updateById(update);
+                            }
+                            dealPlatformContentForLeave(job);
+                         }
                     }
                 }else  if(StringUtils.equals(status.getMotionStatus(),"enter")){
                     //濡傛灉鏄溅杈嗚繘鍏�
@@ -1078,7 +1086,8 @@
                             platformJobMapper.updateById(update);
                         }
                     }
-                    /*if(job.getStartDate() == null){
+                    /*
+                    if(job.getStartDate() == null){
                         update.setStartDate(update.getEditDate());
                     }
                     update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//寮�濮嬩綔涓�
@@ -1104,6 +1113,37 @@
         return  null;
     }
 
+    /**
+     * 鏈堝彴杞﹁締绂诲紑 璁剧疆鏈堝彴鏂囨涓衡�滅┖闂蹭腑 鏂囨鈥�
+     * @param model
+     */
+    private void dealPlatformContentForLeave(PlatformJob model) {
+        List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
+                .eq(PlatformDevice::getType, Constants.ZERO)
+                .eq(PlatformDevice::getPlatformId,model.getPlatformId())
+                .eq(PlatformDevice::getIsdeleted,Constants.ZERO));
+        if(deviceList ==null || deviceList.size() == 0){
+            return;
+        }
+        int speed = 13;
+        try {
+            speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
+        }catch (Exception e){
+        }
+        String content = StringUtils.defaultString(model.getLedContent(), Constants.PlatformLedContent.IDEL_CONTNET.getInfo());
+        List<PlatformBroadcastLog> logList = new ArrayList<>();
+        for(PlatformDevice device : deviceList){
+            if(StringUtils.isBlank(device.getHkId())){
+                continue;
+            }
+            PlatformBroadcastLog log = dealLedContentBiz(model.getId(),device.getHkNo(),device.getName(),content,speed,1);
+            logList.add(log);
+        }
+        if(logList.size()>0){
+            platformBroadcastLogMapper.insert(logList);
+        }
+    }
+
     private PlatformEvent initPlatformEventModel(EventPlatformCarsInfoRequest request, EventPlatformCarsDataRequest data, EventPlatformCarsStatusInfoRequest status) {
         PlatformEvent model = new PlatformEvent();
         model.setCreateDate(new Date());

--
Gitblit v1.9.3