PiPeiGongZuoZhanForGzzxAndRqh_duohang 头物料组合 小于15 个物料的也进行容器匹配

main
霸王龙 2025-02-24 15:44:08 +08:00
parent 13b0f3633a
commit 52ab113fb8
1 changed files with 118 additions and 1 deletions

View File

@ -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_fenzuCount<cfhs &&gongDanList.size() >1) {
List<FenPei> 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<FenPei> 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<GongZuoZhan> listGzz,
List<FenPei> 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<FenPei> 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<GongZuoZhan> FaiXuGzz(Map<String, GongZuoZhan> gzzMap) {
List<GongZuoZhan> list = new ArrayList<DefaultNewWaveManager.GongZuoZhan>();