From 6f1188220b95191fdb3478122572311382b31094 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Fri, 13 Jan 2023 16:51:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=B4=B8=E4=BA=91=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E5=AD=97=E6=AE=B5=E5=AF=B9=E5=BA=94=EF=BC=8C?= =?UTF-8?q?=E5=92=8C=E5=A7=94=E6=89=98=E5=8D=95=E4=BD=8D=E6=9C=AA=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=8A=A5=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs | 65 +++++++++++++++++--- DSWeb/Areas/CommMng/Models/BasicDataModel.cs | 3 +- HcDBUtility/Comm/DBResult.cs | 6 ++ 4 files changed, 68 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 02299d65..d96b4168 100644 --- a/.gitignore +++ b/.gitignore @@ -53,4 +53,5 @@ BookingWeb/Properties/PublishProfiles/FolderProfile.pubxml.user DSWeb/DSWeb.csproj.user BookingJieFeng/BookingJieFeng.csproj.user DispatchWeb/DispatchWeb.csproj.user -DSWeb/Properties/PublishProfiles/FolderProfile.pubxml \ No newline at end of file +DSWeb/Properties/PublishProfiles/FolderProfile.pubxml +/UpdateSQL/update.ldb diff --git a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs index ac111135..983f707c 100644 --- a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs @@ -44,7 +44,13 @@ namespace DSWeb.Areas.CommMng.DAL var admin = cdc.VW_user.First(x => x.CODENAME == "admin"); - var OpapplyHead = getHeadInfo(head, "add", admin); + var _r2 = getHeadInfo(head, "add", admin); + if (!_r2.Success) { + result = new JsonResponse { Success = _r2.Success, Message = _r2.Message, Data = _r2.Data }; + + return result; + } + var OpapplyHead = (MsOpApply)_r2.Data; var OpapplyGoodsDetailList = new List(); @@ -65,7 +71,16 @@ namespace DSWeb.Areas.CommMng.DAL if (_count == 0) { - OpapplyHead = getHeadInfo(head,"add",admin); + + + var _r3 = getHeadInfo(head, "add", admin); + if (!_r3.Success) + { + result = new JsonResponse { Success = _r3.Success, Message = _r3.Message, Data = _r3.Data }; + + return result; + } + OpapplyHead = (MsOpApply)_r3.Data; OpapplyHead.DbOperationType = DbOperationType.DbotIns; @@ -101,7 +116,16 @@ namespace DSWeb.Areas.CommMng.DAL } else { - OpapplyHead = getHeadInfo(head, "update"); + //OpapplyHead = getHeadInfo(head, "update"); + + var _r4 = getHeadInfo(head, "update"); + if (!_r4.Success) + { + result = new JsonResponse { Success = _r4.Success, Message = _r4.Message, Data = _r4.Data }; + + return result; + } + OpapplyHead = (MsOpApply)_r4.Data; OpapplyHead.DbOperationType = DbOperationType.DbotUpd; @@ -327,10 +351,12 @@ namespace DSWeb.Areas.CommMng.DAL } - public static MsOpApply getHeadInfo(GuanMaoYun_Head headinfo,string opstatus,VW_user_md userinfo=null) + public static DBResult getHeadInfo(GuanMaoYun_Head headinfo,string opstatus,VW_user_md userinfo=null) { - var result = new MsOpApply(); + var result = new MsOpApply(); + + var returnresult = new DBResult(); if (opstatus == "add") { @@ -347,7 +373,26 @@ namespace DSWeb.Areas.CommMng.DAL result.MASTERNO = headinfo.BUSINESS_ORDER_INFO.WORK_NO; result.CUSCIQNO = head.EPROT_NO; - result.CUSTOMERNAME = headinfo.BUSINESS_ORDER_INFO.EXPORT_NAME; + var cdc = new CommonDataContext(); + + //委托单位使用BUSINESS_ORDER_INFO.EXPORT_CODE和code_cust_edi中ediname=关贸云的数据相关联 如无则返回错误 + var 委托单位关贸云code = headinfo.BUSINESS_ORDER_INFO.EXPORT_CODE; + + var customernameList = cdc.code_cust_edi.Where(x => x.EDINAME == "关贸云" && 委托单位关贸云code==x.EDICODE).ToList(); + + var CUSTOMER = new info_client_md(); + + if (customernameList.Count > 0) + { + result.CUSTOMERNAME = customernameList[0].CUST; + } + else + { + returnresult.SetErrorInfo($"[{委托单位关贸云code}]没有做代码对应(ediname=关贸云,edicode=关贸云的用户id)"); + return returnresult; + } + + //result.CUSTOMERNAME = headinfo.BUSINESS_ORDER_INFO.EXPORT_NAME; //E出口 I进口 if (head.IE_TYPE == "E") result.BSTYPE = "2"; @@ -395,6 +440,8 @@ namespace DSWeb.Areas.CommMng.DAL result.ENTERP = head.EXPORT_NAME; //经营单位名称 result.ENTERPID = head.EXPORT_CODE; //经营单位代码 + + result.BOOKNO = head.HAND_BOOK_NO;//手册备案号 result.CONTRACTNO = head.CONTR_NO;//合同号 @@ -420,7 +467,11 @@ namespace DSWeb.Areas.CommMng.DAL result.CUSTOMSNUM = headinfo.GOODS_LIST.Count(); - return result; + result.OP = headinfo.BUSINESS_ORDER_INFO.PROJECT_NO;//操作 2023-1-13 + + returnresult.OK("", result); + + return returnresult; } diff --git a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs index 49a7a8c9..480cc596 100644 --- a/DSWeb/Areas/CommMng/Models/BasicDataModel.cs +++ b/DSWeb/Areas/CommMng/Models/BasicDataModel.cs @@ -1209,7 +1209,6 @@ namespace DSWeb.Areas.CommMng.Models /// public string ORIG_BOX_FLAG { get; set; } - public bool 是进口() { return IE_TYPE == "I"; } @@ -1432,6 +1431,8 @@ namespace DSWeb.Areas.CommMng.Models /// /// public string EXPORT_NAME { get; set; } + + public string PROJECT_NO { get; set; } } public class DECL_USER diff --git a/HcDBUtility/Comm/DBResult.cs b/HcDBUtility/Comm/DBResult.cs index 7247be5f..9830b1c0 100644 --- a/HcDBUtility/Comm/DBResult.cs +++ b/HcDBUtility/Comm/DBResult.cs @@ -61,6 +61,12 @@ namespace HcUtility.Comm success = true; message += _message + ";"; } + public void OK(string _message,object data) + { + success = true; + message += _message + ";"; + Data=data; + } public void SetErrorInfo(string message, bool success = false, object data = null) {