| | |
| | | /// 获取工序计划单列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | //[Route("Web/GetPlanList_Json")] |
| | | //[HttpGet] |
| | | //public object GetPlanList_Json(string Billno) |
| | | //{ |
| | | // //sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | // //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | // if (Billno != "") |
| | | // { |
| | | // sWhere = sWhere + " and ( 单据号 like '%" + Billno + "%' ) "; |
| | | // } |
| | | // try |
| | | // { |
| | | // SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | // if (sWhere == null || sWhere.Equals("")) |
| | | [Route("Web/GetPlanList_Json")] |
| | | [HttpGet] |
| | | public object GetPlanList_Json(string Billno) |
| | | { |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1"; |
| | | //sWhere = " Where HStopFlag=0 and HEndFlag=1 and HUSEORGID = " + DBUtility.ClsPub.HORGANIZATIONSID.ToString(); |
| | | if (Billno != "") |
| | | { |
| | | sWhere = sWhere + " and ( 单据号 like '%" + Billno + "%' ) "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | |
| | | // { |
| | | // ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from h_v_Sc_ProcessPlanList where HStopflag=0 Order by HItemID ", "Gy_BadReason"); |
| | | // } |
| | | // else |
| | | // { |
| | | // string sql1 = "Select HItemID,HNumber ,HName from Gy_BadReason where HStopflag=0 and HEndFlag=1 "; |
| | | // string sql = sql1 + sWhere; |
| | | // ds = oCN.RunProcReturn(sql, "Gy_BadReason"); |
| | | // } |
| | | { |
| | | ds = oCN.RunProcReturn("select hmainid,hsubid,单据号,HMaterID,物料代码,物料名称,HCenterID,工作中心,规格型号,计划数量 from h_v_Sc_ProcessPlanList", "h_v_Sc_ProcessPlanList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select hmainid,hsubid,单据号,HMaterID,物料代码,物料名称,HCenterID,工作中心,规格型号,计划数量 from h_v_Sc_ProcessPlanList where 1=1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_ProcessPlanList"); |
| | | } |
| | | |
| | | // //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); |
| | | //ds = webserver.GetUnitList(sWhere, ref DBUtility.ClsPub.sErrInfo); |
| | | |
| | | |
| | | // if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | // { |
| | | // objjson.code = "0"; |
| | | // objjson.count = 0; |
| | | // objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | // objjson.data = null; |
| | | // return objjson; |
| | | // } |
| | | // else |
| | | // { |
| | | // objjson.code = "0"; |
| | | // objjson.count = 1; |
| | | // objjson.Message = "获取成功!"; |
| | | // objjson.data = ds.Tables[0]; |
| | | // return objjson; |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + DBUtility.ClsPub.sErrInfo; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | // objjson.code = "0"; |
| | | // objjson.count = 0; |
| | | // objjson.Message = "获取失败" + ex.ToString(); |
| | | // objjson.data = null; |
| | | // return objjson; |
| | | // } |
| | | //} |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败" + ex.ToString(); |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取登录页组织列 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Web/GetOrganizations")] |
| | | [HttpGet] |
| | | public object GetOrganizations() |
| | | { |
| | | try |
| | | { |
| | | ClsCN oCn = new ClsCN(); |
| | | DataSet oDs = new DataSet(); |
| | | //========== |
| | | oDs = oCn.RunProcReturn("select HItemID ID,Hname Name,HStopflag Stopflag from Xt_ORGANIZATIONS", "Xt_ORGANIZATIONS"); |
| | | objjson.code = "1"; |
| | | objjson.count = 1; |
| | | objjson.Message = "获取成功!"; |
| | | objjson.data = oDs.Tables[0]; |
| | | return objjson; ; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败!异常" + e.ToString(); |
| | | objjson.data = null; |
| | | return objjson; ; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |