| | |
| | | ds = oCN.RunProcReturn |
| | | ("select a.HInterID,a.HBillType,a.HICMOBillNo,a.HICMOInterID,a.HMaterID" + |
| | | ",m.HNumber HMaterNumber,m.HName HMaterName,m.HModel HMaterModel,a.HICMOEntryID" + |
| | | ",a.HSourceBillNo,a.HSourceInterID,a.HSourceEntryID,a.HDatePlanQty " + |
| | | ",a.HSourceBillNo,a.HSourceInterID,a.HSourceEntryID,a.HDatePlanQty,a.HDeptID,d.HName HDeptName,m.HUnitID,u.HName HUnitName" + |
| | | " from Sc_ICMOBillStatus_Tmp a " + |
| | | " left join Gy_Material m on a.HMaterID=m.HItemID " + |
| | | " left join Gy_Department d on a.HDeptID=d.HItemID " + |
| | | " left join Gy_Unit u on m.HUnitID=u.HItemID " + |
| | | " Where a.HInterID=" + HInterID + " and a.HBillType=" + HBillType, "Sc_ICMOBillStatus_Tmp"); |
| | | } |
| | | else { |
| | | ds = oCN.RunProcReturn |
| | | ("select a.HInterID,a.HBillType,a.HICMOBillNo,a.HICMOInterID,a.HMaterID" + |
| | | ",m.HNumber HMaterNumber,m.HName HMaterName,m.HModel HMaterModel,a.HICMOEntryID " + |
| | | ",m.HNumber HMaterNumber,m.HName HMaterName,m.HModel HMaterModel,a.HICMOEntryID,a.HDeptID,d.HName HDeptName,m.HUnitID,u.HName HUnitName " + |
| | | " from Sc_ICMOBillStatus_Tmp a " + |
| | | " left join Gy_Material m on a.HMaterID=m.HItemID " + |
| | | " left join Gy_Department d on a.HDeptID=d.HItemID " + |
| | | " left join Gy_Unit u on m.HUnitID=u.HItemID " + |
| | | " Where a.HInterID=" + HInterID + " and a.HBillType=" + HBillType, "Sc_ICMOBillStatus_Tmp"); |
| | | } |
| | | |
| | |
| | | BillNew.HMaterID = mainList[0].HMaterID; |
| | | BillNew.HSourceID = mainList[0].HSourceID; |
| | | BillNew.HGroupID = mainList[0].HGroupID; |
| | | BillNew.HDeptID = mainList[0].HDeptID; |
| | | BillNew.HCheckManID = mainList[0].HCheckManID; |
| | | BillNew.HBadReasonID = mainList[0].HBadReasonID; |
| | | BillNew.HBarCode = mainList[0].HBarCode; |
| | |
| | | oCN.RunProc("Insert Into Sc_ICMOBillQualityStatus_Tmp " + |
| | | " (HInterID,HBillNo,HDate,HICMOBillNo,HICMOInterID" + |
| | | ",HProcExchBillNo,HProcExchInterID,HProcExchEntryID,HProcID,HMaterID" + |
| | | ",HSourceID,HGroupID,HCheckManID,HBadReasonID,HBarCode" + |
| | | ",HSourceID,HGroupID,HDeptID,HCheckManID,HBadReasonID,HBarCode" + |
| | | ",HMaker,HMakeDate,HBillType,HReportType,HSourceBillNo" + |
| | | ",HSourceInterID,HSourceBillType,HICMOEntryID,HSourceEntryID,HBadReasonHQty" + |
| | | ") " + |
| | | " values(" + BillNew.HInterID + ",'" + BillNew.HBillNo + "','" + BillNew.HDate + "','" + BillNew.HICMOBillNo + "'," + BillNew.HICMOInterID + |
| | | ",'" + BillNew.HProcExchBillNo + "'," + BillNew.HProcExchInterID + "," + BillNew.HProcExchEntryID + "," + BillNew.HProcID + "," + BillNew.HMaterID + |
| | | "," + BillNew.HSourceID + "," + BillNew.HGroupID + "," + BillNew.HCheckManID + "," + BillNew.HBadReasonID + ",'" + BillNew.HBarCode + "'" + |
| | | "," + BillNew.HSourceID + "," + BillNew.HGroupID + "," + BillNew.HDeptID + "," + BillNew.HCheckManID + "," + BillNew.HBadReasonID + ",'" + BillNew.HBarCode + "'" + |
| | | ",'" + BillNew.HMaker + "','" + BillNew.HMakeDate + "','" + BillNew.HBillType + "','" + +BillNew.HReportType + "','" +BillNew.HSourceBillNo + "'" + |
| | | "," + BillNew.HSourceInterID + ",'" + BillNew.HSourceBillType + "'," + BillNew.HICMOEntryID + "," + BillNew.HICMOEntryID + "," + BillNew.HBadReasonHQty + |
| | | ") "); |
| | |
| | | #region æäº¤ä¿åï¼å主å表åæç»è¡¨ |
| | | [Route("Sc_QualityReportBill/set_SaveBill")] |
| | | [HttpGet] |
| | | public object set_SaveBill(long HInterID,string HBillNo, string HChecker,string HBadReasonHQty) |
| | | public object set_SaveBill(long HInterID,string HBillNo, string HChecker) |
| | | { |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | //========================================================= |
| | | //ä¿å |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID+",'"+ HBadReasonHQty +"'"); |
| | | //ä¿å æ¹éä¿åå
çå表æ¯å¦ææ°æ®,ææ°æ®å°±è¿ åå
¥ä¸»è¡¨ æç»è¡¨ 没æå°±åå¨ä¸»åæç»è¡¨ |
| | | string sql = "select * from Sc_QualityReportBillSub where HInterID = '" + HInterID + "'"; |
| | | ds = oCN.RunProcReturn(sql, "Sc_QualityReportBillSub"); |
| | | if (ds.Tables[0].Rows.Count>0) |
| | | { |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBillSum " + HInterID + ""); |
| | | } |
| | | else |
| | | { |
| | | oCN.RunProc("exec h_p_save_Sc_QualityReportBill " + HInterID + ""); |
| | | } |
| | | |
| | | //夿æ¯å¦å
许ä¿åï¼ä¸å
许ååæ» |
| | | ds = oCN.RunProcReturn("exec h_p_JIT_ICMOBillQualityStatus_SaveCtrl", "h_p_JIT_ICMOBillQualityStatus_SaveCtrl"); |
| | | if (ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) == "2") |
| | |
| | | int i = 0; |
| | | foreach (Model.ClsSc_QualityReportBillSub oSub in ls) |
| | | { |
| | | |
| | | |
| | | oSub.HMakeDate = DateTime.Now; |
| | | int qty = Convert.ToInt32(oSub.HQty); |
| | | for (int j = 0; j < qty; j++) |
| | | { |
| | | i++; |
| | | oSub.HEntryID = i; |
| | | string subSql = "Insert into Sc_QualityReportBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HQty,HResult,HEmpID,HSourceID,HBadReasonID" + |
| | | ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo" + |
| | | ",HBarCode,HReportType" + |
| | | ",HAddr,HMaker,HMakeDate" + |
| | | ") values(" + |
| | | "" + oSub.HInterID.ToString() + "" + |
| | | "," + oSub.HEntryID.ToString() + "" + |
| | | ",'" + oSub.HBillNo_bak + "'" + |
| | | ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "" + |
| | | "," + oSub.HSourceEntryID.ToString() + "" + |
| | | ",'" + oSub.HSourceBillNo + "'" + |
| | | ",'" + oSub.HSourceBillType + "'" + |
| | | "," + oSub.HRelationQty.ToString() + "" + |
| | | "," + oSub.HRelationMoney.ToString() + |
| | | |
| | | "," + oSub.HMaterID.ToString() + "" + |
| | | "," + oSub.HUnitID.ToString() + "" + |
| | | ",'" + 1 + |
| | | "','" + oSub.HResult + "'" + |
| | | "," + oSub.HEmpID.ToString() + "" + |
| | | "," + oSub.HSourceID.ToString() + "" + |
| | | "," + oSub.HBadReasonID.ToString() + "" + |
| | | i++; |
| | | oSub.HMakeDate = DateTime.Now; |
| | | oSub.HEntryID = i; |
| | | string subSql = "Insert into Sc_QualityReportBillSub " + |
| | | " (HInterID,HEntryID,HBillNo_bak,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HUnitID,HQty,HResult,HEmpID,HSourceID,HProcID,HBadReasonID,HBadReasonNumber,HGroupID" + |
| | | ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo" + |
| | | ",HBarCode,HReportType" + |
| | | ",HAddr,HMaker,HMakeDate" + |
| | | ") values(" + |
| | | "" + oSub.HInterID.ToString() + "" + |
| | | "," + oSub.HEntryID.ToString() + "" + |
| | | ",'" + oSub.HBillNo_bak + "'" + |
| | | ",'" + oSub.HRemark + "'" + |
| | | "," + oSub.HSourceInterID.ToString() + "" + |
| | | "," + oSub.HSourceEntryID.ToString() + "" + |
| | | ",'" + oSub.HSourceBillNo + "'" + |
| | | ",'" + oSub.HSourceBillType + "'" + |
| | | "," + oSub.HRelationQty.ToString() + "" + |
| | | "," + oSub.HRelationMoney.ToString() + |
| | | |
| | | "," + oSub.HICMOInterID.ToString() + "" + |
| | | "," + oSub.HICMOEntryID.ToString() + "" + |
| | | ",'" + oSub.HICMOBillNo + "'" + |
| | | "," + oSub.HProcExchInterID + "" + |
| | | "," + oSub.HProcExchEntryID + "" + |
| | | ",'" + oSub.HProcExchBillNo + "'" + |
| | | ",'" + oSub.HBarCode + "'" + |
| | | "," + oSub.HMaterID.ToString() + "" + |
| | | "," + oSub.HUnitID.ToString() + "" + |
| | | ",'" + oSub.HQty.ToString() + |
| | | "','" + oSub.HResult + "'" + |
| | | "," + oSub.HEmpID.ToString() + "" + |
| | | "," + oSub.HSourceID.ToString() + "" + |
| | | "," + oSub.HProcID.ToString() + "" + |
| | | "," + oSub.HBadReasonID.ToString() + "" + |
| | | ",'" + oSub.HBadReasonNumber.ToString() + "'" + |
| | | ",'" + oSub.HGroupID.ToString() + "'" + |
| | | |
| | | ",'" + 3 + |
| | | "','" + oSub.HAddr + "'" + |
| | | ",'" + msg4 + "'" + |
| | | ",'" + oSub.HMakeDate.ToShortDateString() + "'" + |
| | | ") "; |
| | | oCN.RunProc(subSql); |
| | | } |
| | | "," + oSub.HICMOInterID.ToString() + "" + |
| | | "," + oSub.HICMOEntryID.ToString() + "" + |
| | | ",'" + oSub.HICMOBillNo + "'" + |
| | | "," + oSub.HProcExchInterID + "" + |
| | | "," + oSub.HProcExchEntryID + "" + |
| | | ",'" + oSub.HProcExchBillNo + "'" + |
| | | ",'" + oSub.HBadReasonNumber.ToString() + "'" + |
| | | |
| | | ",'" + 1 + |
| | | "','" + oSub.HAddr + "'" + |
| | | ",'" + msg4 + "'" + |
| | | ",'" + oSub.HMakeDate.ToShortDateString() + "'" + |
| | | ") "; |
| | | oCN.RunProc(subSql); |
| | | |
| | | } |
| | | objJsonResult.code = "0"; |
| | |
| | | public string HName; |
| | | public DateTime HBeginDate; |
| | | public DateTime HEndDate; |
| | | public string HProcName; |
| | | public string HEquipName; |
| | | public string HBactNo; |
| | | } |
| | | [Route("Sc_QualityReportBill/getSc_QualityReportBillDay")] |
| | | [HttpGet] |
| | |
| | | return objJsonResult; |
| | | } |
| | | ReportWorkDemandPlanBill Report = JsonConvert.DeserializeObject<ReportWorkDemandPlanBill>(sWhere); |
| | | ds = oCN.RunProcReturn($"exec h_p_Sc_StationOutBillMain '{Report.HBeginDate}','{Report.HEndDate}','{Report.HNumber}','{Report.HName}'", "h_p_Sc_StationOutBillMain"); |
| | | ds = oCN.RunProcReturn($"exec h_p_Sc_StationOutBillMain '{Report.HBeginDate}','{Report.HEndDate}','{Report.HNumber}','{Report.HName}','{Report.HProcName}','{Report.HEquipName}','{Report.HBactNo}'", "h_p_Sc_StationOutBillMain"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | public string HYear; |
| | | public string HWorkCenter; |
| | | public string HName; |
| | | public DateTime HBeginDate; |
| | | public DateTime HEndDate; |
| | | |
| | | } |
| | | [Route("Sc_QualityReportBill/getSc_QualityReportBillMonth")] |
| | |
| | | return objJsonResult; |
| | | } |
| | | ReportWorkDemandPlanBill1 Report = JsonConvert.DeserializeObject<ReportWorkDemandPlanBill1>(sWhere); |
| | | ds = oCN.RunProcReturn($"exec h_p_Sc_StationOutBillMonth '{Report.HYear}','{Report.HWorkCenter}','{Report.HName}'", "h_p_Sc_StationOutBillMonth"); |
| | | ds = oCN.RunProcReturn($"exec h_p_Sc_StationOutBillMonth '{Report.HYear}','{Report.HWorkCenter}','{Report.HName}', '{Report.HBeginDate}','{Report.HEndDate}'", "h_p_Sc_StationOutBillMonth"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç©æç产è¯çç»è®¡(æ¯è«å°) æ¥è¯¢ |
| | | |
| | | [Route("Sc_QualityReportBill/getSc_HMaterYieldStatistics")] |
| | | [HttpGet] |
| | | public object getSc_HMaterYieldStatistics(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_HMater_Yield_Statistics_Query order by åæ®å· desc", "h_v_Sc_HMater_Yield_Statistics_Query"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_HMater_Yield_Statistics_Query where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by æ¥æ desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_HMater_Yield_Statistics_Query"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region ä»»å¡åéè¿ç(æ¯è«å°) æ¥è¯¢ |
| | | |
| | | [Route("Sc_QualityReportBill/getSc_HICMMaterStatistics")] |
| | | [HttpGet] |
| | | public object getSc_HICMMaterStatistics(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_QualityReportBill_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_HICMMater_Statistics_Query order by åæ®å· desc", "h_v_Sc_HICMMater_Statistics_Query"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Sc_HICMMater_Statistics_Query where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by æ¥æ desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_HICMMater_Statistics_Query"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | | { |
| | | Type dataType = col.DataType; |
| | | string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; |
| | | columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |