public OperationResult TsCompleteCheck(string card) { OperationResult operationResult = new OperationResult(OperationResultType.Error); if (card == null) { operationResult.Message = "条码不能为空"; return(operationResult); } Ts ts = TsFormService.Tss().Where(t => t.rcard == card).OrderByDescending(t => t.TSID).FirstOrDefault(); if (ts == null) { operationResult.Message = "该产品没有登记不良品"; return(operationResult); } if (!(ts.tsstatus == TsStatus.CONFIRM)) { operationResult.Message = "该产品状态不对"; return(operationResult); } foreach (var ter in ts.tsErrorCodes.ToList()) { if (ter.tsErrorCauses.Count == 0) { operationResult.Message = "该产品维修中"; return(operationResult); } } Item item = (Item)ItemFormService.FindEntity(ts.itemcode).AppendData; if (item == null) { operationResult.Message = "该产品不存在"; return(operationResult); } List <Route> list = item.Routes.ToList(); foreach (var route in list) { route.Ops.ToList(); } TsCompleteModel tsCompleteModel = new TsCompleteModel(); tsCompleteModel.ts = ts; tsCompleteModel.list = list; operationResult.ResultType = OperationResultType.Success; operationResult.Message = "检测成功"; operationResult.AppendData = tsCompleteModel; return(operationResult); }
public OperationResult ActionNgConfirm(string card) { OperationResult operationResult = new OperationResult(OperationResultType.Error); if (card == null) { operationResult.Message = "条码不能为空"; return(operationResult); } Ts ts = TsFormService.Tss().Where(t => t.rcard == card).OrderByDescending(t => t.TSID).FirstOrDefault(); if (ts == null) { operationResult.Message = "该产品没有登记不良品"; return(operationResult); } if (!(ts.tsstatus == TsStatus.NEW || ts.tsstatus == TsStatus.CONFIRM)) { operationResult.Message = "该产品状态不对"; return(operationResult); } foreach (var ter in ts.tsErrorCodes.ToList()) { foreach (var tc in ter.tsErrorCauses.ToList()) { var a = tc.solution; var b = tc.duty; var c = tc.errorCodeSeason.ecsg; var d = tc.errorCom; } ter.errorCode.ToString(); ter.errorCode.ecg.ToString(); } ts.tsstatus = TsStatus.CONFIRM; TsFormService.UpdateEntity(ts); operationResult.ResultType = OperationResultType.Success; operationResult.Message = "确认成功"; operationResult.AppendData = ts; return(operationResult); }
public OperationResult ActionNg(string card, string usercode, string rescode, string selectedEcg, string selectedEc) { OperationResult operationResult = ActionNgCheck(card, usercode, rescode, selectedEcg, selectedEc); if (operationResult.ResultType == OperationResultType.Error) { return(operationResult); } //TBLSIMULATION Simulation simulation = SimulationFormService.Simulations().SingleOrDefault(s => s.RCARD == card); DateTime dt = DateTime.Now; simulation.LOTNO = null; simulation.PRODUCTSTATUS = "NG"; simulation.LACTION = "NG"; simulation.ACTIONLIST += "NG;"; simulation.NGTIMES += 1; simulation.MUSER = usercode; simulation.MDATE = Convert.ToInt32("" + dt.Year + dt.Day); simulation.MTIME = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); //tblsimulationreport SimulationReport simulationReport = new SimulationReport(simulation); //TBLTS Ts ts = new Ts(); // ts.TSID = card + DateTime.Now.ToString(); ts.rcard = card; ts.rcardseq = 1; //固定 ts.tcard = card; ts.tcardseq = 1; //固定 ts.scard = card; ts.scardseq = 1; //固定 ts.cardtype = "cardtype_product"; //固定 ts.modelcode = simulation.MODELCODE; ts.itemcode = simulation.ITEMCODE; ts.mocode = simulation.MOCODE; ts.frmroutecode = simulation.ROUTECODE; ts.frmopcode = ResFormService.Ress().SingleOrDefault(r => r.RESCODE == rescode).Op.OPCODE; ts.frmsegcode = "ZJ"; ts.frmsscode = "A1"; ts.crescode = rescode; ts.shifttypecode = "OS"; ts.shiftcode = "OS1"; ts.tpcode = "OS1-01"; ts.shiftday = 20140624; ts.frmuser = usercode; ts.frmdate = Convert.ToInt32("" + dt.Year + dt.Day); ts.frmtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); ts.frminputtype = "tssource_onwip"; ts.tstimes += 1; //ts.tsstatus = TsStatus.NEW; ts.tsstatus = TsStatus.NEW; ts.tsdate = 0; ts.tstimes = 0; ts.confirmtime = 0; ts.confirmdate = 0; ts.transstatus = "none"; ts.muser = usercode; ts.mdate = Convert.ToInt32("" + dt.Year + dt.Day); ts.mtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); ts.frmmonth = dt.Month; ts.frmweek = dt.DayOfYear / 7 + 1; ts.frmoutroutecode = simulation.ROUTECODE; ts.moseq = simulation.MOSEQ; ts.tsrepairmdate = 0; ts.tsrepairmtime = 0; //TBLTSERRORCODE TsErrorCode tsErrorCode = new TsErrorCode(); tsErrorCode.ts = ts; tsErrorCode.errorCode = (ErrorCode)EcFormService.FindEntity("ecode1").AppendData; tsErrorCode.muser = usercode; tsErrorCode.mdate = Convert.ToInt32("" + dt.Year + dt.Day); tsErrorCode.mtime = Convert.ToInt32("" + dt.Hour + dt.Minute + dt.Second); //update tbllot //delete from tbllot2card //insert into tblonwip //update tblrptre allineqty //insert into tblrptre secg //insert into tblrptre allineecqty //insert into tblrpthisopqty SimulationReportFormService.AddEntity(simulationReport, false); TsFormService.AddEntity(ts, false); TsErrorCodeFormService.AddEntity(tsErrorCode); operationResult.Message = card + Properties.Resources.String_FrmGoodNGService_CollectSuccess; return(operationResult); }
public OperationResult SaveTs(Ts ts) { OperationResult operationResult = TsFormService.UpdateEntity(ts); return(operationResult); }