【开发心得】筑梦上海:项目风云录(5)

写这个长篇的目的,前文已经说过。就这个目的而言,这里会更多的讲项目中存在的风险和应对,假如你正在做项目或者打算从事软件项目管理,可以一起交流讨论一下。

目录

小娇的离去

管人的大忌

理解甲方的立场

时刻表的诞生

未完待续。。。


小娇的离去

上文说的是女员工,自从这个项目以后,从我的角度而言,也不存在女员工的问题了。只是每次回想起来“小娇”的事情,总感觉有点儿耿耿于怀,都说有了第一次,就会有第二次,个人而言,却没有第二次了。

记得那年春节前的一天,领导找到我,项目已经进行了4个月,但是进度始终落后于预期,即使肖博士来了以后,依然没有更多的改善。那天是为春节后的推进做决策,领导和肖博士都认为,一定要有人为进度的事情负责。

当时的气氛很紧张,压迫感让我做出了一个错误决定,让“小娇”离开团队,本来以为是可以到其他项目组去,没想到最后的决定竟然是辞退她,最终领导还要求我去通知她。

事已至此,佩服“小娇”当时的冷静,背井离乡来上海的她,没有多说什么,只是默默的听,后来QQ上联系过几次,但后来就杳无音讯了。

此事过后,肖博士还曾经引用过一句名言给与评价:始乱终弃。也是后来查了以后才知道这个成语的含义,总觉得哪里不是很恰当。

管人的大忌

但这个事情还是引起了连锁反应,在此之前,先要解决另外一个棘手的问题,小光和小魏两名员工。

他们虽然进公司的时间分前后,而且并非在同一个部门,但不知道为什么会进入到这个项目组。说到这里,要给项目经理们提个醒:在组建团队的时候,一定要有自己的话语权。

小魏的资历比较老一些,据说项目经验也比较丰富,并不是与客户沟通的经验,是开发的经验比较丰富。项目经理一定要详细了解成员的背景,我当时并没有认真对待,自身也是缺乏经验的,看过前文的,都知道,团队的组建也不是我负责的。

小光跟我以前不认识,只是为这个项目,大家才呆在一起了。他比我年轻,接触的新东西不少,每次开会,都会提出很多观点,这是好的方面。

但随着时间的推移,发现小光和小魏的关系不错,平时吃饭工作都坐在一起,尤其是在讨论问题的时候,竟然会出奇的一致!乃至到最后,他们俩的意见,竟然能够左右整个项目组。包括“会海”这么有个性的人,对他们的意见也不怎么在明面上反对。

如果他俩能够全身心的投入项目,是件非常好的事情。但发展到最后,两个人一边上班,一边嗑瓜子,其他人敢怒不敢言。我开始也犯了一个错误,没有搞个个击破,而是在大家面前直接批评了他们,犯了管人的大忌。

后来的项目里,每次发现不对,都是先单独出去批评,保留一分做人的情面。没有再犯上面的错误。

也是因为这个错误,导致最后不得不向领导打报告,申请调两个人中的一人到其他部门,避免他们联合起来对付我,从而影响整个项目的进度,毕竟在肖博士来之前,没有人可以替代我,这一点,无论领导还是老板都给与我极大的信任。

朝中有人好做官。这一点,也是项目经理必须要牢记的一点。有时候宁肯做普通员工,也不能做项目经理。

理解甲方的立场

甲方的“松工”也一直支持我的工作。作为甲方的代表,他其实可以向总经理直接汇报的。由于这个项目,也是总经理负责的项目,所以也是非常信任“松工”的。也因此他也有更多的难处,尤其是在项目初期,我们一直无法提供给客户看到明显的进展,因为承受了很大的压力。

“松工”年纪比我们都大,据说做过基层的工作,所以业务流程上的问题,他很熟悉。记得有一次,我把跟“松工”确认过的业务流程,开发原型以后,界面与实际部门的员工进行确认,没想到这个家伙说“松工”说的不对,以至于代码逻辑全部推翻重来。

为此我去埋怨“松工”,他也很生气,“为了你们能够尽快推进,有些事情我拍板,将来我会负责推进使用,他们一句话,你们就改,为什么?”

因为这件事,我吸取了教训,在今后的沟通协调中,尽量和松工一起到业务部门交流,避免双方的不一致,给项目带来无谓的返工。同时,每天都挤出时间跟“松工”汇报当天项目组的进展,让“松工”及时了解项目组的情况。在后面的开发过程中,在用人做事方面,得到了“松工”无私的帮助,也是这个项目最后能够完工的重要基石。

项目经理一定要站在甲方的立场思考问题,同时积极为甲方利益考虑,避免埋头苦干结果把自己埋进去。

时刻表的诞生

前文中的系统功能里,当时有个非常基础,且又非常复杂的模块,时刻表。

现在无线通讯发达了,GPS的技术应用,使得车辆的位置不再是问题。但在当年只有铁皮路牌和时刻表的年代,一张合适的时刻表,耗费了项目组大量的精力实现。

