From 90b950bfd7f8c8c4835edf5e8a1062d17d953032 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期二, 14 十月 2025 11:14:59 +0800
Subject: [PATCH] 宁夏轮换计划接口调整

---
 src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1109.java |  130 ++++++++++++++++++++++++------------------
 1 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1109.java b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1109.java
index 55da4bf..d6d0ff8 100644
--- a/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1109.java
+++ b/src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1109.java
@@ -17,9 +17,12 @@
 import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.text.ParseException;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -112,6 +115,9 @@
                 if (inoutData.getRecordStatus().equals("DEL") || inoutData.getRecordStatus().equals("ERROR")) {
                     continue;
                 }
+                if (!inoutData.getProgress().equals("RECORD")){
+                    continue;
+                }
                 ids = new ArrayList<>();
                 wjlx = "";
                 //鑾峰彇鍑哄叆搴撲笟鍔″崟鍙蜂俊鎭�
@@ -145,6 +151,7 @@
                 }
                 int num = 1;
                 int idsNum = 0;
+                String bizTag = null;
                 for (Fz40FileInfo sysData : fileList) {
                     apiData = new Api1109();
 
@@ -164,9 +171,25 @@
                     }
                     //绉伴噸
                     if (BIZ_TAG_WEIGHT_FULL.equals(sysData.getBizTag()) || BIZ_TAG_WEIGHT_EMPTY.equals(sysData.getBizTag())) {
-                        if(num > 8){
-                            num = 1;
-                            idsNum ++;
+                        bizTag = sysData.getBizTag();
+                        if(StringUtils.isNotEmpty(inoutData.getTransType()) && inoutData.getTransType().equals("3")){
+                            if(num > 6){
+                                num = 1;
+                                idsNum ++;
+                            }
+                        }else {
+                            if(num > 8){
+                                num = 1;
+                                idsNum ++;
+                            }
+                        }
+                        //2024-05-23 姝ゅ鏆傛椂璁剧疆鍚嶇О闀垮害闄愬埗锛屽悗鏈熻皟鏁村悗鍙垹闄�
+                        if(sysData.getCreateTime().after(DateUtils.parseDate("2024-04-18",new String[]{"yyyy-MM-dd"}))){
+                            if(StringUtils.isNotEmpty(inoutData.getTransType()) && inoutData.getTransType().equals("3")){
+                                bizTag = sysData.getBizTag();
+                            }else {
+                                bizTag = null;
+                            }
                         }
                         if(idsNum == ids.size()){
                             break;
@@ -176,7 +199,7 @@
                         wjmc = kqdm + "_" + str;
 
                         //鏂囦欢鍚嶇О
-                        wjmc = getImgNameType(wjmc, sysData.getBizTag(), str, sysData.getFileName(), map);
+                        wjmc = getImgNameType(wjmc, bizTag, str, sysData.getFileName(), map);
                         apiData.setWjmc(wjmc);
                         apiData.setWjlx(wjlx);
                         if (wjmc.indexOf(Constant.IMG_NAME_TYPE_IVG) >= 0 || wjmc.indexOf(Constant.IMG_NAME_TYPE_IVT) >= 0) {
@@ -226,51 +249,54 @@
      * @return
      */
     private String getImgNameType(String wjmc, String bizTag, String bizId, String fileName, Map<String, Integer> map) {
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_DJ) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_DJ + ".jpg";
+        if(null == bizTag){
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_DJ) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_DJ + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_RK) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_RK + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_CK) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_CK + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_GL) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_GL + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_GR) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_GR + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_GT) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_GT + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_TL) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_TL + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_TR) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_TR + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_TT) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_TT + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_SL) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_SL + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_SF) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_SF + ".jpg";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_IVG) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_IVG + ".mp4";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_IVT) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_IVT + ".mp4";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_OVG) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_OVG + ".mp4";
+            }
+            if (fileName.indexOf(Constant.IMG_NAME_TYPE_OVT) >= 0) {
+                return wjmc + "_" + Constant.IMG_NAME_TYPE_OVT + ".mp4";
+            }
         }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_RK) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_RK + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_CK) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_CK + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_GL) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_GL + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_GR) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_GR + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_GT) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_GT + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_TL) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_TL + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_TR) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_TR + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_TT) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_TT + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_SL) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_SL + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_SF) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_SF + ".jpg";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_IVG) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_IVG + ".mp4";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_IVT) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_IVT + ".mp4";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_OVG) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_OVG + ".mp4";
-        }
-        if (fileName.indexOf(Constant.IMG_NAME_TYPE_OVT) >= 0) {
-            return wjmc + "_" + Constant.IMG_NAME_TYPE_OVT + ".mp4";
-        }
+
         Integer num = 0;
         //姣涢噸
         if (BIZ_TAG_WEIGHT_FULL.equals(bizTag)) {
@@ -287,10 +313,6 @@
                 map.put(bizId + "_" + bizTag, 3);
             }
             if (num == 3) {
-                wjmc += "_" + Constant.IMG_NAME_TYPE_GR;
-                map.put(bizId + "_" + bizTag, 4);
-            }
-            if (num == 4) {
                 wjmc += "_" + Constant.IMG_NAME_TYPE_GT;
                 map.remove(bizId + "_" + bizTag);
             }
@@ -310,10 +332,6 @@
                 map.put(bizId + "_" + bizTag, 3);
             }
             if (num == 3) {
-                wjmc += "_" + Constant.IMG_NAME_TYPE_TR;
-                map.put(bizId + "_" + bizTag, 4);
-            }
-            if (num == 4) {
                 wjmc += "_" + Constant.IMG_NAME_TYPE_TT;
                 map.remove(bizId + "_" + bizTag);
             }

--
Gitblit v1.9.3