public override void CheckIsSpecialStep() { DBStep db = new DBStep(); //检测是否是特殊步骤 if (db.CheckIsSpecialStep(WorkType.TQZhuanChu, input.strWorkShopGUID, base._nWorkTypeID)) { DBStep dbStep = new DBStep(); dbStep.UpdateToYiTuiQin(input.strTrainPlanGUID, input.runRecordFileMain.strSiteNumber, DateTime.Now, "", "", "", 2); } }
public override void GetResult(object data, int nWorkTypeID) { InFlows_SpecificOnDutyPrint input = Newtonsoft.Json.JsonConvert.DeserializeObject <InFlows_SpecificOnDutyPrint>(data.ToString()); DBStep db = new DBStep(); foreach (trainmanList t in input.trainmanList) { #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.PRINT.GXHCQ", nWorkTypeID); if (nStepIndex == 0) { break; } StepResult.nStepIndex = nStepIndex; StepResult.strStepBrief = "个性化出勤打印"; StepResult.strStepName = "RS.STEP.PRINT.GXHCQ"; 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 = 1013; 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); //向旧的接口提交数据结束 //检测是否是特殊步骤 if (db.CheckIsSpecialStep("RS.STEP.PRINT.GXHCQ", input.strWorkShopGUID, nWorkTypeID)) { db.UpdateToYiChuQin(input.strTrainPlanGUID, DateTime.Now, "", "", "", nWorkTypeID); } } db.creatMsg("RS.STEP.PRINT.GXHCQ", input.strTrainPlanGUID, input.cid, nWorkTypeID, input.strWorkShopGUID); }
public override void GetResult(object data, int nWorkTypeID) { InFlows_Card input = Newtonsoft.Json.JsonConvert.DeserializeObject <InFlows_Card>(data.ToString()); DBStep db = new DBStep(); IdIcCard c = new IdIcCard(); int k = 0;//判断循环的次数 foreach (trainmanList t in input.trainmanList) { #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.CHECKCARD", nWorkTypeID); if (nStepIndex == 0) { break; } StepResult.nStepIndex = nStepIndex; StepResult.strStepBrief = "验卡记录"; StepResult.strStepName = "RS.STEP.CHECKCARD"; StepResult.strTrainPlanGUID = input.strTrainPlanGUID; StepResult.strTrainmanGUID = t.strTrainmanGUID; StepResult.nStepResult = input.nStepResult; StepResult.strTrainmanName = t.strTrainmanName; StepResult.strTrainmanNumber = t.strTrainmanNumber; StepResult.nWorkTypeID = nWorkTypeID; #endregion #region 出勤步骤索引信息 List <StepIndex> LStepIndex = new List <StepIndex>(); StepIndex StepIndex = new StepIndex(); StepIndex.dtStartTime = ObjectConvertClass.static_ext_date(DateTime.Now); StepIndex.strFieldName = "IsCheckCard"; StepIndex.nStepData = input.nTestCardResult;; StepIndex.strTrainmanNumber = t.strTrainmanNumber; StepIndex.strTrainPlanGUID = input.strTrainPlanGUID; StepIndex.nWorkTypeID = nWorkTypeID; LStepIndex.Add(StepIndex); #endregion #region 出勤步骤详细信息 DBDrink dbpost = new DBDrink(); string npost = dbpost.getTmPost(input.strTrainPlanGUID, t.strTrainmanNumber); List <StepData> LStepData = new List <StepData>(); StepData StepData1 = new StepData(); StepData1.strTrainPlanGUID = input.strTrainPlanGUID; StepData1.strFieldName = "nTestCardResult" + npost; StepData1.nStepData = input.nTestCardResult; StepData1.strTrainmanNumber = t.strTrainmanNumber; StepData1.strStepName = "RS.STEP.CHECKCARD"; StepData1.nWorkTypeID = nWorkTypeID; LStepData.Add(StepData1); StepData StepData2 = new StepData(); StepData2.strTrainPlanGUID = input.strTrainPlanGUID; StepData2.strFieldName = "strTestCardResult" + npost; StepData2.strStepData = input.strTestCardResult; StepData2.strTrainmanNumber = t.strTrainmanNumber; StepData2.strStepName = "RS.STEP.CHECKCARD"; StepData2.nWorkTypeID = nWorkTypeID; LStepData.Add(StepData2); #endregion c.dtCreateTime = input.dtCreateTime.ToString(); c.dtEventTime = input.dtBeginTime.ToString(); c.strEventBrief = input.strTestCardResult; c.strTrainmanName = t.strTrainmanName; c.strTrainmanNumber = t.strTrainmanNumber; c.strTrainPlanGUID = input.strTrainPlanGUID; db.AddStep(LStepIndex, LStepData, StepResult); //添加验卡实际的业务逻辑 db.AddIDICCard(c); //向旧的接口提交数据 MDPlan_Beginwork_Step md = new MDPlan_Beginwork_Step(); md.dtCreateTime = input.dtCreateTime; md.dtEventEndTime = input.dtEndTime; md.dtEventTime = input.dtCreateTime; md.nStepID = 1008; 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); //向运行记录中增加数据 MDRunEvent runEvent = new MDRunEvent(); runEvent.dtCreateTime = DateTime.Now; runEvent.dtEventTime = input.dtBeginTime; runEvent.nEventID = 10008; runEvent.nResult = 10008; runEvent.nTMIS = input.placeID; runEvent.strFlowID = ""; runEvent.strGroupGUID = input.strTrainPlanGUID; runEvent.strResult = input.strTestCardResult; runEvent.strTrainPlanGUID = input.strTrainPlanGUID; runEvent.strRunEventGUID = Guid.NewGuid().ToString(); int isAddResult = 0; string Ex = ""; if (!string.IsNullOrEmpty(input.strTrainPlanGUID)) { DataTable dt = db.getTrainInfo(input.strTrainPlanGUID); if (dt.Rows.Count > 0) { runEvent.strTrainTypeName = dt.Rows[0]["strTrainTypeName"].ToString(); runEvent.nKeHuo = Convert.ToInt32(dt.Rows[0]["nKehuoID"].ToString()); runEvent.strTrainNo = dt.Rows[0]["strTrainNo"].ToString(); runEvent.strTrainNumber = dt.Rows[0]["strTrainNumber"].ToString(); runEvent.strTrainmanNumber1 = dt.Rows[0]["strTrainmanNumber1"].ToString(); runEvent.strTrainmanNumber2 = dt.Rows[0]["strTrainmanNumber2"].ToString(); try { if (db.nCheckIsExist(input.strTrainPlanGUID) >= 1) { if (k == 0)//如果是循环到第一个人,并且是数据库中有记录的话 要进行覆盖 { isAddResult = db.UpdatePlan_RunEvent(runEvent); } } else { isAddResult = db.AddPlan_RunEvent(runEvent); k++; } } catch (Exception ex) { isAddResult = 2; Ex = ex.Message.ToString(); } } } RunEvent_TrainmanDetail rt = new RunEvent_TrainmanDetail(); rt.dtCreateTime = DateTime.Now; rt.dtEventTime = input.dtBeginTime; rt.nEventID = 10008; rt.nKeHuo = runEvent.nKeHuo; rt.nResultID = input.nTestCardResult; rt.strResult = input.strTestCardResult; if (isAddResult == 0) { rt.nSubmitResult = 0; rt.strSubmitRemark = "添加失败,返回0条数据!"; } else if (isAddResult == 1) { rt.nSubmitResult = 1; rt.strSubmitRemark = "添加成功!"; } else if (isAddResult == 2) { rt.nSubmitResult = 2; rt.strSubmitRemark = "添加失败!异常信息" + Ex; } rt.nTMIS = input.placeID; rt.strRunEventGUID = runEvent.strRunEventGUID; rt.strTrainmanNumber = t.strTrainmanNumber; db.AddTrainmanDetail(rt); //检测是否是特殊步骤 if (db.CheckIsSpecialStep("RS.STEP.CHECKCARD", input.strWorkShopGUID, nWorkTypeID)) { db.UpdateToYiChuQin(input.strTrainPlanGUID, DateTime.Now, "", "", "", nWorkTypeID); } } db.creatMsg("RS.STEP.CHECKCARD", input.strTrainPlanGUID, input.cid, nWorkTypeID, input.strWorkShopGUID); }
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); }
private void SaveDrinkStepData(string strTrainPlanGUID, string strTrainmanGUID, string strTrainmanNumber, string strTainmanName, InSubmitDrink InParams, int nWorkTypeID, string strStepName) { DBStep db = new DBStep(); #region 出勤步骤结果的实体信息 StepResult StepResult = new StepResult(); StepResult.dtBeginTime = ObjectConvertClass.static_ext_date(InParams.DrinkInfo.createTime); StepResult.dtCreateTime = ObjectConvertClass.static_ext_date(InParams.DrinkInfo.createTime); StepResult.dtEndTime = ObjectConvertClass.static_ext_date(InParams.DrinkInfo.createTime); int nStepIndex = db.getIndexOfStep(InParams.DrinkInfo.strWorkShopGUID, "RS.STEP.DRINKTEST", nWorkTypeID); StepResult.nStepIndex = nStepIndex; StepResult.strStepBrief = nWorkTypeID == 1?"出勤测酒":"退勤测酒"; StepResult.strStepName = strStepName; StepResult.strTrainPlanGUID = strTrainPlanGUID; StepResult.strTrainmanGUID = InParams.DrinkInfo.trainmanID; StepResult.strTrainmanNumber = strTrainmanNumber; StepResult.strTrainmanName = InParams.DrinkInfo.strTrainmanName; StepResult.nWorkTypeID = nWorkTypeID; StepResult.nStepResult = 1; #endregion #region 出勤步骤索引信息 DateTime dtStartTime = GetdtStartTime(strTrainPlanGUID); string npost = getTmPost(strTrainPlanGUID, strTrainmanNumber); List <StepIndex> LStepIndex = new List <StepIndex>(); StepIndex StepIndex = new StepIndex(); StepIndex.dtStartTime = ObjectConvertClass.static_ext_date(dtStartTime); StepIndex.strFieldName = "nDrinkResult"; StepIndex.nStepData = int.Parse(InParams.DrinkInfo.drinkResult); StepIndex.strTrainmanNumber = strTrainmanNumber; StepIndex.strTrainPlanGUID = strTrainPlanGUID; StepIndex.nWorkTypeID = nWorkTypeID; LStepIndex.Add(StepIndex); StepIndex StepIndex2 = new StepIndex(); StepIndex2.dtStartTime = ObjectConvertClass.static_ext_date(dtStartTime); StepIndex2.strTrainmanNumber = strTrainmanNumber; StepIndex2.strTrainPlanGUID = strTrainPlanGUID; StepIndex2.strFieldName = "LateTimeDiff"; DateTime dt1 = Convert.ToDateTime(DateTime.Now); DateTime dt2 = Convert.ToDateTime(dtStartTime); TimeSpan ts = dt1 - dt2; StepIndex2.nStepData = Convert.ToInt32(ts.TotalMinutes); StepIndex2.nWorkTypeID = nWorkTypeID; LStepIndex.Add(StepIndex2); StepIndex StepIndex3 = new StepIndex(); StepIndex3.dtStartTime = ObjectConvertClass.static_ext_date(dtStartTime); StepIndex3.strTrainmanNumber = strTrainmanNumber; StepIndex3.strTrainPlanGUID = strTrainPlanGUID; StepIndex3.strFieldName = "bbtimediff"; StepIndex3.nWorkTypeID = nWorkTypeID; StepIndex3.nStepData = GetdtStartTimeDiff(strTrainPlanGUID, Convert.ToDateTime(InParams.DrinkInfo.createTime)); LStepIndex.Add(StepIndex3); #endregion #region 出勤步骤详细信息 List <StepData> LStepData = new List <StepData>(); StepData StepData1 = new StepData(); StepData1.strTrainPlanGUID = strTrainPlanGUID; StepData1.strFieldName = "nDrinkResult" + npost; StepData1.strStepName = strStepName; StepData1.strTrainmanNumber = strTrainmanNumber; StepData1.nWorkTypeID = nWorkTypeID; StepData1.nStepData = int.Parse(InParams.DrinkInfo.drinkResult); LStepData.Add(StepData1); StepData StepData2 = new StepData(); StepData2.strTrainPlanGUID = strTrainPlanGUID; StepData2.strFieldName = "LateTimeDiff" + npost; StepData2.strTrainmanNumber = strTrainmanNumber; StepData2.strStepName = strStepName; StepData2.nWorkTypeID = nWorkTypeID; StepData2.nStepData = Convert.ToInt32(ts.TotalMinutes); LStepData.Add(StepData2); StepData StepData3 = new StepData(); StepData3.strTrainPlanGUID = strTrainPlanGUID; StepData3.strFieldName = "dtEventTime" + npost; StepData3.strTrainmanNumber = strTrainmanNumber; StepData3.strStepName = strStepName; StepData3.nWorkTypeID = nWorkTypeID; StepData3.dtStepData = ObjectConvertClass.static_ext_date(InParams.DrinkInfo.createTime); LStepData.Add(StepData3); StepData StepData4 = new StepData(); StepData4.strTrainPlanGUID = strTrainPlanGUID; StepData4.strFieldName = "picture" + npost; StepData4.strTrainmanNumber = strTrainmanNumber; StepData4.strStepName = strStepName; StepData4.nWorkTypeID = nWorkTypeID; StepData4.strStepData = ObjectConvertClass.static_ext_string(InParams.DrinkInfo.imagePath); LStepData.Add(StepData4); StepData StepData5 = new StepData(); StepData5.strTrainPlanGUID = strTrainPlanGUID; StepData5.strFieldName = "nVerifyID" + npost; StepData5.strTrainmanNumber = strTrainmanNumber; StepData5.strStepName = strStepName; StepData5.nWorkTypeID = nWorkTypeID; StepData5.nStepData = ObjectConvertClass.static_ext_int(InParams.VerifyID); LStepData.Add(StepData5); #endregion db.AddStep(LStepIndex, LStepData, StepResult); List <trainmanList> trainmanlist = new List <trainmanList>(); trainmanList trainman = new trainmanList(); trainman.strTrainmanGUID = strTrainmanGUID; trainmanlist.Add(trainman); //检测是否是特殊步骤 if (db.CheckIsSpecialStep(strStepName, InParams.DrinkInfo.strWorkShopGUID, nWorkTypeID)) { if (CheckIsCejiuAll(strTrainPlanGUID, nWorkTypeID)) { if (nWorkTypeID == 1) { db.UpdateToYiChuQin(strTrainPlanGUID, DateTime.Now, "", "", "", nWorkTypeID); } else if (nWorkTypeID == 2) { DBStep dal = new DBStep(); dal.UpdateToYiTuiQin(InParams.TrainPlanGUID, InParams.DrinkInfo.strSiteGUID, DateTime.Now, "", "", "", 2); } } } //检测是否是断网测酒 if (getSetTime(InParams.DrinkInfo.strWorkShopGUID, nWorkTypeID) > Convert.ToDateTime(InParams.DrinkInfo.createTime)) { if (CheckIsCejiuAll(strTrainPlanGUID, nWorkTypeID)) { if (nWorkTypeID == 1) { db.UpdateToYiChuQin(strTrainPlanGUID, DateTime.Now, "", "", "", nWorkTypeID); } else if (nWorkTypeID == 2) { DBStep dal = new DBStep(); dal.UpdateToYiTuiQin(InParams.TrainPlanGUID, InParams.DrinkInfo.strSiteGUID, DateTime.Now, "", "", "", 2); } } } }