初始化库存加公司

temp
ddlucky 2 years ago
parent 114d9eef30
commit c30116ccc9

@ -241,5 +241,14 @@ namespace VOL.Entity.DomainModels
[Column(TypeName = "varchar(150)")] [Column(TypeName = "varchar(150)")]
public string SALENAME { get; set; } public string SALENAME { get; set; }
/// <summary>
///操作
/// </summary>
[Display(Name = "公司简称")]
[MaxLength(150)]
[Column(TypeName = "varchar(150)")]
public string CORPNAME { get; set; }
} }
} }

@ -67,10 +67,23 @@ namespace VOL.WMS.Services
var List = tList[0].Sys_DictionaryList; var List = tList[0].Sys_DictionaryList;
var CORPID = UserContext.Current.UserInfo.CompanyId; var dicnos3 = new string[] { "companyid" };
var tList = DictionaryManager.GetDictionaries(dicnos3).ToList();
var List = tList[0].Sys_DictionaryList;
foreach (var item in infoList) { 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)) { if (string.IsNullOrWhiteSpace(item.MBLNO)) {
return _webResponseContent.SaveAndError( $":提单号不能为空"); return _webResponseContent.SaveAndError( $":提单号不能为空");
} }
@ -256,7 +269,7 @@ namespace VOL.WMS.Services
public override WebResponseContent Import(List<IFormFile> files) public override WebResponseContent Import(List<IFormFile> 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); var WmsImportList = base.GetListByExcel(files,out WebResponseContent _webResponseContent);
@ -333,22 +346,23 @@ namespace VOL.WMS.Services
var tList = DictionaryManager.GetDictionaries(dicnos).ToList(); var tList = DictionaryManager.GetDictionaries(dicnos).ToList();
var List = tList[0].Sys_DictionaryList; var List = tList[0].Sys_DictionaryList;
var CORPID=UserContext.Current.UserInfo.CompanyId; var dicnos3 = new string[] { "companyid" };
var tList = DictionaryManager.GetDictionaries(dicnos3).ToList();
var List = tList[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 看是否有相同(分公司,提单号,入库日期)的入库执行 如果有 则不做处理 //var 非协议费率List = OP_WMS_FEERATERepository.Instance.FindAsIQueryable(x => x.CUSTOMERNAME == "非协议客户" ).ToList();
//20220130 增加相同判断条件 规格 计费数量 库位 //
var oldindoList = VW_OP_WMS_IN_DORepository.Instance.FindAsIQueryable(x => x.CORPID == CORPID).Select(s=>s.WMSDOID).ToList();
var oldindoGoodsList = OP_WMS_IN_DO_GOODSRepository.Instance.FindAsIQueryable(x => oldindoList.Contains((Guid)x.WMSDOID)).ToList();
//每个提单号的每个入库日期 都只生成一条入库信息 //每个提单号的每个入库日期 都只生成一条入库信息
foreach (var head in headList) foreach (var head in headList)
{ {
var _tempgoodsList = infoList.Where(x => x.MBLNO == head.MBLNO && x.INDATE == head.INDATE).ToList(); var _tempgoodsList = infoList.Where(x => x.MBLNO == head.MBLNO && x.INDATE == head.INDATE).ToList();
//如果是客户名称全称 替换成shortname //如果是客户名称全称 替换成shortname
@ -371,6 +385,20 @@ namespace VOL.WMS.Services
foreach (var goods in _tempgoodsList) 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)) if (oldindoGoodsList.Exists(x => x.CNTRNO == goods.CNTRNO && x.MBLNO == .MBLNO))
{ {

Loading…
Cancel
Save