lyf 2 years ago
parent
commit
82fd455272
  1. 45
      src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs
  2. 4
      src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs
  3. 9
      src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs
  4. 2
      src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs
  5. 9
      src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs
  6. 2
      src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj
  7. 5
      src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs
  8. 21
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/HQ_H/HQ_H_PlatformAppService.cs
  9. 3
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  10. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  11. 46
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSCusomerKanbanAppService.cs
  12. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs
  13. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSJitAppService.cs
  14. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSKanbanAppService.cs
  15. 29
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs
  16. 15
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  17. 57
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsHQKBOutputAppService.cs
  18. 33
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsOneTimeSaleOutputAppService.cs
  19. 4
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs
  20. 2
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs
  21. 10
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs
  22. 25
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs
  23. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  24. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs
  25. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs
  26. 29
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs
  27. 18
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs

45
src/Modules/BaseService/BaseService.Application.Contracts/HbDtoExtensions.cs

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Threading;
namespace BaseService
{
public static class HbDtoExtensions
{
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner();
public static void Configure()
{
OneTimeRunner.Run(() =>
{
/* You can add extension properties to DTOs
* defined in the depended modules.
*
* Example:
*
* ObjectExtensionManager.Instance
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title");
*
* See the documentation for more:
* https://docs.abp.io/en/abp/latest/Object-Extensions
*/
ObjectExtensionManager.Instance
.AddOrUpdateProperty<string>(
new[]
{
typeof(IdentityUserDto),
typeof(IdentityUserCreateDto),
typeof(IdentityUserUpdateDto),
typeof(UpdateProfileDto)
},
"CodeNum"
);
});
}
}
}

4
src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs

@ -9,6 +9,8 @@ using BaseService.BaseData.BranchManagement.Dto;
using BaseService.BaseData.UserBranchRoleManagement.Dto; using BaseService.BaseData.UserBranchRoleManagement.Dto;
using BaseService.RelationData.Dto; using BaseService.RelationData.Dto;
using Volo.Abp.Identity;
namespace BaseService namespace BaseService
{ {
public class BaseServiceApplicationAutoMapperProfile : Profile public class BaseServiceApplicationAutoMapperProfile : Profile
@ -24,6 +26,8 @@ namespace BaseService
//分支--角色 //分支--角色
CreateMap<BranchRole, BranchRoleDto>(); CreateMap<BranchRole, BranchRoleDto>();
CreateMap<IdentityUser, IdentityUserDto>().MapExtraProperties();
} }
} }
} }

9
src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs

