Browse Source

红旗结算导入,自定义发货导入,红旗一轿出库单导入,一次性寄售销售导入加入导入时检验物料主数据中是否存在导入的物料号

FoShanPG
44673626 2 years ago
parent
commit
78bf7fa291
  1. 21
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs
  2. 18
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
  3. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs
  4. 15
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  5. 22
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs
  6. 22
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs
  7. 10
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs

21
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs

@ -103,15 +103,24 @@ namespace Win.Sfs.SettleAccount.Entities.HQ_H
throw new BusinessException("导入模板数据不能为空!"); throw new BusinessException("导入模板数据不能为空!");
} }
var entityList = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result); var entityList_org = ObjectMapper.Map<List<HQ_H_PlatformImportDto>, List<HQ_H_Platform>>(result);
var entityList= entityList_org.Where(p => !string.IsNullOrEmpty(p.MaterialCode)).ToList();//过滤掉物料号为空的数据
var gethqimportdata = entityList.Select(p => p.MaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialListCustomerPartCode();
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
foreach (var itm in entityList) var query = from itm in gethqimportdata
{ join itm1 in getmaterial on itm equals itm1.CustomerPartCode into temp1
if (!_erpdapperRepository.GetMaterialList().Any(p => p.CustomerPartCode == itm.MaterialCode)) from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
foreach (var itm in query)
{ {
checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty));
}
} }
if (checkList.Count > 0) if (checkList.Count > 0)

18
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs

@ -486,12 +486,20 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据 var filteResult = result.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode));//过滤掉物料号为空的数据
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
foreach (var itm in filteResult) var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList();
{ var getmaterial = _erpdapperRepository.GetMaterialList();
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
var queryCheck = from itm in gethqimportdata
join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
foreach (var itm in queryCheck)
{ {
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); //if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
} //{
checkList.Add(new ErrorExportDto(version, "自定义出库单导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty));
//}
} }
//检验2:导入模板中的结算数据是否为0 //检验2:导入模板中的结算数据是否为0

4
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs

@ -55,8 +55,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
/// <summary> /// <summary>
/// wms出库 /// wms出库
/// </summary> /// </summary>
//[Authorize(SettleAccountPermissions.WMSJIT.Default)] [Authorize(SettleAccountPermissions.WMSJIT.Default)]
[AllowAnonymous] //[AllowAnonymous]
[Route("api/settleaccount/wmsjitoutput")] [Route("api/settleaccount/wmsjitoutput")]
public class WMSJitAppService : public class WMSJitAppService :

15
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -681,14 +681,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
} }
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
foreach (var itm in result)
{
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
{
checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
}
} //foreach (var itm in result)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "大众备件出库单导入", string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.MaterialCode), string.Empty));
// }
//}
if (checkList.Count > 0) if (checkList.Count > 0)
{ {

22
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs

@ -287,14 +287,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
} }
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
foreach (var itm in _list) var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList();
{ var getmaterial = _erpdapperRepository.GetMaterialList();
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
var queryCheck = from itm in gethqimportdata
join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
foreach (var itm in queryCheck)
{ {
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty));
} }
//foreach (var itm in _list)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty));
// }
} //}
if (checkList.Count > 0) if (checkList.Count > 0)
{ {

22
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs

@ -234,14 +234,26 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
//和物料主数据中SAP物料号检验是否存在 //和物料主数据中SAP物料号检验是否存在
foreach (var itm in _list) var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList();
{ var getmaterial = _erpdapperRepository.GetMaterialList();
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
var queryCheck = from itm in gethqimportdata
join itm1 in getmaterial on itm equals itm1.MaterialCode into temp1
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
foreach (var itm in queryCheck)
{ {
checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty));
} }
//foreach (var itm in _list)
//{
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode))
// {
// checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, itm.SapMaterialCode, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm.SapMaterialCode), string.Empty));
// }
} //}
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
return await ExportErrorReportAsync(checkList); return await ExportErrorReportAsync(checkList);

10
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs

@ -57,6 +57,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
/// <summary>
/// 获取客户物料号
/// </summary>
/// <returns></returns>
public virtual List<Material> GetMaterialListCustomerPartCode()
{
return DbConnection.Query<Material>("select max(Id) ID,'' Factory,CustomerPartCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material where CustomerPartCode is not null group by CustomerPartCode, MaterialDesc, EstimateTypeDesc, EstimateType ").ToList();
}
public virtual List<ErrorBill> GetErrorBillList() public virtual List<ErrorBill> GetErrorBillList()
{ {

Loading…
Cancel
Save