|  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> a = new List<object>(); | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_ICMOReportBillQuery", 1, false, user)) | 
 |  |  |                 { | 
 |  |  | 
 |  |  |                     string sql = sql1 + sWhere + " order by hmainid desc "; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOReportBillList_Edit"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 foreach (DataColumn col in ds.Tables[0].Columns)//遍历ds中第一个表(Tables[0])的所有列(Columns)每次循环中,col变量会持有当前列的引用 | 
 |  |  |                 { | 
 |  |  |                     Type dataType = col.DataType; //获取当前数据类型传入 自定义变量datadataType | 
 |  |  |                     string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //字符串拼接         // 将列名和数据类型信息拼接成一个JSON格式的字符串 | 
 |  |  |                     a.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 | 
 |  |  |                 } | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = a; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn(string.Format(@"SELECT HMaterID,物料代码 HMaterCode,物料名称 HMaterName,规格型号 HMaterSpec, | 
 |  |  |                                             HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName,HSourceID,生产资源代码 HSourceCode,生产资源 HSourceName, | 
 |  |  |                                             HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark | 
 |  |  |                                             HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark, | 
 |  |  |                                             HICMOInterID,HICMOEntryID,HICMOBillNo,HICMOInterID as HSourceInterID,HICMOEntryID as HSourceEntryID, | 
 |  |  |                                             HICMOBillNo as HSourceBillNo,3710 as HSourceBillType,不良数量 HBadQty | 
 |  |  |                                             FROM h_v_IF_ICMOReportBillList_Edit"), "h_v_IF_ICMOReportBillList_Edit"); | 
 |  |  |  | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  | 
 |  |  |                     //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark  from Sc_MouldRepairCheckBillSub where 1 = 1 "; | 
 |  |  |                     string sql1 = string.Format(@"SELECT HMaterID,物料代码 HMaterCode,物料名称 HMaterName,规格型号 HMaterSpec, | 
 |  |  |                                             HUnitID, 计量单位代码 HUnitCode, 计量单位 HUnitName,HSourceID,生产资源代码 HSourceCode,生产资源 HSourceName, | 
 |  |  |                                             HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注 HRemark | 
 |  |  |                                             HWorkerid,操作员代码 HWorkerCode,操作员 HWorkerName,生产数量 HQty,表体备注  | 
 |  |  |                                             HRemark,HICMOInterID,HICMOEntryID,HICMOBillNo, | 
 |  |  |                                             HICMOInterID as HSourceInterID,HICMOEntryID as HSourceEntryID, | 
 |  |  |                                             HICMOBillNo as HSourceBillNo,3710 as HSourceBillType,不良数量 HBadQty | 
 |  |  |                                             FROM h_v_IF_ICMOReportBillList_Edit where 1 = 1 "); | 
 |  |  |                     string sql = sql1 + sqlWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOReportBillList_Edit"); | 
 |  |  | 
 |  |  |                     oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); | 
 |  |  |                     oItemSub.HCloseType = false;   //关闭类型 | 
 |  |  |                     //oItemSub.HRemark = "";         //备注 | 
 |  |  |                     oItemSub.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                     oItemSub.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |                     //oItemSub.HSourceInterID = 0;     // 源单主内码 | 
 |  |  |                     //oItemSub.HSourceEntryID = 0;   //源单子内码 | 
 |  |  |                     //oItemSub.HSourceBillNo = "";  //源单单号 | 
 |  |  |                     //oItemSub.HSourceBillType = ""; //源单类型 | 
 |  |  |                     //oItemSub.HRelationQty = 0;     //关联数量 | 
 |  |  | 
 |  |  |                 //保存 | 
 |  |  |                 //保存完毕后处理 | 
 |  |  |                 bool bResult; | 
 |  |  |                 if (oBill.omodel.HInterID == 0) | 
 |  |  |                 if (refSav == "Add") | 
 |  |  |                 { | 
 |  |  |                     // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                     bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |                 string HBillNo = ""; | 
 |  |  |                 oCN.BeginTran();//开始事务 | 
 |  |  |                 ds = oCN.RunProcReturn("select * from Sc_ICMOReportBillMain where HInterID=" + lngBillKey, "Sc_ICMOReportBillMain"); | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "没有数据,无法删除!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return objJsonResult; ; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString(); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //删除前控制=========================================       | 
 |  |  |                 DataSet Ds; | 
 |  |  |  | 
 |  |  |                 string sql1 = "exec h_p_Sc_ICMOReportBill_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'"; | 
 |  |  |                 Ds = oCN.RunProcReturn(sql1, "h_p_Sc_ICMOReportBill_BeforeDelCtrl"); | 
 |  |  |                 if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0") | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "删除失败!原因:" + Ds.Tables[0].Rows[0]["HRemark"].ToString(); | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 //==================================================================================     | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + "" + "','" + "删除生产汇报单单据:" + ds.Tables[0].Rows[0]["HBillNo"].ToString() + "','LMES-生产汇报单模块','" + DBUtility.ClsPub.IPAddress + "','删除单据'", ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, HBillNo, "h_p_Sc_ICMOReportBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                 if (IsDete) | 
 |  |  |                 { | 
 |  |  |                     oCN.Commit();//提交事务 | 
 |  |  |  | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     oCN.RollBack(); | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "单据未找到"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 oCN.RollBack(); | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  | 
 |  |  |         { | 
 |  |  |             string ModRightNameCheck = "Sc_ICMOReportBill_Check"; | 
 |  |  |             DBUtility.ClsPub.CurUserName = CurUserName; | 
 |  |  |             string sql = ""; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //审核权限 | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 if (IsAudit == 0) //审核提交 | 
 |  |  |                 { | 
 |  |  |                     //审核前控制===============================================Begin=================================================================== | 
 |  |  |                     sql = "exec h_p_Sc_ICMOReportBill_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOReportBill_BeforeCheckCtrl"); | 
 |  |  |                     if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "审核失败!原因:审核前判断失败,无返回信息,请与网络管理人员联系"; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                     if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |                     } | 
 |  |  |                     //审核前控制===============================================End=================================================================== | 
 |  |  |  | 
 |  |  |                     //审核提交 | 
 |  |  |                     if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                     if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOReportBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "1"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                     else | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "1"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 if (IsAudit == 1) //反审核提交 | 
 |  |  |                 { | 
 |  |  |                     //反审核前控制===============================================Begin=================================================================== | 
 |  |  |                     sql = "exec h_p_Sc_ICMOReportBill_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'"; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOReportBill_BeforeUnCheckCtrl"); | 
 |  |  |                     if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "审核失败!原因:反审核前判断失败,无返回信息,请与网络管理人员联系"; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |  | 
 |  |  |                     } | 
 |  |  |                     if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |                     } | 
 |  |  |                     //反审核前控制===============================================End=================================================================== | 
 |  |  |  | 
 |  |  |                     //反审核提交AbandonCheck | 
 |  |  |                     if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                     if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ICMOReportBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "1"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  | 
 |  |  |                     } | 
 |  |  |                     else | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "1"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 生产汇报单关闭/反关闭功能 | 
 |  |  |         [Route("Sc_ICMOReportBill/CloseSc_ICMOReportBill")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object CloseSc_ICMOReportBill(string HInterID, int Type, string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 //判断是否有删除权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_ICMOReportBill_Close", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无权限关闭!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 if (string.IsNullOrWhiteSpace(HInterID)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "HInterID为空!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 ClsPub.CurUserName = user; | 
 |  |  |                 BillOld.MvarItemKey = "Sc_ICMOReportBillMain"; | 
 |  |  |                 oCN.BeginTran();//开始事务 | 
 |  |  |  | 
 |  |  |                 //Type 1 关闭  2  反关闭 | 
 |  |  |                 if (Type == 1) | 
 |  |  |                 { | 
 |  |  |                     //判断单据是否已经关闭 | 
 |  |  |                     DataSet ds; | 
 |  |  |                     string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); | 
 |  |  |                     if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) | 
 |  |  |                     { | 
 |  |  |                         if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "单据已关闭!不需要再关闭!"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     //关闭单据 | 
 |  |  |                     if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  |                         objJsonResult.Message = "关闭失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     //判断单据是否已经反关闭 | 
 |  |  |                     DataSet ds; | 
 |  |  |                     string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); | 
 |  |  |                     if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) | 
 |  |  |                     { | 
 |  |  |                         if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") | 
 |  |  |                         { | 
 |  |  |                             objJsonResult.code = "0"; | 
 |  |  |                             objJsonResult.count = 0; | 
 |  |  |                             objJsonResult.Message = "单据已反关闭!不需要再反关闭!"; | 
 |  |  |                             objJsonResult.data = null; | 
 |  |  |                             return objJsonResult; | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                     //反关闭单据 | 
 |  |  |                     if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 1; | 
 |  |  |                         objJsonResult.Message = "反关闭失败!原因:" + ClsPub.sExeReturnInfo; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.Commit();//提交事务 | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "执行成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; ; | 
 |  |  |  | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "执行失败!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 if (sWhere == null || sWhere.Equals("")) | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |  | 
 |  |  |                 string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 "; | 
 |  |  |                 string sql = sql1 + sWhere; | 
 |  |  |                 ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList"); | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 foreach (DataColumn col in ds.Tables[0].Columns) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select * from h_v_Sc_AssemblyBillList " + sWhere, "h_v_Sc_AssemblyBillList"); | 
 |  |  |                     Type dataType = col.DataType; | 
 |  |  |                     string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; | 
 |  |  |                     columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名 | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_Sc_AssemblyBillList where 1 = 1 "; | 
 |  |  |                     string sql = sql1 + sWhere; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_v_Sc_AssemblyBillList"); | 
 |  |  |                 } | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "false!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "1"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "Sucess!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds.Tables[0]; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region  生产汇报单获取源单产量汇报单临时表信息 | 
 |  |  |         /// <summary> | 
 |  |  |         /// 生产汇报单获取源单产量汇报单临时表信息 | 
 |  |  |         /// </summary> | 
 |  |  |         /// <returns></returns> | 
 |  |  |         [Route("Sc_ICMOReportBill/GetProdReportBillList")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object GetProdReportBillList(string HInterID, string user) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 List<object> columnNameList = new List<object>(); | 
 |  |  |                 | 
 |  |  |                 if (HInterID == null || HInterID.Equals("")) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "产量汇报单内码为空!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |  | 
 |  |  |                     string sql = "exec h_p_Sc_ICMOBillWorkQtyStatus_TmpList '" + HInterID + "'"; | 
 |  |  |                     ds = oCN.RunProcReturn(sql, "h_p_Sc_ICMOBillWorkQtyStatus_TmpList"); | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //添加列名 | 
 |  |  |                 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列对象的列名 | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 //if (ds.Tables[0].Rows.Count != 0 || ds != null) | 
 |  |  |                 //{ | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "Sucess!"; | 
 |  |  |                 objJsonResult.data = ds; | 
 |  |  |                 objJsonResult.list = columnNameList; | 
 |  |  |                 return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |                 //else | 
 |  |  |                 //{ | 
 |  |  |                 //objJsonResult.code = "0"; | 
 |  |  |                 //objJsonResult.count = 0; | 
 |  |  |                 //objJsonResult.Message = "无数据"; | 
 |  |  |                 //objJsonResult.data = null; | 
 |  |  |                 //return objJsonResult; | 
 |  |  |                 //} | 
 |  |  |             } | 
 |  |  |             catch (Exception ex) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "没有返回任何记录!" + ex.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         #region 生产汇报单 根据主内码与子内码获取生产汇报单数据 | 
 |  |  |         [Route("Sc_ICMOReportBill/loadSc_ICMOReportBill_Push")] | 
 |  |  |         [HttpGet] | 
 |  |  |         public object loadSc_ICMOReportBill_Push(long HInterID, long HSubID) | 
 |  |  |         { | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |  | 
 |  |  |                 ds = oCN.RunProcReturn("select * from h_v_IF_ICMOReportBillList_Edit where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_IF_ICMOReportBillList_Edit"); | 
 |  |  |                 if (ds == null || ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "未查询到源单信息!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 else | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "1"; | 
 |  |  |                     objJsonResult.count = 1; | 
 |  |  |                     objJsonResult.Message = "Sucess!"; | 
 |  |  |                     objJsonResult.data = ds.Tables[0]; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "Exception!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | } |