public void ChangeFlow(Entity.JobInfo job) { DataTable handle = new HandleList().GetList("JobID='" + job.JobID + "'").Tables[0]; Entity.FlowInfo flowNow = new FlowInfo().DataRowToModel(new FlowInfo().GetList("JobID='" + job.JobID + "' and IsDelete=0 order by SubmitDate desc").Tables[0].Rows[0]); DataAccess.TranHelper.BeginTran(); bool IsChange = false; switch (flowNow.FlowID) { case 2: #region 当流程处于2(工单已受理)时 //是否重制卡 if (handle.Select("OpeartionID=17 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=17 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=17 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } #endregion break; } try { DataAccess.TranHelper.CommitTran(); if (IsChange) { DataAccess.CardCenterHelper.SendMessage(job.JobID); } } catch (Exception ex) { throw new Exception("流程提交失败!" + ex.ToString()); } }
public void ChangeFlow(Entity.JobInfo job) { DataTable handle = new HandleList().GetList("JobID='" + job.JobID + "'").Tables[0]; Entity.FlowInfo flowNow = new FlowInfo().DataRowToModel(new FlowInfo().GetList("JobID='" + job.JobID + "' and IsDelete=0 order by SubmitDate desc").Tables[0].Rows[0]); DataAccess.TranHelper.BeginTran(); bool IsChange = false; switch (flowNow.FlowID) { case 7: #region 当流程处于7(工单已受理)时 //是否资料已经确认 if (handle.Select("OpeartionID=11 and IsChecked=1").Length > 0) { bool isChange = new ModifyList().GetList("IsDelete=0 and IsChangeName=1 and JobID='" + job.JobID + "'").Tables[0].Rows.Count > 0 ? true : false; //是否变更法人名或企业名 if (isChange) { //将流程从7修改成8 Entity.FlowInfo flowSP = new Entity.FlowInfo(); flowSP.Guid = Guid.NewGuid().ToString(); flowSP.JobID = job.JobID; flowSP.FlowID = 8; flowSP.SubmitDate = DateTime.Now; flowSP.SubmitUser = handle.Select("OpeartionID=11 and IsChecked=1")[0]["OpeartionUser"].ToString(); flowSP.Content = handle.Select("OpeartionID=11 and IsChecked=1")[0]["Remark"].ToString(); flowSP.IsDelete = false; new FlowInfo().Add(flowSP); IsChange = true; if ((bool)job.ExpressFlat) { //是否资料确认、收卡、制卡、快递 if (handle.Select("OpeartionID=11 and IsChecked=1").Length > 0 && handle.Select("FunctionID='A07' and IsChecked=1").Length > 0 && handle.Select("OpeartionID=14 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=10 and IsChecked=1").Length > 0) { //将流程从8修改为6 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 6; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=10 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=10 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否资料确认、收卡、制卡 if (handle.Select("OpeartionID=11 and IsChecked=1").Length > 0 && handle.Select("FunctionID='A07' and IsChecked=1").Length > 0 && handle.Select("OpeartionID=14 and IsChecked=1").Length > 0) { if (handle.Select("OpeartionID=9 and IsChecked=1").Length > 0) { //将流程从8修改为5 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 5; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=9 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=9 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } else { //将流程从8修改为11 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 11; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("", "OpeartionTime desc")[0]["OpeartionUser"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } } else { //将流程从7修改成9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=11 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=11 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } #endregion break; case 8: #region 当流程处于8(资料已去确认)时 //是否快递领取 if ((bool)job.ExpressFlat) { //是否资料确认、收卡、制卡、快递 if (handle.Select("OpeartionID=11 and IsChecked=1").Length > 0 && handle.Select("FunctionID='A07' and IsChecked=1").Length > 0 && handle.Select("OpeartionID=14 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=10 and IsChecked=1").Length > 0) { //将流程从8修改为6 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 6; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=10 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=10 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否资料确认、收卡、制卡 if (handle.Select("OpeartionID=11 and IsChecked=1").Length > 0 && handle.Select("FunctionID='A07' and IsChecked=1").Length > 0 && handle.Select("OpeartionID=14 and IsChecked=1").Length > 0) { if (handle.Select("OpeartionID=9 and IsChecked=1").Length > 0) { //将流程从8修改为5 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 5; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=9 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=9 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } else { //将流程从8修改为11 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 11; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("", "OpeartionTime desc")[0]["OpeartionUser"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } #endregion break; case 11: #region 当流程处于11(等待现场领取)时 //是否已现场领取 if (handle.Select("OpeartionID=9 and IsChecked=1").Length > 0) { //将流程从11修改为5 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 5; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=9 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=9 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } #endregion break; } try { DataAccess.TranHelper.CommitTran(); if (IsChange) { DataAccess.CardCenterHelper.SendMessage(job.JobID); } } catch (Exception ex) { throw new Exception("流程提交失败!" + ex.ToString()); } }
public void ChangeFlow(Entity.JobInfo job) { DataTable handle = new HandleList().GetList("JobID='" + job.JobID + "'").Tables[0]; Entity.FlowInfo flowNow = new FlowInfo().DataRowToModel(new FlowInfo().GetList("JobID='" + job.JobID + "' and IsDelete=0 order by SubmitDate desc").Tables[0].Rows[0]); DataAccess.TranHelper.BeginTran(); bool IsChange = false; switch (flowNow.FlowID) { case 2: #region 当前流程处于2(工单已受理,请缴费)时 bool haveFR = new NewlyAddedList().GetList("IsDelete=0 and JobType='NA001' and JobID='" + job.JobID + "'").Tables[0].Rows.Count > 0 ? true : false; bool haveQT = new NewlyAddedList().GetList("IsDelete=0 and JobType<>'NA001' and JobID='" + job.JobID + "'").Tables[0].Rows.Count > 0 ? true : false; //是否有法人卡 if (haveFR) { bool IsGZ = true; if (job.IsOnline) { string shtyxydm = new NewlyAddedListFR().GetList("ListID='" + new NewlyAddedList().GetList("IsDelete=0 and JobType='NA001' and JobID='" + job.JobID + "'").Tables[0].Rows[0]["ListID"] + "'").Tables[0].Rows[0]["SHTYXYDM_QS"].ToString().Substring(2, 4); if (shtyxydm != "4401" && shtyxydm != "4400") { IsGZ = false; } } //是否非广州市属企业 if (!IsGZ) { //是否已录入前三数据 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0) { //将流程从2修改为3 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 3; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=3 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=3 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否有操作员卡 if (haveQT) { //是否录入前三、后三、制法人卡、制操作员卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=7 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否录入前三、后三、制法人卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } } else { //是否录入制操作员卡 if (handle.Select("OpeartionID=7 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=7 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=7 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } #endregion break; case 3: #region 当前流程处于3(等待审批确认)时 //是否审批确认 if (handle.Select("OpeartionID=5 and IsChecked=1").Length > 0) { //将流程从3修改为4 Entity.FlowInfo flowSP = new Entity.FlowInfo(); flowSP.Guid = Guid.NewGuid().ToString(); flowSP.JobID = job.JobID; flowSP.FlowID = 4; flowSP.SubmitDate = DateTime.Now; flowSP.SubmitUser = handle.Select("OpeartionID=5 and IsChecked=1")[0]["OpeartionUser"].ToString(); flowSP.Content = handle.Select("OpeartionID=5 and IsChecked=1")[0]["Remark"].ToString(); flowSP.IsDelete = false; new FlowInfo().Add(flowSP); IsChange = true; bool QT = new NewlyAddedList().GetList("IsDelete=0 and JobType<>'NA001' and JobID='" + job.JobID + "'").Tables[0].Rows.Count > 0 ? true : false; //是否有操作员卡 if (QT) { //是否录入前三、后三、制法人卡、制操作员卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=7 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否录入前三、后三、制法人卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } #endregion break; case 4: #region 当前流程处于4(审批确认,工单处理中)时 //是否审批确认 if (handle.Select("OpeartionID=5 and IsChecked=1").Length > 0) { bool QT = new NewlyAddedList().GetList("IsDelete=0 and JobType<>'NA001' and JobID='" + job.JobID + "'").Tables[0].Rows.Count > 0 ? true : false; //是否有操作员卡 if (QT) { //是否录入前三、后三、制法人卡、制操作员卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=7 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } else { //是否录入前三、后三、制法人卡 if (handle.Select("OpeartionID=3 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=4 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=6 and IsChecked=1").Length > 0) { //将流程从2修改为9 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 9; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=6 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=6 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } else { //将流程从4修改为3 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 3; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=5 and IsChecked=0")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=5 and IsChecked=0")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } #endregion break; } try { DataAccess.TranHelper.CommitTran(); if (IsChange) { DataAccess.CardCenterHelper.SendMessage(job.JobID); } } catch (Exception ex) { throw new Exception("流程提交失败!" + ex.ToString()); } }
public void ChangeFlow(Entity.JobInfo job) { DataTable handle = new HandleList().GetList("JobID='" + job.JobID + "'").Tables[0]; Entity.FlowInfo flowNow = new FlowInfo().DataRowToModel(new FlowInfo().GetList("JobID='" + job.JobID + "' and IsDelete=0 order by SubmitDate desc").Tables[0].Rows[0]); DataAccess.TranHelper.BeginTran(); bool IsChange = false; switch (flowNow.FlowID) { case 2: #region 当流程处于2(工单已受理)时 //是否快递领取 if ((bool)job.ExpressFlat) { //是否财务确认、发票、快递 if (handle.Select("OpeartionID=8 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=18 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=10 and IsChecked=1").Length > 0) { //将流程从2修改为6 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 6; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=10 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=10 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); CommodityOutList(flow.JobID, flow.SubmitUser, flow.Content); IsChange = true; } } else { //是否财务确认、发票 if (handle.Select("OpeartionID=8 and IsChecked=1").Length > 0 && handle.Select("OpeartionID=18 and IsChecked=1").Length > 0) { //是否已现场领取 if (handle.Select("OpeartionID=9 and IsChecked=1").Length > 0) { //将流程从2修改为5 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 5; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=9 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=9 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); CommodityOutList(flow.JobID, flow.SubmitUser, flow.Content); IsChange = true; } else { //将流程从2修改为11 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 11; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("", "OpeartionTime desc")[0]["OpeartionUser"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); IsChange = true; } } } #endregion break; case 11: #region 当流程处于11(等待现场领取)时 //是否已现场领取 if (handle.Select("OpeartionID=9 and IsChecked=1").Length > 0) { //将流程从11修改为5 Entity.FlowInfo flow = new Entity.FlowInfo(); flow.Guid = Guid.NewGuid().ToString(); flow.JobID = job.JobID; flow.FlowID = 5; flow.SubmitDate = DateTime.Now; flow.SubmitUser = handle.Select("OpeartionID=9 and IsChecked=1")[0]["OpeartionUser"].ToString(); flow.Content = handle.Select("OpeartionID=9 and IsChecked=1")[0]["Remark"].ToString(); flow.IsDelete = false; new FlowInfo().Add(flow); CommodityOutList(flow.JobID, flow.SubmitUser, flow.Content); IsChange = true; } #endregion break; } try { DataAccess.TranHelper.CommitTran(); if (IsChange) { DataAccess.CardCenterHelper.SendMessage(job.JobID); } } catch (Exception ex) { throw new Exception("流程提交失败!" + ex.ToString()); } }