@ -22,6 +22,7 @@ using Volo.Abp.ObjectExtending;
using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement;
using Volo.Abp.Users; using Volo.Abp.Users;
using IdentityUser = Volo.Abp.Identity.IdentityUser; using IdentityUser = Volo.Abp.Identity.IdentityUser;
using Volo.Abp.Data;
namespace BaseService.Systems.UserManagement namespace BaseService.Systems.UserManagement
{ {
@ -122,6 +123,13 @@ namespace BaseService.Systems.UserManagement
public async Task<IdentityUserDto> UpdateAsync(Guid id, IdentityUserUpdateDto input) public async Task<IdentityUserDto> UpdateAsync(Guid id, IdentityUserUpdateDto input)
{ {
var user = await UserManager.GetByIdAsync(id); var user = await UserManager.GetByIdAsync(id);
// user.SetProperty("Title", "My custom title value!");
//var gettitle= user.GetProperty<string>("Title");
// if(string.IsNullOrEmpty(gettitle))
// {
// throw new BusinessException("用户标题不能为空");
// }
user.ConcurrencyStamp = input.ConcurrencyStamp; user.ConcurrencyStamp = input.ConcurrencyStamp;
(await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors(); (await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();
@ -138,6 +146,7 @@ namespace BaseService.Systems.UserManagement
} }
var dto = ObjectMapper.Map<IdentityUser, IdentityUserDto>(user); var dto = ObjectMapper.Map<IdentityUser, IdentityUserDto>(user);
await CurrentUnitOfWork.SaveChangesAsync(); await CurrentUnitOfWork.SaveChangesAsync();

2
src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs

@ -32,7 +32,7 @@ namespace BaseService.Users
#endregion #endregion
public string CodeNum { get; set; }
//public Guid BranchId { get; set; } //public Guid BranchId { get; set; }
//public bool Enable { get; set; } //public bool Enable { get; set; }

9
src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs

@ -14,6 +14,15 @@ namespace BaseService.EntityFrameworkCore
{ {
BaseServiceModuleExtensionConfigurator.Configure(); BaseServiceModuleExtensionConfigurator.Configure();
ObjectExtensionManager.Instance
.MapEfCoreProperty<IdentityUser, string>(
"CodeNum",
(entityBuilder, propertyBuilder) =>
{
}
);
//OneTimeRunner.Run(() => //OneTimeRunner.Run(() =>
//{ //{
// ObjectExtensionManager.Instance // ObjectExtensionManager.Instance

2
src/Modules/BaseService/BaseService.Host/BaseService.Host.csproj

@ -30,7 +30,7 @@
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<!-- <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.4.1" /> --> <!-- <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.4.1" /> -->
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="SettleAccount.HttpApi" Version="1.0.21" /> <PackageReference Include="SettleAccount.HttpApi" Version="1.0.25" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="4.3.3" /> <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="4.3.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="4.3.3" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="4.3.3" />

5
src/Modules/BaseService/BaseService.Host/FileStorage/Migrations/BaseServiceMigrationDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace FileStorage.Migrations
.UseIdentityColumns() .UseIdentityColumns()
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.1"); .HasAnnotation("ProductVersion", "5.0.7");
modelBuilder.Entity("BaseService.BaseData.Branch", b => modelBuilder.Entity("BaseService.BaseData.Branch", b =>
{ {
@ -653,6 +653,9 @@ namespace FileStorage.Migrations
.HasDefaultValue(0) .HasDefaultValue(0)
.HasColumnName("AccessFailedCount"); .HasColumnName("AccessFailedCount");
b.Property<string>("CodeNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
.HasMaxLength(40) .HasMaxLength(40)

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
from tm1 in temp1.DefaultIfEmpty()
where tm1 == null
select itm;
foreach (var itm in query)
{ {
if (!_erpdapperRepository.GetMaterialList().Any(p => p.CustomerPartCode == itm.MaterialCode)) checkList.Add(new ErrorExportDto(version, "红旗结算导入", string.Empty, string.Empty, itm, string.Empty, string.Format("物料主数据不存在当前导入的物料号{0}!", itm), string.Empty));
{
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)

3
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -216,7 +216,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result); var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result);
var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault());
//只过滤类型为10的即正常价格,类型为20的是备件价格
_ls = _ls.Where(p => p.Type == 10).ToList();
foreach (var itm in _ls) foreach (var itm in _ls)
{ {

7
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -170,17 +170,16 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result); var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result);
var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault()); var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault());
//只要类型为20的备件价格数据
_ls = _ls.Where(p => p.Type == 20).ToList();
foreach (var itm in _ls) foreach (var itm in _ls)
{ {
itm.Update(GuidGenerator.Create(),version); itm.Update(GuidGenerator.Create(),version);
} }
_ls=_ls.Where(p => p.Type == 20).ToList();
await _mng.ImportAsync(_ls.ToList(), version); await _mng.ImportAsync(_ls.ToList(), version);
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;
} }

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

@ -485,15 +485,36 @@ 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 sapcodegroup = (from t in filteResult
group t by t.SapMaterialCode into m
where m.Count() >= 2
select m).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{ {
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) foreach (var item in sapcodegroup)
{ {
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, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty));
} }
} }
//和物料主数据中SAP物料号检验是否存在
var gethqimportdata = filteResult.Select(p => p.SapMaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialList();
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)
{
//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
foreach (var itm in filteResult) foreach (var itm in filteResult)
{ {
@ -548,23 +569,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
} }
} }
//检验3:导入模板中物料号,不能重复
var _isRepeatOfReportList = from arc in _lst
group arc by new { arc.Kanban, arc.SapMaterialCode, arc.Version }
into g
where g.Count() > 1
select g;
foreach (var itm in _isRepeatOfReportList)
{
checkList.Add(new ErrorExportDto(version, "自定义出库单", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中物料号{0}有重复,请检查!", itm.Key.SapMaterialCode), string.Empty));
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State != 4 ).ToListAsync(); var outPutDetail = await _wmsRepository.Where(p => p.Version == version && p.State != 4 ).ToListAsync();

2
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSHQHKanbanAppService.cs

@ -505,7 +505,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial( WmsHQHKanbanOutPutDetial _detail = new WmsHQHKanbanOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
itm.Kanban, itm.Kanban,
itm.MaterialCode, itm.MaterialCode,
itm.MaterialDesc, itm.MaterialDesc,

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 :

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

@ -806,7 +806,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{ {
WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial( WmsKanbanOutPutDetial _detail = new WmsKanbanOutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
!string.IsNullOrEmpty(itm.WmsBillNum) ? itm.WmsBillNum : string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
itm.Kanban, itm.Kanban,
itm.MaterialCode, itm.MaterialCode,
@ -815,7 +815,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty, !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号
!string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty, !string.IsNullOrEmpty(itm.Extend2) ? itm.Extend2 : string.Empty,
version, version,
itm.MaterialCode, itm.MaterialCode,

29
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePart90AppService.cs

@ -269,10 +269,10 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty, !string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,//客户物料号
string.Empty, string.Empty,
p.Version, p.Version,
p.MaterialCode, p.ParentMaterialCode,
_billNum, _billNum,
GuidGenerator.Create(), GuidGenerator.Create(),
string.Empty, string.Empty,
@ -318,8 +318,8 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
!string.IsNullOrEmpty(p.Extend1) ? p.Extend1 : string.Empty,
string.Empty, string.Empty,
string.Empty,
input.Version, input.Version,
p.MaterialCode, p.MaterialCode,
_billNum, _billNum,
@ -512,14 +512,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
} }
//和物料主数据中SAP物料号检验是否存在
//foreach (var itm in filteResult) foreach (var itm in filteResult)
//{ {
// if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.MaterialCode)) if (string.IsNullOrEmpty(itm.Extend1))
// { {
// 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, string.Empty, string.Empty, string.Format("当前导入订单号{0}存在物料号为空情况,请检查!", itm.OrderBillNum), string.Empty));
// } }
//} }
if (checkList.Count > 0) if (checkList.Count > 0)
{ {
@ -532,8 +532,9 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{ {
WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial( WmsSharePart90OutPutDetial _detail = new WmsSharePart90OutPutDetial(
GuidGenerator.Create(), GuidGenerator.Create(),
//itm.WmsBillNum, //itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum,
string.Empty, !string.IsNullOrEmpty(itm.WmsBillNum) ? (itm.WmsBillNum.Length > 36 ? "PF" : itm.WmsBillNum) : string.Empty,
//string.Empty,
itm.OrderBillNum, itm.OrderBillNum,
itm.MaterialCode, itm.MaterialCode,
@ -542,7 +543,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
string.Empty, string.Empty,
string.Empty, string.Empty,
0, 0,
string.Empty, !string.IsNullOrEmpty(itm.Extend1) ? itm.Extend1 : string.Empty,//客户物料号
string.Empty, string.Empty,
version, version,
itm.ParentMaterialCode, itm.ParentMaterialCode,

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)
{ {

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

@ -269,7 +269,7 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
throw new BusinessException("导入模板数据不能为空!"); throw new BusinessException("导入模板数据不能为空!");
} }
//物料号不能为空,直接过滤掉,模板的中看不到有空行的情况,但是通过个IE这个插件发现有空行数据导入 //物料号不能为空,直接过滤掉,模板的中看不到有空行的情况,但是通过个IE这个插件发现有空行数据导入
var _list = _listOrgin.Where(p =>!string.IsNullOrEmpty(p.SapMaterialCode)); var _list = _listOrgin.Where(p => !string.IsNullOrEmpty(p.SapMaterialCode));
foreach (var itm in _list) foreach (var itm in _list)
{ {
@ -278,23 +278,54 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件及客户号不能为空,影响出库请检查!", itm.SapMaterialCode), string.Empty));
} }
} }
foreach (var itm in _list) //不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入
var sapcodegroup = (from t in _list
group t by new { sapcode = t.SapMaterialCode, isbj = t.IsBack } into m
select new
{
= m.Key.sapcode,
= m.Key.isbj,
rowcount = m.Count()
} into c
where c.rowcount >= 2
select c).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{ {
if (itm.IsBack != "是" && itm.IsBack != "否") foreach (var item in sapcodegroup)
{ {
checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, string.Empty, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty)); checkList.Add(new ErrorExportDto(version, "红旗一轿出库单导入", string.Empty, string.Empty, item., string.Empty, string.Format("导入模板中SAP编码{0}并且是否备件值为{1},有重复不是汇总出库请检查!", item., item.), string.Empty));
} }
} }
//和物料主数据中SAP物料号检验是否存在
foreach (var itm in _list) foreach (var itm in _list)
{ {
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) if (itm.IsBack != "是" && itm.IsBack != "否")
{ {
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.SapMaterialCode, string.Empty, string.Format("导入模板中SAP编码{0}的是否备件请填写是或否,影响出库请检查!", itm.SapMaterialCode), string.Empty));
} }
} }
//和物料主数据中SAP物料号检验是否存在
var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialList();
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, 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)
{ {
@ -314,11 +345,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
} }
} }
var getbillName = "HQVSBT";//混合数据 var getbillName = "HQVSBT";//混合数据
if(_list.FirstOrDefault().Extend== "100113") if (_list.FirstOrDefault().Extend == "100113")
{ {
getbillName = "BT";//一轿 getbillName = "BT";//一轿
} }
else if(_list.FirstOrDefault().Extend == "100053") else if (_list.FirstOrDefault().Extend == "100053")
{ {
getbillName = "HQKB";//红旗 getbillName = "HQKB";//红旗
} }
@ -346,14 +377,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
0, 0,
0, 0,
itm.Price, itm.Price,
Math.Round((itm.Price * itm.Qty),2) Math.Round((itm.Price * itm.Qty), 2)
); );
await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 }); await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 10000 });
int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum); int _count = _wmsVersionRepository.Count(p => p.Version == version && p.BillNum == _billNum);
if (_count == 0) if (_count == 0)
{ {
var _version = new WmsHQWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email,string.Empty); var _version = new WmsHQWithOutKanbanOutPut(GuidGenerator.Create(), version, _billNum, CurrentUser.Email, string.Empty);
await _wmsVersionRepository.InsertAsync(_version, true); await _wmsVersionRepository.InsertAsync(_version, true);
} }
return ApplicationConsts.SuccessStr; ; return ApplicationConsts.SuccessStr; ;

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

