华恒Mes鼎捷代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

569 lines
20 KiB

using System;
using System.Data.SqlTypes;
using System.Collections;
using System.Linq;
using System.Data.Linq;
using System.Xml;
using System.IO;
using ICSSoft.Base.Config.AppConfig;
using System.Collections.Specialized;
using ICSSoft.Frame.Helper;
using ICSSoft.Frame.Data.Entity;
using ICSSoft.Frame.DataConnect.Action;
namespace ICSSoft.Frame.DataConnect
{
/// <summary>
/// ReportHelper µÄժҪ˵Ã÷¡£
/// </summary>
public class ReportHelper
{
private const string OutLineResource = "OUTLINERESOURCE";
private FramDataContext _domainDataProvider = null;
// public ReportHelper()
// {
// }
public ReportHelper(FramDataContext domainDataProvider)
{
this._domainDataProvider = domainDataProvider;
}
public FramDataContext DataProvider
{
get
{
return _domainDataProvider;
}
}
public int WeekOfYear(string Date)
{
int weekOfYear =0;
String sqlWeek = "select datepart(week,'"+Date+"') ";
var query = this.DataProvider.ExecuteQuery<int>(sqlWeek);
weekOfYear = query.First<int>();
if (weekOfYear > 0)
{
return weekOfYear;
}
else
{
weekOfYear = 1;
}
return weekOfYear;
}
private static void DecodeDateWeek(DateTime dt,out int year,out int weekOfYear,out int dayOfWeek)
{
int dayOfYear = dt.DayOfYear;
int monthOfYear = dt.Month;
year = dt.Year;
dayOfWeek = (int)dt.DayOfWeek;
DateTime startDate = new DateTime(dt.Year,1,1);
System.DayOfWeek startDayOfWeek = startDate.DayOfWeek;
System.DayOfWeek endDayOfWeek = dt.DayOfWeek;
if((startDayOfWeek == DayOfWeek.Friday)||(startDayOfWeek==DayOfWeek.Saturday)||(startDayOfWeek==DayOfWeek.Sunday))
{
dayOfYear = dayOfYear - (7- (int)startDayOfWeek);
}
else
{
dayOfYear = dayOfYear + (int)startDayOfWeek;
}
//dayOfYear+startDayOfWeek <7 ÔòÓ¦¸ÃΪȥÄêµÄÖÜ
if(dayOfYear <0)
{
DecodeDateWeek(startDate.AddDays(-1),out year,out weekOfYear,out dayOfWeek);
}
weekOfYear = dayOfYear/7;
if( SqlInt32.Mod(dayOfYear,7) != 0)
{
weekOfYear++;
}
if(weekOfYear > 52)
{
endDayOfWeek = startDayOfWeek;
if(DateTime.IsLeapYear(dt.Year))
{
if((endDayOfWeek == DayOfWeek.Sunday)||(endDayOfWeek == DayOfWeek.Monday))
{
endDayOfWeek ++;
}
if((endDayOfWeek==DayOfWeek.Monday)||(endDayOfWeek==DayOfWeek.Tuesday)||(endDayOfWeek==DayOfWeek.Wednesday))
{
year ++;
weekOfYear = 1;
}
}
}
}
private bool IsLastOP(string moCode,string routeCode,string opCode)
{
if (routeCode==string.Empty)
return false;
DataCollectFacade dataCollectFacade = new DataCollectFacade(this.DataProvider);
return dataCollectFacade.OPIsMORouteLastOP(moCode,routeCode,opCode);
}
private bool IsMidOutputOP(string itemCode,string routeCode,string opCode,ProductInfo product)
{
if (routeCode.Trim()==string.Empty)
{
//BaseModelFacade itemFacade = new BaseModelFacade(this.DataProvider);
object obj = null;// itemFacade.GetOperation(opCode);
if(obj == null)
{
/*Burn In ©ɨʱ£¬Èç¹ûµ½ÁËFT£¬Ìáʾ¡°¸Ã²úÆ·ÒѾ­Í깤»òÕß±»Ìæ»»¡±Õâ¸öÌáʾҪÐ޸ģ¬ÒÔ±ãÈÃUSERÖªµÀÊÇÔÚÄÄÀïÍ깤ÁË£¬²¢ÌáʾҪ´ÓµÚһվͶÈë¡£
½¨ÒéÈç¹û±¨¸ÃÌáʾµÄʱºò£¬¼´·¢ÏָòúÆ·ÒѾ­Í깤£¬ÏȲ»ÒªÖ±½Ó±¨³öÀ´£¬ÔÚºóÃæÔÙ¼ÓÒ»Ìõ¼ì²é£¬¼ì²éÆäÍ깤¹¤Ðò£¬²¢±¨³öÀ´¡£±Ï¾¹ÕâÖÖÇé¿ö²»ÊǺܶ࣬ËùÒÔÐÔÄÜ·½ÃæµÄ¹ËÂÇ¿ÉÒÔÅųýµô¡£
* */
if(product.LastSimulation != null && product.LastSimulation.ISCOM == "1")
{
throw new Exception("$CS_PRODUCT_ALREADY_COMPLETE $CS_Param_OPCode =" + product.LastSimulation.OPCODE);
}
else
{
throw new Exception("$CS_Route_Failed_GetNotNextOP");
}
}
return FormatHelper.StringToBoolean( ((ICSOP)obj).OPCONTROL,(int)OperationList.MidistOutput);
}
else
{
//ItemFacade itemFacade = new ItemFacade(this.DataProvider);
object obj = null;
if(product.CurrentItemRoute2OP != null)
{
obj = product.CurrentItemRoute2OP;
}
else
{
obj = null;// itemFacade.GetItemRoute2Operation(itemCode, routeCode, opCode);
}
return FormatHelper.StringToBoolean(((ICSITEMROUTE2OP)obj).OPCONTROL, (int)OperationList.MidistOutput);
}
}
//ÐÂÔö ÅжÏÊÇ·ñÊÇÖмäͶÈ빤Ðò
private bool IsMidInputOP(string itemCode,string routeCode,string opCode,ProductInfo product)
{
//return false;
if (routeCode.Trim()==string.Empty)
{
//BaseModelFacade itemFacade = new BaseModelFacade(this.DataProvider);
object obj = null;//itemFacade.GetOperation(opCode);
if(obj == null)
{
/*Burn In ©ɨʱ£¬Èç¹ûµ½ÁËFT£¬Ìáʾ¡°¸Ã²úÆ·ÒѾ­Í깤»òÕß±»Ìæ»»¡±Õâ¸öÌáʾҪÐ޸ģ¬ÒÔ±ãÈÃUSERÖªµÀÊÇÔÚÄÄÀïÍ깤ÁË£¬²¢ÌáʾҪ´ÓµÚһվͶÈë¡£
½¨ÒéÈç¹û±¨¸ÃÌáʾµÄʱºò£¬¼´·¢ÏָòúÆ·ÒѾ­Í깤£¬ÏȲ»ÒªÖ±½Ó±¨³öÀ´£¬ÔÚºóÃæÔÙ¼ÓÒ»Ìõ¼ì²é£¬¼ì²éÆäÍ깤¹¤Ðò£¬²¢±¨³öÀ´¡£±Ï¾¹ÕâÖÖÇé¿ö²»ÊǺܶ࣬ËùÒÔÐÔÄÜ·½ÃæµÄ¹ËÂÇ¿ÉÒÔÅųýµô¡£
* */
if(product.LastSimulation != null && product.LastSimulation.ISCOM == "1")
{
throw new Exception("$CS_PRODUCT_ALREADY_COMPLETE $CS_Param_OPCode =" + product.LastSimulation.OPCODE);
}
else
{
throw new Exception("$CS_Route_Failed_GetNotNextOP");
}
}
return FormatHelper.StringToBoolean( ((ICSOP)obj).OPCONTROL,(int)OperationList.MidistInput);
}
else
{
//ItemFacade itemFacade = new ItemFacade(this.DataProvider);
object obj = null;
if(product.CurrentItemRoute2OP != null)
{
obj = product.CurrentItemRoute2OP;
}
else
{
obj = null;//itemFacade.GetItemRoute2Operation(itemCode,routeCode,opCode);
}
return FormatHelper.StringToBoolean( ((ICSITEM2ROUTE)obj).ROUTECODE,(int)OperationList.MidistInput);
}
}
/// <summary>
/// By Line ͳ¼Æ²úÁ¿£¬NG£¬Ö±Í¨ÂÊ
/// ´¦Àí²¢·¢
/// </summary>
/// <param name="domainDataProvider"></param>
/// <param name="actionType"></param>
/// <param name="product"></param>
/// <returns></returns>
public Messages ReportLineQuanMaster(FramDataContext domainDataProvider, string actionType, ProductInfo product)
{
return ReportLineQuanMaster(domainDataProvider, actionType, product, null);
}
// À©Õ¹Ò»¸ö´øActionCheckStatus²ÎÊýµÄ·½·¨
public Messages ReportLineQuanMaster(FramDataContext domainDataProvider, string actionType, ProductInfo product, ActionCheckStatus actionCheckStatus)
{
Messages messages=new Messages();
ICSReport reportFacade = new ICSReport(domainDataProvider);
//TSFacade tSFacade = new TSFacade(domainDataProvider);
//MOFacade mOFacade = new MOFacade(domainDataProvider);
int ngtimes = 0;
int qty = 0;
int allqty = 0;
int inputQty = 0;
int moInputQty = 0;
int moAllGoodQty = 0;
try
{
//QtyFlag¸ü¸ÄΪÖ÷¼ü
string flag = String.Empty;
bool midOP = false;
bool midInputOP = false;
if (actionCheckStatus == null || actionCheckStatus.IsMidOutputOP == string.Empty)
{
if(IsMidOutputOP(product.NowSimulationReport.ITEMCODE,product.NowSimulationReport.ROUTECODE,product.NowSimulationReport.OPCODE,product))
{
midOP = true;
}
if (actionCheckStatus != null)
{
actionCheckStatus.IsMidOutputOP = midOP.ToString();
}
}
else
{
midOP = Convert.ToBoolean(actionCheckStatus.IsMidOutputOP);
}
if (actionCheckStatus == null || actionCheckStatus.IsMidInputOP == string.Empty)
{
//ÖмäͶÈë
if(IsMidInputOP(product.NowSimulationReport.ITEMCODE,product.NowSimulationReport.ROUTECODE,product.NowSimulationReport.OPCODE,product))
{
midInputOP = true;
}
if (actionCheckStatus != null)
{
actionCheckStatus.IsMidInputOP = midInputOP.ToString();
}
}
else
{
midInputOP = Convert.ToBoolean(actionCheckStatus.IsMidInputOP);
}
//ÊÇ·ñΪ×îºó¹¤Ðò
if (actionCheckStatus == null || actionCheckStatus.IsLastOP == string.Empty)
{
if (IsLastOP(product.NowSimulationReport.MOCODE,product.NowSimulationReport.ROUTECODE,product.NowSimulationReport.OPCODE))//ÊÇ·ñΪ×îºó¹¤Ðò
flag = "Y";
else
flag = "N";
if (actionCheckStatus != null)
{
actionCheckStatus.IsLastOP = flag;
}
}
else
{
flag = actionCheckStatus.IsLastOP;
}
int iNGStart = 0;
int iMoNGStart = 0;
#region ¸üÐÂÊýÁ¿
//ÔÚÖмäͶÈ빤ÐòͶÈëµÄ²»¹ÜÊÇÁ¼Æ·»¹ÊDz»Á¼Æ·,½Ô×÷ΪͶÈëÁ¿µÄ¼ÓÏî.²»´æÔÚ¼õÏî.
if(midInputOP)
{
inputQty = Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE);
}
if (product.NowSimulation.PRODUCTSTATUS == "GOOD" && product.NowSimulation.LACTION != ActionType.DataCollectAction_GoMO)
{
if (flag == "Y" || midOP)//ÊÇ·ñΪ×îºó¹¤Ðò»òÖÐ¼ä¼ÆË㹤Ðò
{
if(product.NowSimulation != null)
{
//iNGStart = tSFacade.QueryTSCountByLine(
// product.NowSimulationReport.RCARD
// ,product.NowSimulationReport.SSCODE
// ,Convert.ToInt32(product.NowSimulationReport.RCARDSEQ));
//iMoNGStart = tSFacade.QueryTSCountByMo(
// product.NowSimulation.RCARD
// ,product.NowSimulation.MOCODE);
}
qty = Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE);
//ֱͨ²úÁ¿²»×¼
//if (
// iNGStart == 0 && IDIsInRejectCount(product.NowSimulationReport.RCARD,product.NowSimulationReport.SSCODE)==0)
//{
// //reportRealtimeLineQty.AllGoodQty += 1 * product.NowSimulation.IDMERGERULE;
// allqty = Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE);
//}
//¹¤µ¥Ö±Í¨Ì¨Êý
#region ÓйزúÁ¿¡¢Í¶ÈëÊý¡¢²»Á¼ÂÊ¡¢Ö±Í¨ÂʵIJ¹³ä˵Ã÷£º
/*3. ¹¤µ¥Ö±Í¨ÂÊ£º
£½(¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©´ÓͶÈëµ½²ú³öµÄ¹ý³ÌÖÐÎ´Ôø³öÏÖ¹ý²»Á¼µÄ²úƷ̨Êý)/¸Ã¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©ÖÐÍê³ÉµÄ²úÆ·Á¼Æ·Ì¨Êý
¶Ô²úÏßÅжÏֱͨ²úÆ·ÊýÁ¿Ê±£¬Ò»¶¨Òª·Ö¹¤µ¥¡£Èç¹û²úÏß×öµÄÊÇA¹¤µ¥£¬Ö»ÐèÅжϸòúÆ·ÐòÁкÅÔÚA¹¤µ¥£¨×¢ÒâÊǹ¤µ¥£¬¶ø²»ÊDzúÏߣ«¹¤µ¥¡£ ¶ÔÓÚÖмä²úÏߣ¬¿ÉÄܸòúÆ·ÐòÁкÅÔÚÆäÉÏδ·¢ÏÖ²»Á¼£¬µ«ÔÚÇ°ÃæµÄ²úÏßÈç¹û³öÏÖ²»Á¼£¬ÈÔÊǸÃÖмä²úÏߵķÇֱͨƷ£©µÄÉú²ú¹ý³ÌÖÐÊÇ·ñ³öÏÖÁ˲»Á¼£¬ÈçÓв»Á¼ÔòΪ·ÇֱͨƷ¡£¼´Ê¹¸Ã²úÆ·ÐòÁкÅÔÚÆäËû¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬µ«¶Ô¸Ã´ÎµÄÉú²ú²»Ó°Ï쵽ֱ̨ͨÊýµÄ¼ÆËã¡£
ֱͨÂʲ»´æÔÚ¿çʱ¶ÎµÄÎÊÌâ.Ö»Òª·¢ÏÖÆäÔÚ¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬Ôò²»»á¼Ç¼ΪֱͨƷ¡£Ã»Óв»Á¼¾Í¼Ç¼ΪֱͨƷ£¬È»ºó¹éÊôµ½Ê±¶Î¡£
¸Ã¹¤µ¥»ØÁ÷µÄ²úÆ·Ò»¶¨²»ÊÇֱͨƷ
FQC³é¼ìΪ²»Á¼»ò±»ÅÐÍ˵IJúÆ·Ò»¶¨²»ÊÇֱͨƷ
*/
#endregion
//if (flag == "Y" && iMoNGStart == 0
// && IDIsInRejectCountByMo(product.NowSimulationReport.RCARD,product.NowSimulationReport.MOCODE)==0
// && product.NowSimulationReport.NGTIMES == 0)
//{
// moAllGoodQty = Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE);
//}
}
}
else if (product.NowSimulation.PRODUCTSTATUS == "NG")
{
//reportRealtimeLineQty.NGTimes += 1;
//ͶÈëÁ¿µÄ¼ÆËã
//Èç¹û³öÏÖTS£¬²¢ÇÒ²úƷǰһ´Î״̬ºÍÏÖÔÚµÄNG״̬²»µÈ
//²¢ÇÒǰһ´ÎActionºÍÏÖÔÚµÄActionÊÇÔÚͬһµÀ¹¤Ðò
//²É¼¯NG£¬Í¶ÈëÊýÓ¦¸Ã¼õÉÙ
//±ÜÃâÖ±½Ó²É¼¯NG£¬¼õͶÈëÊýµÄbug
//Eric ÔÚÖмäͶÈ빤ÐòͶÈëµÄ²»¹ÜÊÇÁ¼Æ·»¹ÊDz»Á¼Æ·,½Ô×÷ΪͶÈëÁ¿µÄ¼ÓÏî.²»´æÔÚ¼õÏî.
ngtimes = 1;
if (product.NowSimulation.OPCODE == product.LastSimulation.OPCODE
&& (product.LastSimulation.LACTION == ActionType.DataCollectAction_GOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_SMTGOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_OutLineGood
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_OQCPass) )
{
if (flag == "Y" || midOP)//ÊÇ·ñΪ×îºó¹¤Ðò»òÖÐ¼ä¼ÆË㹤Ðò
{
//µ±Ç°Õ¾Óйý²Ù×÷,²¢ÇÒǰһ´Î²Ù×÷״̬ÊÇGOOD²Å»á¼õÊýÁ¿
qty = Convert.ToInt32(-1 * product.NowSimulation.IDMERGERULE);
if(product.NowSimulation != null)
{
//iNGStart = tSFacade.QueryTSCountByLine(
// product.NowSimulationReport.RCARD
// ,product.NowSimulationReport.SSCODE
// ,Convert.ToInt32(product.NowSimulationReport.RCARDSEQ));
//iMoNGStart = tSFacade.QueryTSCountByMo(
// product.NowSimulation.RCARD
// ,product.NowSimulation.MOCODE);
}
//ֱͨ²úÁ¿²»×¼
//if ((IDIsInRejectCount(product.NowSimulationReport.RCARD,product.NowSimulationReport.SSCODE)==0)
// && iNGStart == 0)//rejectlist
//{
// allqty = Convert.ToInt32(-1 * product.NowSimulation.IDMERGERULE);
//}
//¹¤µ¥Ö±Í¨Ì¨Êý
#region ÓйزúÁ¿¡¢Í¶ÈëÊý¡¢²»Á¼ÂÊ¡¢Ö±Í¨ÂʵIJ¹³ä˵Ã÷£º
/*3. ¹¤µ¥Ö±Í¨ÂÊ£º
£½(¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©´ÓͶÈëµ½²ú³öµÄ¹ý³ÌÖÐÎ´Ôø³öÏÖ¹ý²»Á¼µÄ²úƷ̨Êý)/¸Ã¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©ÖÐÍê³ÉµÄ²úÆ·Á¼Æ·Ì¨Êý
¶Ô²úÏßÅжÏֱͨ²úÆ·ÊýÁ¿Ê±£¬Ò»¶¨Òª·Ö¹¤µ¥¡£Èç¹û²úÏß×öµÄÊÇA¹¤µ¥£¬Ö»ÐèÅжϸòúÆ·ÐòÁкÅÔÚA¹¤µ¥£¨×¢ÒâÊǹ¤µ¥£¬¶ø²»ÊDzúÏߣ«¹¤µ¥¡£ ¶ÔÓÚÖмä²úÏߣ¬¿ÉÄܸòúÆ·ÐòÁкÅÔÚÆäÉÏδ·¢ÏÖ²»Á¼£¬µ«ÔÚÇ°ÃæµÄ²úÏßÈç¹û³öÏÖ²»Á¼£¬ÈÔÊǸÃÖмä²úÏߵķÇֱͨƷ£©µÄÉú²ú¹ý³ÌÖÐÊÇ·ñ³öÏÖÁ˲»Á¼£¬ÈçÓв»Á¼ÔòΪ·ÇֱͨƷ¡£¼´Ê¹¸Ã²úÆ·ÐòÁкÅÔÚÆäËû¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬µ«¶Ô¸Ã´ÎµÄÉú²ú²»Ó°Ï쵽ֱ̨ͨÊýµÄ¼ÆËã¡£
ֱͨÂʲ»´æÔÚ¿çʱ¶ÎµÄÎÊÌâ.Ö»Òª·¢ÏÖÆäÔÚ¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬Ôò²»»á¼Ç¼ΪֱͨƷ¡£Ã»Óв»Á¼¾Í¼Ç¼ΪֱͨƷ£¬È»ºó¹éÊôµ½Ê±¶Î¡£
¸Ã¹¤µ¥»ØÁ÷µÄ²úÆ·Ò»¶¨²»ÊÇֱͨƷ
FQC³é¼ìΪ²»Á¼»ò±»ÅÐÍ˵IJúÆ·Ò»¶¨²»ÊÇֱͨƷ
*/
#endregion
//if (flag == "Y" && iMoNGStart == 0
// && IDIsInRejectCountByMo(product.NowSimulationReport.RCARD, product.NowSimulationReport.MOCODE) == 0
// && product.NowSimulationReport.NGTIMES == 1)
//{
// moAllGoodQty = Convert.ToInt32(-1 * product.NowSimulation.IDMERGERULE);
//}
}
}
}
else if (product.NowSimulation.PRODUCTSTATUS == "REJECT")
{
if (product.NowSimulation.RESCODE == product.LastSimulation.RESCODE
&& (product.LastSimulation.LACTION == ActionType.DataCollectAction_GOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_SMTGOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_OutLineGood
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_OQCPass) )
{
if (flag == "Y" || midOP)//ÊÇ·ñΪ×îºó¹¤Ðò»òÖÐ¼ä¼ÆË㹤Ðò
{
//reportRealtimeLineQty.OuputQty -= 1 * product.NowSimulation.IDMERGERULE;
if(product.NowSimulationReport != null)
{
//iNGStart = tSFacade.QueryTSCountByLine(
// product.NowSimulationReport.RCARD
// ,product.NowSimulationReport.SSCODE
// ,Convert.ToInt32(product.NowSimulationReport.RCARDSEQ));
//iMoNGStart = tSFacade.QueryTSCountByMo(
// product.NowSimulation.RCARD
// ,product.NowSimulation.MOCODE);
}
//ֱͨ²úÁ¿²»×¼
qty = Convert.ToInt32(-1 * product.NowSimulation.IDMERGERULE);
//if ((IDIsInRejectCount(product.NowSimulationReport.RCARD,product.NowSimulationReport.SSCODE)==1)
// && iNGStart == 0)
//{
// allqty = Convert.ToInt32( -1 * product.NowSimulation.IDMERGERULE);
//}
//¹¤µ¥Ö±Í¨Ì¨Êý
#region ÓйزúÁ¿¡¢Í¶ÈëÊý¡¢²»Á¼ÂÊ¡¢Ö±Í¨ÂʵIJ¹³ä˵Ã÷£º
///<Comment>3. ¹¤µ¥Ö±Í¨ÂÊ£º
///£½(¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©´ÓͶÈëµ½²ú³öµÄ¹ý³ÌÖÐÎ´Ôø³öÏÖ¹ý²»Á¼µÄ²úƷ̨Êý)/¸Ã¹¤µ¥£¨Õý³£¹¤µ¥»ò·µ¹¤¹¤µ¥£©ÖÐÍê³ÉµÄ²úÆ·Á¼Æ·Ì¨Êý
///¶Ô²úÏßÅжÏֱͨ²úÆ·ÊýÁ¿Ê±£¬Ò»¶¨Òª·Ö¹¤µ¥¡£Èç¹û²úÏß×öµÄÊÇA¹¤µ¥£¬Ö»ÐèÅжϸòúÆ·ÐòÁкÅÔÚA¹¤µ¥£¨×¢ÒâÊǹ¤µ¥£¬¶ø²»ÊDzúÏߣ«¹¤µ¥¡£ ¶ÔÓÚÖмä²úÏߣ¬¿ÉÄܸòúÆ·ÐòÁкÅÔÚÆäÉÏδ·¢ÏÖ²»Á¼£¬µ«ÔÚÇ°ÃæµÄ²úÏßÈç¹û³öÏÖ²»Á¼£¬ÈÔÊǸÃÖмä²úÏߵķÇֱͨƷ£©µÄÉú²ú¹ý³ÌÖÐÊÇ·ñ³öÏÖÁ˲»Á¼£¬ÈçÓв»Á¼ÔòΪ·ÇֱͨƷ¡£¼´Ê¹¸Ã²úÆ·ÐòÁкÅÔÚÆäËû¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬µ«¶Ô¸Ã´ÎµÄÉú²ú²»Ó°Ï쵽ֱ̨ͨÊýµÄ¼ÆËã¡£
///ֱͨÂʲ»´æÔÚ¿çʱ¶ÎµÄÎÊÌâ.Ö»Òª·¢ÏÖÆäÔÚ¹¤µ¥ÖÐÔø³öÏÖ¹ý²»Á¼£¬Ôò²»»á¼Ç¼ΪֱͨƷ¡£Ã»Óв»Á¼¾Í¼Ç¼ΪֱͨƷ£¬È»ºó¹éÊôµ½Ê±¶Î¡£
///¸Ã¹¤µ¥»ØÁ÷µÄ²úÆ·Ò»¶¨²»ÊÇֱͨƷ
///FQC³é¼ìΪ²»Á¼»ò±»ÅÐÍ˵IJúÆ·Ò»¶¨²»ÊÇֱͨƷ
///</Comment>
#endregion
//if (flag == "Y" && iMoNGStart == 0
// && IDIsInRejectCountByMo(product.NowSimulationReport.RCARD, product.NowSimulationReport.MOCODE) == 0
// && product.NowSimulationReport.NGTIMES == 1)
//{
// moAllGoodQty = Convert.ToInt32(-1 * product.NowSimulation.IDMERGERULE);
//}
}
}
}
#endregion
if(product.NowSimulationReport.LACTION == ActionType.DataCollectAction_GoMO)
{
moInputQty = Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE);
}
//´¦Àí²¢·¢ÎÊÌâ
//ûÓÐÊý×Ö¡¢²»ÊÇÍÑÀ빤µ¥Ê²Ã´¶¼²»×ö£¬½Úʡϵͳ×ÊÔ´
if(ngtimes != 0 || qty != 0 || allqty != 0 || inputQty != 0 || moInputQty != 0 || moAllGoodQty != 0
|| actionType == ActionType.DataCollectAction_OffMo/*ÍÑÀ빤µ¥ÔÊÐí*/)
{
//ûÓÐÊý×Öʲô¶¼²»×ö£¬½Úʡϵͳ×ÊÔ´
if(ngtimes != 0 || qty != 0 || allqty != 0 || inputQty != 0 || moInputQty != 0 || moAllGoodQty != 0)
{
#region »ñÈ¡±¨±íʵÌå
#endregion
}
}
if(product.NowSimulationReport.LACTION == ActionType.DataCollectAction_OffMo
|| product.NowSimulationReport.LACTION == ActionType.DataCollectAction_GoMO
|| flag == "Y")
{
//ÔÊÐí¸ü餵¥µÄÍÑÀëÊýÁ¿
//mOFacade.UpdateMOQty(product.NowSimulationReport.MOCODE
// ,product.NowSimulationReport.LACTION
// ,Convert.ToInt32(1 * product.NowSimulation.IDMERGERULE));
}
}
catch (Exception e)
{
messages.Add(new Message(e));
}
return messages;
}
//Ó¦¸ÃÊÇûÓп¼Âǵ½»ØÁ÷ºÍÖØ¹¤µÄÇé¿ö
//¼ì²éÊÇ·ñÔÚµ±Ç°Õ¾ÒѾ­×ö¹ýͳ¼Æ
private bool CheckNeedCountInthisResoure(ProductInfo product)
{
if (product.NowSimulation.RESCODE == product.LastSimulation.RESCODE
&& product.NowSimulation.OPCODE == product.LastSimulation.OPCODE
&&
(
product.LastSimulation.LACTION == ActionType.DataCollectAction_GOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_SMTGOOD
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_OutLineGood
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_CollectKeyParts
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_CollectINNO
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_IDTran
|| product.LastSimulation.LACTION == ActionType.DataCollectAction_Split
)
)
return true;
else
return false;
}
}
/// <summary>
/// ÖܵļÆËã
/// </summary>
///
[Serializable]
public class WeekObject
{
public int Week;
}
/// <summary>
///
/// </summary>
///
[Serializable]
public struct ReportQtyHelper
{
public decimal OuputQty;
public decimal AllGoodQty;
public decimal MoAllGoodQty;
public ReportQtyHelper(
decimal ouputQty,
decimal allGoodQty,
decimal moAllGoodQty)
{
OuputQty = ouputQty ;
AllGoodQty = allGoodQty ;
MoAllGoodQty= moAllGoodQty ;
}
}
}