From a7d17c8ecf0076d00e1199cfc5ea8e7d44749ac6 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期六, 06 五月 2023 09:17:27 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+), 1 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs b/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs index ecdce91..c71dd6c 100644 --- a/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs +++ b/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs @@ -5,6 +5,7 @@ using System.Web; using System.Web.Http; using WebAPI.Models; +using Newtonsoft.Json; namespace WebAPI.Controllers.CJGL { @@ -15,6 +16,22 @@ DataSet ds; #region 鍙枡閫�鏂欏崟鍒楄〃 + public class CallGoodsBill { + public DateTime HBeginDate; //閫�鏂欐棩鏈� + public DateTime HEndDate; + public string HBillNo;//鎶ュ簾鍗曞彿 + public string MaterialNumber;//鐗╂枡浠g爜 + public string MaterialName;//鐗╂枡鍚嶇О + public string MaterialModel;//瑙勬牸鍨嬪彿 + public string HDeptName;//鐢熶骇杞﹂棿 + public string ProcMul;//宸ユ + public string Hmaker;//褰撳墠鐢ㄦ埛 + public int HOrgID;//缁勭粐 + public string HPZStatus;//鍝佽川纭 + public string HCKStatus;//浠撳簱鎺ユ敹 + public string Arbitrarily;//浠绘剰鍙傛暟 + } + [Route("Cj_CallGoodsBillBack/CallGoodsBillBackMainList")] [HttpGet] public object CallGoodsBillMainList(string sWhere, string user) @@ -31,7 +48,89 @@ return objJsonResult; } - ds = oCN.RunProcReturn("select * from h_v_IF_JIT_CallGoodsBillBackMainList where 1=1 " + sWhere + " order by hmainid desc", "h_v_IF_JIT_CallGoodsBillBackMainList"); + if (sWhere == null || sWhere.Equals("")) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message =null; + objJsonResult.data = new DataTable(); + return objJsonResult; + } + + CallGoodsBill ca = JsonConvert.DeserializeObject<CallGoodsBill>(sWhere); + ds = oCN.RunProcReturn($"exec h_p_JIT_BackGoodsBillList_Query '{ca.HBillNo}','{ca.MaterialNumber}','{ca.MaterialName}','{ca.MaterialModel}'," + + $"'{ca.ProcMul}','{ca.HDeptName}',{ca.HOrgID},'{ca.Hmaker}','{ca.HPZStatus}','{ca.HCKStatus}','{ca.HBeginDate}','{ca.HEndDate.AddDays(1).AddSeconds(-1)}'", "h_p_JIT_BackGoodsBillList_Query"); + + 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 = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍙枡閫�鏂欏崟 鍒犻櫎 + [Route("Cj_CallGoodsBillBack/DelCallGoodsBill")] + [HttpGet] + public object DelCallGoodsBill(string HInterID, string HEntryID, string user) + { + try + { + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + if (!DBUtility.ClsPub.Security_Log("Cj_CallGoodsBillBack_Drop", 1, false, user)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳煡璇㈡潈闄�"; + objJsonResult.data = null; + return objJsonResult; + } + + ds = oCN.RunProcReturn($"exec h_p_JIT_BackGoodsBillList_Delete {HInterID},{HEntryID} ", "h_p_JIT_BackGoodsBillList_Delete"); + + objJsonResult.code = ds.Tables[0].Rows[0][0].ToString(); + objJsonResult.count = int.Parse(ds.Tables[0].Rows[0][0].ToString()); + objJsonResult.Message = ds.Tables[0].Rows[0][1].ToString(); + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 鍙枡鍗曞垪琛� (榛樿鏌ヨ) + [Route("Cj_CallGoodsBillBack/JIT_BackGoodsList")] + [HttpGet] + public object JIT_BackGoodsList(string HInterID, string user) + { + try + { + if (HInterID == null || HInterID.Equals("")) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = null; + objJsonResult.data = new DataTable(); + return objJsonResult; + } + + ds = oCN.RunProcReturn($"exec h_p_JIT_BackGoods_Load '{HInterID}'", "h_p_JIT_BackGoods_Load"); objJsonResult.code = "1"; objJsonResult.count = 1; -- Gitblit v1.9.1