|
|
|
@ -276,7 +276,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
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, x.CORPNAME };
|
|
|
|
|
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,x.CURRENCY };
|
|
|
|
|
|
|
|
|
|
var WmsImportList = base.GetListByExcel(files,out WebResponseContent _webResponseContent);
|
|
|
|
|
|
|
|
|
@ -366,6 +366,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//每个提单号的每个入库日期 都只生成一条入库信息
|
|
|
|
|
//20230529 增加一个限制 每个提单号的每个入库日期的 每个仓库的入库计划
|
|
|
|
|
foreach (var head in headList)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -406,14 +407,14 @@ namespace VOL.WMS.Services
|
|
|
|
|
|
|
|
|
|
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))
|
|
|
|
|
//20230529 增加一个限制 每个提单号的每个入库日期的 每个仓库的入库计划
|
|
|
|
|
if (oldindoGoodsList.Exists(x => x.CNTRNO == goods.CNTRNO && x.MBLNO == 入库执行.MBLNO && x.STOREHOUSE == 入库执行.STOREHOUSE))
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var 入库计划 = get入库计划(goods, 仓库List, 库管List);
|
|
|
|
|
var 入库计划 = get入库计划(goods, 仓库List, 库管List, CORPID);
|
|
|
|
|
var 入库计划明细 = get入库计划明细(入库计划, goods);
|
|
|
|
|
入库计划明细List.Add(入库计划明细);
|
|
|
|
|
|
|
|
|
@ -428,7 +429,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
|
|
|
|
|
//根据入库执行生成一条入库计划和入库计划明细
|
|
|
|
|
|
|
|
|
|
var 库存 = get库存头表(goods, 仓库List, 库位List, 库管List);
|
|
|
|
|
var 库存 = get库存头表(goods, 仓库List, 库位List, 库管List,CORPID);
|
|
|
|
|
库存List.Add(库存);
|
|
|
|
|
|
|
|
|
|
var 库存base = AutoMapperHelper.MapTo<OP_WMS, OP_WMS_BASE>(库存);
|
|
|
|
@ -436,6 +437,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
库存base.RULEAMOUNT = goods.RULEAMOUNT;
|
|
|
|
|
库存base.KINDPKGS = goods.KINDPKGS;
|
|
|
|
|
库存base.PALLET= goods.PALLET;
|
|
|
|
|
库存base.CORPID = CORPID;
|
|
|
|
|
库存BaseList.Add(库存base);
|
|
|
|
|
|
|
|
|
|
var 物理库存 = get物理库存(入库执行明细, 库存);
|
|
|
|
@ -581,7 +583,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private OP_WMS_IN_PLAN get入库计划( VW_OP_WMS_IMPORT detail, List<OP_WMS_STOREHOUSE> 仓库List, List<Sys_DictionaryList> userlist)
|
|
|
|
|
private OP_WMS_IN_PLAN get入库计划( VW_OP_WMS_IMPORT detail, List<OP_WMS_STOREHOUSE> 仓库List, List<Sys_DictionaryList> userlist,string CORPID)
|
|
|
|
|
{
|
|
|
|
|
var result = new OP_WMS_IN_PLAN();
|
|
|
|
|
|
|
|
|
@ -594,7 +596,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
result.ACCDATE = detail.INDATE;
|
|
|
|
|
|
|
|
|
|
result.CUSTOMERNAME = detail.CUSTOMERNAME;
|
|
|
|
|
result.GOODSOWNER = detail.CUSTOMERNAME;
|
|
|
|
|
result.GOODSOWNER = detail.GOODSOWNER;
|
|
|
|
|
result.ARCLIENTWMSOUT = detail.CUSTOMERNAME;
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrWhiteSpace(detail.ACCBOOKNO))
|
|
|
|
@ -628,6 +630,17 @@ namespace VOL.WMS.Services
|
|
|
|
|
|
|
|
|
|
result.SALE = getuserid(detail.SALENAME, userlist);
|
|
|
|
|
|
|
|
|
|
result.CORPID = CORPID;
|
|
|
|
|
result.CURRENCY = detail.CURRENCY;
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(detail.ACCBOOKNO))
|
|
|
|
|
{
|
|
|
|
|
result.BILLTYPE = "1";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
result.BILLTYPE = "0";
|
|
|
|
|
}
|
|
|
|
|
result.KINDPKGS=detail.KINDPKGS;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -676,7 +689,7 @@ namespace VOL.WMS.Services
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private OP_WMS get库存头表(VW_OP_WMS_IMPORT detail, List<OP_WMS_STOREHOUSE> 仓库List, List<OP_WMS_STOREHOUSE_AREA> 库位List, List<Sys_DictionaryList> userlist) {
|
|
|
|
|
private OP_WMS get库存头表(VW_OP_WMS_IMPORT detail, List<OP_WMS_STOREHOUSE> 仓库List, List<OP_WMS_STOREHOUSE_AREA> 库位List, List<Sys_DictionaryList> userlist,string CORPID) {
|
|
|
|
|
OP_WMS WMS = new OP_WMS();
|
|
|
|
|
|
|
|
|
|
var billno = base.GetBillNo("库存信息");
|
|
|
|
@ -684,14 +697,18 @@ namespace VOL.WMS.Services
|
|
|
|
|
WMS.WMSID = Guid.NewGuid();
|
|
|
|
|
WMS.WMSBASEID = WMS.WMSID;
|
|
|
|
|
WMS.BSNO = billno;
|
|
|
|
|
WMS.CORPID = UserContext.Current.UserInfo.CompanyId;
|
|
|
|
|
//WMS.CORPID = UserContext.Current.UserInfo.CompanyId;
|
|
|
|
|
WMS.CORPID = CORPID;
|
|
|
|
|
|
|
|
|
|
WMS.CUSTOMERNAME = detail.CUSTOMERNAME;
|
|
|
|
|
WMS.GOODSOWNER = detail.GOODSOWNER;
|
|
|
|
|
WMS.GOODSNAME = detail.GOODSNAME;
|
|
|
|
|
WMS.KGS = detail.KGS;
|
|
|
|
|
WMS.CBM = detail.CBM;
|
|
|
|
|
WMS.PKGS = detail.PKGS;
|
|
|
|
|
//WMS.KINDPKGS = detail.KINDPKGS;
|
|
|
|
|
|
|
|
|
|
WMS.KINDPKGS = detail.KINDPKGS;
|
|
|
|
|
|
|
|
|
|
WMS.STORAGEUNIT = detail.STORAGEUNIT;
|
|
|
|
|
WMS.STORAGEUNITCOUNT = detail.STORAGEUNITCOUNT;
|
|
|
|
|
WMS.RULEUNIT = detail.RULEUNIT;
|
|
|
|
|