UI就不再这里展示了,把时刻表的字段及类型方面的代码贴一下,按照命名规则大概能够猜出来是什么意思。

internal void InitVars() {this.columnId = this.Columns["Id"];this.columnRouteCode = this.Columns["RouteCode"];this.columnRouteName = this.Columns["RouteName"];this.columnRouteBirth = this.Columns["RouteBirth"];this.columnRouteProperty = this.Columns["RouteProperty"];this.columnStartStopBoard = this.Columns["StartStopBoard"];this.columnEndStopBoard = this.Columns["EndStopBoard"];this.columnPassByDesc = this.Columns["PassByDesc"];this.columnPlanDistance = this.Columns["PlanDistance"];this.columnRealDistance = this.Columns["RealDistance"];this.columnStopNumber = this.Columns["StopNumber"];this.columnAverageInterval = this.Columns["AverageInterval"];this.columnFormerClass = this.Columns["FormerClass"];this.columnOverdutyClass = this.Columns["OverdutyClass"];this.columnSingleTime = this.Columns["SingleTime"];this.columnRateCode = this.Columns["RateCode"];this.columnBusCompanyCode = this.Columns["BusCompanyCode"];this.columnCircleDesc = this.Columns["CircleDesc"];this.columnAlongLineDesc = this.Columns["AlongLineDesc"];this.columnAttemperType = this.Columns["AttemperType"];this.columnParentRouteCode = this.Columns["ParentRouteCode"];}private void InitClass() {this.columnId = new DataColumn("Id", typeof(int), null, System.Data.MappingType.Element);this.Columns.Add(this.columnId);this.columnRouteCode = new DataColumn("RouteCode", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRouteCode);this.columnRouteName = new DataColumn("RouteName", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRouteName);this.columnRouteBirth = new DataColumn("RouteBirth", typeof(System.DateTime), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRouteBirth);this.columnRouteProperty = new DataColumn("RouteProperty", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRouteProperty);this.columnStartStopBoard = new DataColumn("StartStopBoard", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnStartStopBoard);this.columnEndStopBoard = new DataColumn("EndStopBoard", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnEndStopBoard);this.columnPassByDesc = new DataColumn("PassByDesc", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnPassByDesc);this.columnPlanDistance = new DataColumn("PlanDistance", typeof(System.Double), null, System.Data.MappingType.Element);this.Columns.Add(this.columnPlanDistance);this.columnRealDistance = new DataColumn("RealDistance", typeof(System.Double), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRealDistance);this.columnStopNumber = new DataColumn("StopNumber", typeof(int), null, System.Data.MappingType.Element);this.Columns.Add(this.columnStopNumber);this.columnAverageInterval = new DataColumn("AverageInterval", typeof(System.Double), null, System.Data.MappingType.Element);this.Columns.Add(this.columnAverageInterval);this.columnFormerClass = new DataColumn("FormerClass", typeof(int), null, System.Data.MappingType.Element);this.Columns.Add(this.columnFormerClass);this.columnOverdutyClass = new DataColumn("OverdutyClass", typeof(int), null, System.Data.MappingType.Element);this.Columns.Add(this.columnOverdutyClass);this.columnSingleTime = new DataColumn("SingleTime", typeof(System.Double), null, System.Data.MappingType.Element);this.Columns.Add(this.columnSingleTime);this.columnRateCode = new DataColumn("RateCode", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnRateCode);this.columnBusCompanyCode = new DataColumn("BusCompanyCode", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnBusCompanyCode);this.columnCircleDesc = new DataColumn("CircleDesc", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnCircleDesc);this.columnAlongLineDesc = new DataColumn("AlongLineDesc", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnAlongLineDesc);this.columnAttemperType = new DataColumn("AttemperType", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnAttemperType);this.columnParentRouteCode = new DataColumn("ParentRouteCode", typeof(string), null, System.Data.MappingType.Element);this.Columns.Add(this.columnParentRouteCode);this.Constraints.Add(new UniqueConstraint("Constraint1", new DataColumn[] {this.columnId}, true));this.columnId.AutoIncrement = true;this.columnId.AllowDBNull = false;this.columnId.ReadOnly = true;this.columnId.Unique = true;this.columnRouteCode.AllowDBNull = false;this.columnRouteName.AllowDBNull = false;this.columnRouteBirth.AllowDBNull = false;this.columnRouteProperty.AllowDBNull = false;}

下面的代码是自动生成一个时刻表的代码核心逻辑,根据排版、始发时间、到站时间、空驶情况,最终自动生成的时刻表,会展示在界面上,供营运人员进行手工的微调。

