From 6441a59c20d84d1282e1fd2c62a372272b3cb9a8 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 18 三月 2022 10:57:50 +0800 Subject: [PATCH] 叫料退料功能 --- WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs | 64 +++++++++++++++++++++++++++++++ 1 files changed, 63 insertions(+), 1 deletions(-) diff --git a/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs b/WebAPI/Controllers/CJGL/Cj_CallGoodsBillBackController.cs index ecdce91..f62af96 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,21 @@ 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;//浠撳簱鎺ユ敹 + } + [Route("Cj_CallGoodsBillBack/CallGoodsBillBackMainList")] [HttpGet] public object CallGoodsBillMainList(string sWhere, string user) @@ -31,7 +47,18 @@ 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; @@ -49,5 +76,40 @@ } } #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 } } \ No newline at end of file -- Gitblit v1.9.1