Exemplo n.º 1
0
		public virtual OperationResult UpdateEntity(SimulationReport simulationReport,bool isSave=true)
		{
			return simulationReportRepository.Update(simulationReport,isSave);
		}
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
		public virtual OperationResult AddEntity(SimulationReport simulationReport,bool isSave=true)
		{
			return simulationReportRepository.Insert(simulationReport,isSave);
		}
Exemplo n.º 4
0
        public OperationResult CardGoMo(string moString, string lengthString, string prefixString, string card, string rescode, string usercode)
        {
            bool tbag = false;

            OperationResult operationResult = CardGoMoCheck(moString, lengthString, prefixString, card, rescode, usercode);

            if (operationResult.ResultType == OperationResultType.Error)
                return operationResult;

            Mo mo = (Mo)MoFormService.FindEntity(moString).AppendData;
            Simulation nowSimulation = SimulationFormService.Simulations().SingleOrDefault(s => s.RCARD == card && s.MOCODE == mo.MoCode);
            SimulationReport simulationReport = new SimulationReport();
            Item item = ItemFormService.Items().SingleOrDefault(i => i.ITEMCODE == mo.ITEMCODE);
            if (nowSimulation == null)
            {
                nowSimulation = new Simulation();
                tbag = true;
            }
            MoRcard moRcard = new MoRcard();


            //TBLSimulation               
            nowSimulation.ROUTECODE = mo.Route.ROUTECODE;
            nowSimulation.OpCode = mo.Route.Ops.First().OPCODE;
            nowSimulation.LACTION = "GOMO";
            nowSimulation.ACTIONLIST = ";GOMO;";
            nowSimulation.RCARD = card;
            nowSimulation.TCARD = card;
            nowSimulation.TCARDSEQ = 1;
            nowSimulation.SCARD = card;
            nowSimulation.SCARDSEQ = 1;
            nowSimulation.MOCODE = mo.MoCode;
            nowSimulation.ITEMCODE = mo.ITEMCODE;
            nowSimulation.MODELCODE = item.Model.MODELCODE;
            nowSimulation.IDMERGERULE = mo.IDMERGERULE;
            nowSimulation.ISCOM = "0";
            nowSimulation.RESCODE = rescode;
            nowSimulation.PRODUCTSTATUS = "GOOD";
            nowSimulation.FROMOP = "";
            nowSimulation.FROMROUTE = "";
            nowSimulation.CARTONCODE = "";
            nowSimulation.LOTNO = "";
            nowSimulation.PALLETCODE = "";
            nowSimulation.NGTIMES = 0;
            nowSimulation.ISHOLD = 0;
            nowSimulation.MOSEQ = mo.MOSEQ;
            nowSimulation.MUSER = usercode;

            //TBLSimulationReport           
            simulationReport.ROUTECODE = mo.Route.ROUTECODE;
            simulationReport.OPCODE = mo.Route.Ops.First().OPCODE;
            simulationReport.LACTION = "GOMO";
            simulationReport.ACTIONLIST = ";GOMO;";
            simulationReport.RCARD = card;
            simulationReport.TCARD = card;
            simulationReport.TCARDSEQ = 1;
            simulationReport.SCARD = card;
            simulationReport.SCARDSEQ = 1;
            simulationReport.MOCODE = mo.MoCode;
            simulationReport.ITEMCODE = mo.ITEMCODE;
            simulationReport.MODELCODE = item.Model.MODELCODE;
            simulationReport.IDMERGERULE = mo.IDMERGERULE;
            simulationReport.ISCOM = "0";
            simulationReport.RESCODE = rescode;
            simulationReport.PRODUCTSTATUS = "GOOD";
            simulationReport.FROMOP = "";
            simulationReport.FROMROUTE = "";
            simulationReport.CARTONCODE = "";
            simulationReport.LOTNO = "";
            simulationReport.PALLETCODE = "";
            simulationReport.NGTIMES = 0;
            simulationReport.ISHOLD = 0;
            simulationReport.MOSEQ = mo.MOSEQ;
            simulationReport.MUSER = usercode;

            //TBLONWIP

            //TBLMo            
            mo.MOINPUTQTY = mo.MOINPUTQTY + 1;
            //TBLMoRcard            
            moRcard.MoCode = mo.MoCode;
            moRcard.Seq = 1;
            moRcard.MoCardStart = card;
            moRcard.MoCardEnd = card;
            moRcard.Muser = usercode;
            moRcard.MoSeq = mo.MOSEQ;

            MoFormService.UpdateEntity(mo, false);
            SimulationReportFormService.AddEntity(simulationReport, false);
            MoRcardFormService.AddEntity(moRcard, false);
            if (tbag)
                SimulationFormService.AddEntity(nowSimulation);
            else
                SimulationFormService.UpdateEntity(nowSimulation);

            operationResult.ResultType = OperationResultType.Success;
            operationResult.Message = card +Properties.Resources.String_FrmGoodNGService_CollectSuccess;
            return operationResult;
        }