@ -233,15 +233,40 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty)); checkList.Add(new ErrorExportDto(version, "一次性寄售销售导入", string.Empty, string.Empty, string.Empty, string.Empty, "导入模板中第一页签没有数据,请检查!", string.Empty));
} }
//和物料主数据中SAP物料号检验是否存在 //不是汇总形式出库的不能导入,即导入的数据中如果SAP编号 即厂内零件号有重复不能导入
foreach (var itm in _list) var sapcodegroup = (from t in _list
group t by t.SapMaterialCode into m
where m.Count() >= 2
select m).ToList();
if (sapcodegroup != null && sapcodegroup.Count > 0)
{ {
if (!_erpdapperRepository.GetMaterialList().Any(p => p.MaterialCode == itm.SapMaterialCode)) foreach (var item in sapcodegroup)
{ {
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, item.Key, string.Empty, string.Format("导入模板中SAP编码{0},有重复不是汇总出库请检查!", item.Key), string.Empty));
} }
}
//和物料主数据中SAP物料号检验是否存在
var gethqimportdata = _list.Select(p => p.SapMaterialCode).Distinct().ToList();
var getmaterial = _erpdapperRepository.GetMaterialList();
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, 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);

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

@ -306,13 +306,13 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
var en1= entities.Where(p => p.OutputQty == 0).ToList(); var en1= entities.Where(p => p.OutputQty == 0).ToList();
foreach(var itm in en1) foreach(var itm in en1)
{ {
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) }); checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量为0不能同步Sap", itm.BillNum, itm.MaterialCode) });
} }
var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList(); var en2=entities.Where(p => p.OutputQty != p.Qty && p.OutputQty>0).ToList();
foreach (var itm in en2) foreach (var itm in en2)
{ {
checkList.Add(new ErrorExportDto() { Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) }); checkList.Add(new ErrorExportDto() { Version = input.Version, ItemCode = itm.MaterialCode, Model = "结算出库SAP接口", Message = string.Format("结算号:{0}物料号:{1}实际出库数量不等于结算数量不能同步Sap", itm.BillNum, itm.MaterialCode) });
} }
var _count = entities.Count(p => p.State==2); var _count = entities.Count(p => p.State==2);

