From 52ab113fb8ed54c4ed04642b5e960151694363f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=B8=E7=8E=8B=E9=BE=99?= <768863620@qq.com> Date: Mon, 24 Feb 2025 15:44:08 +0800 Subject: [PATCH] =?UTF-8?q?PiPeiGongZuoZhanForGzzxAndRqh=5Fduohang=20=20?= =?UTF-8?q?=E5=A4=B4=E7=89=A9=E6=96=99=E7=BB=84=E5=90=88=20=E5=B0=8F?= =?UTF-8?q?=E4=BA=8E15=20=E4=B8=AA=E7=89=A9=E6=96=99=E7=9A=84=E4=B9=9F?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=AE=B9=E5=99=A8=E5=8C=B9=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shipping/pojo/DefaultNewWaveManager.java | 119 +++++++++++++++++- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dev/swms/server/service/shipping/pojo/DefaultNewWaveManager.java b/src/main/java/com/dev/swms/server/service/shipping/pojo/DefaultNewWaveManager.java index 87474c2..aff6116 100644 --- a/src/main/java/com/dev/swms/server/service/shipping/pojo/DefaultNewWaveManager.java +++ b/src/main/java/com/dev/swms/server/service/shipping/pojo/DefaultNewWaveManager.java @@ -421,7 +421,25 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements this_notFenPei=this_notFenPei-list_wList.size(); gzzMap.put(curr_gzz.code, curr_gzz); - } else { + }else if(this_fenzuCount1) { + List list_wL_rq=new ArrayList<>(); + String GDH=""; + for (int index = 0; index < gongDanList.size(); index++) { + GongDanMingXi gongDanMingXi = gongDanList.get(index); + list_wL_rq.addAll(gongDanMingXi.list); + GDH=GDH+gongDanMingXi.gdh+"__"; + } + GongZuoZhan curr_gzz = PiPeiGongZuoZhanForGzzxAndRqh_duohang(listGzz, list_wL_rq, cfhs,GDH); + for (int index = 0; index < gongDanList.size(); index++) { + GongDanMingXi gongDanMingXi = gongDanList.get(index); + List list_wList = gongDanMingXi.list; + for (FenPei fenPei : list_wList) { + curr_gzz.renWuList.add(fenPei); + curr_gzz.RongQIHaoMap.put(fenPei.rqh, ""); + curr_gzz.GongZuoZhongXinMap.put(fenPei.gzzx, ""); + } + } + }else{ // 多个工单匹配进行 int gzz_index = 0; // 当前分配工作站的排序下标 GongZuoZhan curr_gzz = listGzz.get(0); @@ -703,6 +721,105 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements "------------------------匹配容器号和工作中心-----------------------------------------------"); return check; } + + + public GongZuoZhan PiPeiGongZuoZhanForGzzxAndRqh_duohang(List listGzz, + List list_wList , int cfhs,String GDH) { + + GongZuoZhan check = listGzz.get(0); + int max_rqh_count = 0; + int max_gzzx = 0; + LogPrint( + log_GongZuoZhanPiPeiForRqhAndGzzx, + "------------------------匹配容器号和工作中心DuoHang-----------------------------------------------"); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, + "↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓"); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前头物料:"+ GDH); + for (GongZuoZhan gzz : listGzz) { + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工作站:" + gzz.code); + List list = gzz.renWuList; + StringBuffer sb_gzzx = new StringBuffer(); + StringBuffer sb_rqh = new StringBuffer(); + for (FenPei fenPei : list) { + sb_gzzx.append(fenPei.gzzx + " , "); + sb_rqh.append(fenPei.rqh + " , "); + } + int chao = (list_wList.size() + gzz.notFinished + gzz.renWuList + .size()) - gzz.maxRenWu; + // LogPrint(listGzz.size()); + //2025/02/24 if (chao > cfhs) { 修改为 chao > 0 散单不追加到 大工单内 + + if (chao > 0) { + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code + + "超出:" + chao + "无法分配,跳过此工作站"); + continue; + } + StringBuffer sb_pipei = new StringBuffer(); + int rqh_count = 0; + int gzzx = 0; + for (FenPei fenPei : list_wList) { + if (gzz.GongZuoZhongXinMap.containsKey(fenPei.gzzx)) { + gzzx = 1; + } + if (gzz.RongQIHaoMap.containsKey(fenPei.rqh)) { + rqh_count = rqh_count + 1; + sb_pipei.append(fenPei.rqh); + } + } + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code + + " gzzx:" + gzzx + " rqh_count:" + rqh_count); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_gzzx.toString()); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_rqh.toString()); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, + "匹配上的容器号: " + sb_pipei.toString()); + Boolean isPiPeiGzzx = false;// true 优先按照工作中心匹配,再按照容器号。false直接按照容器号匹配散单 + if (isPiPeiGzzx) { + if (max_gzzx == 0 && gzzx == 0 && rqh_count > max_rqh_count) { + // 如果工作中心未匹配过,且本次未匹配到工作中心 容器号 匹配 度大优先 + max_rqh_count = rqh_count; + max_gzzx = gzzx; + check = gzz; + } else if (max_gzzx == 0 && gzzx == 1) { + // 如果工作中心未匹配过,本次匹配到工作中心 + max_rqh_count = rqh_count; + max_gzzx = gzzx; + check = gzz; + + } else if (max_gzzx == 1 && gzzx == 1 + && rqh_count > max_rqh_count) { + // 如果匹配过工作中心,且本次匹配到工作中心; 容器号匹配度大优先 + max_rqh_count = rqh_count; + max_gzzx = gzzx; + check = gzz; + + } + } else { + if (rqh_count > max_rqh_count) { + // 无论工作中心是否匹配,容器号匹配次数优先 + max_rqh_count = rqh_count; + max_gzzx = gzzx; + check = gzz; + } else if (rqh_count == max_rqh_count && gzzx == 1 + && max_gzzx == 0) { + // 如果容器号匹配次数相同,且上次匹配工作站未匹配工作中心,本次匹配到了工作中心,本次匹配设为最优解 + max_rqh_count = rqh_count; + max_gzzx = gzzx; + check = gzz; + } + + } + } + + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "容器号匹配次数:" + max_rqh_count + + " 工作中心匹配次数:" + max_gzzx + " 工单号:" + GDH + + " 工作站:" + check.code); + LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, + "↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"); + LogPrint( + log_GongZuoZhanPiPeiForRqhAndGzzx, + "------------------------匹配容器号和工作中心-----------------------------------------------"); + return check; + } public List FaiXuGzz(Map gzzMap) { List list = new ArrayList();