| | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 返回工序流转卡列表 |
| | | ///参数:string sql。 |
| | | ///返回值:object。 |
| | | /// </summary> |
| | | [Route("LEMS/MES_Sc_ProcessExchangeBillList_Json")] |
| | | [HttpGet] |
| | | public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>() |
| | | ; //判断是否有查询权限 |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBillQuery", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "无权限查询!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //获取系统参数 |
| | | string Ret = ""; |
| | | if (oSystemParameter.ShowBill(ref Ret)) |
| | | { |
| | | //判断客户为龙山汽配 |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "龙山汽配") |
| | | { |
| | | //获取需要拼接的字符串 |
| | | string sql_splice = DBUtility.ClsPub.SpliceSQL(user, "生产订单列表"); |
| | | |
| | | sWhere += sql_splice; |
| | | } |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by 制单日期 desc,单据号 desc", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | //添加列名 |
| | | 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.Tables[0]; |
| | | //objJsonResult.list = a; |
| | | //return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没有返回任何记录!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | |
| | | #region 生产订单列表-分页 |
| | | [Route("LEMS/MES_IF_ICMOBillList_Json_byPage")] |
| | | [HttpGet] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 判断下推的工序流转卡是否审核 |
| | | [Route("LEMS/ProcessExchangeBillCheck")] |
| | | [HttpGet] |
| | | public object ProcessExchangeBillCheck(string hmainid, string HEntryID, int OrganizationID,string HSourceBillNo) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 and hmainid=" + hmainid + " and HEntryID=" + HEntryID + " order by 单据号 desc", "h_v_IF_ICMOBillList"); |
| | | string HNumber = ds.Tables[0].Rows[0]["产品代码"].ToString(); |
| | | |
| | | if (ds.Tables[0].Rows[0]["审核人"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "所选生产订单为未审核状态,不允许下推生成工序流转卡!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["关闭人"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "所选生产订单为已关闭状态,不允许下推生成工序流转卡!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["作废人"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "所选生产订单为已作废状态,不允许下推生成工序流转卡!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn("select * from Kf_ICStockBillSub where HInterID=" + hmainid + " and HEntryID=" + HEntryID , "Kf_ICStockBillSub"); |
| | | |
| | | if (double.Parse(ds.Tables[0].Rows[0]["HSourceBillNo"].ToString()).Equals(HSourceBillNo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "所选生产订单已全部下推,不允许再次下推!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | 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 |
| | | |
| | | #region 生产订单流转卡 履历条件查询 |
| | | [Route("LEMS/GetProcessBillOrICMOBillResumeList")] |
| | | [HttpGet] |