From addc36b95965e64748577dbb7db0fc56c64fa531 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期四, 17 三月 2022 14:13:12 +0800
Subject: [PATCH] 墙咔装箱

---
 WebAPI/Controllers/SCGL/Sc_CallGoodsBackRequestBillController.cs |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 115 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_CallGoodsBackRequestBillController.cs b/WebAPI/Controllers/SCGL/Sc_CallGoodsBackRequestBillController.cs
new file mode 100644
index 0000000..999dec0
--- /dev/null
+++ b/WebAPI/Controllers/SCGL/Sc_CallGoodsBackRequestBillController.cs
@@ -0,0 +1,115 @@
+锘縰sing System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+using Newtonsoft.Json;
+using DBUtility;
+using System;
+
+namespace WebAPI.Controllers.SCGL
+{
+    public class Sc_CallGoodsBackRequestBillController : ApiController
+    {
+        private json objJsonResult = new json();
+        public DataSet ds = new DataSet();
+        public WebServer webserver = new WebServer();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+
+        #region 閫�鏂欑敵璇峰崟 鍒楄〃
+        public class CallGoodsBackRequest
+        {
+            public string HBillNo { get; set; }//鎶ュ簾鍗曞彿
+            public string HOrgID { get; set; }//缁勭粐
+            public string MaterialNumber { get; set; }//鐗╂枡浠g爜
+            public string MaterialName { get; set; }//鐗╂枡鍚嶇О
+            public string MaterialModel { get; set; }//瑙勬牸鍨嬪彿
+            public string HDeptName { get; set; }//鐢熶骇杞﹂棿
+            public DateTime HBeginDate { get; set; }//寮�濮嬫椂闂�
+            public DateTime HEndDate { get; set; }//缁撴潫鏃堕棿
+            public string ProcMul { get; set; }//宸ユ
+            public string Hmaker { get; set; }//褰撳墠鐧诲綍浜�
+        }
+
+        [Route("Sc_CallGoodsBackRequestBill/JIT_CallGoodsBackRequestBillList")]
+        [HttpGet]
+        public object JIT_CallGoodsBackRequestBillList(string sWhere, string user)
+        {
+            try
+            {
+                //鏌ョ湅鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log("JIT_ComplementGoods", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "Sucess锛�";
+                    objJsonResult.data = new DataTable();
+                    return objJsonResult;
+                }
+                //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+                CallGoodsBackRequest com = JsonConvert.DeserializeObject<CallGoodsBackRequest>(sWhere.ToString());
+
+                ds = oCN.RunProcReturn($"exec h_p_JIT_BackGoodsRequestBillList_Query '{com.HBeginDate}','{com.HEndDate.AddDays(1).AddSeconds(-1)}','{com.HBillNo}','{com.MaterialNumber}'," +
+                    $"'{com.MaterialName}','{com.MaterialModel}','{com.HDeptName}','{com.ProcMul}','{com.Hmaker}','{com.HOrgID}'", "h_p_JIT_BackGoodsRequestBillList_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 = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 閫�鏂欑敵璇峰崟 鍒犻櫎
+        [Route("Sc_CallGoodsBackRequestBill/DelCallGoodsBackRequestBill")]
+        [HttpGet]
+        public object DelCallGoodsBackRequestBill(string HInterID, string HEntryID, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
+                if (!DBUtility.ClsPub.Security_Log("JIT_ComplementGoods_Drop", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡璇㈡潈闄�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ds = oCN.RunProcReturn($"exec h_p_JIT_BackGoodsRequestBillList_Delete {HInterID},{HEntryID}", "h_p_JIT_BackGoodsRequestBillList_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