Ejemplo n.º 1
0
        public override void GetResult(object data, int nWorkTypeID)
        {
            InFlows_Notice input = Newtonsoft.Json.JsonConvert.DeserializeObject <InFlows_Notice>(data.ToString());

            DBStep db = new DBStep();

            //如果传过的类型不是记名式传达
            if (input.strFileType == "4c628583-10b9-4962-ad09-71b96b44970f")
            {
                foreach (trainmanList t in input.trainmanList)
                {
                    if (db.getNeedReadCount(t.strTrainmanGUID) <= input.fileList.Count)
                    {
                        #region 出勤步骤结果的实体信息
                        StepResult StepResult = new StepResult();
                        StepResult.dtBeginTime  = ObjectConvertClass.static_ext_date(input.dtBeginTime);
                        StepResult.dtCreateTime = ObjectConvertClass.static_ext_date(input.dtCreateTime);
                        StepResult.dtEndTime    = ObjectConvertClass.static_ext_date(input.dtEndTime);
                        int nStepIndex = db.getIndexOfStep(input.strWorkShopGUID, "RS.STEP.WORKREADING", nWorkTypeID);
                        if (nStepIndex == 0)
                        {
                            break;
                        }
                        StepResult.nStepIndex        = nStepIndex;
                        StepResult.strStepBrief      = "记名式传达";
                        StepResult.strStepName       = "RS.STEP.WORKREADING";
                        StepResult.strTrainPlanGUID  = input.strTrainPlanGUID;
                        StepResult.strTrainmanGUID   = t.strTrainmanGUID;
                        StepResult.nStepResult       = input.nStepResult;
                        StepResult.strTrainmanName   = t.strTrainmanName;
                        StepResult.strTrainmanNumber = t.strTrainmanNumber;
                        StepResult.nWorkTypeID       = nWorkTypeID;
                        #endregion
                        db.AddStep(null, null, StepResult);

                        //向旧的接口提交数据
                        MDPlan_Beginwork_Step md = new MDPlan_Beginwork_Step();
                        md.dtCreateTime      = input.dtCreateTime;
                        md.dtEventEndTime    = input.dtEndTime;
                        md.dtEventTime       = input.dtCreateTime;
                        md.nStepID           = 1004;
                        md.nStepResultID     = 1;
                        md.strStepResultText = "";
                        md.strTrainmanGUID   = t.strTrainmanGUID;
                        md.strTrainmanName   = t.strTrainmanName;
                        md.strTrainmanNumber = t.strTrainmanName;
                        md.strTrainPlanGUID  = input.strTrainPlanGUID;
                        db.AddPlan_Beginwork_Step(md);
                        //向旧的接口提交数据结束
                        foreach (fileList fi in input.fileList)
                        {
                            db.UpdateReadTime(fi.fileGUID, t.strTrainmanGUID, input.dtBeginTime.ToString());
                        }
                        //检测是否是特殊步骤
                        if (db.CheckIsSpecialStep("RS.STEP.WORKREADING", input.strWorkShopGUID, nWorkTypeID))
                        {
                            db.UpdateToYiChuQin(input.strTrainPlanGUID, DateTime.Now, "", "", "", nWorkTypeID);
                        }
                    }
                }
            }

            db.creatMsg("RS.STEP.WORKREADING", input.strTrainPlanGUID, input.cid, nWorkTypeID, input.strWorkShopGUID);
        }