2
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs

@ -10,6 +10,7 @@ using Volo.Abp.Dapper;
using Win.Abp.Snowflakes; using Win.Abp.Snowflakes;
using Volo.Abp.EventBus.RabbitMq; using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.RabbitMQ; using Volo.Abp.RabbitMQ;
using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount namespace Win.Sfs.SettleAccount
{ {
@ -22,6 +23,7 @@ namespace Win.Sfs.SettleAccount
typeof(AbpIdentityHttpApiClientModule), typeof(AbpIdentityHttpApiClientModule),
typeof(AbpAutoMapperModule), typeof(AbpAutoMapperModule),
typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(AbpDapperModule) typeof(AbpDapperModule)
//typeof(AbpEventBusRabbitMqModule) //typeof(AbpEventBusRabbitMqModule)

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()
{ {

25
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs

@ -23,6 +23,21 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <summary> /// <summary>
/// 主数据Dapper表 /// 主数据Dapper表
/// </summary> /// </summary>
//public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
//{
// public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider)
// {
// }
// [UnitOfWork(isTransactional: false)]
// public virtual void UpdateFisSettle()
// {
// DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null);
// }
//}
public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency public class FisUpdateDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{ {
public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider) public FisUpdateDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider)
@ -30,15 +45,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
} }
[UnitOfWork(isTransactional: false)] [UnitOfWork(isTransactional: false)]
public virtual void UpdateFisSettle() public virtual void UpdateFisSettle(string version)
{ {
DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null); DbConnection.Execute(string.Format("EXEC sp_settle_fis_update N'{0}'", version), null, null, 1200, null);
} }
}
}
} }

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -1845,7 +1845,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version); var _sql = string.Format(str, version);
@ -1919,7 +1919,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode\n" +
" LEFT JOIN (\n" + " LEFT JOIN (\n" +
" SELECT SUM\n" + " SELECT SUM\n" +
" ( Amt ) / SUM ( Qty ) AS Price,\n" + " ( Amt ) / SUM ( Qty ) AS Price,\n" +

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs

