diff --git a/Vue.Net/VOL.WMS/IServices/WMS/IOP_WMS_COMMONService.cs b/Vue.Net/VOL.WMS/IServices/WMS/IOP_WMS_COMMONService.cs new file mode 100644 index 00000000..20d00042 --- /dev/null +++ b/Vue.Net/VOL.WMS/IServices/WMS/IOP_WMS_COMMONService.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace VOL.WMS.IServices.WMS +{ + public interface IOP_WMS_COMMONService + { + } +} diff --git a/Vue.Net/VOL.WMS/Services/WMS/OP_WMS_COMMONService.cs b/Vue.Net/VOL.WMS/Services/WMS/OP_WMS_COMMONService.cs new file mode 100644 index 00000000..042c01da --- /dev/null +++ b/Vue.Net/VOL.WMS/Services/WMS/OP_WMS_COMMONService.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using VOL.Core.Utilities; +using VOL.Entity.DomainModels; +using VOL.WMS.IServices.WMS; +using VOL.WMS.Repositories; + +namespace VOL.WMS.Services.WMS +{ + public class OP_WMS_COMMONService : IOP_WMS_COMMONService + { + /// + /// 取消业务相关逻辑检测 + /// + /// 业务Id + /// 变动类型 + /// + public WebResponseContent MoveCancelCheck(string WMSDOID, string CHANGETYPE) + { + var result = new WebResponseContent(); + //库存变动明细 + var wmsChanges = Op_Wms_ChangeRepository.Instance + .FindAsIQueryable(x => x.DOBSNO == WMSDOID && x.CHANGETYPE == CHANGETYPE).ToList(); + //新库存 + var wmsList = OP_WMSRepository.Instance + .FindAsIQueryable(x => wmsChanges.Select(s => s.WMSID).Contains(x.WMSID)).ToList(); + //库存id列表 + var wmsIdList = wmsList.Select(s => s.WMSID).ToList(); + + if (Op_Wms_ChangeRepository.Instance + .FindAsIQueryable(x => wmsIdList.Contains(x.WMSID) && x.CHANGETYPE != CHANGETYPE).Any()) + { + return result.Error(CHANGETYPE + "之后进行过其他操作不能直接取消!"); + } + + if (OP_WMS_OUT_PLAN_DETAILRepository.Instance + .FindAsIQueryable(x => wmsIdList.Contains((Guid)x.WMSID)).Any()) + { + return result.Error(CHANGETYPE + "之后的货物已被出库计划引用,不能直接取消!"); + } + + if (CHANGETYPE == WMSCHANGTYPE.移库_移入) + { + if (OP_WMS_TRANSFERGOODS_DETAILRepository.Instance + .FindAsIQueryable(x => wmsIdList.Contains((Guid)x.WMSID)).Any()) + { + return result.Error(CHANGETYPE + "之后的货物已被货权转移业务引用,不能直接取消!"); + } + } + + return result.OK(); + } + } +} \ No newline at end of file diff --git a/Vue.Net/VOL.WebApi/appsettings.json b/Vue.Net/VOL.WebApi/appsettings.json index 0ecd4a6f..49c7c153 100644 --- a/Vue.Net/VOL.WebApi/appsettings.json +++ b/Vue.Net/VOL.WebApi/appsettings.json @@ -61,10 +61,10 @@ //"DbConnectionString": "Data Source=47.104.158.21,1433;Initial Catalog=ShippingWeb_QDTZ;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;", //嘉里物流 - //"DbConnectionString": "Data Source=36.112.133.3,53076;Initial Catalog=ShippingWeb_JLWL;Persist Security Info=True;User ID=JLWLsa;Password=Ds20040201;Connect Timeout=500;", + "DbConnectionString": "Data Source=36.112.133.3,53076;Initial Catalog=ShippingWeb_JLWL;Persist Security Info=True;User ID=JLWLsa;Password=Ds20040201;Connect Timeout=500;", //金港 - "DbConnectionString": "Data Source=47.104.253.169,62356;Initial Catalog=ShippingWeb_JGZHWL;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;", + //"DbConnectionString": "Data Source=47.104.253.169,62356;Initial Catalog=ShippingWeb_JGZHWL;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;", //"DbConnectionString": "Data Source=47.104.253.169,62356;Initial Catalog=ShippingWeb_QDHGTY;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;", //"DbConnectionString": "Data Source=47.104.253.169,62356;Initial Catalog=ShippingWeb_CS;Persist Security Info=True;User ID=sa;Password=Ds20040201;Connect Timeout=500;",