| | |
| | | } |
| | | if (i == Convert.ToInt32(ordernum)) //最后一单时 |
| | | { |
| | | sql = @"insert into TK_Wrk_Man(wo_code,wotype,status,wkshp_code,plan_qty,stck_code,materiel_code,sourceid,m_po,lm_user,lm_date) values(@wo_code,@wotype,@status,@wkshp_code,@plan_qty,@stck_code,@materiel_code,@sourceid,@m_po,@username,@CreateDate)"; |
| | | sql = @"insert into TK_Wrk_Man(wo_code,wotype,status,wkshp_code,plan_qty,stck_code,materiel_code,sourceid,m_po,lm_user,lm_date,saleOrderDeliveryDate) values(@wo_code,@wotype,@status,@wkshp_code,@plan_qty,@stck_code,@materiel_code,@sourceid,@m_po,@username,@CreateDate,@saleOrderDeliveryDate)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | sourceid = erporderid, |
| | | m_po = erpordercode, |
| | | username = username, |
| | | CreateDate = DateTime.Now.ToString() |
| | | CreateDate = DateTime.Now.ToString(), |
| | | saleOrderDeliveryDate = Convert.ToDateTime(saleOrderDeliveryDate) |
| | | } |
| | | }); |
| | | sumqty = sumqty + (decimal.Parse(markqty) - sumqty); |
| | |
| | | else |
| | | { |
| | | |
| | | sql = @"insert into TK_Wrk_Man(wo_code,wotype,status,wkshp_code,plan_qty,stck_code,materiel_code,sourceid,m_po,lm_user,lm_date) values(@wo_code,@wotype,@status,@wkshp_code,@plan_qty,@stck_code,@materiel_code,@sourceid,@m_po,@username,@CreateDate)"; |
| | | sql = @"insert into TK_Wrk_Man(wo_code,wotype,status,wkshp_code,plan_qty,stck_code,materiel_code,sourceid,m_po,lm_user,lm_date,saleOrderDeliveryDate) values(@wo_code,@wotype,@status,@wkshp_code,@plan_qty,@stck_code,@materiel_code,@sourceid,@m_po,@username,@CreateDate,@saleOrderDeliveryDate)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | sourceid = erporderid, |
| | | m_po = erpordercode, |
| | | username = username, |
| | | CreateDate = DateTime.Now.ToString() |
| | | CreateDate = DateTime.Now.ToString(), |
| | | saleOrderDeliveryDate = Convert.ToDateTime(saleOrderDeliveryDate) |
| | | } |
| | | }); |
| | | } |
| | |
| | | A.plan_qty AdvaScheQty, |
| | | U.name AdvaScheUom, |
| | | isnull(E.sched_qty,0) AdvaScheYPQty, |
| | | CONVERT(varchar(100), B.planenddate, 23) AdvaScheEndDate, |
| | | CONVERT(varchar(100), A.saleOrderDeliveryDate, 23) AdvaScheEndDate, |
| | | convert(varchar(20),isnull(E.sched_qty,0))+'/'+convert(varchar(20),isnull(A.plan_qty,0)) AdvaScheSpeed, |
| | | A.route_code AdvaScheRoutid, |
| | | F.name AdvaScheRoutName, |
| | |
| | | (case when CONVERT(varchar(100), H.maxtime, 23)<=CONVERT(varchar(100), E.plan_enddate, 23) then 'Y' when H.MAXTime is null then 'Y' else 'N' end) Flag, |
| | | (case when A.PiroQue='1' then '特急' when A.PiroQue='2' then '紧急' when A.PiroQue='3' then '正常' end) AdvaSchePiroQue |
| | | from TK_Wrk_Man A |
| | | left join TKimp_Ewo B on A.m_po=B.wo |
| | | left join TMateriel_Info C on C.partcode= A.materiel_code |
| | | left join T_Dict D on C.stocktype_code= d.code |
| | | left join TK_Wrk_Step E on E.wo_code=A.wo_code |
| | |
| | | string[] s1 = Array.ConvertAll<string, string>(str.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | //string s1 = string.Format("'{0}'", str.Replace(",", "','")); |
| | | |
| | | string sql = @"select B.wo_code, B.eqp_code,B.time_start,B.time_end, 'S' status , B.alloc_qty,D.partname as part_name |
| | | string sql = @"select B.wo_code, B.eqp_code,B.time_start,B.time_end, 'S' status , B.alloc_qty,D.partcode as part_code,D.partname as part_name,T.name as uom_name |
| | | from TK_Wrk_EqpAps B |
| | | left join TK_Wrk_Man C on B.wo_code=C.wo_code |
| | | left join TMateriel_Info D on C.materiel_code=D.partcode |
| | | left join TUom T on D.uom_code=T.code |
| | | where B.eqp_code in @eqpcode |
| | | and convert(varchar(100),B.Time_Start,21)>=@startdate and convert(varchar(100),B.Time_End,21)<=@enddate order by time_end"; |
| | | dt = DapperHelper.selectlist(sql, new { eqpcode = s1.ToArray(), startdate= startdate + " 00:00:00", enddate= enddate + " 23:59:59" }); |