@ -114,7 +114,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ( a.HQMKanBan <> 'BJ' ) \n" + " ( a.HQMKanBan <> 'BJ' ) \n" +
" AND a.Version= '{0}' {1} \n" + " AND a.Version= '{0}' {1} \n" +
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) and Type=10) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition); var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQMSettledDetailDiff>(_sql, null, null, true, 1200, null);
@ -206,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) A\n" + " ) A\n" +
" LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" + " LEFT JOIN Set_material AS c ON a.MaterialCode = c.CustomerPartCode \n" +
" ) temp1\n" + " ) temp1\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE ( Version = ( SELECT MAX ( Version ) AS Expr1 FROM Set_PriceList ) ) and Type=20 ) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode";
var _sql = string.Format(str, version, condition); var _sql = string.Format(str, version, condition);
var _query = DbConnection.Query<HQMSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQMSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs

@ -1332,7 +1332,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" +
" AND temp1.SAP编码= temp3.MaterialCode\n" + " AND temp1.SAP编码= temp3.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" ) unint1 UNION ALL\n" + " ) unint1 UNION ALL\n" +
"SELECT\n" + "SELECT\n" +
" * \n" + " * \n" +
@ -1389,7 +1389,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ) AS temp1\n" + " ) AS temp1\n" +
" LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" + " LEFT JOIN ( SELECT * FROM set_backQty ) temp3 ON temp1.采购订单号 = temp3.Code \n" +
" AND temp1.SAP编码= temp3.MaterialCode\n" + " AND temp1.SAP编码= temp3.MaterialCode\n" +
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceListBJ WHERE Version = '202110' and Type=20 ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" +
" ) unint2;"; " ) unint2;";

