From 7dd6ca30cb2a680b0867cc1fae8b296d906b3bba Mon Sep 17 00:00:00 2001 From: ddlucky Date: Wed, 18 Jan 2023 16:10:53 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E5=90=88=E8=A7=84=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=8C=E8=B4=A7=E6=8F=8F=E4=BC=A0=E9=94=99=E4=BA=86GOODSNAME?= =?UTF-8?q?=EF=BC=8C=E5=BA=94=E4=B8=BADESCRIPTION?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index 75724379..14244316 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -6493,7 +6493,7 @@ namespace DSWeb.Areas.CommMng.DAL bi.service = head.SERVICE; bi.marks = head.MARKS; bi.hsCode = head.HSCODE; - bi.goodsDescription = head.GOODSNAME; + bi.goodsDescription = head.DESCRIPTION; bi.pkGs = GetInt(head.PKGS); bi.kindPKGs = head.KINDPKGS; bi.kGs = GetInt(head.KGS); From 4420e0790c723bd54869cc0d7385f3b80138bf14 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Wed, 18 Jan 2023 21:14:30 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=85=81=E8=AE=B8?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MsRptNoFeeDetail/MsRptNoFeeCrDetailIndex.js | 12 ++++++++++++ .../MsRptNoFeeDetail/MsRptNoFeeDetailIndex.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeCrDetailIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeCrDetailIndex.js index da6f35fe..6845965f 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeCrDetailIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeCrDetailIndex.js @@ -605,6 +605,9 @@ Ext.extend(Shipping.MsRptNoFeeCrDetailIndex, Ext.Panel, { disableSelection: false, columns: this.girdcolumsdr, selModel: this.GridCheckBoxModel, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, // paging bar on the bottom bbar: [Ext.create('Ext.PagingToolbar', { store: this.storeListDr, @@ -876,6 +879,9 @@ Ext.extend(Shipping.MsRptNoFeeCrDetailIndex, Ext.Panel, { trackMouseOver: true, disableSelection: false, columns: this.girdcolumsfeedr, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeFeeListDr, @@ -1058,6 +1064,9 @@ Ext.extend(Shipping.MsRptNoFeeCrDetailIndex, Ext.Panel, { trackMouseOver: true, disableSelection: false, selModel: this.CUSTGridCheckBoxModel, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, columns: this.girdcolumscust, // features: [{ // ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 @@ -1217,6 +1226,9 @@ Ext.extend(Shipping.MsRptNoFeeCrDetailIndex, Ext.Panel, { loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, columns: this.girdcolumssum }); diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeDetailIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeDetailIndex.js index be4eed18..8d34eae1 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeDetailIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsRptNoFeeDetail/MsRptNoFeeDetailIndex.js @@ -612,6 +612,9 @@ Ext.extend(Shipping.MsRptNoFeeDetailIndex, Ext.Panel, { disableSelection: false, columns: this.girdcolumsdr, selModel: this.GridCheckBoxModel, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, // paging bar on the bottom bbar: [Ext.create('Ext.PagingToolbar', { store: this.storeListDr, @@ -867,6 +870,9 @@ Ext.extend(Shipping.MsRptNoFeeDetailIndex, Ext.Panel, { trackMouseOver: true, disableSelection: false, columns: this.girdcolumsfeedr, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, // paging bar on the bottom bbar: Ext.create('Ext.PagingToolbar', { store: this.storeFeeListDr, @@ -1050,6 +1056,9 @@ Ext.extend(Shipping.MsRptNoFeeDetailIndex, Ext.Panel, { trackMouseOver: true, disableSelection: false, selModel: this.CUSTGridCheckBoxModel, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, columns: this.girdcolumscust, // features: [{ // ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性 @@ -1208,6 +1217,9 @@ Ext.extend(Shipping.MsRptNoFeeDetailIndex, Ext.Panel, { loadMask: { msg: "数据加载中,请稍等..." }, trackMouseOver: true, disableSelection: false, + viewConfig: { + enableTextSelection: true //允许复制数据 + }, columns: this.girdcolumssum }); From d2812d1b3088126e569e99fa18d998a6ace33c94 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Thu, 19 Jan 2023 10:09:05 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=AF=B9=E8=B4=A6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=8F=90=E5=8D=95=E5=8F=B7=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E9=83=BD=E8=BD=AC=E6=8D=A2=E4=B8=BA=E5=A4=A7?= =?UTF-8?q?=E5=86=99=E5=86=8D=E5=88=A4=E6=96=AD=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb.Common/DB/Comm.cs | 110 ++++++++++++++++++ DSWeb.Common/DB/CommonDataContext.cs | 2 +- .../Controllers/MsChFeeAutoDuiController.cs | 6 +- .../DAL/MsChFeeAutoDui/MsChFeeAutoDuiDAL.cs | 10 +- 4 files changed, 122 insertions(+), 6 deletions(-) diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index 284da720..1b8c8da0 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -507,6 +507,116 @@ namespace DSWeb.Common.DB } + [Table("v_op_bill")] + public partial class v_op_bill_mb + { + + [Key] + public string BSNO { get; set; } + public string MASTERNO { get; set; } + public string PARENTID { get; set; } + public string OPTYPE { get; set; } + public string OPLB { get; set; } + public string OPLBNAME { get; set; } + public string BSTYPE { get; set; } + public string CUSTOMERNAME { get; set; } + public string CUSTNO { get; set; } + public string ORDERNO { get; set; } + public string MBLNO { get; set; } + public string HBLNO { get; set; } + public string ETD { get; set; } + public DateTime? ETA { get; set; } + public DateTime? STLDATE { get; set; } + public string STLNAME { get; set; } + public string VESSEL { get; set; } + public string VOYNO { get; set; } + public string INPUTBY { get; set; } + public DateTime? CREATETIME { get; set; } + public int? BSSTATUS { get; set; } + public string SALE { get; set; } + public string OP { get; set; } + public string DOC { get; set; } + public string CUSTSERVICE { get; set; } + public string PORTLOAD { get; set; } + public string PORTDISCHARGE { get; set; } + public string CUSTOMNO { get; set; } + public string ACCDATE { get; set; } + public string CARRIER { get; set; } + public string BSSOURCE { get; set; } + public string BSSOURCEDETAIL { get; set; } + public string LANE { get; set; } + public string FORWARDER { get; set; } + public decimal? NETWEIGHT { get; set; } + public decimal? KGS { get; set; } + public int? TEU { get; set; } + public string CNTRTOTAL { get; set; } + public string CORPID { get; set; } + public int? CNTR1 { get; set; } + public int? CNTR2 { get; set; } + public int? CNTR3 { get; set; } + public int? CNTR4 { get; set; } + public int? CNTR5 { get; set; } + public int? CNTR6 { get; set; } + public int? CNTR7 { get; set; } + public int? CNTR8 { get; set; } + public int? CNTR9 { get; set; } + public int? CNTR10 { get; set; } + public int? OTCNTR { get; set; } + public string TRADETYPE { get; set; } + public string GOODSNAME { get; set; } + public int? FEESTATUS { get; set; } + public DateTime? OPDATE { get; set; } + public DateTime? CUSTOMDATE { get; set; } + public string ENTERP { get; set; } + public decimal? PKGS { get; set; } + public decimal? CBM { get; set; } + public string BLFRT { get; set; } + public string SALEDEPT { get; set; } + public int? CUSTOMSNUM { get; set; } + public string INVNO { get; set; } + public string BSCUSTOMNO { get; set; } + public DateTime? INSPECTIONDATE { get; set; } + public string INSPECTIONNO { get; set; } + public string CONTRACTNO { get; set; } + public string BOOKNO { get; set; } + public string AGENTID { get; set; } + public string ISPRINTPR { get; set; } + public string NUMBERPLATE { get; set; } + public decimal? FEEKGS { get; set; } + public string OPERATOR { get; set; } + public string SERVICECONTRACTNO { get; set; } + public string BLTYPE { get; set; } + public int? ISCANCEL { get; set; } + public string APPLYNO { get; set; } + public string ISSUETYPE { get; set; } + public string BLISSUESTATUS { get; set; } + public string REMARK { get; set; } + public string TRADETERM { get; set; } + public string REASON { get; set; } + public string PLACERECEIPT { get; set; } + public string DESTINATION { get; set; } + public string CNTRSEALNO { get; set; } + public int? BillFeeStatus { get; set; } + public int? ISVOU { get; set; } + public string VOUNO { get; set; } + public string SALECORPID { get; set; } + public string YARD { get; set; } + public DateTime? DELIVERYDATE { get; set; } + public string FRCUSTSERVICE { get; set; } + public string SERVICE { get; set; } + public string REMARK2 { get; set; } + public DateTime? BILLFEESTATUSTIME { get; set; } + public string TRUCKER { get; set; } + public string CUSTOMSER { get; set; } + public DateTime? CLOSINGDATE { get; set; } + public string KINDPKGS { get; set; } + public string CARGOID { get; set; } + public string DCLASS { get; set; } + public DateTime? ATD { get; set; } + public string ALLBILLNO { get; set; } + + } + [Table("code_fee")] public class code_fee_md { diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 7788acac..5518d869 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -52,8 +52,8 @@ namespace DSWeb.Common.DB public DbSet company { get; set; } public DbSet v_op_bs { get; set; } + public DbSet v_op_bill { get; set; } - public DbSet v_fee_do_settlement{ get; set; } public DbSet v_ch_fee_settlementinfo { get; set; } diff --git a/DSWeb/Areas/MvcShipping/Controllers/MsChFeeAutoDuiController.cs b/DSWeb/Areas/MvcShipping/Controllers/MsChFeeAutoDuiController.cs index 252790f5..ad5db857 100644 --- a/DSWeb/Areas/MvcShipping/Controllers/MsChFeeAutoDuiController.cs +++ b/DSWeb/Areas/MvcShipping/Controllers/MsChFeeAutoDuiController.cs @@ -207,8 +207,7 @@ namespace DSWeb.MvcShipping.Controllers var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", Data = dataListStr }); return new ContentResult() { Content = json }; } - public ContentResult Save ( string opstatus, string data, - string CargoBody, string CargoDelBody ) + public ContentResult Save ( string opstatus, string data, string CargoBody, string CargoDelBody ) { var head = JsonConvert.Deserialize(data); @@ -260,8 +259,7 @@ namespace DSWeb.MvcShipping.Controllers return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; } - public ContentResult CFSave(string data, - string CargoBody, string CargoDelBody) + public ContentResult CFSave(string data, string CargoBody, string CargoDelBody) { var head = JsonConvert.Deserialize(data); diff --git a/DSWeb/Areas/MvcShipping/DAL/MsChFeeAutoDui/MsChFeeAutoDuiDAL.cs b/DSWeb/Areas/MvcShipping/DAL/MsChFeeAutoDui/MsChFeeAutoDuiDAL.cs index f0429c1d..df416c40 100644 --- a/DSWeb/Areas/MvcShipping/DAL/MsChFeeAutoDui/MsChFeeAutoDuiDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/MsChFeeAutoDui/MsChFeeAutoDuiDAL.cs @@ -665,6 +665,14 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL } } + /// + /// 生成自动对账单内容 + /// + /// + /// + /// + /// + /// public static DBResult ReMake ( MsChFeeAutoDuimb _head, string userid, string username, string companyid ) { var head = GetData("GID='" + _head.GID + "'"); @@ -715,7 +723,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeAutoDuiDAL var _localDetail=new CH_FEE_AutoDuiDetailmb(); var get = false; foreach (var _L in LocalDetailList) { - if (_L.MBLNO == _D.MBLNO) { + if (_L.MBLNO.ToUpper() == _D.MBLNO.ToUpper()) { _localDetail = _L; get = true; continue; From acca2633544111f136d1ad6c3b048f30f3108b74 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Thu, 19 Jan 2023 17:36:19 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E8=8D=A3=E5=9C=A3=E8=BE=BE=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=BE=AE=E8=B0=83=EF=BC=9B=E8=AF=9A=E9=94=90=E9=92=89?= =?UTF-8?q?=E9=92=89=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=80=BC=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb.Common/DB/OtherDBModel.cs | 4 +- DSWeb.Service.Output/JobFanWeiToDS7.cs | 65 +++++++++++++++---- .../Chfee_payapplicationController.cs | 2 +- .../CommMng/Controllers/WorkFlowController.cs | 28 +++++--- .../MvcShipping/Helper/DingTalkHelper.cs | 6 +- 5 files changed, 78 insertions(+), 27 deletions(-) diff --git a/DSWeb.Common/DB/OtherDBModel.cs b/DSWeb.Common/DB/OtherDBModel.cs index 134622ab..ada712ba 100644 --- a/DSWeb.Common/DB/OtherDBModel.cs +++ b/DSWeb.Common/DB/OtherDBModel.cs @@ -34,8 +34,8 @@ namespace DSWeb.Common.DB public int requestid { get; set; } public int workflowid { get; set; } public string requestname { get; set; } - public int creater { get; set; } - public int lastoperator { get; set; } + public int? creater { get; set; } + public int? lastoperator { get; set; } public string lastoperatedate { get; set; } public string lastoperatetime { get; set; } public string currentnodetype { get; set; } diff --git a/DSWeb.Service.Output/JobFanWeiToDS7.cs b/DSWeb.Service.Output/JobFanWeiToDS7.cs index e44b157b..d12ceecc 100644 --- a/DSWeb.Service.Output/JobFanWeiToDS7.cs +++ b/DSWeb.Service.Output/JobFanWeiToDS7.cs @@ -2,12 +2,14 @@ using DSWeb.Common.DB; using DSWeb.Common.Helper; using log4net; +using log4net.Repository.Hierarchy; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Quartz; using RabbitMQ.Client; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Configuration; using System.Linq; using System.Runtime.Caching; @@ -32,10 +34,14 @@ namespace DSWeb.Service.Output public void Execute(IJobExecutionContext context) { + + //int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout")); + try { + log.Debug("Execute start"); + //int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout")); - int reqTimeout = Convert.ToInt32(context.JobDetail.JobDataMap.GetString("RequestTimeout")); var dc1 = new OtherDB(OAconnStr); @@ -48,7 +54,7 @@ namespace DSWeb.Service.Output var idList = 待审核付费申请List.Select(s => s.PAYAPPID).ToList(); - + log.Info(idList.ToList()); //从dc1中寻找这些id的业务的审核结果 var 审核结果List = dc1.view_pjrequestbas.Where(x => x.workflowid == 79 && x.currentnodetype == "3" && idList.Contains(x.requestid.ToString())).ToList(); @@ -59,8 +65,10 @@ namespace DSWeb.Service.Output SetAudit(dc1, cdc, DS7URL, item); } + //将审核完成的更新至cdc中的业务中 //update ch_fee_payapplication set BILLSTATUS=0,AUDITUSER='" + USERID + "',AUDITTIME='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where BILLNO=@BILLNO"); + log.Debug("Execute end"); } catch (Exception ex) { @@ -70,29 +78,62 @@ namespace DSWeb.Service.Output } } - private void SetAudit(OtherDB dc1, CommonDataContext cdc, string DS7URL, view_pjrequestbas_md Audititem) + public void DoWork() { - //根据oa系统的userid查找ds7系统的userid + var dc1 = new OtherDB(OAconnStr); + + var cdc = new CommonDataContext(DS7connStr); - var OAUser = dc1.view_hrmresource.FirstOrDefault(x => x.id == Audititem.lastoperator); + //从cdc中寻找待读取审核结果的业务 + var 待审核付费申请List = cdc.ch_fee_payapplication.Where(x => x.BILLSTATUS == 2 && x.PAYAPPID != null && x.PAYAPPID != "").ToList(); - var ds7user = cdc.VW_user.Where(x => x.SHOWNAME == OAUser.lastname).ToList(); + if (待审核付费申请List == null || 待审核付费申请List.Count <= 0) return; - //var ds7user = cdc.VW_user.Where(x => x.SHOWNAME == "系统管理员").ToList(); + var idList = 待审核付费申请List.Select(s => s.PAYAPPID).ToList(); + + log.Debug(idList.ToList()); + + //从dc1中寻找这些id的业务的审核结果 + var 审核结果List = dc1.view_pjrequestbas.Where(x => x.workflowid == 79 && x.currentnodetype == "3" && idList.Contains(x.requestid.ToString())).ToList(); + + //var AuditGidlistStr = ""; + + foreach (var item in 审核结果List) + { + SetAudit(dc1, cdc, DS7URL, item); + } - if (ds7user != null && ds7user.Count > 0) + } + private void SetAudit(OtherDB dc1, CommonDataContext cdc, string DS7URL, view_pjrequestbas_md Audititem) + { + try { - var userid = ds7user[0].USERID; + //根据oa系统的userid查找ds7系统的userid + log.Debug("audit start"); + var OAUser = dc1.view_hrmresource.FirstOrDefault(x => x.id == Audititem.lastoperator); + + var ds7user = cdc.VW_user.Where(x => x.SHOWNAME.Replace(" ","") == OAUser.lastname).ToList(); - var dic = new Dictionary { + //var ds7user = cdc.VW_user.Where(x => x.SHOWNAME == "系统管理员").ToList(); + + if (ds7user != null && ds7user.Count > 0) + { + var userid = ds7user[0].USERID; + + var dic = new Dictionary { { "requestid",Audititem.requestid.ToString()}, { "userid",userid} }; - string rtn = WebRequestHelper.DoPost(DS7URL, dic, 12000); + string rtn = WebRequestHelper.DoPost(DS7URL, dic, 12000); - log.Debug("rtn=" + rtn); + log.Debug("rtn=" + rtn); + } + log.Debug("audit end"); + } + catch (Exception e) { + log.Error(e.Message); } } diff --git a/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs b/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs index bca4d12e..503413d6 100644 --- a/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs +++ b/DSWeb/Areas/Account/Controllers/Chfee_payapplicationController.cs @@ -717,7 +717,7 @@ namespace DSWeb.Areas.Account.Controllers var bodyList = ChpayapplicationDAL.GetDataList(0, 9999, " cm.payappid in("+ requestid + ")", userid); - DBResult result = ChpayapplicationDAL.AuditList(bodyList, Convert.ToString(Session["USERID"])); + DBResult result = ChpayapplicationDAL.AuditList(bodyList, userid); if (result.Message2 == "1") { var PAYAUDITAUTOCLOSEDR = MsSysParamSetDAL.GetData("PARAMNAME='PAYAUDITAUTOCLOSEDR'"); diff --git a/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs b/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs index 81566684..c678e8a1 100644 --- a/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs +++ b/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs @@ -20,6 +20,8 @@ using DSWeb.Areas.MvcShipping.Models.Message.VGM; using DSWeb.Areas.MvcShipping.Helper; using HcUtility.Comm; using DSWeb.MvcShipping.DAL.MsSysParamSet; +using NPOI.SS.Formula.Functions; +using sun.security.krb5.@internal.crypto; namespace DSWeb.Areas.CommMng.Controllers { @@ -325,21 +327,29 @@ namespace DSWeb.Areas.CommMng.Controllers { var result = ""; var _r = new DBResult(); - var 钉钉应用 = DingTalkApp.GetDingTalkApp("诚锐东胜对接"); + var appname = MsSysParamSetDAL.GetSysParamValue("DingTalkAppName"); + + //var 钉钉应用 = DingTalkApp.GetDingTalkApp("诚锐东胜对接"); + var 钉钉应用 = DingTalkApp.GetDingTalkApp(appname); + //钉钉应用=DingTalkProcess.GetDingTalkProcessByProcessCode(callbackinfo.processCode); + + + + //实例化钉钉解密类构造参数为对应的 应用中的token、aes_key、AppKey值 + DingTalkEncryptor dingTalkEncryptor = new DingTalkEncryptor(钉钉应用.token, 钉钉应用.aes_key, 钉钉应用.appkey); + + + //定义字符串接收解密后的值 + + //JeffSoft.Logger.Error("dingTalkEncryptor.getDecryptMsg:" + text + ""); + BasicDataRefDAL.SaveLog(text, "admin", "钉钉回调", "测试1"); var callbackinfo = JsonConvert.Deserialize(text); var 钉钉审批 = 钉钉应用.GetDingTalkProcessByProcessCode(callbackinfo.processCode); - 钉钉审批.SaveCallBack(callbackinfo); - - //var objRtn2 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(text.ToString(), new { EventType = "" }); - //var _jsstr = JsonConvert.Serialize(objRtn2); + 钉钉审批.SaveCallBack(callbackinfo); - //BasicDataRefDAL.SaveLog(_jsstr, "admin", "钉钉回调", "保存2"); - //取出事件类型字段 - //JeffSoft.Logger.Error("DingdingCallback Success,EventType:" + EventType + ""); - //第二部分 // { //判断事件类型是否是日程事件 if ("bpms_instance_change" == callbackinfo.EventType) { diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index 6df69cc2..cf885a5e 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -878,7 +878,7 @@ namespace DSWeb.Areas.MvcShipping.Helper //根据内容修改wms和wmsin值 var cdc = new CommonDataContext(); - var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", "Wnr2YHcmSD-PjBWkTDkqIg05361673511300"); + var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", processInstanceId); if (lv != null && lv.ContainsKey("instanceId")) { var wmsno = lv["BSNO"]; @@ -1045,7 +1045,7 @@ namespace DSWeb.Areas.MvcShipping.Helper cdc.SaveChanges(); //然后执行入库的费用入账原逻辑 - DSWeb.MvcShipping.DAL.WMSNewDAL.WMSNewDAL.DoWMSLOCK(wmsno); + DSWeb.MvcShipping.DAL.WMSNewDAL.WMSNewDAL.DoWMSLOCK("'"+wmsno+"'"); } } catch (Exception e) @@ -1382,7 +1382,7 @@ namespace DSWeb.Areas.MvcShipping.Helper return result; } - new public DingTalkProcess GetDingTalkProcessByProcessCode(string processCode) + public override DingTalkProcess GetDingTalkProcessByProcessCode(string processCode) { var processdic = new Dictionary { { "PROC-0888A19C-0562-42AC-A9C6-24E4C4398410","诚锐入货通知"}, From 182b540197f73be89dbc7f36b249814f587c814d Mon Sep 17 00:00:00 2001 From: ddlucky Date: Thu, 19 Jan 2023 17:36:41 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ToolProject/TestForm/TestForm/App.config | 6 + .../TestForm/TestForm/Form1.Designer.cs | 13 + ToolProject/TestForm/TestForm/Form1.cs | 15 +- ToolProject/TestForm/TestForm/TestForm.csproj | 18 +- .../TestForm/job_scheduling_data_2_0.xsd | 364 ++++++++++++++++++ ToolProject/TestForm/TestForm/packages.config | 3 + 6 files changed, 414 insertions(+), 5 deletions(-) create mode 100644 ToolProject/TestForm/TestForm/job_scheduling_data_2_0.xsd diff --git a/ToolProject/TestForm/TestForm/App.config b/ToolProject/TestForm/TestForm/App.config index 9b634119..1c883a5f 100644 --- a/ToolProject/TestForm/TestForm/App.config +++ b/ToolProject/TestForm/TestForm/App.config @@ -10,6 +10,12 @@ + + + + + + diff --git a/ToolProject/TestForm/TestForm/Form1.Designer.cs b/ToolProject/TestForm/TestForm/Form1.Designer.cs index 529cfea6..02db917e 100644 --- a/ToolProject/TestForm/TestForm/Form1.Designer.cs +++ b/ToolProject/TestForm/TestForm/Form1.Designer.cs @@ -32,6 +32,7 @@ this.button2 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 @@ -70,11 +71,22 @@ this.textBox1.Size = new System.Drawing.Size(96, 21); this.textBox1.TabIndex = 3; // + // button3 + // + this.button3.Location = new System.Drawing.Point(114, 82); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 4; + this.button3.Text = "button3"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(294, 181); + this.Controls.Add(this.button3); this.Controls.Add(this.textBox1); this.Controls.Add(this.label1); this.Controls.Add(this.button2); @@ -92,6 +104,7 @@ private System.Windows.Forms.Button button2; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button3; } } diff --git a/ToolProject/TestForm/TestForm/Form1.cs b/ToolProject/TestForm/TestForm/Form1.cs index ca34a981..5379c101 100644 --- a/ToolProject/TestForm/TestForm/Form1.cs +++ b/ToolProject/TestForm/TestForm/Form1.cs @@ -1,4 +1,5 @@ -using D7MqClient; + +using DSWeb.Service.Output; using System; using System.Collections.Generic; using System.ComponentModel; @@ -8,6 +9,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +//using D7MqClient; + namespace TestForm { @@ -20,7 +23,7 @@ namespace TestForm private void button1_Click(object sender, EventArgs e) { - DJYtoD7_OPSTATUS dj = new DJYtoD7_OPSTATUS(); + //DJYtoD7_OPSTATUS dj = new DJYtoD7_OPSTATUS(); } private void button2_Click(object sender, EventArgs e) @@ -36,5 +39,13 @@ namespace TestForm } label1.Text = newint.ToString(); } + + private void button3_Click(object sender, EventArgs e) + { + //触发荣圣达读取泛微审核结果逻辑 + + JobFanWeiToDS7 jd = new JobFanWeiToDS7(); + jd.DoWork(); + } } } diff --git a/ToolProject/TestForm/TestForm/TestForm.csproj b/ToolProject/TestForm/TestForm/TestForm.csproj index 6b3a6f0b..e0be6c6a 100644 --- a/ToolProject/TestForm/TestForm/TestForm.csproj +++ b/ToolProject/TestForm/TestForm/TestForm.csproj @@ -36,12 +36,21 @@ 4 + + ..\..\..\packages\Common.Logging.3.3.1\lib\net40\Common.Logging.dll + + + ..\..\..\packages\Common.Logging.Core.3.3.1\lib\net40\Common.Logging.Core.dll + ..\..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll ..\..\..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + + ..\..\..\packages\Quartz.2.6.2\lib\net40\Quartz.dll + @@ -76,6 +85,9 @@ True Resources.resx + + Designer + SettingsSingleFileGenerator @@ -91,9 +103,9 @@ - - {f3096387-37a2-403b-b147-64a8b4fc1077} - D7MqClient + + {fb5f0a53-8aa0-4993-8fb9-2b6c5fac0482} + DSWeb.Service.Output diff --git a/ToolProject/TestForm/TestForm/job_scheduling_data_2_0.xsd b/ToolProject/TestForm/TestForm/job_scheduling_data_2_0.xsd new file mode 100644 index 00000000..7bff0f0a --- /dev/null +++ b/ToolProject/TestForm/TestForm/job_scheduling_data_2_0.xsd @@ -0,0 +1,364 @@ + + + + + + + Root level node + + + + + + Commands to be executed before scheduling the jobs and triggers in this file. + + + + + Directives to be followed while scheduling the jobs and triggers in this file. + + + + + + + + + + + + + + Version of the XML Schema instance + + + + + + + + + + Delete all jobs, if any, in the identified group. "*" can be used to identify all groups. Will also result in deleting all triggers related to the jobs. + + + + + Delete all triggers, if any, in the identified group. "*" can be used to identify all groups. Will also result in deletion of related jobs that are non-durable. + + + + + Delete the identified job if it exists (will also result in deleting all triggers related to it). + + + + + + + + + + + Delete the identified trigger if it exists (will also result in deletion of related jobs that are non-durable). + + + + + + + + + + + + + + + + Whether the existing scheduling data (with same identifiers) will be overwritten. If false, and ignore-duplicates is not false, and jobs or triggers with the same names already exist as those in the file, an error will occur. + + + + + If true (and overwrite-existing-data is false) then any job/triggers encountered in this file that have names that already exist in the scheduler will be ignored, and no error will be produced. + + + + + If true trigger's start time is calculated based on earlier run time instead of fixed value. Trigger's start time must be undefined for this to work. + + + + + + + + Define a JobDetail + + + + + + + + + + + + + + + + + Define a JobDataMap + + + + + + + + + Define a JobDataMap entry + + + + + + + + + + Define a Trigger + + + + + + + + + + + Common Trigger definitions + + + + + + + + + + + + + + + + + + + + + + + Define a SimpleTrigger + + + + + + + + + + + + + + + + + Define a CronTrigger + + + + + + + + + + + + + + + Define a DateIntervalTrigger + + + + + + + + + + + + + + + + Cron expression (see JavaDoc for examples) + + Special thanks to Chris Thatcher (thatcher@butterfly.net) for the regular expression! + + Regular expressions are not my strong point but I believe this is complete, + with the caveat that order for expressions like 3-0 is not legal but will pass, + and month and day names must be capitalized. + If you want to examine the correctness look for the [\s] to denote the + seperation of individual regular expressions. This is how I break them up visually + to examine them: + + SECONDS: + ( + ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) + | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) + | ([\?]) + | ([\*]) + ) [\s] + MINUTES: + ( + ((([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?,)*([0-9]|[0-5][0-9])(-([0-9]|[0-5][0-9]))?) + | (([\*]|[0-9]|[0-5][0-9])/([0-9]|[0-5][0-9])) + | ([\?]) + | ([\*]) + ) [\s] + HOURS: + ( + ((([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?,)*([0-9]|[0-1][0-9]|[2][0-3])(-([0-9]|[0-1][0-9]|[2][0-3]))?) + | (([\*]|[0-9]|[0-1][0-9]|[2][0-3])/([0-9]|[0-1][0-9]|[2][0-3])) + | ([\?]) + | ([\*]) + ) [\s] + DAY OF MONTH: + ( + ((([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?,)*([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(-([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1]))?(C)?) + | (([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])/([1-9]|[0][1-9]|[1-2][0-9]|[3][0-1])(C)?) + | (L(-[0-9])?) + | (L(-[1-2][0-9])?) + | (L(-[3][0-1])?) + | (LW) + | ([1-9]W) + | ([1-3][0-9]W) + | ([\?]) + | ([\*]) + )[\s] + MONTH: + ( + ((([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?,)*([1-9]|0[1-9]|1[0-2])(-([1-9]|0[1-9]|1[0-2]))?) + | (([1-9]|0[1-9]|1[0-2])/([1-9]|0[1-9]|1[0-2])) + | (((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?,)*(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)(-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC))?) + | ((JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)/(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)) + | ([\?]) + | ([\*]) + )[\s] + DAY OF WEEK: + ( + (([1-7](-([1-7]))?,)*([1-7])(-([1-7]))?) + | ([1-7]/([1-7])) + | (((MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?,)*(MON|TUE|WED|THU|FRI|SAT|SUN)(-(MON|TUE|WED|THU|FRI|SAT|SUN))?(C)?) + | ((MON|TUE|WED|THU|FRI|SAT|SUN)/(MON|TUE|WED|THU|FRI|SAT|SUN)(C)?) + | (([1-7]|(MON|TUE|WED|THU|FRI|SAT|SUN))(L|LW)?) + | (([1-7]|MON|TUE|WED|THU|FRI|SAT|SUN)#([1-7])?) + | ([\?]) + | ([\*]) + ) + YEAR (OPTIONAL): + ( + [\s]? + ([\*])? + | ((19[7-9][0-9])|(20[0-9][0-9]))? + | (((19[7-9][0-9])|(20[0-9][0-9]))/((19[7-9][0-9])|(20[0-9][0-9])))? + | ((((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?,)*((19[7-9][0-9])|(20[0-9][0-9]))(-((19[7-9][0-9])|(20[0-9][0-9])))?)? + ) + + + + + + + + + + Number of times to repeat the Trigger (-1 for indefinite) + + + + + + + + + + Simple Trigger Misfire Instructions + + + + + + + + + + + + + + + Cron Trigger Misfire Instructions + + + + + + + + + + + + Date Interval Trigger Misfire Instructions + + + + + + + + + + + + Interval Units + + + + + + + + + + + + + \ No newline at end of file diff --git a/ToolProject/TestForm/TestForm/packages.config b/ToolProject/TestForm/TestForm/packages.config index 09a1842d..ae18e20a 100644 --- a/ToolProject/TestForm/TestForm/packages.config +++ b/ToolProject/TestForm/TestForm/packages.config @@ -1,4 +1,7 @@  + + + \ No newline at end of file From 63e756e13dd71d0ab0bab7c6d992865ce72175e6 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Sat, 28 Jan 2023 09:00:12 +0800 Subject: [PATCH 06/16] 20230128-1 --- .gitignore | 2 ++ DSWeb.Service.Output/App.config | 4 ++-- DSWeb/DSWeb.csproj.user | 40 --------------------------------- 3 files changed, 4 insertions(+), 42 deletions(-) delete mode 100644 DSWeb/DSWeb.csproj.user diff --git a/.gitignore b/.gitignore index 41585ce3..0100355d 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,5 @@ DSWeb/Properties/PublishProfiles/FolderProfile.pubxml /WebSqlHelper/Fakes/Microsoft.Practices.EnterpriseLibrary.Common.fakes /BookingWeb/App_Data/Logs/debug.log20221102 /BookingWeb/App_Data/Logs +/packages +/DSWeb/DSWeb.csproj.user diff --git a/DSWeb.Service.Output/App.config b/DSWeb.Service.Output/App.config index 8ed7b303..a6fb6af9 100644 --- a/DSWeb.Service.Output/App.config +++ b/DSWeb.Service.Output/App.config @@ -12,9 +12,9 @@ - + - + diff --git a/DSWeb/DSWeb.csproj.user b/DSWeb/DSWeb.csproj.user deleted file mode 100644 index 4b503d3c..00000000 --- a/DSWeb/DSWeb.csproj.user +++ /dev/null @@ -1,40 +0,0 @@ - - - - ShowAllFiles - 配置文件1 - true - Debug|Any CPU - - - - - - - - - - - - - - CurrentPage - True - False - False - False - - - - - - - - - True - False - - - - - \ No newline at end of file From 314f83cf689becaad8dfdceaacda347359d2764f Mon Sep 17 00:00:00 2001 From: ddlucky Date: Sat, 28 Jan 2023 14:20:59 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E6=97=A7=E4=BB=93=E5=82=A8=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E9=92=89=E9=92=89=E5=AE=A1=E6=A0=B8=E9=83=A8?= =?UTF-8?q?=E5=88=86=EF=BC=8C=E5=A6=82=E6=9E=9C=E8=AE=BE=E4=B8=BA=E9=92=89?= =?UTF-8?q?=E9=92=89=E5=AE=A1=E6=A0=B8=EF=BC=8C=E5=88=99=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=B4=B9=E7=94=A8=E5=85=A5=E8=B4=A6=E5=90=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=92=89=E9=92=89=EF=BC=8C=E9=92=89=E9=92=89=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=90=8E=E5=AE=9E=E9=99=85=E6=89=A7=E8=A1=8C=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E5=85=A5=E8=B4=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb.Common/DB/Comm.cs | 14 + DSWeb.Common/DB/CommonDataContext.cs | 1 + .../DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs | 113 ++++-- .../MvcShipping/Helper/DingTalkHelper.cs | 381 +++++++++++++++++- DSWeb/Areas/MvcShipping/Models/WMS/WMS.cs | 26 ++ .../Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js | 1 - 6 files changed, 498 insertions(+), 38 deletions(-) diff --git a/DSWeb.Common/DB/Comm.cs b/DSWeb.Common/DB/Comm.cs index 1b8c8da0..2b982164 100644 --- a/DSWeb.Common/DB/Comm.cs +++ b/DSWeb.Common/DB/Comm.cs @@ -2243,6 +2243,20 @@ namespace DSWeb.Common.DB public string GOODSCKQSTOCK { get; set; } } + + /// + /// 暂时只用于查询出库相关库存在入库单和入库单明细中的提单号箱号 + /// + [Table("VW_WMS_OUT_DETAIL")] + public partial class VW_WMS_OUT_DETAIL_md + { + [Key] + public string GID_OUT { get; set; } + public string BLNO { get; set; } + public string CNTRNO { get; set; } + + public string GOODSNAME_OUT { get; set; } + } public static class StrHelper { #region 将一个dictionary转化为用;;和::隔开的文本 diff --git a/DSWeb.Common/DB/CommonDataContext.cs b/DSWeb.Common/DB/CommonDataContext.cs index 5518d869..4bf60de0 100644 --- a/DSWeb.Common/DB/CommonDataContext.cs +++ b/DSWeb.Common/DB/CommonDataContext.cs @@ -73,6 +73,7 @@ namespace DSWeb.Common.DB public DbSet wms_in { get; set; } public DbSet wms_out { get; set; } public DbSet wms_out_detail { get; set; } + public DbSet VW_WMS_OUT_DETAIL { get; set; } } diff --git a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs index e617032d..058ecc7d 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs @@ -22,12 +22,13 @@ using Ivony.Fluent; using DSWeb.MvcShipping.DAL.WMSStock; using System.Configuration; using DSWeb.Areas.MvcShipping.Helper; +using NPOI.HSSF.Record; namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL { public class WMSOUT_GuiGeDAL { - #region 查询主表 + #region 出库管理(规格) 查询主表 static public List GetDataListHJ(string strCondition, string userid, string usercode, string companyid, int start=0, int limit=10000, string sort = null) { @@ -1890,12 +1891,93 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL result.Success = false; result.Message = "没有输入任何需要修改的数据"; } - gids = "'" + gids.Trim().Replace(",", "','") + "'"; - #region 费用入账 + Database db = DatabaseFactory.CreateDatabase(); + + //20230128 改为 + if (ConfigurationManager.AppSettings["DingTalkAuditWMSIN"] == "true") + {//向钉钉发送出库审批流程 + + var _r0 = new DBResult(); + _r0.OK(); + //如果是费用入账动作 且配置了钉钉审批入库 则调用向钉钉发送新建审批实例方法 + + var strSql = new StringBuilder(); + strSql.Append("select o.IsDetail AS ISDETAIL,d.inbsno as INBSNO,o.gid as OUTGID,o.bsno as OUTNO,o.ASSOCIATEDNO AS ASSOCIATEDNO, "); + strSql.Append(" o.ARCLIENTWMSOUT as ARCLIENTWMSOUT,isnull(d.GOODSOUTFEE,0) AS GOODSOUTFEE_OUT,"); + strSql.Append(" o.TRUCKNAME as TRUCKNAME_OUT,isnull(d.GOODSOUTFEEAP,0) AS GOODSOUTFEEAP_OUT,"); + strSql.Append(" isnull(d.ARFEE,0) AS ARFEE_OUT,isnull(d.ARFEE_2,0) AS ARFEE_2_OUT,d.GID OUTDEGID"); + strSql.Append(" ,ol.PROPVALUE"); + strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); + strSql.Append(" left join OP_LOGICINFO ol on ol.BSNO=o.bsno "); + strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); + + //var 需要发送给钉钉出库审核流程的业务编号List = new List(); + + using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) + { + while (reader.Read()) + { + var outbsno = Convert.ToString(reader["OUTNO"]); + var instanceId = Convert.ToString(reader["PROPVALUE"]); + + if (!string.IsNullOrWhiteSpace(instanceId)) continue; + + var _r = DingTalkHelper.Send_WMSOUT(strUserID, outbsno); + if (!_r.Success) + { + _r0.SetErrorInfo(_r.Message); + } + //仅用于测试解析读取钉钉审批实例内容 + //result = TestReadDingtalkInstanceinfo(); + if (!_r0.Success) + { + result.Success = false; + result.Message = "发送钉钉审批失败:" + _r0.Message; + return result; + } + else + { + //增加一条钉钉审批记录 + + } + } + + } + return result; + } + else { + return DoSetislock(gids, bEIP, outType, strUserID, strCompanyID, strDEPTNAME, strSHOWNAME); + } + + } + /// + /// 实际执行费用入账操作 + /// + /// wms_out.GID 用逗号,隔开 + /// bool型 wms_out.EIP + /// StockOut、StockOutDetail,来自wms_out.ISDETAIL true=StockOutDetail false=StockOut + /// 调用时可使用wms_out.CREATEUSER + /// 未使用 不填 + /// 未使用 不填 + /// 未使用 不填 + /// + public static DBResult DoSetislock(string gids, bool bEIP, string outType, string strUserID, string strCompanyID = "", string strDEPTNAME = "", string strSHOWNAME = "") + { + DBResult result = new DBResult(); + if (gids.Trim() == "") + { + result.Success = false; + result.Message = "没有输入任何需要修改的数据"; + } Database db = DatabaseFactory.CreateDatabase(); + + gids = "'" + gids.Trim().Replace(",", "','") + "'"; + + #region 费用入账 + using (SqlTransaction sqlTran = SqlHelper.BeginTransaction(SqlHelper.ConnectionStringLocalTransaction)) { try @@ -1908,8 +1990,6 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); - var 需要发送给钉钉出库审核流程的业务编号List = new List(); - using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) { int i = 0; @@ -1988,9 +2068,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL #endregion - if (!需要发送给钉钉出库审核流程的业务编号List.Exists(x => x == outFee.OUTNO)) { - 需要发送给钉钉出库审核流程的业务编号List.Add(outFee.OUTNO); - } + } @@ -2023,26 +2101,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL #endregion } - if (ConfigurationManager.AppSettings["DingTalkAuditWMSIN"] == "true" ) - {//向钉钉发送出库审批流程 - - var _r0 = new DBResult(); - _r0.OK(); - //如果是费用入账动作 且配置了钉钉审批入库 则调用向钉钉发送新建审批实例方法 - foreach (var outbsno in 需要发送给钉钉出库审核流程的业务编号List) { - var _r = DingTalkHelper.Send_WMSOUT(strUserID, outbsno); - if (!_r.Success) { - _r0.SetErrorInfo(_r.Message); - } - } - //仅用于测试解析读取钉钉审批实例内容 - //result = TestReadDingtalkInstanceinfo(); - if (!_r0.Success) { - result.Success = false; - result.Message = "发送钉钉审批失败:"+_r0.Message; - } - } } catch (Exception) { diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index cf885a5e..17fe163e 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -687,11 +687,16 @@ namespace DSWeb.Areas.MvcShipping.Helper 尺码 = item.GOODSPFSL == null ? 0M : (decimal)item.GOODSPFSL; } + var cntrno = item.CntrNo; + if (string.IsNullOrWhiteSpace(cntrno)) { + cntrno = 对应入库wmsin.CNTRNO; + } + var newrk = new List { new DingTalkFormField("提单号", 对应入库wms.BLNO), - //new DingTalkFormField("箱号", 对应入库wmsin.CNTRNO), + new DingTalkFormField("箱号", cntrno), new DingTalkFormField("品名", item.GOODSNAME), new DingTalkFormField("重量", 重量.ToString()), new DingTalkFormField("件数", item.GOODSPACKPFSL.ToString()), @@ -774,8 +779,10 @@ namespace DSWeb.Areas.MvcShipping.Helper jo = (DingTalk_SendAuditResult)JsonToObject(result.Data.ToString(), jo); - var dic = new Dictionary(); - dic.Add("instanceId", jo.instanceId); + var dic = new Dictionary + { + { "instanceId", jo.instanceId } + }; BasicDataRefDAL.SaveLogicInfo(BSNO, "钉钉审批", dic); } @@ -863,6 +870,10 @@ namespace DSWeb.Areas.MvcShipping.Helper type = callbackinfo.type; } + /// + /// 已不使用 改为在子类内各自实现 + /// + /// public DBResult ReadDingtalkInstanceinfo() { @@ -1444,8 +1455,10 @@ namespace DSWeb.Areas.MvcShipping.Helper public override DBResult DoDeal() { var result = new DBResult(); //根据processinstancid 读取审批实例信息 - var 返回结果Str = DingTalkHelper.DingTalk_Instanceinfo(callbackinfo.processInstanceId); + + var 返回结果Str = DingTalkHelper.DingTalk_Instanceinfo(callbackinfo.processInstanceId); + //解析返回结果 @@ -1469,7 +1482,208 @@ namespace DSWeb.Areas.MvcShipping.Helper public override DBResult DoDeal() { //return new DBResult(); - return callbackinfo.ReadDingtalkInstanceinfo(); + + if (callbackinfo.type == "finish") + { + + return ReadDingtalkInstanceinfo(callbackinfo.processInstanceId); + } + else { + return new DBResult(); + } + } + + public DBResult ReadDingtalkInstanceinfo(string processInstanceId) + { + + var result = new DBResult(); + + //var userid= + try + { + //如果是费用入账动作 且配置了钉钉审批入库 则调用 + result = DingTalkHelper.DingTalk_Instanceinfo(processInstanceId); + + DingTalkInstanceinfo di = DSWeb.MvcShipping.Helper.JsonConvert.Deserialize(result.Data.ToString()); + + //根据内容修改wms和wmsin值 + var cdc = new CommonDataContext(); + var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", processInstanceId); + if (lv != null && lv.ContainsKey("instanceId")) + { + var wmsno = lv["BSNO"]; + + var wmsold = new DSWeb.MvcShipping.Models.WMS.WMS_IN_OLD(wmsno); + var wms = wmsold.wms; + var wmslist = wmsold.wms_in; + //var wms = cdc.wms.FirstOrDefault(x => x.WMSNO == wmsno); + //var wmslist = new List(); + //if (wms != null) { + // wmslist = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wms.GID).ToList(); + //} + var updwmsinlist = new List(); + var newwmsinlist = new List(); + var 车辆信息 = new wms_in_md(); + foreach (var item in di.result.formComponentValues) + { + //从其中查找货物信息 并更新至当前 + if (item.name == "客户名称") + { + + //var cust=cdc.info_client.Where(x=>x.SHORTNAME==item.value || x.DESCRIPTION==item.value) + } + if (item.name == "入库日期") + { + wms.WMSDATE = Convert.ToDateTime(item.value); + } + if (item.name == "入库信息") + { + var 入库信息list = FormComponentValues.GetRowValues(item.value); + if (入库信息list != null) + { + foreach (var DingWmsin in 入库信息list) + { + var 提单号 = DingWmsin.getValue("提单号"); + var 箱号 = DingWmsin.getValue("箱号"); + if (wmslist.Exists(x => x.BLNO == 提单号 && x.CNTRNO == 箱号)) + { + + var updrec = wmslist.First(x => x.BLNO == 提单号 && x.CNTRNO == 箱号); + + //new DingTalkFormField("提单号", item.BLNO), + //new DingTalkFormField("箱号", item.CNTRNO), + //new DingTalkFormField("品名", item.GOODSNAME), + //new DingTalkFormField("重量", item.GOODSRKSL.ToString()), + //new DingTalkFormField("件数", item.GOODSPACK.ToString()), + //new DingTalkFormField("尺码", item.CHIMA1.ToString()), + //new DingTalkFormField("库位", item.CHIMA1.ToString()) + updrec.GOODSNAME = DingWmsin.getValue("品名"); + + if (wms.CHARGEUNIT == "吨" || wms.CHARGEUNIT == "千克") + { + updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量")); + updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量")); + + updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量")); + updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量")); + + updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码")); + updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码")); + } + + if (wms.CHARGEUNIT == "CBM") + { + updrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("尺码")); + updrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量")); + + updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量")); + updrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量")); + + updrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码")); + updrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码")); + } + updrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数")); + + updrec.AREANAME = DingWmsin.getValue("库位"); + updrec.DODATE = wms.WMSDATE; + updwmsinlist.Add(updrec); + } + else + { + var newrec = new wms_in_md(); + newrec.ASSOCIATEDNO = wms.GID; + newrec.GID = Guid.NewGuid().ToString(); + newrec.BLNO = DingWmsin.getValue("提单号"); + newrec.CNTRNO = DingWmsin.getValue("箱号"); + newrec.CLIENTNAME = wms.CUSTOMERNAME; + newrec.DODATE = wms.WMSDATE; + newrec.GOODSNAME = DingWmsin.getValue("品名"); + + if (wms.CHARGEUNIT == "吨" || wms.CHARGEUNIT == "千克") + { + newrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("重量")); + newrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量")); + + newrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量")); + newrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量")); + + newrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码")); + newrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码")); + } + + if (wms.CHARGEUNIT == "CBM") + { + newrec.GOODSRKSL = Convert.ToDecimal(DingWmsin.getValue("尺码")); + newrec.GOODSSTOCK = Convert.ToDecimal(DingWmsin.getValue("重量")); + + newrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量")); + newrec.SHIJIZHONGLIANG = Convert.ToDouble(DingWmsin.getValue("重量")); + + newrec.CHIMA1 = Convert.ToDouble(DingWmsin.getValue("尺码")); + newrec.SHIJICHIMA = Convert.ToDouble(DingWmsin.getValue("尺码")); + } + newrec.GOODSPACK = Convert.ToDecimal(DingWmsin.getValue("件数")); + newrec.AREANAME = DingWmsin.getValue("库位"); + newrec.CREATETIME = DateTime.Now; + newrec.CHARGEUNIT = wms.CHARGEUNIT; + newrec.CORPID = wms.CORPID; + newwmsinlist.Add(newrec); + } + } + } + } + + if (item.name == "车队信息") + { + var 车队信息list = FormComponentValues.GetRowValues(item.value); + if (车队信息list != null && 车队信息list.Count > 0) + { + var 车队name = 车队信息list[0].getValue("车队"); + var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); + if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "") + { + 车辆信息.CHEDUIID = 车队.GID; + 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); + } + } + + } + } + cdc.wms.AddOrUpdate(wms); + if (updwmsinlist != null && updwmsinlist.Count > 0) + { + foreach (var item in updwmsinlist) + { + item.CHEDUIID = 车辆信息.CHEDUIID; + item.TRUCKNO = 车辆信息.TRUCKNO; + cdc.wms_in.AddOrUpdate(item); + } + } + if (newwmsinlist != null && newwmsinlist.Count > 0) + { + foreach (var item in newwmsinlist) + { + item.CHEDUIID = 车辆信息.CHEDUIID; + item.TRUCKNO = 车辆信息.TRUCKNO; + cdc.wms_in.AddOrUpdate(item); + } + } + + wms.ISLOCK2 = false; + cdc.wms.AddOrUpdate(wms); + + cdc.SaveChanges(); + + //然后执行入库的费用入账原逻辑 + DSWeb.MvcShipping.DAL.WMSNewDAL.WMSNewDAL.DoWMSLOCK("'" + wmsno + "'"); + } + } + catch (Exception e) + { + result.SetErrorInfo(e.Message); + } + + return result; } } public class DingTalkProcess_诚锐出库 : DingTalkProcess @@ -1487,11 +1701,158 @@ namespace DSWeb.Areas.MvcShipping.Helper } - //public override DBResult DoDeal() - //{ - // //return new DBResult(); - // //return callbackinfo.ReadDingtalkInstanceinfo(); - //} + public override DBResult DoDeal() + { + //return new DBResult(); + if (callbackinfo.type == "finish") + { + + return ReadDingtalkInstanceinfo(callbackinfo.processInstanceId); + } + else + { + return new DBResult(); + } + } + + public DBResult ReadDingtalkInstanceinfo(string processInstanceId) + { + + var result = new DBResult(); + + //var userid= + try + { + + result = DingTalkHelper.DingTalk_Instanceinfo(processInstanceId); + + DingTalkInstanceinfo di = DSWeb.MvcShipping.Helper.JsonConvert.Deserialize(result.Data.ToString()); + + //根据内容修改wms_out_detail的值 + var cdc = new CommonDataContext(); + var lv = BasicDataRefDAL.GetLogicHaveValue("钉钉审批", "instanceId", processInstanceId); + if (lv != null && lv.ContainsKey("instanceId")) + { + var BSNO = lv["BSNO"]; + + var wmsold = new DSWeb.MvcShipping.Models.WMS.WMS_OUT_OLD(BSNO); + var wms_out = wmsold.wms_out; + var wms_out_detaillist = wmsold.wms_out_detail; + + List updwmslist = new List(); + + + var 车辆信息 = new wms_in_md(); + foreach (var item in di.result.formComponentValues) + { + //从其中查找货物信息 并更新至当前 + //if (item.name == "客户名称") + //{ + + // //var cust=cdc.info_client.Where(x=>x.SHORTNAME==item.value || x.DESCRIPTION==item.value) + //} + //if (item.name == "入库日期") + //{ + // wms.WMSDATE = Convert.ToDateTime(item.value); + //} + + + + if (item.name == "出库信息") + { + var 出库信息list = FormComponentValues.GetRowValues(item.value); + if (出库信息list != null) + { + foreach (var DingWmsin in 出库信息list) + { + var 提单号 = DingWmsin.getValue("提单号"); + var 箱号 = DingWmsin.getValue("箱号"); + var 品名 = DingWmsin.getValue("品名"); + if (wmsold.VW_WMS_OUT_DETAIL.Exists(x => x.BLNO == 提单号 && x.CNTRNO == 箱号 && x.GOODSNAME_OUT == 品名)) + { + var _outrec= wmsold.VW_WMS_OUT_DETAIL.First(x => x.BLNO == 提单号 && x.CNTRNO == 箱号 && x.GOODSNAME_OUT == 品名); + var updrec = wms_out_detaillist.First(x => x.GID== _outrec.GID_OUT); + + //new DingTalkFormField("提单号", item.BLNO), + //new DingTalkFormField("箱号", item.CNTRNO), + //new DingTalkFormField("品名", item.GOODSNAME), + //new DingTalkFormField("重量", item.GOODSRKSL.ToString()), + //new DingTalkFormField("件数", item.GOODSPACK.ToString()), + //new DingTalkFormField("尺码", item.CHIMA1.ToString()), + //new DingTalkFormField("库位", item.CHIMA1.ToString()) + updrec.GOODSNAME = DingWmsin.getValue("品名"); + + if (wms_out.CHARGEUNIT == "吨" || wms_out.CHARGEUNIT == "千克") + { + updrec.GOODSPFSL = Convert.ToDecimal(DingWmsin.getValue("重量")); + + updrec.GOODSKGS = Convert.ToDecimal(DingWmsin.getValue("重量")); + + } + + if (wms_out.CHARGEUNIT == "CBM") + { + updrec.GOODSPFSL = Convert.ToDecimal(DingWmsin.getValue("尺码")); + updrec.GOODSKGS =0; + + } + updrec.GOODSPACK = DingWmsin.getValue("件数"); + + //updrec.AREANAME = DingWmsin.getValue("库位"); + //updrec.DODATE = wms_out.DODATE; + updwmslist.Add(updrec); + } + else + { + + } + } + } + } + + if (item.name == "车队信息") + { + var 车队信息list = FormComponentValues.GetRowValues(item.value); + if (车队信息list != null && 车队信息list.Count > 0) + { + var 车队name = 车队信息list[0].getValue("车队"); + var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); + if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "") + { + 车辆信息.CHEDUIID = 车队.GID; + 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); + } + } + + } + } + //cdc.wms.AddOrUpdate(wms); + if (updwmslist != null && updwmslist.Count > 0) + { + foreach (var item in updwmslist) + { + //item.CHEDUIID = 车辆信息.CHEDUIID; + item.TRUCKNO = 车辆信息.TRUCKNO; + cdc.wms_out_detail.AddOrUpdate(item); + } + } + + cdc.SaveChanges(); + + //然后执行出库的费用入账原逻辑 + + var outtype = wms_out.IsDetail == "1" ? "StockOutDetail" : "StockOut"; + + DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL.WMSOUT_GuiGeDAL.DoSetislock(wms_out.GID, (bool)wms_out.EIP, outtype,wms_out.CREATEUSER); + } + } + catch (Exception e) + { + result.SetErrorInfo(e.Message); + } + + return result; + } } #endregion diff --git a/DSWeb/Areas/MvcShipping/Models/WMS/WMS.cs b/DSWeb/Areas/MvcShipping/Models/WMS/WMS.cs index 6bd997a6..ce05da57 100644 --- a/DSWeb/Areas/MvcShipping/Models/WMS/WMS.cs +++ b/DSWeb/Areas/MvcShipping/Models/WMS/WMS.cs @@ -3010,6 +3010,32 @@ namespace DSWeb.MvcShipping.Models.WMS } } + + public class WMS_OUT_OLD + { + public wms_out_md wms_out { get; set; } + public List wms_out_detail { get; set; } + public List VW_WMS_OUT_DETAIL { get; set; } + public WMS_OUT_OLD() { } + + public WMS_OUT_OLD(string bsno) + { + + var cdc = new CommonDataContext(); + + wms_out = cdc.wms_out.FirstOrDefault(x => x.BSNO == bsno); + + if (wms_out != null) + { + wms_out_detail = cdc.wms_out_detail.Where(x => x.OUTBSNO == wms_out.BSNO).ToList(); + var gids = wms_out_detail.Select(s => s.GID).ToList(); + VW_WMS_OUT_DETAIL = cdc.VW_WMS_OUT_DETAIL.Where(x => gids.Contains(x.GID_OUT)).ToList(); + } + + } + } + + #region 新的仓储数据结构 public class WMSIN_mb { } diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js index 986270a7..eaa5c251 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js @@ -696,7 +696,6 @@ Ext.extend(Shipping.WMSOUT_GuiGeIndex, Ext.Panel, { } else { this.outType = "StockOut"; DsOpenEditWin('/MvcShipping/WMSOUT_GuiGe/Edit', "货权转移-出库单"); - } } From be33cabfc1129580a88ef7053923ead440c2360d Mon Sep 17 00:00:00 2001 From: ddlucky Date: Sat, 28 Jan 2023 14:32:29 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E6=97=A7=E4=BB=93=E5=82=A8=EF=BC=8C?= =?UTF-8?q?=E5=87=BA=E5=BA=93=EF=BC=8C=E9=92=89=E9=92=89=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E3=80=82=E5=A6=82=E6=9E=9C=E5=B7=B2=E6=8F=90=E4=BA=A4=E5=88=99?= =?UTF-8?q?=E5=9C=A8=E5=87=BA=E5=BA=93=E4=B8=9A=E5=8A=A1=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E3=80=90=E9=92=89=E9=92=89=E5=AE=A1=E6=89=B9=E3=80=91?= =?UTF-8?q?=E5=88=97=E6=98=BE=E7=A4=BA=E2=80=9C=E5=B7=B2=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=92=89=E9=92=89=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs | 4 ++++ .../MvcShipping/Models/WMSOUT_GuiGe/WMSOUT_GuiGe.cs | 12 +++++++++++- .../Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js | 6 ++++++ .../Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeModel.js | 3 ++- 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs index 058ecc7d..b61aabe6 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs @@ -67,6 +67,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL + ",(SELECT distinct wi.PICIHAO+'/' FROM wms_in wi where wi.GID in (select inbsno from wms_out_detail where BSNO=wms_out.bsno) and ISNULL(wi.PICIHAO,'')<>'' FOR XML PATH(''))as PICIHAO " + " ,isnull(CNTRTOTAL,'')CNTRTOTAL_2 ,isnull(KGS_OUT,0)KGS_OUT_2 ,isnull(PKGS_OUT,0)PKGS_OUT_2 ,isnull(CBM_OUT,0)CBM_OUT_2 " + " , dbo.F_WMSOUTCOUNTRY_CN(BSNO) COUNTRYOFORIGIN_2 " + + " ,case when exists(select 1 from OP_LOGICINFO where bsno=wms_out.BSNO) then '已提交钉钉' else '' end DingTalkAudit " //2023-1-28 增加对钉钉审核的op_logicinfo数据的支持 如果存在OP_LOGICINFO.bsno=wms_out.bsno 则显示“已提交钉钉” + " from wms_out WITH(NOLOCK) where (ISDELETE=0 or ISDELETE is null)"); if (!string.IsNullOrEmpty(strCondition)) { @@ -259,6 +260,9 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL data.CBM_OUT = (reader["CBM_OUT"] == DBNull.Value ? 0 : Convert.ToDecimal(reader["CBM_OUT"]));//KGS_OUT if (BasicDataRefDAL.ReadFieldExist(reader, "COUNTRYOFORIGIN_2")) data.COUNTRYOFORIGIN = reader["COUNTRYOFORIGIN"].ToString(); + if (BasicDataRefDAL.ReadFieldExist(reader, "DingTalkAudit")) + data.DingTalkAudit = reader["DingTalkAudit"].ToString(); + #endregion headList.Add(data); } diff --git a/DSWeb/Areas/MvcShipping/Models/WMSOUT_GuiGe/WMSOUT_GuiGe.cs b/DSWeb/Areas/MvcShipping/Models/WMSOUT_GuiGe/WMSOUT_GuiGe.cs index 63f521f2..1ddc54dc 100644 --- a/DSWeb/Areas/MvcShipping/Models/WMSOUT_GuiGe/WMSOUT_GuiGe.cs +++ b/DSWeb/Areas/MvcShipping/Models/WMSOUT_GuiGe/WMSOUT_GuiGe.cs @@ -876,7 +876,17 @@ namespace DSWeb.MvcShipping.Models.WMSOUT_GuiGe set { _countryoforigin = value; } } - + /// + /// 钉钉审批状态 + /// + /// + private string _DingTalkAudit; + public string DingTalkAudit + { + get { return _DingTalkAudit; } + set { _DingTalkAudit = value; } + } + #endregion public WMSOUT_GuiGe() diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js index eaa5c251..d73da3fb 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeIndex.js @@ -489,6 +489,12 @@ Ext.extend(Shipping.WMSOUT_GuiGeIndex, Ext.Panel, { header: '原产国', width: 120 }, + { + sortable: true, + dataIndex: 'DingTalkAudit', + header: '钉钉审批', + width: 120 + }, { sortable: true, dataIndex: 'STORAGENAME', diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeModel.js b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeModel.js index 7b01706d..fa3d6060 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeModel.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/WMSOUT_GuiGe/WMSOUT_GuiGeModel.js @@ -83,7 +83,8 @@ , { name: 'KGS_OUT', type: 'string' } //重量 , { name: 'PKGS_OUT', type: 'string' } //件数 , { name: 'CBM_OUT', type: 'string' } //尺码 - , { name: 'COUNTRYOFORIGIN', type: 'string' } //原产国 + , { name: 'COUNTRYOFORIGIN', type: 'string' } //原产国 + , { name: 'DingTalkAudit', type: 'string' } //钉钉审批 ] }); From 5f28226bee1128a9504bb345d86a9e370de8229c Mon Sep 17 00:00:00 2001 From: ddlucky Date: Sun, 29 Jan 2023 15:33:06 +0800 Subject: [PATCH 09/16] 20230129-2 --- DSWeb.Service.Output/JobFanWeiToDS7.cs | 2 +- .../Chfee_PayapplicationDAL.cs | 2 ++ .../DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs | 2 +- .../Areas/MvcShipping/Helper/DingTalkHelper.cs | 18 +++++++++++------- DSWeb/EntityDA/cookies.cs | 3 ++- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/DSWeb.Service.Output/JobFanWeiToDS7.cs b/DSWeb.Service.Output/JobFanWeiToDS7.cs index d12ceecc..00b3683b 100644 --- a/DSWeb.Service.Output/JobFanWeiToDS7.cs +++ b/DSWeb.Service.Output/JobFanWeiToDS7.cs @@ -125,7 +125,7 @@ namespace DSWeb.Service.Output { "requestid",Audititem.requestid.ToString()}, { "userid",userid} }; - + log.Debug("url=" + DS7URL+";dic="+JsonConvert.SerializeObject(dic)); string rtn = WebRequestHelper.DoPost(DS7URL, dic, 12000); log.Debug("rtn=" + rtn); diff --git a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs index 40779858..86c51149 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs @@ -3137,6 +3137,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication result.Success = false; result.Message = "审核出现错误,请重试或联系系统管理员"+e.Message; + BasicDataRefDAL.SaveLog(result.Message, "", "付费申请审核", "错误"); + return result; } diff --git a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs index b61aabe6..28297698 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs @@ -1914,7 +1914,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL strSql.Append(" ,ol.PROPVALUE"); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); strSql.Append(" left join OP_LOGICINFO ol on ol.BSNO=o.bsno "); - strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); + strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); //var 需要发送给钉钉出库审核流程的业务编号List = new List(); diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index 17fe163e..50dc212a 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -392,12 +392,14 @@ namespace DSWeb.Areas.MvcShipping.Helper public bool cansend(string GID) { //看是否已发过 - var logiclog = BasicDataRefDAL.GetLogicInfo(GID, "钉钉审批"); + //var logiclog = BasicDataRefDAL.GetLogicInfo(GID, "钉钉审批"); - if (logiclog.Count > 0) - { - return false; - } + //if (logiclog.Count > 0) + //{ + // return false; + //} + + //20230129 改为任何时候都可以发 但是重发的话会覆盖op_logicinfo.propvalue中已存在的instanceid return true; } @@ -422,8 +424,10 @@ namespace DSWeb.Areas.MvcShipping.Helper jo = (DingTalk_SendAuditResult)JsonToObject(result.Data.ToString(), jo); - var dic = new Dictionary(); - dic.Add("instanceId", jo.instanceId); + var dic = new Dictionary + { + { "instanceId", jo.instanceId } + }; BasicDataRefDAL.SaveLogicInfo(BSNO, "钉钉审批", dic); }catch(Exception ex) diff --git a/DSWeb/EntityDA/cookies.cs b/DSWeb/EntityDA/cookies.cs index 2b54d575..9f35c17f 100644 --- a/DSWeb/EntityDA/cookies.cs +++ b/DSWeb/EntityDA/cookies.cs @@ -52,9 +52,10 @@ namespace DSWeb.EntityDA //读取 public string getCookie(string strName) { - HttpCookie Cookie= new HttpCookie(strName); + try { + HttpCookie Cookie = new HttpCookie(strName); Cookie.Value = System.Web.HttpContext.Current.Request.Cookies[strName].Value.ToString(); if (Cookie != null) { From 67a7f137c83b41bda4152cea29a3bdd6b4c94423 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Sun, 29 Jan 2023 15:35:35 +0800 Subject: [PATCH 10/16] 20230129-3 --- DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs index 28297698..0d8390c7 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs @@ -1992,7 +1992,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL strSql.Append(" o.TRUCKNAME as TRUCKNAME_OUT,isnull(d.GOODSOUTFEEAP,0) AS GOODSOUTFEEAP_OUT,"); strSql.Append(" isnull(d.ARFEE,0) AS ARFEE_OUT,isnull(d.ARFEE_2,0) AS ARFEE_2_OUT,d.GID OUTDEGID"); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); - strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); + strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) { From ff878d2261758e6f96d0aaff7746bcf3690a5854 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 30 Jan 2023 09:19:07 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=AF=9A=E9=94=90=E9=92=89=E9=92=89?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=EF=BC=8C=E5=85=A5=E5=BA=93=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=BD=A6=E8=BE=86=E4=BF=A1=E6=81=AF=E5=88=97?= =?UTF-8?q?=E8=A1=A8=EF=BC=8C=E5=9C=A8=E5=85=A5=E5=BA=93=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8A=A0=E8=BD=A6=E9=98=9F=E5=92=8C=E8=BD=A6=E7=89=8C=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommMng/Controllers/WorkFlowController.cs | 9 ++- .../DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs | 54 +++++++++------ .../MvcShipping/Helper/DingTalkHelper.cs | 69 ++++++++++++------- 3 files changed, 85 insertions(+), 47 deletions(-) diff --git a/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs b/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs index c678e8a1..f1371844 100644 --- a/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs +++ b/DSWeb/Areas/CommMng/Controllers/WorkFlowController.cs @@ -326,6 +326,7 @@ namespace DSWeb.Areas.CommMng.Controllers public string Test_DingdingCallback(string text) { var result = ""; + try { var _r = new DBResult(); var appname = MsSysParamSetDAL.GetSysParamValue("DingTalkAppName"); @@ -371,8 +372,14 @@ namespace DSWeb.Areas.CommMng.Controllers var data = Newtonsoft.Json.JsonConvert.SerializeObject(_r); + return data; + } + catch(Exception ex) + { - return data; + return ex.Message; + } + } public class CallBackInfo diff --git a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs index 0d8390c7..a9ddb1ff 100644 --- a/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs +++ b/DSWeb/Areas/MvcShipping/DAL/WMSOUT_GuiGe/WMSOUT_GuiGeDAL.cs @@ -23,6 +23,7 @@ using DSWeb.MvcShipping.DAL.WMSStock; using System.Configuration; using DSWeb.Areas.MvcShipping.Helper; using NPOI.HSSF.Record; +using Quartz.Util; namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL { @@ -1898,6 +1899,8 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL Database db = DatabaseFactory.CreateDatabase(); + gids = "'" + gids.Trim().Replace(",", "','") + "'"; + //20230128 改为 if (ConfigurationManager.AppSettings["DingTalkAuditWMSIN"] == "true") {//向钉钉发送出库审批流程 @@ -1914,41 +1917,52 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL strSql.Append(" ,ol.PROPVALUE"); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); strSql.Append(" left join OP_LOGICINFO ol on ol.BSNO=o.bsno "); - strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); + strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); //var 需要发送给钉钉出库审核流程的业务编号List = new List(); + var outbsnodic = new Dictionary(); using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) { while (reader.Read()) { var outbsno = Convert.ToString(reader["OUTNO"]); - var instanceId = Convert.ToString(reader["PROPVALUE"]); - - if (!string.IsNullOrWhiteSpace(instanceId)) continue; - var _r = DingTalkHelper.Send_WMSOUT(strUserID, outbsno); - if (!_r.Success) + if(!outbsnodic.ContainsKey(outbsno)) { - _r0.SetErrorInfo(_r.Message); + var instanceId = Convert.ToString(reader["PROPVALUE"]); + outbsnodic.Add(outbsno, instanceId); } + } + } - //仅用于测试解析读取钉钉审批实例内容 - //result = TestReadDingtalkInstanceinfo(); - if (!_r0.Success) - { - result.Success = false; - result.Message = "发送钉钉审批失败:" + _r0.Message; - return result; - } - else - { - //增加一条钉钉审批记录 - } + foreach(var item in outbsnodic) + { + + //if (!string.IsNullOrWhiteSpace(item.Value)) continue; + + var _r = DingTalkHelper.Send_WMSOUT(strUserID, item.Key); + if (!_r.Success) + { + _r0.SetErrorInfo(_r.Message); + } + + //仅用于测试解析读取钉钉审批实例内容 + //result = TestReadDingtalkInstanceinfo(); + if (!_r0.Success) + { + result.Success = false; + result.Message = "发送钉钉审批失败:" + _r0.Message; + return result; } + else + { + //增加一条钉钉审批记录 + } } + result.SetErrorInfo("钉钉提交成功"); return result; } else { @@ -1992,7 +2006,7 @@ namespace DSWeb.MvcShipping.DAL.WMSOUT_GuiGeDAL strSql.Append(" o.TRUCKNAME as TRUCKNAME_OUT,isnull(d.GOODSOUTFEEAP,0) AS GOODSOUTFEEAP_OUT,"); strSql.Append(" isnull(d.ARFEE,0) AS ARFEE_OUT,isnull(d.ARFEE_2,0) AS ARFEE_2_OUT,d.GID OUTDEGID"); strSql.Append(" from wms_out o inner join wms_out_detail d on o.bsno = d.outbsno "); - strSql.Append(" where o.gid in ('" + gids + "') and o.ISLOCK=0"); + strSql.Append(" where o.gid in (" + gids + ") and o.ISLOCK=0"); using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString())) { diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index 50dc212a..1152ff50 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -509,6 +509,7 @@ namespace DSWeb.Areas.MvcShipping.Helper foreach (var item in wmsinList) { + var 车队 = 车队list.First(x => x.GID == item.CHEDUIID).SHORTNAME; var newrk = new List { new DingTalkFormField("提单号", item.BLNO), @@ -517,7 +518,9 @@ namespace DSWeb.Areas.MvcShipping.Helper new DingTalkFormField("重量", item.GOODSRKSL.ToString()), new DingTalkFormField("件数", item.GOODSPACK.ToString()), new DingTalkFormField("尺码", item.CHIMA1.ToString()), - new DingTalkFormField("库位", item.AREANAME.ToString()) + new DingTalkFormField("库位", item.AREANAME.ToString()), + new DingTalkFormField("车队", 车队), + new DingTalkFormField("车牌号", item.TRUCKNO.ToString()) }; 入库信息list.Add(newrk); @@ -545,7 +548,9 @@ namespace DSWeb.Areas.MvcShipping.Helper var 入库信息 = new DingTalkFormField("入库信息", JsonConvert.SerializeObject(入库信息list)); - var 车队信息 = new DingTalkFormField("车队信息", JsonConvert.SerializeObject(车队信息list)); + + //20230130 取消入库审核的车队信息 + //var 车队信息 = new DingTalkFormField("车队信息", JsonConvert.SerializeObject(车队信息list)); body.formComponentValues = new List { @@ -553,8 +558,7 @@ namespace DSWeb.Areas.MvcShipping.Helper //增加字段内容 new DingTalkFormField("客户名称", wms.CUSTOMERNAME), new DingTalkFormField("入库日期", ((DateTime)wms.WMSDATE).ToString("yyyy-MM-dd")), - 入库信息, - 车队信息 + 入库信息 }; jsonObj = body; @@ -1590,6 +1594,16 @@ namespace DSWeb.Areas.MvcShipping.Helper updrec.AREANAME = DingWmsin.getValue("库位"); updrec.DODATE = wms.WMSDATE; + + //if(string.IsNullOrWhiteSpace(DingWmsin.getValue("车牌号"))) + updrec.TRUCKNO = DingWmsin.getValue("车牌号"); + + var 车队name= DingWmsin.getValue("车队"); + var 车队infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); + + if(车队infoclient!=null && string.IsNullOrWhiteSpace( 车队infoclient.SHORTNAME)) + updrec.CHEDUIID = 车队infoclient.SHORTNAME; + updwmsinlist.Add(updrec); } else @@ -1631,27 +1645,36 @@ namespace DSWeb.Areas.MvcShipping.Helper newrec.CREATETIME = DateTime.Now; newrec.CHARGEUNIT = wms.CHARGEUNIT; newrec.CORPID = wms.CORPID; + + newrec.TRUCKNO = DingWmsin.getValue("车牌号"); + + var 车队name = DingWmsin.getValue("车队"); + var 车队infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); + + if (车队infoclient != null && string.IsNullOrWhiteSpace(车队infoclient.SHORTNAME)) + newrec.CHEDUIID = 车队infoclient.SHORTNAME; + newwmsinlist.Add(newrec); } } } } - if (item.name == "车队信息") - { - var 车队信息list = FormComponentValues.GetRowValues(item.value); - if (车队信息list != null && 车队信息list.Count > 0) - { - var 车队name = 车队信息list[0].getValue("车队"); - var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); - if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "") - { - 车辆信息.CHEDUIID = 车队.GID; - 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); - } - } + //if (item.name == "车队信息") + //{ + // var 车队信息list = FormComponentValues.GetRowValues(item.value); + // if (车队信息list != null && 车队信息list.Count > 0) + // { + // var 车队name = 车队信息list[0].getValue("车队"); + // var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); + // if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "") + // { + // 车辆信息.CHEDUIID = 车队.GID; + // 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); + // } + // } - } + //} } cdc.wms.AddOrUpdate(wms); if (updwmsinlist != null && updwmsinlist.Count > 0) @@ -1814,18 +1837,12 @@ namespace DSWeb.Areas.MvcShipping.Helper } } - if (item.name == "车队信息") + if (item.name == "车辆信息") { var 车队信息list = FormComponentValues.GetRowValues(item.value); if (车队信息list != null && 车队信息list.Count > 0) { - var 车队name = 车队信息list[0].getValue("车队"); - var 车队 = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); - if (车队 != null && 车队.SHORTNAME != null && 车队.SHORTNAME != "") - { - 车辆信息.CHEDUIID = 车队.GID; - 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); - } + 车辆信息.TRUCKNO = 车队信息list[0].getValue("车牌号"); } } From fe168e3196f8a52094ad0362d20c1c4b11f295c9 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 30 Jan 2023 13:21:41 +0800 Subject: [PATCH 12/16] =?UTF-8?q?DS7=E5=90=88=E8=A7=84=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E7=9A=84=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E7=A8=8D=E4=BD=9C=E4=BF=AE=E6=94=B9=EF=BC=9B=E8=AF=9A=E9=94=90?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E6=B5=81=E7=A8=8B=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs | 16 +++++++------- .../MvcShipping/Helper/DingTalkHelper.cs | 6 +++++- .../Viewsjs/MsOpSeae/MsOpSeaeEdit.js | 21 +++++++++++++++++-- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index 14244316..3a3fe365 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -6395,10 +6395,11 @@ namespace DSWeb.Areas.CommMng.DAL var ruleresult = JsonConvert.Deserialize(rtn); - var msg = ""; - foreach (var detail in ruleresult.extra.detailList) { - msg += detail.resultName+"\r\n"; - } + //var msg = ""; + //foreach (var detail in ruleresult.extra.detailList) { + // msg += detail.resultName+"\r\n"; + //} + result.Data = ruleresult; result.OK("校验完成"); return result; @@ -6622,7 +6623,8 @@ namespace DSWeb.Areas.CommMng.DAL if (!string.IsNullOrWhiteSpace(head.PORTDISCHARGEID)) { - bi.portDischargeCountryNo = head.PORTDISCHARGEID.Substring(0, 2); + if (head.PORTDISCHARGEID.Length >= 2) + bi.portDischargeCountryNo = head.PORTDISCHARGEID.Substring(0, 2); var dischargecountry = cdc.code_country.FirstOrDefault(x => x.COUNTRYID == bi.portDischargeCountryNo); if (dischargecountry != null) { @@ -6634,8 +6636,8 @@ namespace DSWeb.Areas.CommMng.DAL if (!string.IsNullOrWhiteSpace(head.TRANSPORT)) { - - bi.transportCountryNo = head.TRANSPORT.Substring(0, 2); + if(head.TRANSPORT.Length>=2) + bi.transportCountryNo = head.TRANSPORT.Substring(0, 2); var transportcountry = cdc.code_country.FirstOrDefault(x => x.COUNTRYID == bi.transportCountryNo); if (transportcountry != null) diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index 1152ff50..fe1d9154 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -509,7 +509,11 @@ namespace DSWeb.Areas.MvcShipping.Helper foreach (var item in wmsinList) { - var 车队 = 车队list.First(x => x.GID == item.CHEDUIID).SHORTNAME; + var 车队 = ""; + + if(!string.IsNullOrWhiteSpace(item.CHEDUIID)) + 车队 = 车队list.First(x => x.GID == item.CHEDUIID).SHORTNAME; + var newrk = new List { new DingTalkFormField("提单号", item.BLNO), diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index f1143c01..52999089 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -19787,8 +19787,25 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var grid = Ext.create('Ext.grid.Panel', { store: store, columns: [ - //{ text: "校验提醒", flex: 1, dataIndex: 'errorType', sortable: true }, - { text: "校验内容", flex: 1, dataIndex: 'resultName', sortable: true } + { + text: " ", flex: 1, dataIndex: 'errorType', sortable: true, + renderer: function (value, cellmeta) { + if (value == "Error" ) { + return ""; + } + if (value == "Warning") { + return ""; + } + + } + }, + { + text: "校验内容", flex: 11, dataIndex: 'resultName', sortable: true, + renderer: function (value, meta, record) { + meta.style = 'overflow:auto;padding: 1px 6px;text-overflow: ellipsis;white-space: nowrap;white-space:normal;line-height:20px;'; + return value; + } + } ], forceFit: true, split: true, From ae64419adbe0e3f0368584e14786c335220e2953 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 30 Jan 2023 14:05:54 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E5=90=88=E8=A7=84=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=9A=E6=AF=8F=E8=A1=8C=E5=89=8D=E6=96=B9=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=B0=B4=E5=B9=B3=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index 52999089..b8daa380 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -19786,17 +19786,24 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { var grid = Ext.create('Ext.grid.Panel', { store: store, + viewConfig: { + enableTextSelection: true, //允许复制数据 + }, columns: [ { - text: " ", flex: 1, dataIndex: 'errorType', sortable: true, + text: " ", + flex: 1, + dataIndex: 'errorType', + sortable: true, + align: 'center', renderer: function (value, cellmeta) { + if (value == "Error" ) { - return ""; + return ""; } if (value == "Warning") { - return ""; + return ""; } - } }, { From ead2707c07888c29227c8d62b664830f1a125045 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 30 Jan 2023 16:16:31 +0800 Subject: [PATCH 14/16] =?UTF-8?q?grid=E5=8D=95=E5=85=83=E6=A0=BC=E5=8F=AF?= =?UTF-8?q?=E5=9E=82=E7=9B=B4=E5=B1=85=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Viewsjs/MsOpSeae/MsOpSeaeEdit.js | 42 +++++++++++++++---- DSWeb/TruckMng/Content/Comm.css | 8 +++- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js index b8daa380..958c9943 100644 --- a/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js +++ b/DSWeb/Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js @@ -19774,17 +19774,19 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { if (checkresult.length > 0) { - var store = Ext.data.Store({ + var store = Ext.create('Ext.data.Store', { + autoLoad: true, fields: [{ name: 'errorType', type: "string" }, { name: 'resultName', type: "string" }], - data: this.ruleCheckNameArr_2, - autoLoad: true + data: [] }); - var grid = Ext.create('Ext.grid.Panel', { + + var rulegrid = Ext.create('Ext.grid.Panel', { + id:"RuleResultGrid", store: store, viewConfig: { enableTextSelection: true, //允许复制数据 @@ -19796,8 +19798,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { dataIndex: 'errorType', sortable: true, align: 'center', - renderer: function (value, cellmeta) { - + renderer: function (value, meta, record) { + meta.tdCls = 'middle'; if (value == "Error" ) { return ""; } @@ -19833,7 +19835,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { modal: 'true', buttonAlign: "center", bodyStyle: "padding:0 0 0 0", - items: [grid], + items: [rulegrid], buttons: [{ text: Zi.LAN.GuanBi, //"关闭", minWidth: 70, @@ -19843,6 +19845,32 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, { }] }); + + + //function setTdCls() { + // var gridJglb = document.getElementById("RuleResultGrid"); + // var tables = gridJglb.getElementsByTagName("table");//找到每个表格 + // for (var k = 0; k < tables.length; k++) { + // var tableV = tables[k]; + // if (tableV.className == "x-grid3-row-table") { + // var trs = tables[k].getElementsByTagName("tr");//找到每个tr + // for (var i = 0; i < trs.length; i++) { + // var tds = trs[i].getElementsByTagName("td");//找到每个TD + // for (var j = 1; j < tds.length; j++) { + // tds[j].style.cssText = "202px;text-align:center;line-height:130px;vertical-align:center;"; + // } + // } + // }; + // } + //} + //Ext.getCmp("RuleResultGrid").getStore().on('load', setTdCls);//设置表格加载数据完毕后,更改表格TD样式为垂直居中 + //rulegrid.getStore().on('load', setTdCls ); + + + store.loadData(this.ruleCheckNameArr_2); + //var gridJglb = Ext.getCmp("RuleResultGrid"); + //setTdCls(); + this.winCheckRuleListShow.show(); } else { diff --git a/DSWeb/TruckMng/Content/Comm.css b/DSWeb/TruckMng/Content/Comm.css index 3f62f606..730cdbf0 100644 --- a/DSWeb/TruckMng/Content/Comm.css +++ b/DSWeb/TruckMng/Content/Comm.css @@ -284,4 +284,10 @@ /*货权转移Owenr Ship Tuansfer*/ background-color: #F86868; } -/*End*/ \ No newline at end of file +/*End*/ + + +/*grid单元格内容垂直居中*/ +.x-grid-cell.middle { + vertical-align: middle; +} \ No newline at end of file From 7a415fbcfa7cf8b103e0747eb98d4184bc6f1625 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 30 Jan 2023 17:07:52 +0800 Subject: [PATCH 15/16] 20230130-2 --- DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs | 8 ++++++-- DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs | 16 ++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs index 3a3fe365..50983c11 100644 --- a/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/BasicDataRefDAL.cs @@ -44,7 +44,7 @@ using DSWeb.MvcShipping.Models.MsOpSeae; using DSWeb.MvcShipping.DAL.MsOpSeaeDAL; using Aspose.Cells.Drawing; using DSWeb.MvcShipping.Models.MsOp_BLISSUE; - +using System.Data.Entity.Migrations; namespace DSWeb.Areas.CommMng.DAL { @@ -4925,7 +4925,11 @@ namespace DSWeb.Areas.CommMng.DAL if (infoList != null && infoList.Count > 0) { - infoList[0].PROPVALUE = DicToStr(InfoDic); + + var updrec = infoList[0]; + updrec.PROPVALUE = DicToStr(InfoDic); + cdc.OP_LOGICINFO.AddOrUpdate(updrec); + cdc.SaveChanges(); } else { diff --git a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs index fe1d9154..af5ced47 100644 --- a/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs +++ b/DSWeb/Areas/MvcShipping/Helper/DingTalkHelper.cs @@ -509,11 +509,16 @@ namespace DSWeb.Areas.MvcShipping.Helper foreach (var item in wmsinList) { - var 车队 = ""; + var 车队 = "无"; if(!string.IsNullOrWhiteSpace(item.CHEDUIID)) 车队 = 车队list.First(x => x.GID == item.CHEDUIID).SHORTNAME; + var 车牌号 = "无"; + if (!string.IsNullOrWhiteSpace(item.TRUCKNO)) + 车牌号 = item.TRUCKNO; + + var newrk = new List { new DingTalkFormField("提单号", item.BLNO), @@ -524,7 +529,7 @@ namespace DSWeb.Areas.MvcShipping.Helper new DingTalkFormField("尺码", item.CHIMA1.ToString()), new DingTalkFormField("库位", item.AREANAME.ToString()), new DingTalkFormField("车队", 车队), - new DingTalkFormField("车牌号", item.TRUCKNO.ToString()) + new DingTalkFormField("车牌号", 车牌号) }; 入库信息list.Add(newrk); @@ -1605,8 +1610,8 @@ namespace DSWeb.Areas.MvcShipping.Helper var 车队name= DingWmsin.getValue("车队"); var 车队infoclient = cdc.info_client.FirstOrDefault(x => x.SHORTNAME == 车队name); - if(车队infoclient!=null && string.IsNullOrWhiteSpace( 车队infoclient.SHORTNAME)) - updrec.CHEDUIID = 车队infoclient.SHORTNAME; + if(车队infoclient!=null && !string.IsNullOrWhiteSpace( 车队infoclient.SHORTNAME)) + updrec.CHEDUIID = 车队infoclient.GID; updwmsinlist.Add(updrec); } @@ -1685,8 +1690,7 @@ namespace DSWeb.Areas.MvcShipping.Helper { foreach (var item in updwmsinlist) { - item.CHEDUIID = 车辆信息.CHEDUIID; - item.TRUCKNO = 车辆信息.TRUCKNO; + cdc.wms_in.AddOrUpdate(item); } } From 628d9982f465532fbc04393c2e286f1f42c20af3 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Tue, 31 Jan 2023 10:20:45 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E8=8D=A3=E5=9C=A3=E8=BE=BE=E6=B3=9B?= =?UTF-8?q?=E5=BE=AEOA=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AF=B9=E9=99=84=E4=BB=B6=E7=9A=84=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Chfee_PayapplicationDAL.cs | 30 +++++++++ DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs | 61 ++++++++++++++++++- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs index 86c51149..89efb5a8 100644 --- a/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs +++ b/DSWeb/Areas/Account/DAL/Chfee_payapplication/Chfee_PayapplicationDAL.cs @@ -2372,6 +2372,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication { var result = new DBResult(); + T_ALL_DA T_ALL_DA = new T_ALL_DA(); Database db = DatabaseFactory.CreateDatabase(); using (var conn = db.CreateConnection()) @@ -2412,7 +2413,36 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication Resultmb WorkResult = WorkFlowDAL.WorkFlowStart(WorkFlowName, bill, USERID,bill, bill,"", WorkFlowid); + #region 测试逻辑 + /* + if (true) + { + if (ConfigurationManager.AppSettings["FanWeiOAAPI"] == "true") + { + var _r = FanWeiOA_Submit(headdata, USERID, usercode, companyid); + + if (!_r.Success) + { + tran.Rollback(); + result.Success = false; + result.Message = $"提交审核错误[{_r.Message}],请重试或联系系统管理员"; + + return result; + } + else + { + var requestid = _r.Data.ToString(); + var cmdupdate = db.GetSqlStringCommand("update ch_fee_payapplication set PAYAPPID='" + requestid + "' where BILLNO=@BILLNO"); + cmdupdate.Parameters.Clear(); + db.AddInParameter(cmdupdate, "@BILLNO", DbType.String, bill); + db.ExecuteNonQuery(cmdupdate, tran); + } + } + } + return result; + */ + #endregion if (WorkResult.Success == true) { diff --git a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs index 8e0a969a..66ae0127 100644 --- a/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs +++ b/DSWeb/Areas/CommMng/DAL/PublicAPIDAL.cs @@ -63,6 +63,9 @@ using System.ServiceModel.Configuration; using java.util; using DSWeb.Areas.Account.Models.Chfee_Payapplication; using DSWeb.MvcShipping.DAL.MsSysThirdPartyAccount; +using DSWeb.Areas.Account.Models.Chfee_payapplication; +using DSWeb.Areas.Account.DAL.Chfee_payapplication; + namespace DSWeb.Areas.CommMng.DAL { @@ -1044,7 +1047,41 @@ namespace DSWeb.Areas.CommMng.DAL public string token { get; set; } } + public class fj { + public string filePath { get; set; } + public string fileName { get; set; } + + public fj() { } + + public fj(ChfeeFile chfeefile) { + + //系统参数 + var paramset = MsSysParamSetDAL.GetDataByName("DS7URL"); + if (!string.IsNullOrWhiteSpace(chfeefile.File_Path) && chfeefile.File_Path.IndexOf("\\Areas\\") >= 0) { + var oldfilePath = chfeefile.File_Path.Substring(chfeefile.File_Path.IndexOf("\\Areas\\"), chfeefile.File_Path.Length - chfeefile.File_Path.IndexOf("\\Areas\\")).Replace("\\","/"); + filePath = (paramset.PARAMVALUE + "/" + oldfilePath).Replace("//Areas", "/Areas"); + filePath = filePath.Replace("//Areas", "/Areas"); + fileName = chfeefile.File_Name; + } + + + } + + } + + public static List GetFileList(string billno) { + var filelist= ChfeeFileDal.GetFileList(billno); + + var result=new List(); + + if (filelist != null && filelist.Count > 0) { + foreach (var item in filelist) { + result.Add(new fj(item)); + } + } + return result; + } public class Field { public string fieldName { get; set; } @@ -1064,8 +1101,16 @@ namespace DSWeb.Areas.CommMng.DAL } } - public class FileField : Field { - public List fieldValue { get; set; } + public class FileField { + + public string fieldName { get; set; } + public List fieldValue { get; set; } + + public FileField(string _fieldname, List _fieldvalue) + { + fieldName = _fieldname; + fieldValue = _fieldvalue; + } } public static ArrayList GetMainData(ChPayapplication headdata, string userid,int deptid, view_xdf_md fkdx) { @@ -1103,10 +1148,19 @@ namespace DSWeb.Areas.CommMng.DAL result.add(new Field("jehjdxmj", Math.Round(headdata.AMOUNTUSD,2)));//金额合计大写美金 //result.add(new Field("jehjmjdx", BasicDataRefDAL.ConvertToChineseMoney2((double)headdata.AMOUNTUSD))); + //附件fj字段的值: [{ "filePath":"上传的附件地址或者base64","fileName":"附件名称(包含附件类型)"}] + + var fjlist = GetFileList(headdata.BILLNO); + //var fjliststr = JsonConvert.Serialize(fjlist); + + result.add(new FileField("fj", fjlist));//金额合计大写美金 + var bsnolist = cdc.ch_fee_do.Where(x=>x.BILLNO ==headdata.BILLNO).Select(s=>s.BSNO).Distinct().ToList(); var vopbsMblnoList = cdc.v_op_bs.Where(x => bsnolist.Contains(x.BSNO)).Select(s => s.MBLNO).Distinct().ToList(); + + var bodymblnostr = ""; if (vopbsMblnoList != null && vopbsMblnoList.Count > 0) { bodymblnostr = string.Join(" , ", vopbsMblnoList); @@ -1230,8 +1284,9 @@ namespace DSWeb.Areas.CommMng.DAL var FanWeidc = new OtherDB(fanweiconnstr); var oaname = _user.SHOWNAME.Trim().Replace(" ", ""); - + var fwuser = FanWeidc.view_hrmresource.Where(x => x.lastname == oaname).ToList(); + //var fwuser = FanWeidc.view_hrmresource.Where(x => x.lastname == "宫喜芬").ToList(); if (fwuser == null || fwuser.Count <= 0) {