| | |
| | | select wo_code,sum(good_qty) as good_qty,sum(ng_qty) as ng_qty,sum(bad_qty) as bad_qty from TK_Wrk_Step where isend='Y' group by wo_code |
| | | ) S on P.wo_code=S.wo_code |
| | | where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1' |
| | | ) as AA where AA.plan_qty>(AA.good_qty+aa.bad_qty+AA.ng_qty)"; |
| | | ) as AA where AA.plan_qty>=(AA.good_qty+aa.bad_qty+AA.ng_qty)"; |
| | | var data0 = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() }); |
| | | |
| | | if (data0.Rows.Count > 0) |
| | |
| | | lineone.children = new List<TreeTwo>(); |
| | | |
| | | //查新工单下工序信息 |
| | | sql = @"select A.seq,T.stepcode,T.stepname,A.plan_qty,A.good_qty,A.ng_qty,A.status |
| | | sql = @"select A.seq,T.stepcode,T.stepname,A.plan_qty,A.start_qty,A.good_qty,A.ng_qty,A.status |
| | | from TK_Wrk_Step A |
| | | left join TStep T on A.step_code=T.stepcode |
| | | where A.wo_code=@wo_code"; |
| | |
| | | string stepcode = data1.Rows[k]["STEPCODE"].ToString();//工序编码 |
| | | string stepname = data1.Rows[k]["STEPNAME"].ToString();//工序名称 |
| | | string planqty = data1.Rows[k]["PLAN_QTY"].ToString();//任务数量 |
| | | string startqty = data1.Rows[k]["START_QTY"].ToString();//开工数量 |
| | | string good_qty = data1.Rows[k]["GOOD_QTY"].ToString();//报工数量 |
| | | string ng_qty = data1.Rows[k]["NG_QTY"].ToString();//不良数量 |
| | | string status = data1.Rows[k]["STATUS"].ToString();//状态 |
| | |
| | | linetwo.stepcode = stepcode; |
| | | linetwo.stepname = stepname; |
| | | linetwo.planqty = planqty; |
| | | linetwo.startqty = startqty; |
| | | linetwo.goodqty = good_qty; |
| | | linetwo.ngqty = ng_qty; |
| | | linetwo.status = status; |
| | |
| | | left join TMateriel_Info M on A.materiel_code=M.partcode |
| | | left join TUom U on M.uom_code=U.code |
| | | where A.status<>'CLOSED' and A.wkshp_code in @shopcode and A.is_delete<>'1' and B.isend='Y' |
| | | and A.plan_qty>(B.good_qty+B.ng_qty+B.bad_qty) |
| | | and A.plan_qty>=(B.good_qty+B.ng_qty+B.bad_qty) |
| | | )as A "; |
| | | var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() }); |
| | | mes.code = "200"; |