| | |
| | | { |
| | | private JsonResult objJsonResult = new JsonResult(); |
| | | private json objjson = new json(); |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | |
| | | /// <summary> |
| | | /// 采购单列表 |
| | |
| | | /// <param name="OnePage"></param> |
| | | /// <returns></returns> |
| | | [Route("GetEntrustOrderBill")] |
| | | [HttpGet] |
| | | //采购订单列表 |
| | | public object GetEntrustOrderBill(string HSupNo, string sqlWhere) |
| | | [HttpPost] |
| | | public object GetEntrustOrderBill([FromBody] JObject msg) |
| | | { |
| | | string msg = ""; |
| | | string HSupNo = msg["HSupNo"].ToString(); string sqlWhere = msg["sqlWhere"].ToString(); |
| | | try |
| | | { |
| | | string VsWhere = ""; |
| | | string PcWhere = ""; |
| | | SQLHelper.ClsCNSRM oCn = new SQLHelper.ClsCNSRM(); |
| | | DataSet ds; |
| | | //其他过滤 |
| | | if (msg.Trim() == "") |
| | | { |
| | | msg = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=^^" + HSupNo.Trim() + "^^) " + sqlWhere; |
| | | // msg = " Where hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)"; |
| | | } |
| | | else |
| | | { |
| | | msg = msg + " and hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=^^" + HSupNo.Trim() + "^^) " + sqlWhere; |
| | | // msg = msg + " Where hsupid in (select hsupid from Gy_UserSupplierRelation where HUserID=^^" + System.Web.HttpContext.Current.Session["HUserName"].ToString() + "^^)"; |
| | | } |
| | | //转换特殊字符 |
| | | if (Common.SQLtoChange(msg, ref VsWhere, ref PcWhere) == false) |
| | | string sql = " Where hsupid in (select HSupID from h_v_Gy_UserSupplierList where 用户=^^" + HSupNo.Trim() + "^^) " + sqlWhere; |
| | | if (Common.SQLtoChange(sql, ref VsWhere, ref PcWhere) == false) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败"; |
| | | objjson.Message = "转换特殊字符失败"; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | |
| | | Int64 RowTotal = Common.GetRowTotal("H_v_SRM_EntrustOrderBillList", VsWhere, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //获取返回数据 |
| | | ds = oCn.RunProcReturn("exec H_p_SRM_EntrustOrderBillList '" + PcWhere + "'", "H_p_SRM_EntrustOrderBillList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 0; |
| | | objjson.Message = "获取失败"; |
| | | objjson.data = null; |
| | | return objjson; |
| | | } |
| | | else |
| | | { |
| | | objjson.code = "0"; |
| | | objjson.count = 10000; |
| | | objjson.Message = "获取成功"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | objjson.code = "0"; |
| | | objjson.count = 10000; |
| | | objjson.Message = "获取成功"; |
| | | objjson.data = ds.Tables[0]; |
| | | return objjson; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "接受失败!"+e.ToString(); |
| | | objJsonResult.Message = "接受失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | [Route("EntrustOrderRefuse")] |
| | | [HttpGet] |
| | | /// <summary> |
| | | /// 订单拒绝 |
| | | /// </summary> |
| | | /// <param name="HInterID"></param> |
| | | /// <returns></returns> |
| | | [Route("EntrustOrderRefuse")] |
| | | [HttpGet] |
| | | /// <summary> |
| | | /// 订单拒绝 |
| | | /// </summary> |
| | | /// <param name="HInterID"></param> |
| | | /// <returns></returns> |
| | | public object EntrustOrderRefuse(string HInterID, string HBillNo, string HUser, string HBackRemark) |
| | | { |
| | | try |
| | | { |
| | | try |
| | | { |
| | | if (DBUtility.ClsPub.isLong(HInterID) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill(); |
| | | oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "拒绝成功!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | if (DBUtility.ClsPub.isLong(HInterID) == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败!" + e.ToString(); |
| | | objJsonResult.Message = "失败!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DAL.ClsWW_EntrustOrderBill oBill = new DAL.ClsWW_EntrustOrderBill(); |
| | | oBill.WebRefuse(DBUtility.ClsPub.isLong(HInterID), DBUtility.ClsPub.isStrNull(HBillNo), DBUtility.ClsPub.isStrNull(HUser), DBUtility.ClsPub.isStrNull(HBackRemark), ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "拒绝成功!"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | [Route("EntrustOrderBack")] |
| | | [HttpGet] |
| | | /// <summary> |
| | | /// 订单反馈状态 |
| | | /// </summary> |
| | | /// <param name=""></param> |
| | | /// <returns></returns> |
| | | public object EntrustOrderBack(string HmainidList, string OrderBackId) |
| | | { |
| | | try |
| | | { |
| | | string sql = ""; |
| | | for (int i = 0; i < HmainidList.Split(',').Length; i++) |
| | | { |
| | | var Hmainid = HmainidList.Split(',')[i]; |
| | | sql = string.Format(@" |
| | | update WW_EntrustOrderBillSub set |
| | | HFeedback ='{0}' |
| | | where HInterID = '{1}' and HEntryID = '{2}' ", OrderBackId, Hmainid.Split('-')[0], Hmainid.Split('-')[1]); |
| | | oCn.RunProc(sql); |
| | | |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "操作成功!"; |
| | | //objJsonResult.Message = string.Join(",", HmainidList.ToArray()); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败!" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |