|  |  | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_Gy_RoutingBillList where 1 = 1 "; | 
 |  |  |                     //客户自定义 | 
 |  |  |                     if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺") | 
 |  |  |                     if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺" || oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") | 
 |  |  |                     { | 
 |  |  |                          sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 "; | 
 |  |  |                     } | 
 |  |  | 
 |  |  |                 { | 
 |  |  |                     string sql1 = "select * from h_v_Gy_RoutingBillList_His where 1 = 1 "; | 
 |  |  |                     //客户自定义 | 
 |  |  |                     if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺") | 
 |  |  |                     if (oSystemParameter.omodel.WMS_CampanyName == "瑞与祺"|| oSystemParameter.omodel.WMS_CampanyName == "凯贝奈特") | 
 |  |  |                     { | 
 |  |  |                         sql1 = "select top 1000 * from h_v_Gy_RoutingBillList_His where 1 = 1 "; | 
 |  |  |                     } | 
 |  |  | 
 |  |  |             return GetObjectJson(ds); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         #region 客户订单  生产订单完工 | 
 |  |  |         [Route("LEMS/sc_ICOMReportClose")] | 
 |  |  |         [HttpPost] | 
 |  |  |         public object sc_ICOMReportClose([FromBody] JObject sMainSub) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 var _value = sMainSub["sMainSub"].ToString(); | 
 |  |  |                 string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); | 
 |  |  |                 string HICOMBillNoNum = sArray[0].ToString();  | 
 |  |  |                 string user = sArray[1].ToString();  | 
 |  |  |  | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无权限查询!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 var HICOMBillNo = HICOMBillNoNum.Split(','); | 
 |  |  |  | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |                 for (int i = 0; i < HICOMBillNo.Length; i++) | 
 |  |  |                 { | 
 |  |  |                     ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo[i] + "'", "Sc_ICMOBillMain"); | 
 |  |  |                     if (ds.Tables[0].Rows.Count == 0) | 
 |  |  |                     { | 
 |  |  |                         objJsonResult.code = "0"; | 
 |  |  |                         objJsonResult.count = 0; | 
 |  |  |                         objJsonResult.Message = "查无数据!"; | 
 |  |  |                         objJsonResult.data = null; | 
 |  |  |                         return objJsonResult; | 
 |  |  |                     } | 
 |  |  |                     oCN.RunProc("update Sc_ICMOBillSub set HSTATUS=5 where HInterID=" + ds.Tables[0].Rows[0]["HInterID"].ToString()); | 
 |  |  |                 } | 
 |  |  |                 oCN.Commit(); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "成功完工订单!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 oCN.RollBack(); | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "没有返回任何记录!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 客户订单  生产订单添加备注 | 
 |  |  |         [Route("LEMS/sc_ICOMReportAddHRemark")] | 
 |  |  |         [HttpPost] | 
 |  |  |         public object sc_ICOMReportAddHRemark([FromBody] JObject sMainSub) | 
 |  |  |         { | 
 |  |  |             DataSet ds; | 
 |  |  |             try | 
 |  |  |             { | 
 |  |  |                 var _value = sMainSub["sMainSub"].ToString(); | 
 |  |  |                 string[] sArray = _value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); | 
 |  |  |                 string HICOMBillNo = sArray[0].ToString(); | 
 |  |  |                 string HRemark = sArray[1].ToString(); | 
 |  |  |                 string user = sArray[2].ToString(); | 
 |  |  |  | 
 |  |  |                 //判断是否有查询权限 | 
 |  |  |                 if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBill_Edit", 1, false, user)) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "无权限查询!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |  | 
 |  |  |                 oCN.BeginTran(); | 
 |  |  |  | 
 |  |  |                 ds = oCN.RunProcReturn("select * from Sc_ICMOBillMain where HBillNo='" + HICOMBillNo + "'", "Sc_ICMOBillMain"); | 
 |  |  |                 if (ds.Tables[0].Rows.Count == 0) | 
 |  |  |                 { | 
 |  |  |                     objJsonResult.code = "0"; | 
 |  |  |                     objJsonResult.count = 0; | 
 |  |  |                     objJsonResult.Message = "查无数据!"; | 
 |  |  |                     objJsonResult.data = null; | 
 |  |  |                     return objJsonResult; | 
 |  |  |                 } | 
 |  |  |                 oCN.RunProc("update Sc_ICMOBillMain set HRemark2='" + HRemark + "' where HBillNo='" + HICOMBillNo + "'"); | 
 |  |  |  | 
 |  |  |                 oCN.Commit(); | 
 |  |  |  | 
 |  |  |                 objJsonResult.code = "1"; | 
 |  |  |                 objJsonResult.count = 1; | 
 |  |  |                 objJsonResult.Message = "保存成功!"; | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |             catch (Exception e) | 
 |  |  |             { | 
 |  |  |                 oCN.RollBack(); | 
 |  |  |                 objJsonResult.code = "0"; | 
 |  |  |                 objJsonResult.count = 0; | 
 |  |  |                 objJsonResult.Message = "没有返回任何记录!" + e.ToString(); | 
 |  |  |                 objJsonResult.data = null; | 
 |  |  |                 return objJsonResult; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         #endregion | 
 |  |  |  | 
 |  |  |         #region 判断下推的生产订单是否审核 | 
 |  |  |         [Route("LEMS/ICMOBillCheck")] | 
 |  |  |         [HttpGet] |