29
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs

@ -11,6 +11,27 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report namespace SettleAccount.Job.Services.Report
{ {
//public class FisUpdateExportService : ITransientDependency, IExportJob
//{
// private readonly FisUpdateDapperRepository _dapperRepository;
// public FisUpdateExportService(
// FisUpdateDapperRepository dapperRepository
// )
// {
// _dapperRepository = dapperRepository;
// }
// [UnitOfWork(isTransactional: false)]
// public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
// {
// _dapperRepository.UpdateFisSettle();
// return id.ToString();
// }
//}
public class FisUpdateExportService : ITransientDependency, IExportJob public class FisUpdateExportService : ITransientDependency, IExportJob
{ {
private readonly FisUpdateDapperRepository _dapperRepository; private readonly FisUpdateDapperRepository _dapperRepository;
@ -19,15 +40,17 @@ namespace SettleAccount.Job.Services.Report
public FisUpdateExportService( public FisUpdateExportService(
FisUpdateDapperRepository dapperRepository FisUpdateDapperRepository dapperRepository
) )
{ {
_dapperRepository = dapperRepository; _dapperRepository = dapperRepository;
} }
[UnitOfWork(isTransactional: false)] [UnitOfWork(isTransactional: false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{ {
_dapperRepository.UpdateFisSettle(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
_dapperRepository.UpdateFisSettle(version);
return id.ToString(); return id.ToString();
} }
} }

18
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs

@ -54,7 +54,7 @@ namespace SettleAccount.Job.Services
private readonly ErpPartDapperRepository _erpdapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository;
private readonly IBlobContainer<MyFileContainer> _fileContainer; private readonly IBlobContainer<MyFileContainer> _fileContainer;
private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository; //private readonly ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> _errorListRepository;
private readonly OutputService _outputService; private readonly OutputService _outputService;
private readonly InputService _inputService; private readonly InputService _inputService;
@ -65,9 +65,9 @@ namespace SettleAccount.Job.Services
InvoiceSettledDetailDiffDapperRepository dapperRepository1, InvoiceSettledDetailDiffDapperRepository dapperRepository1,
OutputService outputService, OutputService outputService,
InputService inputService, InputService inputService,
UnSettledDetailDapperRepository dapperRepository2, UnSettledDetailDapperRepository dapperRepository2
ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository //ISettleAccountBranchEfCoreRepository<ErrorBill, Guid> errorListRepository
) )
{ {
_fileContainer = fileContainer; _fileContainer = fileContainer;
@ -79,7 +79,7 @@ namespace SettleAccount.Job.Services
_dapperRepository =dapperRepository; _dapperRepository =dapperRepository;
_dapperRepository1 = dapperRepository1; _dapperRepository1 = dapperRepository1;
_dapperRepository2 = dapperRepository2; _dapperRepository2 = dapperRepository2;
_errorListRepository = errorListRepository; // _errorListRepository = errorListRepository;
} }
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
@ -347,7 +347,9 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms
} }
var _checkList = _errorListRepository.ToList(); //var _checkList = _errorListRepository.ToList();
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _erpdapperRepository.GetErrorBillList();
var query = from itm in _ls var query = from itm in _ls
join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum }
@ -427,8 +429,10 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
} }
} }
var _checkList = _errorListRepository.ToList(); //var _checkList = _errorListRepository.ToList();
//应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629
var _checkList = _erpdapperRepository.GetErrorBillList();
var query = from itm in _list var query = from itm in _list
join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum }

Loading…
Cancel
Save