sunhao 1 month ago
parent 8c84a7c4ab
commit b35cba291d

@ -1636,6 +1636,13 @@ namespace ibk.IPD.Controller.IPD_PS
{
itemGP_PLATE.SUB_FULL = "P";
}
//标准
if (!ChkStandGroup(itemGP_PLATE, order))
{
continue;
}
//logger.InfoFormat("钢板:{0},订单:{1}-{2},协议替代存储临时表", itemGP_PLATE.PLATE_NO, order.ORD_NO, order.ORD_ITEM);
AddTempDatas(itemGP_PLATE, order, intLackNum, 1, itemGP_PLATE.SUB_FULL, "", "", false, false, true);
@ -4959,7 +4966,7 @@ namespace ibk.IPD.Controller.IPD_PS
continue;
}
//20240306
logger.InfoFormat("二次优化前,钢板号:{0},订单号:{1}-{2}", TD.PLATE_NO, TD.ORD_NO, TD.ORD_ITEM);
logger.InfoFormat("二次优化前,钢板号:{0},订单号:{1}-{2} 成材率:{3}", TD.PLATE_NO, TD.ORD_NO, TD.ORD_ITEM,TD.EFF_RATE);
//分板数据,长度小于最小值,不替换
@ -4998,6 +5005,65 @@ namespace ibk.IPD.Controller.IPD_PS
}
string strOrderNoOrg= string.Empty;
string strOrderItemOrg = string.Empty;
if (gP_PLATEs.Where(p=>p.PLATE_NO== TD.PLATE_NO).Count()>0)
{
GP_PLATE GPOrder = gP_PLATEs.Where(p => p.PLATE_NO == TD.PLATE_NO).FirstOrDefault();
strOrderNoOrg = GPOrder.ORG_ORD_NO;
strOrderItemOrg = GPOrder.ORG_ORD_ITEM;
}
//2024-12-07 陈科长提出的
//原订单优先
if (gTEMP_DATA.Where(p=>p.ORD_NO== strOrderNoOrg
&& p.ORD_NO == strOrderItemOrg
&& p.PLATE_NO == TD.PLATE_NO
&& p.USE_FLG != "1"
&& p.IS_REPLACE != "1"
&& p.DEF_NUM > 0
&& p.EFF_RATE * 100 >= 85).Count()>0)
{
TEMP_DATA Fir_TD = gTEMP_DATA.Where(p => p.ORD_NO == strOrderNoOrg
&& p.ORD_NO == strOrderItemOrg
&& p.PLATE_NO == TD.PLATE_NO
&& p.USE_FLG != "1"
&& p.IS_REPLACE != "1"
&& p.DEF_NUM > 0
&& p.EFF_RATE * 100 >= 85).
OrderByDescending(p => p.PROFIT).
ThenBy(p => p.CUST_DEL_TO_DATE).
FirstOrDefault();
logger.InfoFormat("***原订单优先:{0}-{1}-{2}", TD.PLATE_NO, strOrderNoOrg, strOrderItemOrg);
if (Fir_TD != null)
{
if (Fir_TD.DEF_NUM > 0)
{
Fir_TD.CON_FLG = "1";
if (ConverDataToDecimal(Fir_TD.LACK_NUM) > 0)
{
Fir_TD.SLAB_LACK_FLG = "1";
}
//循环当前所有钢板,标记被使用
foreach (TEMP_DATA TD_PLATE in gTEMP_DATA.Where(p => p.PLATE_NO == TD.PLATE_NO).ToList())
{
TD_PLATE.USE_FLG = "1";//标记已被使用
}
//循环所有被替代的订单,欠量减一
foreach (TEMP_DATA TD_ORDER in gTEMP_DATA.Where(p => p.ORD_NO == Fir_TD.ORD_NO && p.ORD_ITEM == Fir_TD.ORD_ITEM).ToList())
{
TD_ORDER.LACK_NUM = TD_ORDER.LACK_NUM - 1; //欠量减一
TD_ORDER.DEF_NUM = TD_ORDER.DEF_NUM - 1;// TD_ORDER.SUB_NUM;//欠量减替代块数
}
}
}
}
else
{
//筛选钢板号替代率最高的数据
//20240105改 刘桂英提出没有基价按照替代率替换
//20240307 如果是小尺板,不限制替代率
@ -5074,6 +5140,8 @@ namespace ibk.IPD.Controller.IPD_PS
}
}
// TEMP_DATA Fir_TD = gTEMP_DATA.Where(p => p.PLATE_NO == TD.PLATE_NO
//&& p.USE_FLG != "1" && p.IS_REPLACE != "1"

@ -20,11 +20,11 @@ namespace ibk.IPD.Service.IPD_PS
{
private static readonly ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string glstrPlateNo = "24207171010101";//24101846070122
private static string glstrPlateNo = "24310104410101";//24101846070122
private static string glstrOrdNo = "OMG24080136";
private static string glstrOrdNo = "OMK24120078";
private static string glstrOrdItem = "001";
private static string glstrOrdItem = "011";
#region 获取存储数据

Loading…
Cancel
Save