From 8de87213db233b968683bf39d9593396ee842bfb Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期四, 27 三月 2025 13:29:16 +0800
Subject: [PATCH] 1.增加产品编码批量查找关联的工艺信息接口 2.增加根据工艺信息(工艺路线编码)批量查找关联工序集合接口 3.增加工单批量绑定工艺接口

---
 VueWebCoreApi/DLL/DAL/BasicSettingDAL.cs |  124 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/VueWebCoreApi/DLL/DAL/BasicSettingDAL.cs b/VueWebCoreApi/DLL/DAL/BasicSettingDAL.cs
index f39c590..cf5fab2 100644
--- a/VueWebCoreApi/DLL/DAL/BasicSettingDAL.cs
+++ b/VueWebCoreApi/DLL/DAL/BasicSettingDAL.cs
@@ -10,6 +10,7 @@
 using VueWebCoreApi.DLL.BLL;
 using VueWebCoreApi.Models;
 using VueWebCoreApi.Models.RolePermission;
+using VueWebCoreApi.Models.WorkData;
 using VueWebCoreApi.Tools;
 using static VueWebCoreApi.Models.RolePermission.RolePermission;
 using static VueWebCoreApi.Models.RolePermission.RolePermissionSava;
@@ -3518,6 +3519,129 @@
         }
         #endregion
 
