| | |
| | | { |
| | | SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN(); |
| | | DataSet DSet = new DataSet(); |
| | | ////è¿æ»¤æ¡ä»¶Dlg |
| | | //string sDlgWhere = ""; |
| | | //if (txtHProcessExchangeBillNo.Text != "")//æµè½¬å¡ |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and c.HProcExchBillNo like '%" + txtHProcessExchangeBillNo.Text + "%'"; |
| | | //} |
| | | //if (txtHICMOBillNo.Text != "")//ç产订å |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and a.HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'"; |
| | | //} |
| | | //if (textHmaterName.Text != "")//ç©æ |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and b.HName like '%" + textHmaterName.Text + "%'"; |
| | | //} |
| | | //if (textHprocName.Text != "")//å·¥åº |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and d.HName like '%" + textHprocName.Text + "%'"; |
| | | //} |
| | | //if (dtpHBDate.Value.ToShortDateString() != "")//å¼å§æ¥æ |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and a.HMakeDate >= '" + dtpHBDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | //if (dtpHEDate.Value.ToShortDateString() != "")//ç»ææ¥æ |
| | | //{ |
| | | // sDlgWhere = sDlgWhere + "and a.HMakeDate <= '" + dtpHEDate.Value.ToShortDateString() + "'"; |
| | | //} |
| | | ////è¿æ»¤æ¡ä»¶ |
| | | ////string sWhere = ""; |
| | | ////sWhere = sWhere + ",'" + this.dtpHBDate.Value.ToShortDateString() + "'"; |
| | | ////sWhere = sWhere + ",'" + this.dtpHEDate.Value.ToShortDateString() + "'"; |
| | | ////sWhere = sWhere + ",1,3"; |
| | | //////sWhere = sWhere + ",'" + frmQuery.dtpHBakEndDate.Value.ToShortDateString() + "'"; |
| | | //////sWhere = sWhere + "," + frmQuery.txtHCusID.Tag.ToString().Trim(); |
| | | ////if (sWhere.Trim().Length > 0) |
| | | ////{ |
| | | //// sWhere = sWhere.Substring(1, sWhere.Length - 1); |
| | | ////} |
| | | //// |
| | | //DSet = SubCn.RunProcReturn("select " + |
| | | // "MAX(a.HMakeDate) æ±æ¥æ¥æ, a.HICMOBillNo ä»»å¡åå·, c.HProcExchBillNo æµè½¬å¡å·, c.HProcID, d.HName å·¥åºåç§°" + |
| | | // ", sum(a.HWorkTimes) å·¥æ¶, b.HName ç©æåç§°, a.HICMOQty çäº§è®¢åæ°é, a.HPlanQty è®¡åæ°é, c.HQty è¿ç«æ°é" + |
| | | // ", co.HQty åºç«åæ ¼æ°é, c.HQty - co.HQty - co.HWasterQty æªè¿ç«æ°é" + |
| | | // ", co.HWasterQty ä¸åæ ¼æ°é, co.HQty / nullif((co.HQty+co.HWasterQty),0) åºç«è¯ç,a.hb, co.HName ä¸è¯æç», co.HBadQty ä¸è¯æ°é " + |
| | | // " FROM Sc_StationOutBillMain a " + |
| | | // "left join Gy_Material b on a.HMaterID = b.HItemID " + |
| | | // "left join( " + |
| | | // "select sum(aa.HQty) HQty, aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " + |
| | | // "from Sc_StationInBillMain aa " + |
| | | // "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " + |
| | | // ") c on a.HProcExchInterID = c.HProcExchInterID and a.HProcID = c.HProcID " + |
| | | // "left join( " + |
| | | // "select sum(aa.HQty) HQty, sum(aa.HWasterQty) HWasterQty, bad.HBadQty, bad.HName" + |
| | | // ", aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " + |
| | | // "from Sc_StationOutBillMain aa " + |
| | | // "left join ( " + |
| | | // "select qa.HProcExchInterID, qb.HBadQty, qbr.HName, qa.HProcID " + |
| | | // "from QC_NoPassProdCheckBillMain qa " + |
| | | // "left join QC_NoPassProdCheckBillsub qb on qa.HInterID = qb.HInterID " + |
| | | // "left join Gy_BadReason qbr on qb.HBadReasonID = qbr.HItemID " + |
| | | // "group by qa.HProcExchInterID, qbr.HName, qa.HProcID, qb.HBadQty " + |
| | | // ") bad on aa.HProcExchInterID = bad.HProcExchInterID and aa.HProcID = bad.HProcID " + |
| | | // "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID, bad.HBadQty, bad.HName " + |
| | | // ") co on a.HProcExchInterID = co.HProcExchInterID and a.HProcID = co.HProcID " + |
| | | // "left join Gy_Process d on c.HProcID = d.HItemID " + |
| | | // "where 1 = 1 " + sDlgWhere + |
| | | // "group by a.HICMOBillNo,c.HProcExchBillNo,d.HName,b.HName,a.HICMOQty,c.HQty,a.HPlanQty" + |
| | | // ",co.HQty,c.HProcID,co.HWasterQty,co.HName,co.HBadQty,a.HWasterQty " + |
| | | // "order by c.HProcID", "Sc_StationOutBillMain", ref ClsPub.sExeReturnInfo); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //è¿æ»¤æ¡ä»¶Dlg |
| | | string sDlgWhere = ""; |
| | | sDlgWhere = sDlgWhere + ",'" + txtHProcessExchangeBillNo.Text + "'"; |
| | | sDlgWhere = sDlgWhere + ",'" + txtHICMOBillNo.Text + "'"; |
| | | sDlgWhere = sDlgWhere + ",'" + textHmaterName.Text + "'"; |
| | | sDlgWhere = sDlgWhere + ",'" + textHprocName.Text + "'"; |
| | | sDlgWhere = sDlgWhere + ",'" + dtpHBDate.Value.ToShortDateString() + "'"; |
| | | sDlgWhere = sDlgWhere + ",'" + dtpHEDate.Value.ToShortDateString() + "'"; |
| | | if (sDlgWhere.Trim().Length > 0) |
| | | if (txtHProcessExchangeBillNo.Text != "")//æµè½¬å¡ |
| | | { |
| | | sDlgWhere = sDlgWhere.Substring(1, sDlgWhere.Length - 1); |
| | | sDlgWhere = sDlgWhere + "and c.HProcExchBillNo like '%" + txtHProcessExchangeBillNo.Text + "%'"; |
| | | } |
| | | if (txtHICMOBillNo.Text != "")//ç产订å |
| | | { |
| | | sDlgWhere = sDlgWhere + "and a.HICMOBillNo like '%" + txtHICMOBillNo.Text + "%'"; |
| | | } |
| | | if (textHmaterName.Text != "")//ç©æ |
| | | { |
| | | sDlgWhere = sDlgWhere + "and b.HName like '%" + textHmaterName.Text + "%'"; |
| | | } |
| | | if (textHprocName.Text != "")//å·¥åº |
| | | { |
| | | sDlgWhere = sDlgWhere + "and d.HName like '%" + textHprocName.Text + "%'"; |
| | | } |
| | | if (dtpHBDate.Value.ToShortDateString() != "")//å¼å§æ¥æ |
| | | { |
| | | sDlgWhere = sDlgWhere + "and a.HMakeDate >= '" + dtpHBDate.Value.ToShortDateString() + "'"; |
| | | } |
| | | if (dtpHEDate.Value.ToShortDateString() != "")//ç»ææ¥æ |
| | | { |
| | | sDlgWhere = sDlgWhere + "and a.HMakeDate <= '" + dtpHEDate.Value.ToShortDateString() + "'"; |
| | | } |
| | | //è¿æ»¤æ¡ä»¶ |
| | | //string sWhere = ""; |
| | | //sWhere = sWhere + ",'" + this.dtpHBDate.Value.ToShortDateString() + "'"; |
| | | //sWhere = sWhere + ",'" + this.dtpHEDate.Value.ToShortDateString() + "'"; |
| | | //sWhere = sWhere + ",1,3"; |
| | | ////sWhere = sWhere + ",'" + frmQuery.dtpHBakEndDate.Value.ToShortDateString() + "'"; |
| | | ////sWhere = sWhere + "," + frmQuery.txtHCusID.Tag.ToString().Trim(); |
| | | //if (sWhere.Trim().Length > 0) |
| | | //{ |
| | | // sWhere = sWhere.Substring(1, sWhere.Length - 1); |
| | | //} |
| | | // |
| | | DSet = SubCn.RunProcReturn("select " + |
| | | "MAX(a.HMakeDate) æ±æ¥æ¥æ, a.HICMOBillNo ä»»å¡åå·," + |
| | | "case when isnull(ic.HBillSubType,0)='1055' then 'è¿å·¥' else 'æ®é订å' end ä»»å¡åç±»å , c.HProcExchBillNo æµè½¬å¡å·, c.HProcID, d.HName å·¥åºåç§°" + |
| | | ", sum(a.HWorkTimes) å·¥æ¶, b.HName ç©æåç§°, a.HICMOQty çäº§è®¢åæ°é, a.HPlanQty è®¡åæ°é, c.HQty è¿ç«æ°é" + |
| | | ", co.HQty åºç«åæ ¼æ°é, c.HQty - co.HQty - co.HWasterQty æªè¿ç«æ°é" + |
| | | ", co.HWasterQty ä¸åæ ¼æ°é, co.HQty / nullif((co.HQty+co.HWasterQty),0) åºç«è¯ç,co.HBillSubType ä¸å¡ç±»å, co.HName ä¸è¯æç», co.HBadQty ä¸è¯æ°é " + |
| | | " FROM Sc_StationOutBillMain a " + |
| | | "left join sc_icmobillmain ic on a.HICMOInterID =ic.HInterID " + |
| | | "left join Gy_Material b on a.HMaterID = b.HItemID " + |
| | | "left join( " + |
| | | "select sum(aa.HQty) HQty, aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " + |
| | | "from Sc_StationInBillMain aa " + |
| | | "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID " + |
| | | ") c on a.HProcExchInterID = c.HProcExchInterID and a.HProcID = c.HProcID " + |
| | | "left join( " + |
| | | "select sum(aa.HQty) HQty, sum(aa.HWasterQty) HWasterQty, bad.HBadQty, bad.HName" + |
| | | ", aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID,bad.HBillSubType " + |
| | | "from Sc_StationOutBillMain aa " + |
| | | "left join ( " + |
| | | "select qa.HProcExchInterID, qb.HBadQty, qbr.HName, qa.HProcID,qa.HBillSubType " + |
| | | "from QC_NoPassProdCheckBillMain qa " + |
| | | "left join QC_NoPassProdCheckBillsub qb on qa.HInterID = qb.HInterID " + |
| | | "left join Gy_BadReason qbr on qb.HBadReasonID = qbr.HItemID " + |
| | | "group by qa.HProcExchInterID, qbr.HName, qa.HProcID, qb.HBadQty,qa.HBillSubType " + |
| | | ") bad on aa.HProcExchInterID = bad.HProcExchInterID and aa.HProcID = bad.HProcID " + |
| | | "group by aa.HProcExchBillNo, aa.HProcExchInterID, aa.HProcID, bad.HBadQty, bad.HName,bad.HBillSubType " + |
| | | ") co on a.HProcExchInterID = co.HProcExchInterID and a.HProcID = co.HProcID " + |
| | | "left join Gy_Process d on c.HProcID = d.HItemID " + |
| | | "where 1 = 1 " + sDlgWhere + |
| | | "group by a.HICMOBillNo,c.HProcExchBillNo,d.HName,b.HName,a.HICMOQty,c.HQty,a.HPlanQty" + |
| | | ",case when isnull(ic.HBillSubType,0)='1055' then 'è¿å·¥' else 'æ®é订å' end " + |
| | | ",co.HQty,c.HProcID,co.HWasterQty,co.HName,co.HBadQty,a.HWasterQty,co.HBillSubType " + |
| | | "order by c.HProcID", "Sc_StationOutBillMain", ref ClsPub.sExeReturnInfo); |
| | | |
| | | DSet = SubCn.RunProcReturn("exec h_p_DefectiveDetailedYieldReport_New " + sDlgWhere, "h_p_DefectiveDetailedYieldReport_New"); |
| | | |
| | | |
| | | |
| | | |
| | | ////è¿æ»¤æ¡ä»¶Dlg |
| | | //string sDlgWhere = ""; |
| | | //sDlgWhere = sDlgWhere + ",'" + txtHProcessExchangeBillNo.Text + "'"; |
| | | //sDlgWhere = sDlgWhere + ",'" + txtHICMOBillNo.Text + "'"; |
| | | //sDlgWhere = sDlgWhere + ",'" + textHmaterName.Text + "'"; |
| | | //sDlgWhere = sDlgWhere + ",'" + textHprocName.Text + "'"; |
| | | //sDlgWhere = sDlgWhere + ",'" + dtpHBDate.Value.ToShortDateString() + "'"; |
| | | //sDlgWhere = sDlgWhere + ",'" + dtpHEDate.Value.ToShortDateString() + "'"; |
| | | //if (sDlgWhere.Trim().Length > 0) |
| | | //{ |
| | | // sDlgWhere = sDlgWhere.Substring(1, sDlgWhere.Length - 1); |
| | | //} |
| | | |
| | | //DSet = SubCn.RunProcReturn("exec h_p_DefectiveDetailedYieldReport_New " + sDlgWhere, "h_p_DefectiveDetailedYieldReport_New"); |
| | | |
| | | //çæé¦è¡æ é¢ |
| | | if (DSet == null) |