From cad72e6525f7bc8ed9143d8b18670c2bb16af6b3 Mon Sep 17 00:00:00 2001 From: dengyu Date: Thu, 10 Oct 2024 11:56:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E4=BC=98=E5=8C=96=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=9F=A5=E8=AF=A2=E5=AD=90=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DAL/Chfee_Invoicehexiao/Chfee_InvoicehexiaoDAL.cs | 6 ++++-- .../DAL/MsCodeExcelExpFormat/MsCodeExcelExpFormatDAL.cs | 8 +++++--- .../DAL/MsCodeExcelImpFormat/MsCodeExcelImpFormatDAL.cs | 8 +++++--- .../MsCodeServiceFeeTemplateDAL.cs | 8 +++++--- DSWeb/Areas/MvcShipping/DAL/MsOpAire/MsOpAireDAL.cs | 7 ++++--- DSWeb/Areas/MvcShipping/DAL/MsOpSeai/MsOpSeaiDAL.cs | 5 +++-- DSWeb/Areas/MvcShipping/DAL/MsOpSocCtn/MsOpSocCtnDAL.cs | 5 +++-- 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/DSWeb/Areas/Account/DAL/Chfee_Invoicehexiao/Chfee_InvoicehexiaoDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_Invoicehexiao/Chfee_InvoicehexiaoDAL.cs index c2bdbf7c..5b9c8f17 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_Invoicehexiao/Chfee_InvoicehexiaoDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_Invoicehexiao/Chfee_InvoicehexiaoDAL.cs @@ -2625,12 +2625,14 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Invoicehexiao { var rangeDa = new RangeDA(); var deptid = rangeDa.GetDEPTGID(userid); - str = " OP in (select showname from vw_user where deptid='" + deptid + "') "; + //str = " OP in (select showname from vw_user where deptid='" + deptid + "') "; + str = $"exists(select 1 from vw_user where SHOWNAME=OP and COMPANYID='{companyid}' and deptid='{deptid}')"; } else if (visiblerange == "1") { - str = " OP in (select showname from vw_user where COMPANYID='" + companyid + "') "; + //str = " OP in (select showname from vw_user where COMPANYID='" + companyid + "') "; + str = $"exists(select 1 from vw_user where SHOWNAME=OP and COMPANYID='{companyid}')"; } else if (visiblerange == "5") { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelExpFormat/MsCodeExcelExpFormatDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelExpFormat/MsCodeExcelExpFormatDAL.cs index 853b7c4d..5aa5e173 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelExpFormat/MsCodeExcelExpFormatDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelExpFormat/MsCodeExcelExpFormatDAL.cs @@ -9,6 +9,7 @@ using Microsoft.Practices.EnterpriseLibrary.Data; using DSWeb.EntityDA; using DSWeb.Areas.CommMng.Models; using HcUtility.Comm; +using org.junit.rules; namespace DSWeb.MvcShipping.DAL.MsCodeExcelExpFormatDAL { @@ -375,12 +376,13 @@ namespace DSWeb.MvcShipping.DAL.MsCodeExcelExpFormatDAL { var rangeDa = new RangeDA(); var deptname = rangeDa.GetDEPTNAME(userid); - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; - + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' and DEPTNAME='{deptname}')"; } else if (visiblerange == "1") { - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' )"; } else if (visiblerange == "0") { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelImpFormat/MsCodeExcelImpFormatDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelImpFormat/MsCodeExcelImpFormatDAL.cs index c28bd095..069fcaa4 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelImpFormat/MsCodeExcelImpFormatDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeExcelImpFormat/MsCodeExcelImpFormatDAL.cs @@ -15,6 +15,7 @@ using DSWeb.MvcShipping.DAL.ChMonthCloseDAL; using System.Linq; using DSWeb.MvcShipping.DAL.MsSysBillNoSet; using DSWeb.MvcShipping.Models.MsChFee; +using org.junit.rules; namespace DSWeb.MvcShipping.DAL.MsCodeExcelImpFormatDAL { @@ -748,12 +749,13 @@ namespace DSWeb.MvcShipping.DAL.MsCodeExcelImpFormatDAL { var rangeDa = new RangeDA(); var deptname = rangeDa.GetDEPTNAME(userid); - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; - + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' and DEPTNAME='{deptname}')"; } else if (visiblerange == "1") { - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' )"; } else if (visiblerange == "0") { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsCodeServiceFeeTemplate/MsCodeServiceFeeTemplateDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsCodeServiceFeeTemplate/MsCodeServiceFeeTemplateDAL.cs index bb24407d..8fb77182 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsCodeServiceFeeTemplate/MsCodeServiceFeeTemplateDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsCodeServiceFeeTemplate/MsCodeServiceFeeTemplateDAL.cs @@ -9,6 +9,7 @@ using Microsoft.Practices.EnterpriseLibrary.Data; using DSWeb.EntityDA; using DSWeb.Areas.CommMng.Models; using HcUtility.Comm; +using org.junit.rules; namespace DSWeb.MvcShipping.DAL.MsCodeServiceFeeTemplateDAL { @@ -413,12 +414,13 @@ namespace DSWeb.MvcShipping.DAL.MsCodeServiceFeeTemplateDAL { var rangeDa = new RangeDA(); var deptname = rangeDa.GetDEPTNAME(userid); - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; - + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))"; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' and DEPTNAME='{deptname}')"; } else if (visiblerange == "1") { - str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + //str = " S.OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "')) "; + str = $" exists(select 1 from vw_user where SHOWNAME =S.OP and COMPANYID='{companyid}' )"; } else if (visiblerange == "0") { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpAire/MsOpAireDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpAire/MsOpAireDAL.cs index 64ebd743..135b247f 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpAire/MsOpAireDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpAire/MsOpAireDAL.cs @@ -17,6 +17,7 @@ using HcUtility.Core; using DSWeb.Areas.CommMng.DAL; using DSWeb.MvcShipping.DAL.MsSysParamSet; using DSWeb.MvcShipping.Models.MsSeaeOrder; +using org.junit.rules; namespace DSWeb.MvcShipping.DAL.MsOpAireDAL @@ -1472,10 +1473,10 @@ namespace DSWeb.MvcShipping.DAL.MsOpAireDAL { var rangeDa = new RangeDA(); var deptid = rangeDa.GetDEPTGID(userid); - str = " (B.OP in (select showname from vw_user where deptgid='" + deptid + "') OR B.SALE in (select showname from vw_user where deptgid='" + deptid + "') OR B.CUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') " - + " OR B.DOC in (select showname from vw_user where deptgid='" + deptid + "') OR B.FRCUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') OR B.INPUTBY in (select showname from vw_user where deptgid='" + deptid + "'))"; - + //str = " (B.OP in (select showname from vw_user where deptgid='" + deptid + "') OR B.SALE in (select showname from vw_user where deptgid='" + deptid + "') OR B.CUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') " + //+ " OR B.DOC in (select showname from vw_user where deptgid='" + deptid + "') OR B.FRCUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') OR B.INPUTBY in (select showname from vw_user where deptgid='" + deptid + "'))"; + str = $" exists(select 1 from vw_user where SHOWNAME in (B.OP,B.SALE,B.CUSTSERVICE,B.FRCUSTSERVICE,B.INPUTBY) and COMPANYID='{companyid}' and deptgid='{deptid}')"; } else { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSeai/MsOpSeaiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSeai/MsOpSeaiDAL.cs index 66d04e66..e3ee5dee 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSeai/MsOpSeaiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSeai/MsOpSeaiDAL.cs @@ -4941,8 +4941,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaiDAL { var rangeDa = new RangeDA(); var deptid = rangeDa.GetDEPTGID(userid); - str = " (OP in (select showname from vw_user where deptgid='" + deptid + "') OR SALE in (select showname from vw_user where deptgid='" + deptid + "') OR CUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') " - + " OR DOC in (select showname from vw_user where deptgid='" + deptid + "') OR FRCUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') OR INPUTBY in (select showname from vw_user where deptgid='" + deptid + "'))"; + //str = " (OP in (select showname from vw_user where deptgid='" + deptid + "') OR SALE in (select showname from vw_user where deptgid='" + deptid + "') OR CUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') " + //+ " OR DOC in (select showname from vw_user where deptgid='" + deptid + "') OR FRCUSTSERVICE in (select showname from vw_user where deptgid='" + deptid + "') OR INPUTBY in (select showname from vw_user where deptgid='" + deptid + "'))"; + str = $" exists(select 1 from vw_user where SHOWNAME in(OP,SALE,DOC,INPUTBY,CUSTSERVICE,FRCUSTSERVICE) and deptgid='{deptid}') "; } else if (visiblerange == "1") { diff --git a/DSWeb/Areas/MvcShipping/DAL/MsOpSocCtn/MsOpSocCtnDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsOpSocCtn/MsOpSocCtnDAL.cs index bfa5d780..375e13ed 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsOpSocCtn/MsOpSocCtnDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsOpSocCtn/MsOpSocCtnDAL.cs @@ -1810,8 +1810,9 @@ namespace DSWeb.MvcShipping.DAL.MsOpSocCtnDAL { var rangeDa = new RangeDA(); var deptname = rangeDa.GetDEPTNAME(userid); - str = " (OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))" - + " OR CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))"; + //str = " (OP in (select showname from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "'))" + //+ " OR CREATEUSER in (select GID from [user] where GID in (select USERID from user_company where COMPANYID='" + companyid + "') and GID in (select userid from user_baseinfo where DEPTNAME='" + deptname + "')))"; + str = $" exists(select 1 from vw_user where SHOWNAME in(OP,CREATEUSER) and COMPANYID='{companyid}'and DEPTNAME='{deptname}') "; } else if (visiblerange == "1") {