+        #region[浜у搧缂栫爜鎵归噺鏌ユ壘鍏宠仈鐨勫伐鑹轰俊鎭痌
+        public static ToMessage PartSelectRputeList(List<PartRouteList> list, User us)
+        {
+            string sql = "";
+            var dynamicParams = new DynamicParameters();
+            List<Dictionary<object, object>> dir = new List<Dictionary<object, object>>();
+            try
+            {
+                dynamic dynObj = JObject.Parse(us.mesSetting);
+                bool route = dynObj.route;
+                if (route) //宸ヨ壓璺嚎鐗�
+                {
+                    for (int i = 0; i < list.Count; i++)
+                    {
+                        // 鍒涘缓涓�涓柊鐨勫瓧鍏�
+                        Dictionary<object, object> dict = new Dictionary<object, object>();
+                        //閫氳繃浜у搧缂栫爜鏌ユ壘鍏宠仈鐨勫伐鑹鸿矾绾夸俊鎭�
+                        sql = @"select A.route_code,B.name as route_name   
+                        from TMateriel_Route A
+                        inner join TFlw_Rout B on A.route_code=B.code 
+                        where A.materiel_code=@partcode and B.is_delete<>'1' and A.is_delete<>'1'";
+                        dynamicParams.Add("@partcode", list[i].partcode);
+                        var data = DapperHelper.selectdata(sql, dynamicParams);
+                        // 鍚戝瓧鍏镐腑娣诲姞鏁版嵁
+                        dict.Add("routedata", data);
+                        // 灏嗗瓧鍏告坊鍔犲埌鍒楄〃涓�
+                        dir.Add(dict);
+                    }
+                }
+                else //宸ュ簭鐗�
+                {
+                    for (int i = 0; i < list.Count; i++)
+                    {
+                        // 鍒涘缓涓�涓柊鐨勫瓧鍏�
+                        Dictionary<object, object> dict = new Dictionary<object, object>();
+                        //閫氳繃浜у搧缂栫爜鏌ユ壘鍏宠仈鐨勫伐搴忎俊鎭�
+                        sql = @"select A.step_seq,A.step_code as stepcode,S.stepname as stepname,A.unprice as stepprice,A.isbott,A.isend   
+                            from (
+                            select S.materiel_code,R.step_seq,S.step_code,S.unprice,R.isbott,R.isend   from TPrteEqp_Stad S
+                            inner join TMateriel_Step R on S.materiel_code=R.materiel_code and S.step_code=R.step_code
+                            where S.materiel_code=@partcode
+                            union all
+                            select  materiel_code,step_seq,step_code,'0' as unprice,isbott,isend from TMateriel_Step 
+                            where materiel_code=@partcode and materiel_code+step_code
+                            not in(select materiel_code+step_code  from TPrteEqp_Stad
+                            where materiel_code=@partcode)
+                            ) as A
+                            left join TStep S on A.step_code=S.stepcode";
+                        dynamicParams.Add("@partcode", list[i].partcode);
+                        var data = DapperHelper.selectdata(sql, dynamicParams);
+                        // 鍚戝瓧鍏镐腑娣诲姞鏁版嵁
+                        dict.Add("stepdata", data);
+                        // 灏嗗瓧鍏告坊鍔犲埌鍒楄〃涓�
+                        dir.Add(dict);
+                    }
+                }
+
+                mes.code = "200";
+                mes.message = "鏌ヨ鎴愬姛!";
+                mes.count = dir.Count;
+                mes.data = dir;
+            }
+            catch (Exception e)
+            {
+                mes.code = "300";
+                mes.count = 0;
+                mes.message = e.Message;
+                mes.data = null;
+            }
+            return mes;
+        }
+        #endregion
+
+        #region[鏍规嵁宸ヨ壓淇℃伅(宸ヨ壓璺嚎缂栫爜)鎵归噺鏌ユ壘鍏宠仈宸ュ簭闆嗗悎]
+        public static ToMessage RouteSelectStepList(List<PartRouteStepList> list)
+        {
+            string sql = "";
+            var dynamicParams = new DynamicParameters();
+            List<Dictionary<object, object>> dir = new List<Dictionary<object, object>>();
+            try
+            {
+                for (int i = 0; i < list.Count; i++)
+                {
+                    // 鍒涘缓涓�涓柊鐨勫瓧鍏�
+                    Dictionary<object, object> dict = new Dictionary<object, object>();
+                    //閫氳繃宸ヨ壓璺嚎缂栫爜鏌ユ壘鍏宠仈鐨勫伐搴忎俊鎭�
+                    sql = @"select A.step_seq,A.step_code as stepcode,S.stepname as stepname,A.unprice as stepprice,A.isbott,A.isend   
+                        from (
+                        select S.materiel_code,R.seq as step_seq,S.step_code,S.unprice,R.first_choke as isbott,R.last_choke as isend   from TPrteEqp_Stad S
+                        inner join TFlw_Rtdt R on  S.route_code=R.rout_code and S.step_code=R.step_code
+                        where S.materiel_code=@partcode and S.route_code=@route_code 
+                        union all
+                        select  @partcode as materiel_code,B.seq as step_seq,B.step_code,'0' as unprice,B.first_choke as isbott,B.last_choke as isend from TFlw_Rout A
+                        inner join TFlw_Rtdt B on A.code=B.rout_code
+                        where A.code=@route_code and  @partcode+A.code+B.step_code
+                        not in(select materiel_code+rout_code+step_code  from TPrteEqp_Stad
+                        where materiel_code=@partcode and route_code=@route_code)
+                        ) as A
+                        left join TStep S on A.step_code=S.stepcode";
+                    dynamicParams.Add("@partcode", list[i].partcode);
+                    dynamicParams.Add("@route_code", list[i].routecode);
+                    var data = DapperHelper.selectdata(sql, dynamicParams);
+                    // 鍚戝瓧鍏镐腑娣诲姞鏁版嵁
+                    dict.Add("stepdata", data);
+                    // 灏嗗瓧鍏告坊鍔犲埌鍒楄〃涓�
+                    dir.Add(dict);
+                }
+
+                mes.code = "200";
+                mes.message = "鏌ヨ鎴愬姛!";
+                mes.data = dir;
+            }
+            catch (Exception e)
+            {
+                mes.code = "300";
+                mes.count = 0;
+                mes.message = e.Message;
+                mes.data = null;
+            }
+            return mes;
+        }
+        #endregion
+
         #region[鑺傛媿宸ヤ环鏌ヨ]
         public static ToMessage BeatRateSearch(string partcode, string routecode, string stepcode, User us, int startNum, int endNum, string prop, string order)
         {

--
Gitblit v1.9.3