yl
2023-09-21 77a5d0b49691eed59891ea3c156381edef871c72
VueWebApi/DLL/DAL/ErpSyncMesDAL.cs
@@ -1,6 +1,7 @@
using Dapper;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using VueWebApi.Tools;
@@ -202,21 +203,27 @@
            var dynamicParams = new DynamicParameters();
            try
            {
                if (stu_torgcode == "" || stu_torgcode == null)
                if (stu_torgcode == "" || stu_torgcode == null)
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.Message = "管理员账号无操作权限,请使用车间级账号!";
                    mes.data = null;
                    return mes;
                    stu_torgcode = "";
                }
                if (stu_torgtypecode == "D")
                {
                    mes.code = "300";
                    mes.count = 0;
                    mes.Message = "部门账号无操作权限,请使用车间级账号!";
                    mes.data = null;
                    return mes;
                    sql = @" with CTE as (
                           select id, org_code,org_name, parent_id
                           from TOrganization A
                           where org_code =@stu_torgcode
                           union all
                           select A.id,A.org_code,A.org_name,A.parent_id
                           from TOrganization A
                           inner join CTE on A.parent_id = CTE.id
                           )
                           select org_code,org_name from CTE";
                    dynamicParams.Add("@stu_torgcode", stu_torgcode);
                    var data = DapperHelper.selectdata(sql, dynamicParams);
                    stu_torgcode=string.Join(",", data.AsEnumerable().Select(row => row.Field<string>("org_code")));
                    //stu_torgcode = string.Join(",", data.AsEnumerable().Select(row => $"'{row.Field<string>("org_code")}'"));
                    //LogHelper.WriteLogData("获取车间编码:"+stu_torgcode);
                }
                //存储过程名
                sql = @"h_p_IFCLD_ERPMO";