diff --git a/Vue.Net/VOL.Entity/DomainModels/WMS/VW_OP_WMS_IMPORT.cs b/Vue.Net/VOL.Entity/DomainModels/WMS/VW_OP_WMS_IMPORT.cs index b7949b4f..7e1cde93 100644 --- a/Vue.Net/VOL.Entity/DomainModels/WMS/VW_OP_WMS_IMPORT.cs +++ b/Vue.Net/VOL.Entity/DomainModels/WMS/VW_OP_WMS_IMPORT.cs @@ -241,5 +241,14 @@ namespace VOL.Entity.DomainModels [Column(TypeName = "varchar(150)")] public string SALENAME { get; set; } + + /// + ///操作 + /// + [Display(Name = "公司简称")] + [MaxLength(150)] + [Column(TypeName = "varchar(150)")] + public string CORPNAME { get; set; } + } } \ No newline at end of file diff --git a/Vue.Net/VOL.WMS/Services/WMS/Partial/VW_OP_WMS_IMPORTService.cs b/Vue.Net/VOL.WMS/Services/WMS/Partial/VW_OP_WMS_IMPORTService.cs index acae6806..394f687c 100644 --- a/Vue.Net/VOL.WMS/Services/WMS/Partial/VW_OP_WMS_IMPORTService.cs +++ b/Vue.Net/VOL.WMS/Services/WMS/Partial/VW_OP_WMS_IMPORTService.cs @@ -67,10 +67,23 @@ namespace VOL.WMS.Services var 品名List = t品名List[0].Sys_DictionaryList; - var CORPID = UserContext.Current.UserInfo.CompanyId; + var dicnos3 = new string[] { "companyid" }; + var t公司List = DictionaryManager.GetDictionaries(dicnos3).ToList(); + var 公司List = t公司List[0].Sys_DictionaryList; + + + foreach (var item in infoList) { + var CORPIDinfo = 公司List.FirstOrDefault(x => x.DicName == item.CORPNAME); + if (CORPIDinfo == null || string.IsNullOrWhiteSpace(CORPIDinfo.DicName)) + { + return _webResponseContent.Error($"公司名【{item.CORPNAME}】不存在"); + } + + var CORPID = CORPIDinfo.DicValue; + if (string.IsNullOrWhiteSpace(item.MBLNO)) { return _webResponseContent.SaveAndError( $":提单号不能为空"); } @@ -256,7 +269,7 @@ namespace VOL.WMS.Services public override WebResponseContent Import(List files) { - DownLoadTemplateColumns = x => new { x.CUSTOMERNAME,x.GOODSOWNER,x.GOODSNAME,x.MBLNO,x.CNTRNO,x.CUSTOMNO,x.PKGS,x.KGS,x.CBM,x.NETWEIGHT,x.STORAGEUNIT,x.STORAGEUNITCOUNT,x.RULEUNIT,x.RULEUNITCOUNT,x.INDATE,x.OPNAME,x.ACCBOOKNO,x.STORAGENAME,x.AREANAME,x.GOODSMODEL,x.GOODSHSCODE,x.COUNTRY,x.RULEAMOUNT,x.REMARK,x.KINDPKGS,x.PALLET,x.SALENAME }; + DownLoadTemplateColumns = x => new { x.CUSTOMERNAME,x.GOODSOWNER,x.GOODSNAME,x.MBLNO,x.CNTRNO,x.CUSTOMNO,x.PKGS,x.KGS,x.CBM,x.NETWEIGHT,x.STORAGEUNIT,x.STORAGEUNITCOUNT,x.RULEUNIT,x.RULEUNITCOUNT,x.INDATE,x.OPNAME,x.ACCBOOKNO,x.STORAGENAME,x.AREANAME,x.GOODSMODEL,x.GOODSHSCODE,x.COUNTRY,x.RULEAMOUNT,x.REMARK,x.KINDPKGS,x.PALLET,x.SALENAME, x.CORPNAME }; var WmsImportList = base.GetListByExcel(files,out WebResponseContent _webResponseContent); @@ -333,22 +346,23 @@ namespace VOL.WMS.Services var t库管List = DictionaryManager.GetDictionaries(dicnos).ToList(); var 库管List = t库管List[0].Sys_DictionaryList; - var CORPID=UserContext.Current.UserInfo.CompanyId; + var dicnos3 = new string[] { "companyid" }; + var t公司List = DictionaryManager.GetDictionaries(dicnos3).ToList(); + var 公司List = t公司List[0].Sys_DictionaryList; - var 费率HeadList = OP_WMS_FEERATERepository.Instance.FindAsIQueryable(x => x.CORPID== CORPID && x.CUSTOMERNAME != "非协议客户").ToList(); + //var CORPID=UserContext.Current.UserInfo.CompanyId; - var 非协议费率List = OP_WMS_FEERATERepository.Instance.FindAsIQueryable(x => x.CUSTOMERNAME == "非协议客户" && x.CORPID == CORPID).ToList(); + //var 费率HeadList = OP_WMS_FEERATERepository.Instance.FindAsIQueryable(x => x.CUSTOMERNAME != "非协议客户").ToList(); - //20210414 看是否有相同(分公司,提单号,入库日期)的入库执行 如果有 则不做处理 - //20220130 增加相同判断条件 规格 计费数量 库位 - var oldindoList = VW_OP_WMS_IN_DORepository.Instance.FindAsIQueryable(x => x.CORPID == CORPID).Select(s=>s.WMSDOID).ToList(); + //var 非协议费率List = OP_WMS_FEERATERepository.Instance.FindAsIQueryable(x => x.CUSTOMERNAME == "非协议客户" ).ToList(); + // - var oldindoGoodsList = OP_WMS_IN_DO_GOODSRepository.Instance.FindAsIQueryable(x => oldindoList.Contains((Guid)x.WMSDOID)).ToList(); //每个提单号的每个入库日期 都只生成一条入库信息 foreach (var head in headList) { + var _tempgoodsList = infoList.Where(x => x.MBLNO == head.MBLNO && x.INDATE == head.INDATE).ToList(); //如果是客户名称全称 替换成shortname @@ -371,6 +385,20 @@ namespace VOL.WMS.Services foreach (var goods in _tempgoodsList) { ///如果有重复的提单号箱号 就跳过去 + var CORPIDinfo = 公司List.FirstOrDefault(x => x.DicName == goods.CORPNAME); + if (CORPIDinfo == null || string.IsNullOrWhiteSpace(CORPIDinfo.DicName)) + { + return _webResponseContent.Error($"公司名【{goods.CORPNAME}】不存在"); + } + + var CORPID = CORPIDinfo.DicValue; + + //20210414 看是否有相同(分公司,提单号,入库日期)的入库执行 如果有 则不做处理 + //20220130 增加相同判断条件 规格 计费数量 库位 + var oldindoList = VW_OP_WMS_IN_DORepository.Instance.FindAsIQueryable(x => x.CORPID== CORPID).Select(s => s.WMSDOID).ToList(); + + var oldindoGoodsList = VW_OP_WMS_IN_DO_GOODSRepository.Instance.FindAsIQueryable(x => oldindoList.Contains((Guid)x.WMSDOID)).ToList(); + if (oldindoGoodsList.Exists(x => x.CNTRNO == goods.CNTRNO && x.MBLNO == 入库执行.MBLNO)) {