From dac60fce253e085b3c4f4ee049a795f16aed2eba Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期一, 08 五月 2023 18:15:39 +0800
Subject: [PATCH] 物流检验记录接口修改 末道工序完工报工自动关单方法开发 登录登出记录接口修改(去掉update,保留insert)

---
 VueWebApi/DLL/DAL/ReportManagerDAL.cs |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/VueWebApi/DLL/DAL/ReportManagerDAL.cs b/VueWebApi/DLL/DAL/ReportManagerDAL.cs
index ce31505..320a62c 100644
--- a/VueWebApi/DLL/DAL/ReportManagerDAL.cs
+++ b/VueWebApi/DLL/DAL/ReportManagerDAL.cs
@@ -1360,5 +1360,124 @@
             return mes;
         }
         #endregion
+
+
+        #region[鐗╂祦妫�楠岃褰曟煡璇
+        public static ToMessage LogisticsCheckSearch(string checktypecode, string partcode, string partname, string partspec, string labcode, string customercode, string batchno, string checkuser, string opencheckdate, string closecheckdate, int startNum, int endNum, string prop, string order)
+        {
+            var dynamicParams = new DynamicParameters();
+            string search = "";
+            try
+            {
+                if (checktypecode != "" && checktypecode != null)
+                {
+                    search += "and A.check_type=@checktypecode ";
+                    dynamicParams.Add("@checktypecode", checktypecode);
+                }
+                if (partcode != "" && partcode != null)
+                {
+                    search += "and M.partcode like '%'+@partcode+'%' ";
+                    dynamicParams.Add("@partcode", partcode);
+                }
+                if (partname != "" && partname != null)
+                {
+                    search += "and M.partname like '%'+@partname+'%' ";
+                    dynamicParams.Add("@partname", partname);
+                }
+                if (partspec != "" && partspec != null)
+                {
+                    search += "and M.partspec like '%'+@partspec+'%' ";
+                    dynamicParams.Add("@partspec", partspec);
+                }
+                if (labcode != "" && labcode != null)
+                {
+                    search += "and A.hbarcode like '%'+@labcode+'%' ";
+                    dynamicParams.Add("@labcode", labcode);
+                }
+                if (customercode != "" && customercode != null)
+                {
+                    search += "and A.customer_code=@customercode ";
+                    dynamicParams.Add("@customercode", customercode);
+                }
+                if (batchno != "" && batchno != null)
+                {
+                    search += "and R.hbatchno like '%'+@batchno+'%' ";
+                    dynamicParams.Add("@batchno", labcode);
+                }
+                if (checkuser != "" && checkuser != null)
+                {
+                    search += "and U.username like '%'+@checkuser+'%' ";
+                    dynamicParams.Add("@checkuser", checkuser);
+                }        
+                if (opencheckdate != "" && opencheckdate != null)
+                {
+                    search += "and A.lm_date between @opencheckdate and @closecheckdate ";
+                    dynamicParams.Add("@opencheckdate", opencheckdate + " 00:00:00");
+                    dynamicParams.Add("@closecheckdate", closecheckdate + " 23:59:59");
+                }
+                // --------------鏌ヨ鎸囧畾鏁版嵁--------------
+                var total = 0; //鎬绘潯鏁�
+                var sql = @"select A.id,A.check_type,A.check_typename,A.sampmethod,M.partcode,M.partname,M.partspec,R.hbatchno, 
+                            A.hbarcode,A.customer_code,C.name as customer_name,U.usercode,U.username,A.lm_date,A.check_result 
+                            from TStepCheckRecord A
+                            inner join TStepCheckRecordSub B on A.id=B.m_id
+                            left  join TMateriel_Info M on A.partcode=M.partcode
+                            left  join T_BarCodeBill R on A.hbarcode=R.hbarcode
+                            left  join TCustomer C on A.customer_code=C.code
+                            left  join TUser U on A.check_user=U.usercode
+                            where A.check_type in('InCheck','OutCheck') " + search;
+                var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total);
+                mes.code = "200";
+                mes.Message = "鏌ヨ鎴愬姛!";
+                mes.count = total;
+                mes.data = data.ToList();
+            }
+            catch (Exception e)
+            {
+                mes.code = "300";
+                mes.count = 0;
+                mes.Message = e.Message;
+                mes.data = null;
+            }
+            return mes;
+        }
+        #endregion
+
+        #region[鐗╂祦妫�楠岋紝鏌ョ湅妫�楠屾槑缁哴
+        public static ToMessage LogisticsCheckSubSearch(string checkid)
+        {
+            var sql = "";
+            var dynamicParams = new DynamicParameters();
+            try
+            {
+                //瀛樺偍杩囩▼鍚�
+                sql = @"h_p_IFCLD_WuLiuCheckSubSelect";
+                dynamicParams.Add("@checkid", checkid);
+                DataTable dt = DapperHelper.selectProcedure(sql, dynamicParams);
+                if (dt.Rows.Count > 0)
+                {
+                    mes.code = "200";
+                    mes.count = 0;
+                    mes.Message = "鏌ヨ鎴愬姛!";
+                    mes.data = dt;
+                }
+                else
+                {
+                    mes.code = "300";
+                    mes.count = 0;
+                    mes.Message = "鏃犳楠屾槑缁嗘暟鎹�!";
+                    mes.data = null;
+                }
+            }
+            catch (Exception e)
+            {
+                mes.code = "300";
+                mes.count = 0;
+                mes.Message = e.Message;
+                mes.data = null;
+            }
+            return mes;
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3