public bool AutoCreateGoWorkFlowRecord(string timetableid,string stop1,int stop1outNullDrivetime,int stop1inNullDrivetime,string stop2,int stop2outNullDrivetime,int stop2inNullDrivetime,int RegualMaintainTimeLength,int difflunchtime,int nonRegualMaintainTimeLength,bool useoldtime, System.Windows.Forms.ProgressBar  showbar){//System.Wind OleDbDataReader reader;OleDbDataReader reader2;OleDbDataReader reader3;OleDbDataReader reader4;OleDbDataReader reader5;OleDbDataReader reader6;int barnum=0;int barmaxnum=0;string ssql;//ssql="select id from RouteBoard where TimeTableID='" + timetableid.Trim()   +"' and RouteBoardName='" +routeboardname.Trim() +"'";//取得新添加班次的路牌ssql="select count(*) from  TimeTableRecord  a where a.timetableid='"+ timetableid+"' and  a.RouteBoardCode not in ( select RouteBoardCode from GoWorkFlow ) group by a.RouteBoardCode ";reader =this.GetReader (ssql);reader.Read ();barmaxnum=Convert.ToInt32 ( reader.GetValue(0).ToString ());ssql="select a.RouteBoardCode  from  TimeTableRecord  a where a.timetableid='"+ timetableid+"' and  a.RouteBoardCode not in ( select RouteBoardCode from GoWorkFlow ) group by a.RouteBoardCode ";reader =this.GetReader (ssql);ssql="update  TimeTableRecord  set begintime ='1900-01-01 '+convert(char(10), begintime,108) where convert(char(10), begintime,20)>'1900-01-02' and DATEPART(hh, begintime)>='03' and timetableid="+ timetableid +" and routeboardcode in (select id from routeboard where allnight='0')";this.GetReader (ssql);showbar.Maximum =barmaxnum*2+1;try{//遍历路牌while (reader.Read () ){barnum++;string routeboardcode="";string beginstop="";string endstop="";string WorkFlowType="";string cbeginstop="";string cendstop="";bool stopflag=false;DateTime  CheckInTime=DateTime.Now  ; //报到时间DateTime  CheckOutTime=DateTime.Now ;//出场时间DateTime GoOutTime=DateTime.Now ;   //离场时间DateTime ArriveTime=DateTime.Now ;  //回场时间DateTime begintime=DateTime.Now ;  DateTime endtime=DateTime.Now ;DateTime lunchtime= Convert.ToDateTime("1900-01-01 0:00:00") ;double RunningTimeLength=0;double CheckInNullDriveMileage=0;double CheckInNullDriveTimeLength=0;double CheckoutNullDriveMileage=0;double CheckoutNullDriveTimeLength=0;double LunchTimeLength=difflunchtime;double WorkTimeLength=0;int nowdifflunchtime=0;double spanNullDriveMileage=0;double SpannullDriveTimeLength=0;TimeSpan difftime;routeboardcode=reader.GetValue(0).ToString ();//判断接落班类型ssql="select  count(*)  from VIEWAllClass  where RouteBoardCode='"+routeboardcode.Trim ()  + "' and (backflag=1  or StopFlag=1)";reader2 =this.GetReader (ssql);reader2.Read ();if( Convert.ToInt32(reader2.GetValue(0))<2)// 全天{WorkFlowType="229003";//得到起始班次ssql="select top 1 BeginStopBoard,BeginTime,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.BeginStopBoard=tbstopboard.BoardCode  where RouteBoardCode='"+routeboardcode.Trim () + "'   order by BeginTime";reader3 =this.GetReader (ssql);reader3.Read ();beginstop=reader3.GetValue(0).ToString ();begintime=Convert.ToDateTime( reader3.GetValue(1).ToString ());cbeginstop=reader3.GetValue (2).ToString (); ssql=" select EndStopBoard,EndTime, backflag,StopFlag,LunchFalg,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode where RouteBoardCode='"+ routeboardcode.Trim () + "' and (backflag=1 or StopFlag=1 or LunchFalg=1)";reader3 =this.GetReader (ssql);nowdifflunchtime=0;while(reader3.Read ()){//吃饭时间//lunchtime=0;if(reader3.GetValue(4).ToString ()=="1"){int intdifflunchtime=difflunchtime;if(useoldtime==true){//都得原始吃饭时间try{ssql="select * from  lunchtimetable where timetableid="+timetableid +" and workflowtype="+WorkFlowType+" and routeboardcode="+routeboardcode;reader5 =this.GetReader (ssql);reader5.Read ();if(Convert.ToInt32 (reader5.GetValue(3).ToString ())!=0){intdifflunchtime=Convert.ToInt32 (reader5.GetValue(3).ToString ()); }}catch{}}lunchtime =Convert.ToDateTime( reader3.GetValue(1).ToString ()).AddMinutes(-intdifflunchtime );nowdifflunchtime=intdifflunchtime;}//回场else{endstop = reader3.GetValue(0).ToString ();endtime = Convert.ToDateTime(reader3.GetValue(1).ToString ());cendstop=reader3.GetValue(5).ToString () ;//回场场时间ssql="select b.boardname,a.span,a.distance,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid= "+ timetableid +") ";reader4=this.GetReader (ssql);stop1inNullDrivetime=0;CheckInNullDriveMileage =0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cendstop.Trim ()){if(stop1inNullDrivetime==0){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim()=="202002"){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}ArriveTime=endtime .AddMinutes(stop1inNullDrivetime );CheckInNullDriveTimeLength=stop1inNullDrivetime;//									//离场时间GoOutTime=ArriveTime.AddMinutes (RegualMaintainTimeLength);}//出场时间ssql="select b.boardname,a.span,a.distance ,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid= "+ timetableid +") ";reader4=this.GetReader (ssql);stop1outNullDrivetime=0;CheckoutNullDriveMileage=0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cbeginstop.Trim ()){if(stop1outNullDrivetime==0){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim ()=="202001"){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}int  intstop1outNullDrivetime=-stop1outNullDrivetime;CheckOutTime=begintime.AddMinutes(intstop1outNullDrivetime);CheckoutNullDriveTimeLength=stop1outNullDrivetime;//报道时间int intRegualMaintainTimeLength=-RegualMaintainTimeLength;CheckInTime=CheckOutTime.AddMinutes (intRegualMaintainTimeLength);}//跨路线公里,时间spanNullDriveMileage=0;SpannullDriveTimeLength=0;ssql=" select sum(NullMileage),sum(Nulltime)  from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode where VIEWAllClass.TimeTableID="+timetableid +" and   RouteBoardCode='"+ routeboardcode.Trim () + "' and  spanflag=1";reader6 =this.GetReader (ssql);reader6.Read ();if(reader6.GetValue(0)!=DBNull.Value){spanNullDriveMileage=Convert.ToDouble (reader6.GetValue(0).ToString ());}if(reader6.GetValue(1)!=DBNull.Value){SpannullDriveTimeLength =Convert.ToDouble (reader6.GetValue(1).ToString ());}//营运时间WorkTimeLength=0;RunningTimeLength=0;difftime= GoOutTime-CheckInTime;if(difftime.TotalMinutes<0){GoOutTime=GoOutTime.AddDays (1);difftime= GoOutTime-CheckInTime;}WorkTimeLength=Convert.ToDouble(difftime.TotalMinutes)-Math.Abs (nowdifflunchtime);RunningTimeLength=WorkTimeLength-2*RegualMaintainTimeLength-stop1outNullDrivetime-stop1inNullDrivetime ;int MaintainTimeLength=2*RegualMaintainTimeLength;ssql="insert into GoWorkFlow(TimeTableID,RouteBoardCode,WorkFlowType,CheckOutTime,CheckInTime,ArriveTime,GoOutTime,LunchTime,CheckOutDirection,CheckInDirection,LunchTimeLength,RegualMaintainTimeLength,RunningTimeLength,CheckInNullDriveTimeLength,CheckoutNullDriveTimeLength,CheckoutNullDriveMileage,CheckInNullDriveMileage,WrokTimeLength,SpannullDriveMileage,SpannullDriveTimeLength)"  +" values('" + timetableid + "','" + routeboardcode + "','" + WorkFlowType + " ','" + CheckOutTime+ "','"+ CheckInTime +"','"+ArriveTime  +"','"+GoOutTime + "','" + lunchtime + "','" +beginstop  + "','"+ endstop +"',"+ nowdifflunchtime  +"," + MaintainTimeLength +","+RunningTimeLength +"," +CheckInNullDriveTimeLength+","+CheckoutNullDriveTimeLength +","+CheckoutNullDriveMileage +","+CheckInNullDriveMileage+","+WorkTimeLength+","+spanNullDriveMileage+","+SpannullDriveTimeLength  +")";this.GetReader (ssql);}else  //上下午{string firstbacktime;ssql="select EndTime from VIEWAllClass  where RouteBoardCode='"+ routeboardcode.Trim ()+"' and (backflag=1  or StopFlag=1)   order by BeginTime";reader3 =this.GetReader (ssql);reader3.Read ();firstbacktime=Convert.ToDateTime(reader3.GetValue(0).ToString ()).ToString() ;//上午WorkFlowType="229001";//得到起始班次ssql="select top 1 BeginStopBoard,BeginTime,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.BeginStopBoard=tbstopboard.BoardCode where RouteBoardCode='"+routeboardcode.Trim () + "' order by BeginTime";reader3 =this.GetReader (ssql);reader3.Read ();beginstop=reader3.GetValue(0).ToString ();begintime=Convert.ToDateTime( reader3.GetValue(1).ToString ());cbeginstop =reader3.GetValue(2).ToString ();//得到上午回场时间ssql=" select EndStopBoard ,EndTime, backflag,StopFlag,LunchFalg,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode where RouteBoardCode='"+ routeboardcode.Trim ()+"' and (backflag=1 or StopFlag=1 or LunchFalg=1)  and BeginTime<='" + firstbacktime +"' ";reader3 =this.GetReader (ssql);nowdifflunchtime=0;while(reader3.Read ()){//吃饭时间//lunchtime=0;if(reader3.GetValue(4).ToString ()=="1"){int intdifflunchtime=difflunchtime;//都得原始吃饭时间if(useoldtime==true){try{ssql="select * from  lunchtimetable where timetableid="+timetableid +" and workflowtype="+WorkFlowType+" and routeboardcode="+routeboardcode;reader5 =this.GetReader (ssql);reader5.Read ();if(Convert.ToInt32 (reader5.GetValue(3).ToString ())!=0){intdifflunchtime=Convert.ToInt32 (reader5.GetValue(3).ToString ()); }}								catch{}}lunchtime =Convert.ToDateTime( reader3.GetValue(1).ToString ()).AddMinutes(-intdifflunchtime );nowdifflunchtime=intdifflunchtime;}//回场else {endstop = reader3.GetValue(0).ToString ();endtime = Convert.ToDateTime(reader3.GetValue(1).ToString ());cendstop= reader3.GetValue(5).ToString ();//回场场时间stop1inNullDrivetime=0;CheckInNullDriveMileage =0;if(reader3.GetValue(2).ToString ()=="1")//回场{stopflag=false;ssql="select b.boardname,a.span,a.distance ,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid= "+ timetableid +") ";reader4=this.GetReader (ssql);stop1inNullDrivetime=0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cendstop.Trim ()){if(stop1inNullDrivetime==0){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim ()=="202002"){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}}else//站停{stopflag=true; }ArriveTime=endtime .AddMinutes(stop1inNullDrivetime );CheckInNullDriveTimeLength=stop1inNullDrivetime;//离场时间GoOutTime=ArriveTime;}//出场时间stop1outNullDrivetime=0;CheckoutNullDriveMileage=0;ssql="select b.boardname,a.span,a.distance ,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid= "+ timetableid +") ";reader4=this.GetReader (ssql);stop1outNullDrivetime=0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cbeginstop.Trim ()){if(stop1outNullDrivetime==0){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim ()=="202001"){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}int  intstop1outNullDrivetime=-stop1outNullDrivetime;CheckOutTime=begintime.AddMinutes(intstop1outNullDrivetime);CheckoutNullDriveTimeLength=stop1outNullDrivetime;//报道时间int intRegualMaintainTimeLength=-RegualMaintainTimeLength;CheckInTime=CheckOutTime.AddMinutes (intRegualMaintainTimeLength);}//跨路线公里,时间spanNullDriveMileage=0;SpannullDriveTimeLength=0;ssql=" select sum(NullMileage),sum(Nulltime)  from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode where VIEWAllClass.TimeTableID="+timetableid +" and   RouteBoardCode='"+ routeboardcode.Trim () + "' and  spanflag=1 and BeginTime<='" + firstbacktime +"' ";reader6=this.GetReader (ssql);reader6.Read ();if(reader6.GetValue(0)!=DBNull.Value){spanNullDriveMileage=Convert.ToDouble (reader6.GetValue(0).ToString ());}if(reader6.GetValue(1)!=DBNull.Value){SpannullDriveTimeLength =Convert.ToDouble (reader6.GetValue(1).ToString ());}//营运时间,工时WorkTimeLength=0;RunningTimeLength=0;difftime= GoOutTime-CheckInTime;if(difftime.TotalMinutes<0){GoOutTime=GoOutTime.AddDays (1);difftime= GoOutTime-CheckInTime;}WorkTimeLength=Convert.ToDouble(difftime.TotalMinutes)-Math.Abs (nowdifflunchtime);RunningTimeLength=WorkTimeLength-RegualMaintainTimeLength-stop1outNullDrivetime-stop1inNullDrivetime ;int MaintainTimeLength=RegualMaintainTimeLength;ssql="insert into GoWorkFlow(TimeTableID,RouteBoardCode,WorkFlowType,CheckOutTime,CheckInTime,ArriveTime,GoOutTime,LunchTime,CheckOutDirection,CheckInDirection,LunchTimeLength,RegualMaintainTimeLength,RunningTimeLength,CheckInNullDriveTimeLength,CheckoutNullDriveTimeLength,CheckoutNullDriveMileage,CheckInNullDriveMileage,WrokTimeLength,SpannullDriveMileage,SpannullDriveTimeLength)"  +" values('" + timetableid + "','" + routeboardcode + "','" + WorkFlowType + " ','" + CheckOutTime+ "','"+ CheckInTime +"','"+ArriveTime  +"','"+GoOutTime + "','" + lunchtime + "','" +beginstop  + "','"+ endstop +"',"+ nowdifflunchtime  +"," + MaintainTimeLength +","+RunningTimeLength +"," +CheckInNullDriveTimeLength+","+CheckoutNullDriveTimeLength +","+CheckoutNullDriveMileage +","+CheckInNullDriveMileage+","+WorkTimeLength+ ","+spanNullDriveMileage+","+SpannullDriveTimeLength +")";this.GetReader (ssql);//下午WorkFlowType="229002";//得到起始班次ssql="select top 1 BeginStopBoard ,BeginTime ,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.BeginStopBoard=tbstopboard.BoardCode  where RouteBoardCode='"+routeboardcode.Trim () + "' and BeginTime>='" + firstbacktime  +"'  order by BeginTime";reader3 =this.GetReader (ssql);reader3.Read ();beginstop=reader3.GetValue(0).ToString ();begintime=Convert.ToDateTime( reader3.GetValue(1).ToString ());cbeginstop= reader3.GetValue(2).ToString ();//得到下午回场时间ssql=" select EndStopBoard ,EndTime, backflag,StopFlag,LunchFalg,BoardName from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode  where RouteBoardCode='"+ routeboardcode.Trim ()+"' and (backflag=1 or StopFlag=1 or LunchFalg=1)  and BeginTime>'" + firstbacktime +"' ";reader3 =this.GetReader (ssql);//lunchtime=0;nowdifflunchtime=0;while(reader3.Read ()){//吃饭时间if(reader3.GetValue(4).ToString ()=="1"){int intdifflunchtime=difflunchtime;//都得原始吃饭时间if(useoldtime==true ){try{ssql="select * from  lunchtimetable where timetableid="+timetableid +" and workflowtype="+WorkFlowType+" and routeboardcode="+routeboardcode;reader5 =this.GetReader (ssql);reader5.Read ();if(Convert.ToInt32 (reader5.GetValue(3).ToString ())!=0){intdifflunchtime=Convert.ToInt32 (reader5.GetValue(3).ToString ()); }}catch{}}lunchtime =Convert.ToDateTime( reader3.GetValue(1).ToString ()).AddMinutes(-intdifflunchtime );nowdifflunchtime=intdifflunchtime ;}//回场else{endstop = reader3.GetValue(0).ToString ();endtime = Convert.ToDateTime(reader3.GetValue(1).ToString ());cendstop= reader3.GetValue(5).ToString ();//回场场时间stop1inNullDrivetime=0;CheckInNullDriveMileage =0;ssql="select b.boardname,a.span,a.distance ,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid="+timetableid +" ) ";reader4=this.GetReader (ssql);stop1inNullDrivetime=0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cendstop.Trim ()){if(stop1inNullDrivetime==0){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim ()=="202002"){stop1inNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckInNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}ArriveTime=endtime .AddMinutes(stop1inNullDrivetime );CheckInNullDriveTimeLength=stop1inNullDrivetime;//离场时间GoOutTime=ArriveTime.AddMinutes (RegualMaintainTimeLength);}//出场时间stop1outNullDrivetime=0;CheckoutNullDriveMileage =0;if(stopflag==false ){ssql="select b.boardname,a.span,a.distance,a.DirectionType from tbhavetorun a left outer  join tbstopboard b on a.stopboardcode=b.boardcode where  a.mark=0 and a.routeid in (select distinct routecode from VIEWRouteTimeTable where timetableid= "+ timetableid +") ";reader4=this.GetReader (ssql);stop1outNullDrivetime=0;while(reader4.Read ()){if(reader4.GetValue(0).ToString()== cbeginstop.Trim ()){if(stop1outNullDrivetime==0){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}else{if(reader4.GetValue(3).ToString().Trim ()=="202001"){stop1outNullDrivetime=Convert.ToInt32(reader4.GetValue(1).ToString ());CheckoutNullDriveMileage =Convert.ToDouble(reader4.GetValue (2).ToString ());}}}}}int  intstop1outNullDrivetime=-stop1outNullDrivetime;CheckOutTime=begintime.AddMinutes(intstop1outNullDrivetime);CheckoutNullDriveTimeLength=stop1outNullDrivetime;//报道时间int intRegualMaintainTimeLength=-nonRegualMaintainTimeLength ;CheckInTime=CheckOutTime.AddMinutes (intRegualMaintainTimeLength);}//跨路线公里,时间spanNullDriveMileage=0;SpannullDriveTimeLength=0;ssql=" select sum(NullMileage),sum(Nulltime)  from VIEWAllClass left outer join tbstopboard on VIEWAllClass.EndStopBoard=tbstopboard.BoardCode where VIEWAllClass.TimeTableID="+timetableid +" and   RouteBoardCode='"+ routeboardcode.Trim () + "' and  spanflag=1 and BeginTime>'" + firstbacktime +"' ";reader6=this.GetReader (ssql);reader6.Read (); if( reader6.GetValue(0)!=DBNull.Value  ){spanNullDriveMileage=Convert.ToDouble (reader6.GetValue(0).ToString ());}if( reader6.GetValue(1)!=DBNull.Value){SpannullDriveTimeLength =Convert.ToDouble (reader6.GetValue(1).ToString ());}//营运时间//营运时间WorkTimeLength=0;RunningTimeLength=0;difftime= GoOutTime-CheckInTime;if(difftime.TotalMinutes<0){GoOutTime=GoOutTime.AddDays (1);difftime= GoOutTime-CheckInTime;}WorkTimeLength=Convert.ToDouble(difftime.TotalMinutes)-Math.Abs (nowdifflunchtime);RunningTimeLength=WorkTimeLength-RegualMaintainTimeLength-nonRegualMaintainTimeLength-stop1outNullDrivetime-stop1inNullDrivetime ;MaintainTimeLength=RegualMaintainTimeLength+nonRegualMaintainTimeLength;ssql="insert into GoWorkFlow(TimeTableID,RouteBoardCode,WorkFlowType,CheckOutTime,CheckInTime,ArriveTime,GoOutTime,LunchTime,CheckOutDirection,CheckInDirection,LunchTimeLength,RegualMaintainTimeLength,RunningTimeLength,CheckInNullDriveTimeLength,CheckoutNullDriveTimeLength,CheckoutNullDriveMileage,CheckInNullDriveMileage,WrokTimeLength,SpannullDriveMileage,SpannullDriveTimeLength)"  +" values('" + timetableid + "','" + routeboardcode + "','" + WorkFlowType + " ','" + CheckOutTime+ "','"+ CheckInTime +"','"+ArriveTime  +"','"+GoOutTime + "','" + lunchtime + "','" +beginstop  + "','"+ endstop +"',"+ nowdifflunchtime +"," + MaintainTimeLength +","+RunningTimeLength +"," +CheckInNullDriveTimeLength+","+CheckoutNullDriveTimeLength +","+CheckoutNullDriveMileage +","+CheckInNullDriveMileage+","+WorkTimeLength+","+spanNullDriveMileage+","+SpannullDriveTimeLength  +")";this.GetReader (ssql);}showbar.Value =barnum ;showbar.Refresh ();}return  true;}

未完待续。。。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/430822.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

dotnet4.0编译问题

因为最近在写cobaltstrike的execute-assembly内存加载的c#项目 用visual studio2022编译&#xff0c;最低net只能用6.0版本的&#xff0c;并且execute-assembly不支持 我想使用4.x版本进行编译&#xff0c;因为visual studio不支持&#xff0c;那么使用命令行进行编译 因为要用…

np.pad实现零填充

np.pad 是 NumPy 中用于对数组进行填充的函数&#xff0c;它可以在数组的不同维度上添加指定数量的值。 X&#xff1a;输入的 NumPy 数组。通常是一个 4 维数组&#xff0c;可能表示图像数据&#xff0c;形状为 (batch_size, height, width, channels)&#xff0c;例如 (样本数…

Java语法-类和对象(上)

1. 面向对象的初步认识 1.1 什么是面向对象 概念: Java是一门纯面向对象的语言(Object Oriented Program&#xff0c;简称OOP)&#xff0c;在面向对象的世界里&#xff0c;一切皆为对象。 1.2 面向对象VS面向过程 如:洗衣服 面向过程: 注重的是洗衣服的过程,少了一个环节也不…

nginx基础篇(一)

文章目录 学习链接概图一、Nginx简介1.1 背景介绍名词解释 1.2 常见服务器对比IISTomcatApacheLighttpd其他的服务器 1.3 Nginx的优点(1)速度更快、并发更高(2)配置简单&#xff0c;扩展性强(3)高可靠性(4)热部署(5)成本低、BSD许可证 1.4 Nginx的功能特性及常用功能基本HTTP服…

工厂模式,策略模式,代理模式,单例模式在项目中的应用

项目背景&#xff1a; 首先这篇文章是总结了OJ项目和AI答题平台项目&#xff08;和一点点的聚合搜索项目&#xff09;中设计模式的文章 在项目中也用了很多次的设计模式&#xff0c;我感觉起来&#xff0c;这些设计模式的作用就是提高项目的扩展性和降低耦合性 工厂模式&…

vite分目录打包以及去掉默认的.gz 文件

1.vite打包情况介绍&#xff1a; 1.1vite在不进行任何配置的情况下&#xff0c;会将除开public的所有引用到资源打包编译添加哈希值至assets文件夹中&#xff08;非引用文件以及行内样式图片未被打包编译资源会被treeSharp直接忽略不打包&#xff09;&#xff0c;     1.2w…

七层负载均衡和四层负载均衡的区别

文章目录 什么是七层负载均衡&#xff1f;一、定义与工作原理二、优点与缺点三、应用场景四、常见七层负载均衡器五、负载均衡算法 什么是四层负载均衡&#xff1f;一、定义与原理定义&#xff1a;原理&#xff1a; 二、特点与应用场景特点&#xff1a;应用场景&#xff1a; 三…

Python中的数据可视化:从基础图表到高级可视化

数据可视化是数据分析和科学计算中不可或缺的一部分。它通过图形化的方式呈现数据&#xff0c;使复杂的统计信息变得直观易懂。Python提供了多种强大的库来支持数据可视化&#xff0c;如Matplotlib、Seaborn、Plotly等。本文将从基础图表入手&#xff0c;逐步介绍如何使用这些库…

基础漏洞——SSRF

目录 一.原理 二.引起ssrf的函数 三.这些函数具体作用 &#xff08;1&#xff09;File_get_content() &#xff08;2&#xff09;Fsockopen() &#xff08;3&#xff09;Curl_exec() 四.常见的业务场景&#xff08;可能出现的漏洞的地方&#xff0c;漏洞挖掘&#xff09…

自动化学习2:pytest的高级用法(mark标记/fixture/hook)

一.mark的用法 概念&#xff1a;Pytest提供的mark标记&#xff0c;允许我们标记测试函数&#xff0c;测试类和整个模块。通过不同的标记实现不同的运行策略&#xff0c;如标记冒烟测试用例。 1.注册标记 可以在pytest.ini文件注册自定义标记 除了自己注册的标记外&#xff0…

蓝队技能-应急响应篇Web内存马查杀JVM分析Class提取诊断反编译日志定性

知识点&#xff1a; 1、应急响应-Web内存马-定性&排查 2、应急响应-Web内存马-分析&日志 注&#xff1a;传统WEB类型的内存马只要网站重启后就清除了。 演示案例-蓝队技能-JAVA Web内存马-JVM分析&日志URL&内存查杀 0、环境搭建 参考地址&#xff1a;http…

Java面试篇基础部分- 锁详解

可重入锁 可重入锁也叫作递归锁,是指在同一个线程中,在外层函数获取到该锁之后,内存的递归函数还可以获取到该锁。在Java语言环境下,ReentrantLock和Synchroinzed都是可重入锁的代表。 公平锁与非公平锁 公平锁(Fair Lock)是指在分配锁之前检查是否有线程在排队等待获取…

搜维尔科技:SenseGlove触觉反馈手套遥操作人形机器人、机械臂解决方案

硬件组成&#xff1a; 1. SenseGlove 力反馈手套&#xff1a;这是整个系统的核心交互设备&#xff0c;手套上配备了多种传感器和执行器。传感器可以精确地捕捉用户手部的动作&#xff0c;包括手指的弯曲程度、手掌的朝向、手部的移动速度等信息。执行器则能够根据系统反馈的信…

SRS流媒体服务器在宝塔面板下的安装

目录 一、安装 1、安装Docker 2、安装srs 二、测试 1、进入后台 2、推流 3、播放测试: (1)网页 (2)拉流 之前一篇文章,我们介绍了SRS流媒体服务器在CentOS下的安装,安装流程还是比较麻烦且耗时的,其实SRS支持Docker部署,今天我们介绍在宝塔面板的Docker中部署…

[C#]winform 使用opencvsharp实现玉米粒计数

【算法介绍】 这段代码是使用OpenCvSharp库&#xff08;OpenCV的C#封装&#xff09;对图像进行处理&#xff0c;主要流程包括图像的二值化、腐蚀操作、距离变换、轮廓检测&#xff0c;并在原图上标出检测到的轮廓位置及数量。下面是对代码的详细解读&#xff1a; 初始化&…

element下拉框联动 或 多选 回显数据后页面操作不生效问题解决

第一种:多选回显不生效 解决方式: 代码: <el-form-item label"系统" prop"Key"> <el-select v-model"addForm.Key" multiple placeholder"请选择" change"$forceUpdate()"> <el-option v-for"item …

【计算机网络 - 基础问题】每日 3 题(十九)

✍个人博客&#xff1a;Pandaconda-CSDN博客 &#x1f4e3;专栏地址&#xff1a;http://t.csdnimg.cn/fYaBd &#x1f4da;专栏简介&#xff1a;在这个专栏中&#xff0c;我将会分享 C 面试中常见的面试题给大家~ ❤️如果有收获的话&#xff0c;欢迎点赞&#x1f44d;收藏&…

肝内胆管癌中三级淋巴结构分布与临床预后的相关性研究|文献精析·24-09-22

小罗碎碎念 这篇文章是关于肝内胆管癌&#xff08;intrahepatic cholangiocarcinoma, iCCA&#xff09;中三级淋巴结构&#xff08;tertiary lymphoid structures, TLSs&#xff09;的分布、密度及其对临床结果的预测价值的研究。 作者类型作者姓名单位名称&#xff08;中文&a…

如何在算家云搭建DiffSynth-Kolors-Painter(图像生成)

一、DiffSynth-Kolors-Painter简介 DiffSynth 画板提供了 Prompt 分区控制技术&#xff0c;可以通过创建图层、调整不同的提示&#xff08;Prompt&#xff09;精细地控制画面的每一部分&#xff0c;影响画面的特定区域&#xff0c;从而实现对画面的精细操控&#xff0c;实现了…

基于单片机的智能窗帘控制系统-设计说明书

设计摘要&#xff1a; 智能窗帘控制系统是一种利用单片机技术实现的智能化控制系统&#xff0c;可以实现窗帘的自动开合和定时控制功能。本系统的设计基于单片机技术&#xff0c;结合传感器、电机和执行器等硬件设备&#xff0c;实现对窗帘的智能化控制。通过传感器采集环境信…