| | |
| | | if (shopcode != null || shopcode != "") //产线编码不为空 |
| | | { |
| | | string[] selects = Array.ConvertAll<string, string>(shopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | //查询产线下已开工的加工单信息 |
| | | //查询产线下已开工的加工单信息(当年) |
| | | sql = @"select * from ( |
| | | select distinct E.saleOrderCode,A.wo_code,P.plan_qty,M.partcode,M.partname,M.partspec,T.name as uomname,S.good_qty,S.ng_qty,S.bad_qty from TK_Wrk_Record A |
| | | inner join TK_Wrk_Man P on A.wo_code=P.wo_code |
| | |
| | | left join ( |
| | | 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' |
| | | where P.status<>'CLOSED' and P.status<>'NEW' and P.wkshp_code in @shopcode and A.style='S' and A.step_seq='1' and year(P.lm_date) = YEAR(GETDATE()) |
| | | ) as AA where AA.plan_qty>=(AA.good_qty+aa.bad_qty+AA.ng_qty)"; |
| | | var data0 = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() }); |
| | | |
| | |
| | | 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; |
| | |
| | | string[] selects = Array.ConvertAll<string, string>(shopcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | try |
| | | { |
| | | //获取任务列表信息 |
| | | //获取任务列表信息(当年) |
| | | sql = @"select A.*,ROW_NUMBER() OVER(ORDER BY (case when A.warning<=2 then A.planenddate end) asc ,A.planstartdate asc) AS RowNum from( |
| | | select A.status,A.lm_date,E.saleOrderCode,A.wo_code,M.partcode,M.partname,M.partspec,U.name, |
| | | A.plan_qty,B.good_qty,B.ng_qty,E.planstartdate,E.planenddate, datediff(day,getdate(),E.planenddate) warning |
| | |
| | | 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) and year(A.lm_date) = YEAR(GETDATE()) |
| | | )as A "; |
| | | var data = DapperHelper.selectlist(sql, new { shopcode = selects.ToArray() }); |
| | | mes.code = "200"; |