学 赵 1 year ago
parent
commit
d095154129
  1. 7
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  2. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js
  3. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
  4. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  5. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  6. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  7. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  8. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  9. 88
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

7
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js

@ -1,5 +1,6 @@
import html from "html";
import { reactive, ref } from "vue";
import { dayjs } from "element-plus";
export default {
template: html`<div class="app-table el-table" ref="tableRef">
@ -37,7 +38,10 @@ export default {
</template>
</template>
<div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
<div class="cell">{{row[key]}}</div>
<div class="cell">
<template v-if="item.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-else>{{row[key]}}</template>
</div>
</div>
</template>
</div>
@ -96,6 +100,7 @@ export default {
checkAllClick,
getSelection,
clearSelection,
dayjs,
};
},
};

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/router/business.js

@ -107,11 +107,11 @@ function createCommerceCheckList(path, business, client, title = "商务审批")
"title=客户已收票&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && o.value === 3) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
createButton(
"bao-fei",
"title=报废&isTop=true",
(_, q) => q.filters.some((o) => o.column === "state" && (o.value === 3 || o.value === 4)) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
),
// createButton(
// "bao-fei",
// "title=报废&isTop=true",
// (_, q) => q.filters.some((o) => o.column === "state" && (o.value === 3 || o.value === 4)) && q.filters.some((o) => o.column === "invoiceState" && o.value === 1)
// ),
],
};
}

37
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs

@ -103,7 +103,7 @@ public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot<Guid>
/// <summary>
/// BBAC结算导入请求
/// </summary>
public class BBACSaImportRequestDto //: IValidatableObject
public class BBACSaImportRequestDto
{
/// <summary>
/// 文件
@ -119,42 +119,7 @@ public class BBACSaImportRequestDto //: IValidatableObject
/// </summary>
[Display(Name = "地点")]
[Required(ErrorMessage = "{0}必须填写")]
//[ValidateSite(Sites = new string[] { "1040", "1046" }, ErrorMessage = "{0}值无效")]
public string Site { get; set; }
//public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
//{
// if (Site != "1040" && Site != "1046")
// {
// yield return new ValidationResult(
// $"地点值无效",
// new[] { nameof(Site) });
// }
//}
}
public class ValidateSiteAttribute : ValidationAttribute
{
public ValidateSiteAttribute()
{
}
public string[] Sites { get; set; }
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
if (!Sites.Contains(value))
{
return new ValidationResult(FormatErrorMessage(validationContext.DisplayName));
}
return ValidationResult.Success;
}
//public override bool IsValid(object value)
//{
// return AllowEmptyStrings || value is not string stringValue || !string.IsNullOrWhiteSpace(stringValue);
// return base.IsValid(value);
//}
}
/// <summary>

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs

@ -37,7 +37,6 @@ using Volo.Abp.Users;
using Volo.Abp.Validation;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared;
using Win.Sfs.Shared.Filter;
@ -86,11 +85,11 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
/// Excel 转 JSON
/// </summary>
[HttpPost, Consumes("multipart/form-data")]
public async Task<List<PUB_ADJ_DETAIL_IMP_DTO>> ExcelToJSONAsync(List<IFormFile> files)
public async Task<List<PUB_ADJ_DETAIL_DTO>> ExcelToJSONAsync(List<IFormFile> files)
{
using var ms = new MemoryStream();
await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
return this.ImportInternal<PUB_ADJ_DETAIL_IMP_DTO>(ms.ToArray()).Select(o => o.Item1).ToList();
return this.ImportInternal<PUB_ADJ_DETAIL_DTO>(ms.ToArray()).Select(o => o.Item1).ToList();
}
/// <summary>
@ -193,7 +192,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
query = query.Where(input.Filters.ToLambda<VmiBalance>());
}
query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting);
var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc,RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) });
var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) });
var totalCount = query2.Count();
var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false);
return new PagedResultDto<VmiBalanceSumDto>(totalCount, entities);
@ -506,7 +505,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran
{
var row = ws.Row(rowIndex);
var model = Activator.CreateInstance<T>();
for (var columnIndex = 1; columnIndex < columnsUsedCount; columnIndex++)
for (var columnIndex = 1; columnIndex < columnsUsedCount + 1; columnIndex++)
{
var cell = row.Cell(columnIndex);
var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim();
@ -656,6 +655,7 @@ public class VmiBalanceSumDto
{
[Display(Name = "ERP库位", Order = 13)]
public string ErpToLoc { get; set; }
[Display(Name = "厂内零件号", Order = 6)]
public string RealPartCode { get; set; }//原始

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -149,7 +149,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
/// </summary>
private List<PriceList> CheckPriceListContinuity(List<PriceList> priceList)
{
var pricelist = new List<PriceList>();
var result = new List<PriceList>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
@ -167,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1))
{
pricelist.Add(sortedList[i]);
result.Add(sortedList[i]);
}
}
}
return pricelist; // 所有价格时间都连续
return result; // 所有价格时间都连续
}
/// <summary>

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -133,7 +133,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
/// </summary>
private List<PriceListBJ> CheckPriceListContinuity(List<PriceListBJ> priceList)
{
var pricelist = new List<PriceListBJ>();
var result = new List<PriceListBJ>();
if (priceList.Count <= 1)
{
return priceList; // 只有一个或零个价格条目
@ -151,12 +151,12 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{
if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1))
{
pricelist.Add(sortedList[i]);
result.Add(sortedList[i]);
}
}
}
return pricelist; // 所有价格时间都连续
return result;
}
/// <summary>

3
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs

@ -3,8 +3,6 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Dynamic.Core;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ;
@ -17,7 +15,6 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report

12
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs

@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Drawing;
using System.Linq;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using ShardingCore.Extensions;
using Shouldly;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
@ -19,8 +16,8 @@ using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Enums;
using Win.Sfs.SettleAccount.Reports;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
using Win.Sfs.Shared.RepositoryBase;
namespace SettleAccount.Job.Services.Report
@ -174,7 +171,7 @@ namespace SettleAccount.Job.Services.Report
}
//结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == businessType
where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -201,6 +198,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == businessType
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -278,12 +276,13 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// 获取比对数据
/// 印度件根据客户零件号对比
/// </summary>
private List<SaSeCompareDiff> GetSaSeCompareDataYinDu(int version)
{
//结算
var saGroup = from sa in _settleAccountDbContext.Set<PUB_SA_DETAIL>()
where sa.BusinessType == EnumBusinessType.YinDuJian
where sa.BusinessType == EnumBusinessType.YinDuJian && sa.MappingType == EnumMappingType.None
group sa by new { sa.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -308,6 +307,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<PUB_SE_DETAIL>()
where se.BusinessType == EnumBusinessType.YinDuJian
group se by new { se.CustomerPartCodeNoSpace } into groupItem
select new
{

88
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs

@ -5,6 +5,7 @@ using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
@ -44,7 +45,7 @@ namespace SettleAccount.Job.Services.Report
{
//结算
var saGroup = from sa in _settleAccountDbContext.Set<TSaDetail>()
where sa.BusinessType == businessType
where sa.BusinessType == businessType && sa.MappingType == EnumMappingType.None
group sa by new { sa.PN, sa.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -71,6 +72,7 @@ namespace SettleAccount.Job.Services.Report
};
//发运
var seGroup = from se in _settleAccountDbContext.Set<TSeDetail>()
where se.BusinessType == businessType
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -211,32 +213,64 @@ namespace SettleAccount.Job.Services.Report
});
});
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
select new SaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode,
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc,
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode
}).ToList();
if (businessType != EnumBusinessType.YinDuJian)
{
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.PN, notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.PN, haveSaNotHaveSe.ReplaceFactoryPartCode }
select new SaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode,
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc,
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode
}).ToList();
}
else
{
//获取二次比对上的数据
secondMatchHaveSaHaveSes = (from notHaveSaHaveSe in notHaveSaHaveSes
join haveSaNotHaveSe in haveSaNotHaveSes
on new { notHaveSaHaveSe.ReplaceFactoryPartCode } equals new { haveSaNotHaveSe.ReplaceFactoryPartCode }
select new SaSeCompareDiff()
{
WmsBillNum = notHaveSaHaveSe.WmsBillNum,
ShippingDate = notHaveSaHaveSe.ShippingDate,
SeqNumber = notHaveSaHaveSe.SeqNumber,
PJISSeqNumber = notHaveSaHaveSe.PJISSeqNumber,
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
Category = EnumPubSaSeCompareCategory.HaveSaHaveSe,
SeCustomerPartCode = notHaveSaHaveSe.SeCustomerPartCode,
SeFactoryPartCode = notHaveSaHaveSe.SeFactoryPartCode,
SaCustomerPartCode = haveSaNotHaveSe.SaCustomerPartCode,
SaFactoryPartCode = haveSaNotHaveSe.SaFactoryPartCode,
CustomerPartCode = haveSaNotHaveSe.CustomerPartCode,
PartCodeDesc = haveSaNotHaveSe.PartCodeDesc,
FactoryPartCode = haveSaNotHaveSe.FactoryPartCode,
ReplaceFactoryPartCode = haveSaNotHaveSe.ReplaceFactoryPartCode
}).ToList();
}
return secondMatchHaveSaHaveSes;
}

Loading…
Cancel
Save