// 头物料相同的工单且行数差小于4 放在一起 或者 头物料相同的工单且行数大于40 放在一起
parent
4b544cac3a
commit
947c440423
|
|
@ -428,12 +428,17 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
LogPrint(
|
LogPrint(
|
||||||
log_GongZuoZhanMinXi,
|
log_GongZuoZhanMinXi,
|
||||||
"---------------------------------------------------工作站详情-----------------------------------------------------------------------------------------------");
|
"---------------------------------------------------工作站详情-----------------------------------------------------------------------------------------------");
|
||||||
|
LogPrint(
|
||||||
|
log_GongZuoZhanMinXi,
|
||||||
|
"---------------------------------------------------开始分配-----------------------------------------------------------------------------------------------");
|
||||||
for (TwlFenZu twlFenZu : twlFenZuList) {
|
for (TwlFenZu twlFenZu : twlFenZuList) {
|
||||||
List<GongDanMingXi> gongDanList = twlFenZu.gdPaiXus; // 当前头物料所有的工单组合,以及每个工单的物料明细
|
List<GongDanMingXi> gongDanList = twlFenZu.gdPaiXus; // 当前头物料所有的工单组合,以及每个工单的物料明细
|
||||||
int this_fenzuCount = twlFenZu.wl_count; // 当前分组总物料行数
|
int this_fenzuCount = twlFenZu.wl_count; // 当前分组总物料行数
|
||||||
int this_notFenPei=this_fenzuCount;
|
int this_notFenPei=this_fenzuCount;
|
||||||
List<GongZuoZhan> listGzz = FaiXuGzz(gzzMap); // 工作站根据可分配数量进行排序
|
List<GongZuoZhan> listGzz = FaiXuGzz(gzzMap); // 工作站根据可分配数量进行排序
|
||||||
|
|
||||||
|
LogPrint( true,"当前头物料:"+twlFenZu.gdPaiXus.get(0).twl+"总数量为:"+twlFenZu.wl_count +"工单数为:"+twlFenZu.gdPaiXus.size());
|
||||||
|
|
||||||
if (gongDanList.size() == 1) {
|
if (gongDanList.size() == 1) {
|
||||||
GongDanMingXi gongDanMingXi = gongDanList.get(0);
|
GongDanMingXi gongDanMingXi = gongDanList.get(0);
|
||||||
GongZuoZhan curr_gzz = PiPeiGongZuoZhanForGzzxAndRqh(listGzz,
|
GongZuoZhan curr_gzz = PiPeiGongZuoZhanForGzzxAndRqh(listGzz,
|
||||||
|
|
@ -449,6 +454,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
gzzMap.put(curr_gzz.code, curr_gzz);
|
gzzMap.put(curr_gzz.code, curr_gzz);
|
||||||
|
|
||||||
}else if(this_fenzuCount<cfhs &&gongDanList.size() >1) {
|
}else if(this_fenzuCount<cfhs &&gongDanList.size() >1) {
|
||||||
|
// 多个工单匹配进行
|
||||||
List<FenPei> list_wL_rq=new ArrayList<>();
|
List<FenPei> list_wL_rq=new ArrayList<>();
|
||||||
String GDH="";
|
String GDH="";
|
||||||
for (int index = 0; index < gongDanList.size(); index++) {
|
for (int index = 0; index < gongDanList.size(); index++) {
|
||||||
|
|
@ -467,7 +473,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// 多个工单匹配进行
|
|
||||||
int gzz_index = 0; // 当前分配工作站的排序下标
|
int gzz_index = 0; // 当前分配工作站的排序下标
|
||||||
GongZuoZhan curr_gzz = listGzz.get(0);
|
GongZuoZhan curr_gzz = listGzz.get(0);
|
||||||
for (int index = 0; index < gongDanList.size(); index++) {
|
for (int index = 0; index < gongDanList.size(); index++) {
|
||||||
|
|
@ -475,7 +481,10 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
// 当前工单的物料
|
// 当前工单的物料
|
||||||
List<FenPei> list_wList = gongDanMingXi.list;
|
List<FenPei> list_wList = gongDanMingXi.list;
|
||||||
|
|
||||||
|
LogPrint( true,"当前工作站:"+curr_gzz.code+"notFinished:"+ curr_gzz.notFinished +"renWuList.size():"+curr_gzz.renWuList.size()+"maxRenWu:"+curr_gzz.maxRenWu);
|
||||||
|
|
||||||
int GzzRenwuOver = (list_wList.size() + curr_gzz.notFinished + curr_gzz.renWuList.size()) - curr_gzz.maxRenWu;
|
int GzzRenwuOver = (list_wList.size() + curr_gzz.notFinished + curr_gzz.renWuList.size()) - curr_gzz.maxRenWu;
|
||||||
|
LogPrint( true,"list_wList:"+list_wList.size() +"GzzRenwuOver:"+ GzzRenwuOver+"this_notFenPei:"+this_notFenPei+"cfhs:"+cfhs+"index---"+index+"---"+( gongDanList.size() - 1));
|
||||||
// LogPrint(listGzz.size());
|
// LogPrint(listGzz.size());
|
||||||
//如果当前任务分配进此工作站不超过最大任务数,或者 当前任务在内 剩余数量不超过 拆分行数或者 当前工单是最后一个工单
|
//如果当前任务分配进此工作站不超过最大任务数,或者 当前任务在内 剩余数量不超过 拆分行数或者 当前工单是最后一个工单
|
||||||
if (GzzRenwuOver <= 0 || (this_notFenPei<=cfhs||index == gongDanList.size() - 1)) {
|
if (GzzRenwuOver <= 0 || (this_notFenPei<=cfhs||index == gongDanList.size() - 1)) {
|
||||||
|
|
@ -663,8 +672,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
"------------------------匹配容器号和工作中心-----------------------------------------------");
|
"------------------------匹配容器号和工作中心-----------------------------------------------");
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
||||||
"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓");
|
"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓");
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工单号:"
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工单号:"+ gongDanMingXi.gdh);
|
||||||
+ gongDanMingXi.gdh);
|
|
||||||
for (GongZuoZhan gzz : listGzz) {
|
for (GongZuoZhan gzz : listGzz) {
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工作站:" + gzz.code);
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工作站:" + gzz.code);
|
||||||
List<FenPei> list = gzz.renWuList;
|
List<FenPei> list = gzz.renWuList;
|
||||||
|
|
@ -680,8 +688,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
//2025/02/24 if (chao > cfhs) { 修改为 chao > 0 散单不追加到 大工单内
|
//2025/02/24 if (chao > cfhs) { 修改为 chao > 0 散单不追加到 大工单内
|
||||||
|
|
||||||
if (chao > 0) {
|
if (chao > 0) {
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code+ "超出:" + chao + "无法分配,跳过此工作站");
|
||||||
+ "超出:" + chao + "无法分配,跳过此工作站");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
StringBuffer sb_pipei = new StringBuffer();
|
StringBuffer sb_pipei = new StringBuffer();
|
||||||
|
|
@ -696,12 +703,10 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
sb_pipei.append(fenPei.rqh);
|
sb_pipei.append(fenPei.rqh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code+ " gzzx:" + gzzx + " rqh_count:" + rqh_count);
|
||||||
+ " gzzx:" + gzzx + " rqh_count:" + rqh_count);
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_gzzx.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_gzzx.toString());
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_rqh.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_rqh.toString());
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,"匹配上的容器号: " + sb_pipei.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
|
||||||
"匹配上的容器号: " + sb_pipei.toString());
|
|
||||||
Boolean isPiPeiGzzx = false;// true 优先按照工作中心匹配,再按照容器号。false直接按照容器号匹配散单
|
Boolean isPiPeiGzzx = false;// true 优先按照工作中心匹配,再按照容器号。false直接按照容器号匹配散单
|
||||||
if (isPiPeiGzzx) {
|
if (isPiPeiGzzx) {
|
||||||
if (max_gzzx == 0 && gzzx == 0 && rqh_count > max_rqh_count) {
|
if (max_gzzx == 0 && gzzx == 0 && rqh_count > max_rqh_count) {
|
||||||
|
|
@ -745,9 +750,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
+ " 工作站:" + check.code);
|
+ " 工作站:" + check.code);
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
||||||
"↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑");
|
"↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑");
|
||||||
LogPrint(
|
|
||||||
log_GongZuoZhanPiPeiForRqhAndGzzx,
|
|
||||||
"------------------------匹配容器号和工作中心-----------------------------------------------");
|
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -761,11 +764,10 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
LogPrint(
|
LogPrint(
|
||||||
log_GongZuoZhanPiPeiForRqhAndGzzx,
|
log_GongZuoZhanPiPeiForRqhAndGzzx,
|
||||||
"------------------------匹配容器号和工作中心DuoHang-----------------------------------------------");
|
"------------------------匹配容器号和工作中心DuoHang-----------------------------------------------");
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓");
|
||||||
"↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓");
|
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前头物料:"+ GDH);
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前头物料:"+ GDH);
|
||||||
for (GongZuoZhan gzz : listGzz) {
|
for (GongZuoZhan gzz : listGzz) {
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工作站:" + gzz.code);
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "当前工作站:" + gzz.code);
|
||||||
List<FenPei> list = gzz.renWuList;
|
List<FenPei> list = gzz.renWuList;
|
||||||
StringBuffer sb_gzzx = new StringBuffer();
|
StringBuffer sb_gzzx = new StringBuffer();
|
||||||
StringBuffer sb_rqh = new StringBuffer();
|
StringBuffer sb_rqh = new StringBuffer();
|
||||||
|
|
@ -779,8 +781,7 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
//2025/02/24 if (chao > cfhs) { 修改为 chao > 0 散单不追加到 大工单内
|
//2025/02/24 if (chao > cfhs) { 修改为 chao > 0 散单不追加到 大工单内
|
||||||
|
|
||||||
if (chao > 0) {
|
if (chao > 0) {
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code+ "超出:" + chao + "无法分配,跳过此工作站");
|
||||||
+ "超出:" + chao + "无法分配,跳过此工作站");
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
StringBuffer sb_pipei = new StringBuffer();
|
StringBuffer sb_pipei = new StringBuffer();
|
||||||
|
|
@ -795,12 +796,10 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
sb_pipei.append(fenPei.rqh);
|
sb_pipei.append(fenPei.rqh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, "工作站:" + gzz.code+ " gzzx:" + gzzx + " rqh_count:" + rqh_count);
|
||||||
+ " gzzx:" + gzzx + " rqh_count:" + rqh_count);
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_gzzx.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_gzzx.toString());
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_rqh.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx, sb_rqh.toString());
|
//LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,"匹配上的容器号: " + sb_pipei.toString());
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
|
||||||
"匹配上的容器号: " + sb_pipei.toString());
|
|
||||||
Boolean isPiPeiGzzx = false;// true 优先按照工作中心匹配,再按照容器号。false直接按照容器号匹配散单
|
Boolean isPiPeiGzzx = false;// true 优先按照工作中心匹配,再按照容器号。false直接按照容器号匹配散单
|
||||||
if (isPiPeiGzzx) {
|
if (isPiPeiGzzx) {
|
||||||
if (max_gzzx == 0 && gzzx == 0 && rqh_count > max_rqh_count) {
|
if (max_gzzx == 0 && gzzx == 0 && rqh_count > max_rqh_count) {
|
||||||
|
|
@ -844,9 +843,6 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
+ " 工作站:" + check.code);
|
+ " 工作站:" + check.code);
|
||||||
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
LogPrint(log_GongZuoZhanPiPeiForRqhAndGzzx,
|
||||||
"↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑");
|
"↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑");
|
||||||
LogPrint(
|
|
||||||
log_GongZuoZhanPiPeiForRqhAndGzzx,
|
|
||||||
"------------------------匹配容器号和工作中心-----------------------------------------------");
|
|
||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -935,11 +931,9 @@ public class DefaultNewWaveManager extends DefaultBaseManager implements
|
||||||
int currCount = gdPaiXu.hangshu;
|
int currCount = gdPaiXu.hangshu;
|
||||||
boolean isFind = false;
|
boolean isFind = false;
|
||||||
for (String twlKey : touwuliao_map.keySet()) {
|
for (String twlKey : touwuliao_map.keySet()) {
|
||||||
String twl_in = touwuliao_map.get(twlKey).get(0).twl + "_"
|
String twl_in = touwuliao_map.get(twlKey).get(0).twl + "_"+ touwuliao_map.get(twlKey).get(0).list.get(0).wllx;
|
||||||
+ touwuliao_map.get(twlKey).get(0).list.get(0).wllx;
|
|
||||||
int currCount_in = touwuliao_map.get(twlKey).get(0).hangshu;
|
int currCount_in = touwuliao_map.get(twlKey).get(0).hangshu;
|
||||||
if (twl_in.equals(fenzu)
|
if ((twl_in.equals(fenzu)&& Math.abs(currCount - currCount_in) <= 4)||(twl_in.equals(fenzu)&&currCount>40&&currCount_in>40)) {
|
||||||
&& Math.abs(currCount - currCount_in) <= 4||Math.abs(currCount - currCount_in) >40) {
|
|
||||||
// 在分配好的数据中找到了相同的头物料 且 数量差小于4 头物料分组规则
|
// 在分配好的数据中找到了相同的头物料 且 数量差小于4 头物料分组规则
|
||||||
List<GongDanMingXi> old = touwuliao_map.get(twlKey);
|
List<GongDanMingXi> old = touwuliao_map.get(twlKey);
|
||||||
old.add(gdPaiXu);
|
old.add(gdPaiXu);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue