Browse Source

更新岸本

master
学 赵 1 year ago
parent
commit
0086145489
  1. 10
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
  2. 6
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js
  3. 30
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js
  4. 18
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js
  5. 11
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js
  6. 69
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  7. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  8. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  9. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs
  10. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  11. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  12. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  13. 103
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  14. 100
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  15. 66
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  16. 58
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
  17. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs
  18. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  19. 41
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs
  20. 18
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs
  21. 39
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs
  22. 57
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs
  23. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs
  24. 21
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
  25. 147
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs
  26. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs
  27. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs
  28. 118
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs
  29. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs
  30. 25
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs
  31. 5777
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.Designer.cs
  32. 190
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs
  33. 5781
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.Designer.cs
  34. 179
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs
  35. 5790
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.Designer.cs
  36. 201
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs
  37. 41
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs
  38. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs
  39. 150
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  40. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSaSeEdiCompareExportService.cs
  41. 155
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  42. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs
  43. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs
  44. 57
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PubSaSeCompareExportService.cs
  45. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeCompareExportBaseService.cs
  46. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs
  47. 200
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs
  48. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

10
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs

@ -1,5 +1,4 @@
using System;
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
@ -13,20 +12,21 @@ public class Program
{
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true);
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true)
.Build();
Log.Logger = new LoggerConfiguration()
.WriteTo.Async(c => c.File(Path.Combine(Directory.GetCurrentDirectory(), "../Logs/logs.txt")
.WriteTo.Async(c => c.Console())
.WriteTo.Async(c => c.File("Logs/logs.txt"
, rollingInterval: RollingInterval.Day
, rollOnFileSizeLimit: true
, fileSizeLimitBytes: 30 * 1024 * 1024))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
Log.Information("Starting web host.");
CreateHostBuilder(args).Build().Run();
CreateHostBuilder(args).UseSerilog().Build().Run();
return 0;
}
catch (Exception ex)

6
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js

@ -92,7 +92,7 @@ export default {
</template>
<template v-else>
<template v-if="!item.hideForList&&showColumn(item,key)">
<el-table-column :prop="key" sortable="custom" :sort-orders="['descending', 'ascending', null]" :filters="getFilters(item,key)">
<el-table-column :prop="key" sortable="custom" :sort-orders="['descending', 'ascending', null]">
<template #header="scope">{{item.title}}</template>
<template #default="scope">
<app-form-input mode="details" :schema="item" :prop="key" v-model="scope.row" />
@ -441,6 +441,9 @@ export default {
}
return null;
};
const filterHandler = (value, row, column) => {
return row[column.property] === value;
};
const handleSelectionChange = (rows) => (selectedRows.value = rows);
const load = async () => {
tableLoading.value = true;
@ -863,6 +866,7 @@ export default {
pushfilterList,
getOperators,
getFilters,
filterHandler,
};
},
};

30
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/base-data/xiao-shou.js

@ -82,6 +82,36 @@ export default function () {
value: null,
readOnly: true,
},
{
logic: "and",
column: "beginTime",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
clearable: true,
},
{
logic: "and",
column: "endTime",
action: "smallThan",
value: null,
readOnly: true,
clearable: true,
},
{
logic: "and",
column: "clientCode",
action: "like",
value: null,
readOnly: true,
},
{
logic: "and",
column: "contractNo",
action: "like",
value: null,
readOnly: true,
},
],
},
skipCount: {

18
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/settle/detail.js

@ -139,6 +139,24 @@ export default function (businessType, type) {
},
},
default: [
{
logic: "and",
column: "settleDate",
action: "biggerThanOrEqual",
value: null,
readOnly: true,
clearable: true,
title: "下线开始",
},
{
logic: "and",
column: "settleDate",
action: "smallThan",
value: null,
readOnly: true,
clearable: true,
title: "下线结束",
},
{
logic: "and",
action: "like",

11
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/home.js

@ -21,20 +21,13 @@ export default {
if (input) {
result.push({
...createRoute("input", "数据输入"),
children: [
{ ...createRoute("jie-suan", "结算数据", page) },
{ ...createRoute("fa-yun", "发运数据", page) },
{ ...createRoute("edi", "EDI数据", page) },
],
children: [{ ...createRoute("jie-suan", "结算数据", page) }, { ...createRoute("fa-yun", "发运数据", page) }, { ...createRoute("edi", "EDI数据", page) }],
});
}
if (compare) {
result.push({
...createRoute("compare", "数据比对"),
children: [
{ ...createRoute("fa-yun", "EDI与发运数据", page) },
{ ...createRoute("jie-suan", "EDI、发运与计算数据比对", page) },
],
children: [{ ...createRoute("fa-yun", "EDI与发运数据", page) }, { ...createRoute("jie-suan", "EDI、发运与计算数据比对", page) }],
});
}
if (settle) {

69
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js

@ -19,7 +19,6 @@ export default {
<app-table :data="model.invoicE_MAP_GROUP" :columns="columns1" />
</el-scrollbar>
</el-tab-pane>
<el-tab-pane :label="columns2.title" v-if="model.invoicE_WAIT_DETAIL?.length">
<el-scrollbar>
<app-table :data="model.invoicE_WAIT_DETAIL" :columns="columns2" />
@ -83,7 +82,7 @@ export default {
<el-row style="width:100%;height:100%;padding:10px;">
<el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL" :columns="setup2columns" />
<app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL??model.invoicE_WAIT_DETAIL_BBAC??model.invoicE_WAIT_DETAIL_BJ" :columns="setup2columns" />
</el-scrollbar>
</el-col>
<el-col :span="12" style="height:100%;padding:0 0 0 5px;">
@ -97,14 +96,20 @@ export default {
<el-row style="width:100%;height:100%;padding:10px;">
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<el-descriptions>
<el-descriptions-item label="发票号">{{setup3Model.invbillNum}}</el-descriptions-item>
<el-descriptions-item label="业务类型">{{businessTypes.options.find(o=>o.value===setup3Model.businesType)?.label}}</el-descriptions-item>
<el-descriptions-item label="未税金额">{{setup3Model.tax}}</el-descriptions-item>
<el-descriptions-item label="税额">{{setup3Model.businesType}}</el-descriptions-item>
<el-descriptions-item label="税率">{{setup3Model.businesType}}</el-descriptions-item>
</el-descriptions>
<app-table :data="setup3Model.detail" :columns="setup2columns" />
<el-tabs style="height:100%;">
<template v-for="item in setup3Model.items">
<el-tab-pane :label="item.invbillNum">
<el-descriptions border>
<el-descriptions-item label="发票号">{{item.invbillNum}}</el-descriptions-item>
<el-descriptions-item label="业务类型">{{businessTypes.options.find(o=>o.value===item.businesType)?.label}}</el-descriptions-item>
<el-descriptions-item label="未税金额">{{item.tax}}</el-descriptions-item>
<el-descriptions-item label="税额">{{item.businesType}}</el-descriptions-item>
<el-descriptions-item label="税率">{{item.businesType}}</el-descriptions-item>
</el-descriptions>
<app-table v-if="item.detail" :data="item.detail" :columns="setup2columns" />
</el-tab-pane>
</template>
</el-tabs>
</el-scrollbar>
</el-col>
</el-row>
@ -127,7 +132,7 @@ export default {
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1&&setupRef<4">上一步</el-button>
</span>
<span class="dialog-footer">
<el-button type="primary" @click="next" v-if="setupRef<3">下一步</el-button>
<el-button type="primary" @click="next" v-if="setupRef<4">下一步</el-button>
</span>
</template>
</el-dialog>
@ -193,7 +198,9 @@ export default {
watch(show, (value) => context.emit("update:modelValue", value));
const loading = ref(false);
const model = ref({
invoicE_WAIT_DETAIL: [],
invoicE_WAIT_DETAIL: null,
invoicE_WAIT_DETAIL_BBAC: null,
invoicE_WAIT_DETAIL_BJ: null,
invoicE_MAP_GROUP: [],
invoicE_NOT_SETTLE: [],
adJ_DETAIL: [],
@ -564,6 +571,14 @@ export default {
}
};
const next = async () => {
let service = null;
if (props.businessType === "JisBBAC") {
service = "bbac_ba_service";
} else if (props.usinessType === "JisHBPO") {
service = "hbpo_ba_service";
} else {
service = "pub_ba_service";
}
if (setupRef.value === 1) {
try {
// setupRef.value += 1;
@ -587,47 +602,31 @@ export default {
});
});
} else if (result.data?.code === 400) {
ElMessage({
type: "error",
message: "操作失败",
});
// ElMessage({
// type: "error",
// message: "操作失败",
// });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} catch (e) {
console.log(e);
}
} else if (setupRef.value === 2) {
let service = null;
if (props.businessType === "JisBBAC") {
service = "bbac_ba_service";
} else if (props.usinessType === "JisHBPO") {
service = "hbpo_ba_service";
} else {
service = "pub_ba_service";
}
const url = `settleaccount/${service}}/reissue-invoice-list`;
const url = `settleaccount/${service}/reissue-invoice-list`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
//setup3的数据来源
setup3Model.value = result.data.data;
setup3Model.value = result.data;
setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} else if (setupRef.value === 3) {
const url = `settleaccount/${service}}/reissue-invoice-extend`;
const url = `settleaccount/${service}/reissue-invoice-extend`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) {
setupRef.value += 1;
} else if (result.data?.code === 400 && result.data.fileName) {
ElMessage({
type: "error",
message: "操作失败",
});
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} else {

8
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -133,7 +133,7 @@ public class PriceListImportDto
/// </summary>
[Display(Name = "零件号")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "*Part No.")]
[ImporterHeader(Name = "Part No.")]
public string PartNo { get; set; }
/// <summary>
/// 价格
@ -143,17 +143,17 @@ public class PriceListImportDto
/// <summary>
/// 开始时间
/// </summary>
[ImporterHeader(Name = "*Valid From")]
[ImporterHeader(Name = "Valid From")]
public DateTime ValidFrom { get; set; }
/// <summary>
/// 结束时间
/// </summary>
[ImporterHeader(Name = "*Valid To")]
[ImporterHeader(Name = "Valid To")]
public DateTime ValidTo { get; set; }
/// <summary>
/// 客户编码
/// </summary>
[ImporterHeader(Name = "*Plant")]
[ImporterHeader(Name = "Plant")]
public string Plant { get; set; }
/// <summary>
/// ES1

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -400,11 +400,10 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
//导入的零件号集合
var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct();
//销售价格
var priceListEntitys = _priceListRepository.Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false).Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
bbacSaDetails.ForEach(bbacSaDetail =>
{
//根据物料号、结算日期获取价格
//根据物料号、结算日期获取价格
var priceListEntity = priceListEntitys
.Where(t => t.LU == bbacSaDetail.LU)
@ -414,7 +413,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
.FirstOrDefault();
bbacSaDetail.Price = priceListEntity?.Price ?? 0;
bbacSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == bbacSaDetail.LU)?.ErpMaterialCode ?? bbacSaDetail.LU.Replace(new string(' ', 6), "-");
bbacSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == bbacSaDetail.LU)?.ErpMaterialCode;
});
#endregion

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs

@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@ -76,15 +75,13 @@ public class CompareService : ApplicationService
[HttpPost]
public async Task<string> SaSeCompare(SaSeCompareRequestDto saSeCompareRequestDto)
{
var isWuLiuRole = CurrentUser.IsInRole("物流") == true ? "物流" : "";
var businessTypeDisplayName = saSeCompareRequestDto.BusinessType.ToString();
var attributeOfType = saSeCompareRequestDto.BusinessType.GetAttributeOfType<DisplayAttribute>();
if (attributeOfType != null)
{
businessTypeDisplayName = attributeOfType.Name;
}
var projectName = $"{isWuLiuRole}{businessTypeDisplayName}结算与发运数据对比";
var projectName = $"{businessTypeDisplayName}结算与发运数据对比";
var customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version });

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -370,7 +370,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
//导入的零件号集合
var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct();
//销售价格
var priceListEntitys = _priceListRepository.Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false).Where(t => importPubSaLUs.Contains(t.LU)).ToList();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false);
hbpoSaDetails.ForEach(hbpoSaDetail =>
{
@ -383,7 +383,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
.FirstOrDefault();
hbpoSaDetail.Price = priceListEntity?.Price ?? 0;
hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode ?? hbpoSaDetail.LU.Replace(new string(' ', 6), "-");
hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode;
});
#endregion

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -443,7 +443,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
if (businessType == EnumBusinessType.BeiJian)
{
//备件销售价格
var priceListEntitys = _priceBjListRepository.Where(t => lus.Contains(t.LU)).ToList();
var priceListEntitys = _priceBjListRepository.Where(t => t.IsCancel == false)
.Where(t => lus.Contains(t.LU)).ToList();
pubSaDetails.ForEach(importPubSaDetail =>
{
//根据物料号、结算日期获取价格
@ -459,7 +460,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
else
{
//销售价格
var priceListEntitys = _priceListRepository.Where(t => lus.Contains(t.LU)).ToList();
var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false)
.Where(t => lus.Contains(t.LU)).ToList();
pubSaDetails.ForEach(importPubSaDetail =>
{
//根据物料号、结算日期获取价格
@ -467,6 +469,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
.Where(t => t.LU == importPubSaDetail.LU)
.Where(t => importPubSaDetail.SettleDate >= t.BeginTime && importPubSaDetail.SettleDate <= t.EndTime)
.OrderByDescending(t => t.Date)
.ThenByDescending(t => t.CreationTime)
.FirstOrDefault();
importPubSaDetail.Price = priceListEntity?.Price ?? 0;
});
@ -479,7 +482,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var seAllMaterialRelationships = materialRelationshipEntitys.Union(materialRelationships);
pubSaDetails.ForEach(pubSaDetail =>
{
pubSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.LU)?.ErpMaterialCode ?? pubSaDetail.LU.Replace(new string(' ', 6), "-");
pubSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.LU)?.ErpMaterialCode;
});
#endregion

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs

@ -90,11 +90,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public async Task<string> TextExportAsync()
{
var fileName = $"发运数据_{Guid.NewGuid()}.xlsx";
var haveEdiHaveSeList = new List<JisBBACEidSeCompareExport>();
var haveEdiHaveSeList = new List<JisBBACSeEidCompareReport>();
for (int i = 0; i < 2_000_000; i++)
{
haveEdiHaveSeList.Add(new JisBBACEidSeCompareExport()
haveEdiHaveSeList.Add(new JisBBACSeEidCompareReport()
{
Category = "JIS",
WmsBillNum = i.ToString(),
@ -119,7 +119,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
});
}
var jisBBACEidSeCompareEexcelExporterAttribute = typeof(JisBBACEidSeCompareExport).GetAttribute<ExcelExporterAttribute>();
var jisBBACEidSeCompareEexcelExporterAttribute = typeof(JisBBACSeEidCompareReport).GetAttribute<ExcelExporterAttribute>();
var jisBBACEidSeCompareEexcelMaxRowNumberOnASheet = 9_000_000;
if (jisBBACEidSeCompareEexcelExporterAttribute != null)
{

103
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System;
using System.Linq;
using System.Threading.Tasks;
using Coravel.Invocable;
@ -30,30 +29,44 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
/// </summary>
public async Task Invoke()
{
try
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
var ediDetailGroup = db.Set<BBAC_SE_EDI>()
.Where(t => t.IsDeleted == false && t.IsHaveSeData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
var keyCodes = (from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace
select new { se.PN, se.CustomerPartCodeNoSpace }
).Take(1000).ToList();
if (keyCodes.Any())
{
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace });
var ediDetailGroup = db.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var keyCodes = from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.LU == edi.LU
select new { se.PN, se.LU };
var seDetailsQuery = from se in db.Set<BBAC_SE_DETAIL>()
from keyCode in keyCodes
where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false
select se;
var ediDetailsQuery = from edi in db.Set<BBAC_SE_EDI>()
from keyCode in keyCodes
where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false
select edi;
var seDetails = seDetailsQuery.Take(5000).ToList();
var ediDetails = ediDetailsQuery.Take(5000).ToList();
var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<BBAC_SE_DETAIL>()
.GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x)
.ToList();
var ediDetails = db.Set<BBAC_SE_EDI>()
.Where(t => t.IsDeleted == false)
.Where(t => t.IsHaveSeData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<BBAC_SE_EDI>()
.GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x)
.ToList();
seDetails.ForEach(t => t.IsHaveEdiData = true);
ediDetails.ForEach(t => t.IsHaveSeData = true);
using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false);
try
{
@ -64,13 +77,8 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
catch (Exception)
{
await transaction.RollbackAsync().ConfigureAwait(false);
throw;
}
}
catch (Exception)
{
throw;
}
}
/// <summary>
@ -86,23 +94,38 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
*/
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
//Edi 删除的数据(有发运数据)
var ediDelKeyCodes = db.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).Select(t => new { t.PN, t.LU }).Distinct().ToList();
if (ediDelKeyCodes.Any())
var seed = 0;
while (seed < 10)
{
var seDetails = db.Set<BBAC_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<BBAC_SE_EDI>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
seed++;
//Edi 删除的数据(有发运数据)
var ediDelKeyCodes = db.Set<BBAC_SE_EDI>().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList();
if (ediDelKeyCodes.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = false);
db.Set<BBAC_SE_DETAIL>().UpdateRange(seDetails);
var seDetails = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == true)
.Where(t => ediDelKeyCodes.Contains(t.PN))
.ToList();
if (seDetails.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = false);
await db.BulkUpdateAsync<BBAC_SE_DETAIL>(seDetails).ConfigureAwait(false);
}
var ediDetails = db.Set<BBAC_SE_EDI>()
.Where(t => t.IsHaveSeData == true)
.Where(t => ediDelKeyCodes.Contains(t.PN))
.ToList();
if (ediDetails.Any())
{
ediDetails.ForEach(t => t.IsHaveSeData = false);
await db.BulkUpdateAsync<BBAC_SE_EDI>(ediDetails).ConfigureAwait(false);
}
}
if (ediDetails.Any())
else
{
ediDetails.ForEach(t => t.IsHaveSeData = false);
db.Set<BBAC_SE_EDI>().UpdateRange(ediDetails);
break;
}
await db.SaveChangesAsync().ConfigureAwait(false);
}
}
}

100
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
@ -31,34 +30,44 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
/// </summary>
public async Task Invoke()
{
try
{
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
await HandDelEdiDataAsync().ConfigureAwait(false);
await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false).GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }).Select(t => new { t.Key.PN, LU = t.Key.CustomerPartCodeNoSpace });
var ediDetailGroup = db.Set<HBPO_SE_EDI>().Where(t => t.IsDeleted == false && t.IsHaveSeData == false).GroupBy(t => new { t.PN, t.LU }).Select(t => new { t.Key.PN, t.Key.LU });
var seDetailGroup = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
var ediDetailGroup = db.Set<HBPO_SE_EDI>()
.Where(t => t.IsDeleted == false && t.IsHaveSeData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
var keyCodes = from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.LU == edi.LU
select new { se.PN, se.LU };
var seDetailsQuery = from se in db.Set<HBPO_SE_DETAIL>()
from keyCode in keyCodes
where se.PN == keyCode.PN && se.CustomerPartCodeNoSpace == keyCode.LU && se.IsHaveEdiData == false
select se;
var ediDetailsQuery = from edi in db.Set<HBPO_SE_EDI>()
from keyCode in keyCodes
where edi.PN == keyCode.PN && edi.LU == keyCode.LU && edi.IsDeleted == false && edi.IsHaveSeData == false
select edi;
var keyCodes = (from se in seDetailGroup
from edi in ediDetailGroup
where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace
select new { se.PN, se.CustomerPartCodeNoSpace }
).Take(1000).ToList();
if (keyCodes.Any())
{
var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = seDetailsQuery.Take(5000).ToList();
var ediDetails = ediDetailsQuery.Take(5000).ToList();
var seDetails = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<HBPO_SE_DETAIL>()
.GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x)
.ToList();
var ediDetails = db.Set<HBPO_SE_EDI>()
.Where(t => t.IsDeleted == false)
.Where(t => t.IsHaveSeData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<HBPO_SE_EDI>()
.GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x)
.ToList();
seDetails.ForEach(t => t.IsHaveEdiData = true);
ediDetails.ForEach(t => t.IsHaveSeData = true);
using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false);
try
{
@ -69,13 +78,8 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
catch (Exception)
{
await transaction.RollbackAsync().ConfigureAwait(false);
throw;
}
}
catch (Exception)
{
throw;
}
}
/// <summary>
@ -85,24 +89,38 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
{
using var serviceScope = _serviceProvider.CreateScope();
var db = serviceScope.ServiceProvider.GetRequiredService<SettleAccountDbContext>();
//Edi 删除的数据(有发运数据)
var ediDelKeyCodes = db.Set<HBPO_SE_EDI>().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).Select(t => new { t.PN, t.LU }).Distinct().ToList();
if (ediDelKeyCodes.Any())
var seed = 0;
while (seed < 10)
{
var seDetails = db.Set<HBPO_SE_DETAIL>().Join(ediDelKeyCodes, a => new { a.PN, LU = a.CustomerPartCodeNoSpace }, b => new { b.PN, b.LU }, (a, b) => a);
var ediDetails = db.Set<HBPO_SE_EDI>().Join(ediDelKeyCodes, a => new { a.PN, a.LU }, b => new { b.PN, b.LU }, (a, b) => a);
if (seDetails.Any())
seed++;
//Edi 删除的数据(有发运数据)
var ediDelKeyCodes = db.Set<HBPO_SE_EDI>().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList();
if (ediDelKeyCodes.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = false);
db.Set<HBPO_SE_DETAIL>().UpdateRange(seDetails);
var seDetails = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.IsHaveEdiData == true)
.Where(t => ediDelKeyCodes.Contains(t.PN))
.ToList();
if (seDetails.Any())
{
seDetails.ForEach(t => t.IsHaveEdiData = false);
await db.BulkUpdateAsync<HBPO_SE_DETAIL>(seDetails).ConfigureAwait(false);
}
var ediDetails = db.Set<HBPO_SE_EDI>()
.Where(t => t.IsHaveSeData == true)
.Where(t => ediDelKeyCodes.Contains(t.PN))
.ToList();
if (ediDetails.Any())
{
ediDetails.ForEach(t => t.IsHaveSeData = false);
await db.BulkUpdateAsync<HBPO_SE_EDI>(ediDetails).ConfigureAwait(false);
}
}
if (ediDetails.Any())
else
{
ediDetails.ForEach(t => t.IsHaveSeData = false);
db.Set<HBPO_SE_EDI>().UpdateRange(ediDetails);
break;
}
await db.SaveChangesAsync().ConfigureAwait(false);
}
}
}

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

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
@ -13,10 +14,7 @@ using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.Shared.RepositoryBase;
@ -30,26 +28,26 @@ namespace Win.Sfs.SettleAccount.Entities.Prices;
[Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppService : SettleAccountApplicationBase<PriceList>
{
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 销售价格仓储
/// </summary>
private readonly INormalEfCoreRepository<PriceList, Guid> _priceListRepository;
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository;
private readonly TaskJobService _service;
public PriceListAppService(
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<PriceList, Guid> priceListRepository,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository,
TaskJobService service,
IDistributedCache<PriceList> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_settleAccountDbContext = settleAccountDbContext;
_priceListRepository = priceListRepository;
_mapRepository = mapRepository;
_service = service;
}
#region 导入、导出
@ -70,22 +68,52 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
public virtual async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImportByHeadDesc<PriceListImportDto>(files, _excelImportService).ConfigureAwait(false);
List<string> _checkls = new List<string>();
_checkls.Add("1040");
_checkls.Add("1046");
_checkls.Add("104T");
result = result.Where(p => _checkls.Contains(p.Plant)).ToList();
result.ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);
var filter = new List<string>
{
"1040",
"1046",
"104T"
};
result = result.FindAll(p => filter.Contains(p.Plant)).ToList();
result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);
var entityList = ObjectMapper.Map<List<PriceListImportDto>, List<PriceList>>(result);
entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginTime, p.EndTime }).Select(p => p.FirstOrDefault()).ToList();
var newPrice = entityList.GroupBy(p => p.LU).Select(p => p.FirstOrDefault()).ToList();
foreach (var item in entityList)
var importLus = newPrice.Select(t => t.LU).Distinct().ToList();
var oldPrices = _settleAccountDbContext.Set<PriceList>()
.Where(t => t.IsCancel == false)
.Where(t => importLus.Contains(t.LU))
.ToList();
//系统中合同日期比导入文件中的合同日期晚
var oldpriceNewDate = from oldprice in oldPrices
from newprice in newPrice
where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date
select oldprice;
oldPrices.ForEach(t => t.IsCancel = true);
if (oldpriceNewDate.Any())
{
oldPrices.FindAll(t => oldpriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false);
var importCancelLus = oldPrices.Select(t => t.LU).Distinct();
newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true);
}
foreach (var item in newPrice)
{
item.Update(GuidGenerator.Create());
}
await _priceListRepository.InsertManyAsync(entityList).ConfigureAwait(false);
using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false);
try
{
await _settleAccountDbContext.BulkUpdateAsync<PriceList>(oldPrices).ConfigureAwait(false);
await _settleAccountDbContext.BulkInsertAsync<PriceList>(newPrice).ConfigureAwait(false);
await transaction.CommitAsync().ConfigureAwait(false);
}
catch (Exception)
{
await transaction.RollbackAsync().ConfigureAwait(false);
return new JsonResult(new { Code = 200, Message = "导入失败" });
}
return new JsonResult(new { Code = 200, Message = "导入成功" });
}

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

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
@ -11,7 +12,6 @@ using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
@ -26,9 +26,14 @@ namespace Win.Sfs.SettleAccount.Entities.Prices;
[Route("api/settleaccount/[controller]/[action]")]
public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
{
/// <summary>
/// 数据上下文
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
private readonly INormalEfCoreRepository<PriceListBJ, Guid> _repository;
public PriceListAppServiceBJ(
SettleAccountDbContext settleAccountDbContext,
INormalEfCoreRepository<PriceListBJ, Guid> repository,
IDistributedCache<PriceListBJ> cache,
IExcelImportAppService excelImportService,
@ -36,6 +41,7 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_settleAccountDbContext = settleAccountDbContext;
_repository = repository;
}
@ -47,23 +53,53 @@ public class PriceListAppServiceBJ : SettleAccountApplicationBase<PriceListBJ>
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImportByHeadDesc<PriceListBJImportDto>(files, _excelImportService).ConfigureAwait(false);
List<string> _checkls = new List<string>();
_checkls.Add("1040");
_checkls.Add("1046");
_checkls.Add("104T");
result = result.Where(p => _checkls.Contains(p.ClientCode)).ToList();
var filter = new List<string>
{
"1040",
"1046",
"104T"
};
result = result.Where(p => filter.Contains(p.ClientCode)).ToList();
var entityList = ObjectMapper.Map<List<PriceListBJImportDto>, List<PriceListBJ>>(result);
entityList = entityList.GroupBy(p => new { p.LU, p.ClientCode, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList();
var newPrice = entityList.GroupBy(p => p.LU).Select(p => p.FirstOrDefault()).ToList();
foreach (var item in entityList)
var importLus = newPrice.Select(t => t.LU).Distinct().ToList();
var oldPrices = _settleAccountDbContext.Set<PriceListBJ>()
.Where(t => t.IsCancel == false)
.Where(t => importLus.Contains(t.LU))
.ToList();
//系统中合同日期比导入文件中的合同日期晚
var oldpriceNewDate = from oldprice in oldPrices
from newprice in newPrice
where oldprice.LU == newprice.LU && oldprice.Date > newprice.Date
select oldprice;
oldPrices.ForEach(t => t.IsCancel = true);
if (oldpriceNewDate.Any())
{
oldPrices.FindAll(t => oldpriceNewDate.Contains(t)).ForEach(t => t.IsCancel = false);
var importCancelLus = oldPrices.Select(t => t.LU).Distinct();
newPrice.FindAll(t => importCancelLus.Contains(t.LU)).ForEach(t => t.IsCancel = true);
}
foreach (var item in newPrice)
{
item.Update(GuidGenerator.Create());
}
await _repository.InsertManyAsync(entityList).ConfigureAwait(false);
using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false);
try
{
await _settleAccountDbContext.BulkUpdateAsync<PriceListBJ>(oldPrices).ConfigureAwait(false);
await _settleAccountDbContext.BulkInsertAsync<PriceListBJ>(newPrice).ConfigureAwait(false);
await transaction.CommitAsync().ConfigureAwait(false);
}
catch (Exception)
{
await transaction.RollbackAsync().ConfigureAwait(false);
return new JsonResult(new { Code = 200, Message = "导入失败" });
}
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs

@ -43,10 +43,6 @@ public class JobAppService: ApplicationService
[UnitOfWork(false)]
public virtual async Task<PagedResultDto<JobDto>> GetListAsync(JobRequestDto input)
{
if (CurrentUser.IsInRole("物流") && input.Name.Contains("对比"))
{
input.Name = "物流" + input.Name;
}
var lists = await _service.GetListAsync(input).ConfigureAwait(false);
return new PagedResultDto<JobDto>(lists.Count, lists);
}

26
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -12,6 +12,7 @@ using Volo.Abp.Validation;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
using Win.Sfs.SettleAccount.Entities.SettleAccountDomain;
using Win.Sfs.SettleAccount.Enums;
using static System.Runtime.CompilerServices.RuntimeHelpers;
namespace SettleAccount.Bases
@ -342,11 +343,8 @@ namespace SettleAccount.Bases
public class SA_BASE : AuditedAggregateRoot<Guid>, ISA_BASE
{
public SA_BASE() { }
public SA_BASE(Guid id) : base(id) { }
/// <summary>
/// 期间
/// </summary>
@ -392,16 +390,15 @@ namespace SettleAccount.Bases
/// 厂内物料号
/// </summary>
public virtual string PartCode { get; set; }
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
/// <summary>
/// 匹配类型
/// </summary>
public EnumMappingType MappingType { get; set; }
}
public class SA_CAN_BASE : AuditedAggregateRoot<Guid>, ISA_BASE
@ -600,6 +597,13 @@ namespace SettleAccount.Bases
/// 数量
/// </summary>
public decimal Qty { get; set; }
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
}
public class PD_BASE : FullAuditedAggregateRoot<Guid>, ISBASE
{
@ -682,6 +686,12 @@ namespace SettleAccount.Bases
public class JisSeBase : SE_BASE
{
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; }
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; }
[Display(Name = "注塑码")]
public string InjectionCode { get; set; }
/// <summary>
/// UID
/// </summary>

41
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs

@ -1,54 +1,13 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using SettleAccount.Bases;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC发运单")]
public class BBAC_SE_DETAIL : JisSeBase
{
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "LU+生产码")]
//public string KeyCode { get; set; } = null!;
//[Display(Name = "期间")]
//public int Version { get; set; }
//[Display(Name = "零件号")]
//public string LU { get; set; } = null!;
//[Display(Name = "生产码")]
//public string PN { get; set; } = null!;
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; } = null!;
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; } = null!;
[Display(Name = "注塑码")]
public string InjectionCode { get; set; } = null!;
//[Display(Name = "发货数量")]
//public decimal Qty { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
//[Display(Name = "发货时间")]
//public DateTime ShippingDate { get; set; }
//[Display(Name = "Wms发货单号")]
//public string WmsBillNum { get; set; } = null!;
public BBAC_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum)
{
Id= guid;

18
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs

@ -3,14 +3,14 @@ using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC的EDI数据")]
public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
{
public class SE_EDI : FullAuditedAggregateRoot<Guid>
{
[Display(Name = "LU+生产码")]
public string KeyCode { get; set; } = null!;
[Display(Name = "期间")]
public int Version { get; set; }
public int Version { get; set; }
[Display(Name = "零件号")]
public string LU { get; set; } = null!;
@ -43,7 +43,7 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
public string Extend2 { set; get; }
[Display(Name = "生产码序列号")]
public string Extend3 { set; get; }
[Display(Name ="车型")]
[Display(Name = "车型")]
public string Extend4 { set; get; }
/// <summary>
@ -54,7 +54,7 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
/// <summary>
/// 生产线
/// </summary>
[Display(Name ="生产线")]
[Display(Name = "生产线")]
[MaxLength(50)]
public string LineStationCode { set; get; }
@ -63,7 +63,11 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
[Display(Name = "原客户零件号")]
[MaxLength(50)]
public string CustomerPartCodeNoSpace { set; get; }
}
[Display(Name = "BBAC的EDI数据")]
public class BBAC_SE_EDI : SE_EDI
{
public BBAC_SE_EDI()
{ }
public BBAC_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate
@ -86,7 +90,7 @@ public class BBAC_SE_EDI:FullAuditedAggregateRoot<Guid>
Extend2 = extend2;
Extend3 = extend3;
Extend4 = extend4;
customerPartCodeNoSpace = customerPartCodeNoSpace;
CustomerPartCodeNoSpace = customerPartCodeNoSpace;
}
public BBAC_SE_EDI SetQty(decimal qty)

39
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs

@ -8,45 +8,6 @@ namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO发运数据")]
public class HBPO_SE_DETAIL : JisSeBase
{
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "LU+生产码")]
//public string KeyCode { get; set; } = null!;
//[Display(Name = "期间")]
//public int Version { get; set; }
//[Display(Name = "零件号")]
//public string LU { get; set; } = null!;
//[Display(Name = "生产码")]
//public string PN { get; set; } = null!;
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; } = null!;
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; } = null!;
[Display(Name = "注塑码")]
public string InjectionCode { get; set; } = null!;
//[Display(Name = "发货数量")]
//public decimal Qty { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
//[Display(Name = "发货时间")]
//public DateTime ShippingDate { get; set; }
//[Display(Name = "Wms发货单号")]
//public string WmsBillNum { get; set; } = null!;
public HBPO_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum)
{
this.Id = guid;

57
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs

@ -4,63 +4,8 @@ using Volo.Abp.Domain.Entities.Auditing;
namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO的EDI数据")]
public class HBPO_SE_EDI :FullAuditedAggregateRoot<Guid>
public class HBPO_SE_EDI : SE_EDI
{
[Display(Name = "LU+生产码")]
public string KeyCode { get; set; } = null!;
[Display(Name = "期间")]
public int Version { get; set; }
[Display(Name = "零件号")]
public string LU { get; set; } = null!;
/// <summary>
/// 对应字段ExternalCalNumber
/// </summary>
[Display(Name = "生产码")]
public string PN { get; set; } = null!;
[Display(Name = "日顺序号")]
public string SeqNumber { get; set; } = null!;
[Display(Name = "小总成号")]
public string AssemblyCode { get; set; } = null!;
[Display(Name = "注塑码")]
public string InjectionCode { get; set; } = null!;
[Display(Name = "EDI数量")]
public decimal Qty { get; set; }
[Display(Name = "订货时间")]
public DateTime BeginDate { get; set; }
[Display(Name = "工厂")]
public string Site { get; set; }
public string Extend1 { set; get; }
public string Extend2 { set; get; }
public string Extend3 { set; get; }
public string Extend4 { set; get; }
/// <summary>
/// 是否有发运数据
/// </summary>
[Display(Name = "是否有发运数据")]
public bool IsHaveSeData { get; set; }
[Display(Name = "原客户零件号")]
[MaxLength(50)]
public string CustomerPartCodeNoSpace { set; get; }
public HBPO_SE_EDI(Guid guid ,string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, string site, string extend1, string extend2, string extend3, string extend4, string customerPartCodeNoSpace)
{
Id = guid;

9
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs

@ -17,15 +17,6 @@ public class PUB_SE_DETAIL :SE_BASE
[Display(Name = "扩展3")]
public string Extend3 { get; set; } = null!;
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
[Display(Name = "订单时间")]
public DateTime BeginDate { get; set; }
/// <summary>
/// UID
/// </summary>

21
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs

@ -75,43 +75,41 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// </summary>
[Display(Name = "零件号")]
public string LU { get; set; }
/// <summary>
/// 价格
/// </summary>
[Display(Name = "价格")]
public Decimal Price { set; get; }
/// <summary>
/// 开始时间
/// </summary>
[Display(Name = "开始时间")]
public DateTime BeginTime { set; get; }
/// <summary>
/// 结束时间
/// </summary>
[Display(Name = "结束时间")]
public DateTime EndTime { set; get; }
/// <summary>
/// 客户编码
/// </summary>
[Display(Name = "客户编码")]
public string ClientCode { get; set; }
/// <summary>
/// 合同签订时间
/// </summary>
[Display(Name = "合同签订时间")]
public DateTime Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
/// <summary>
/// 是否作废
/// </summary>
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }
@ -227,25 +225,26 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// </summary>
[Display(Name = "结算时间")]
public DateTime EndDate { set; get; }
/// <summary>
/// 客户编码
/// </summary>
[Display(Name = "客户编码")]
public string ClientCode { get; set; }
/// <summary>
/// 合同签订时间
/// </summary>
[Display(Name = "合同签订时间")]
public DateTime Date { get; set; }
/// <summary>
/// 合同号
/// </summary>
[Display(Name = "合同号")]
public string ContractNo { get; set; }
/// <summary>
/// 是否作废
/// </summary>
[Display(Name = "是否作废")]
public bool IsCancel { get; set; }

147
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACEidSeCompareReport.cs

@ -1,147 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisBBAC Edi与发运对比
/// </summary>
public class JisBBACEidSeCompareReport
{
}
/// <summary>
/// JisBBAC Edi、发运对比导出
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisBBACEidSeCompareExport
{
/// <summary>
/// 类别
/// </summary>
[Display(Name = "类别")]
[ExporterHeader(DisplayName = "类别")]
public string Category { get; set; }
/// <summary>
/// 车型
/// </summary>
[Display(Name = "车型")]
[ExporterHeader(DisplayName = "车型")]
public string CarModeCode { get; set; }
/// <summary>
/// 生产线
/// </summary>
[Display(Name = "生产线")]
[ExporterHeader(DisplayName = "生产线")]
public string LineStationcode { get; set; }
/// <summary>
/// 生产码序列号日期
/// </summary>
[Display(Name = "生产码序列号日期")]
[ExporterHeader(DisplayName = "生产码序列号日期")]
public string SequenceNumber { get; set; }
/// <summary>
/// 生产码
/// </summary>
[Display(Name = "生产码")]
[ExporterHeader(DisplayName = "生产码")]
public string PN { get; set; }
/// <summary>
/// 物料号
/// </summary>
[Display(Name = "物料号")]
[ExporterHeader(DisplayName = "物料号")]
public string MaterialNumber { get; set; }
/// <summary>
/// 物料描述
/// </summary>
[Display(Name = "物料描述")]
[ExporterHeader(DisplayName = "物料描述")]
public string MaterialDes { get; set; }
/// <summary>
/// WMS发货数量
/// </summary>
[Display(Name = "WMS发货数量")]
[ExporterHeader(DisplayName = "WMS发货数量")]
public decimal SEQty { get; set; }
/// <summary>
/// EDI数量
/// </summary>
[Display(Name = "EDI数量")]
[ExporterHeader(DisplayName = "EDI数量")]
public decimal EdiQty { get; set; }
/// <summary>
/// WMS发货与EDI数量差
/// </summary>
[Display(Name = "WMS发货与EDI数量差")]
[ExporterHeader(DisplayName = "WMS发货与EDI数量差")]
public decimal DiffQty => SEQty - EdiQty;
/// <summary>
/// 交货单号
/// </summary>
[Display(Name = "交货单号")]
[ExporterHeader(DisplayName = "交货单号")]
public string WmsBillNum { get; set; }
/// <summary>
/// ParType
/// </summary>
[Display(Name = "ParType")]
[ExporterHeader(DisplayName = "ParType")]
public string ParType { get; set; }
/// <summary>
/// 配置码
/// </summary>
[Display(Name = "配置码")]
[ExporterHeader(DisplayName = "配置码")]
public string MESConfigCode { get; set; }
/// <summary>
/// 发货日期
/// </summary>
[Display(Name = "发货日期")]
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Display(Name = "序列号")]
[ExporterHeader(DisplayName = "序列号")]
public string Seq { get; set; }
/// <summary>
/// PJIS日顺序号
/// </summary>
[Display(Name = "PJIS日顺序号")]
[ExporterHeader(DisplayName = "PJIS日顺序号")]
public string PjsNum { get; set; }
/// <summary>
/// 客户下线时间
/// </summary>
[Display(Name = "客户下线时间")]
[ExporterHeader(DisplayName = "客户下线时间")]
public DateTime? AssemblyDate { get; set; }
/// <summary>
/// 小总成号
/// </summary>
[Display(Name = "小总成号")]
[ExporterHeader(DisplayName = "小总成号")]
public string MatchNumber { get; set; }
/// <summary>
/// 注塑码
/// </summary>
[Display(Name = "注塑码")]
[ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { get; set; }
/// <summary>
/// 是否完全匹配
/// </summary>
[Display(Name = "是否完全匹配")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
/// <summary>
/// 差异说明
/// </summary>
[Display(Name = "差异说明")]
[ExporterHeader(DisplayName = "差异说明")]
public string DiffDesc { get; set; }
}

11
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisBBACSeEidCompareReport.cs

@ -0,0 +1,11 @@
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisBBAC 发运、Edi与对比导出
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisBBACSeEidCompareReport : SeEidCompareReport
{
}

11
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOSeEidCompareReport.cs

@ -0,0 +1,11 @@
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisHBPO 发运、Edi与对比报告
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisHBPOSeEidCompareReport : SeEidCompareReport
{
}

118
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/PubSaSeCompareDiff.cs

@ -47,11 +47,6 @@ public class PubSaSeCompareDiff
[Display(Name = "发货数量")]
public decimal? SEQty { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
public decimal? FixPrice { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]
@ -299,12 +294,6 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -318,18 +307,6 @@ public class PubSaSeCompareDetailExportZhiGongJianBBAC : PubSaSeCompareDetailExp
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 直供件BBAC结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportZhiGongJianBBACWuLiu : PubSaSeCompareDetailExportZhiGongJianBBAC
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// 直供件HBPO结算与发运对比明细
@ -420,12 +397,6 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -439,19 +410,6 @@ public class PubSaSeCompareDetailExportZhiGongJianHBPO : PubSaSeCompareDetailExp
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 直供件HBPO结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportZhiGongJianHBPOWuLiu : PubSaSeCompareDetailExportZhiGongJianHBPO
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// 买单件BBAC结算与发运对比明细
/// </summary>
@ -543,12 +501,6 @@ public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExpo
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -562,19 +514,6 @@ public class PubSaSeCompareDetailExportMaiDanJianBBAC : PubSaSeCompareDetailExpo
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 买单件BBAC结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportMaiDanJianBBACWuLiu : PubSaSeCompareDetailExportMaiDanJianBBAC
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// 买单件HBPO结算与发运对比明细
/// </summary>
@ -666,12 +605,6 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -685,19 +618,6 @@ public class PubSaSeCompareDetailExportMaiDanJianHBPO : PubSaSeCompareDetailExpo
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 买单件HBPO结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportMaiDanJianHBPOWuLiu : PubSaSeCompareDetailExportMaiDanJianHBPO
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// 备件结算与发运对比明细
/// </summary>
@ -788,12 +708,6 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -807,19 +721,6 @@ public class PubSaSeCompareDetailExportBeiJian : PubSaSeCompareDetailExport, IPu
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 备件结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportBeiJianWuLiu : PubSaSeCompareDetailExportBeiJian
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}
/// <summary>
/// 印度件结算与发运对比明细
/// </summary>
@ -909,12 +810,6 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0;
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(DisplayName = "定价")]
public virtual decimal? FixPrice { get; set; }
/// <summary>
/// WMS目标库位
/// </summary>
[Display(Name = "WMS目标库位")]
@ -927,16 +822,3 @@ public class PubSaSeCompareDetailExportYinDuJian : PubSaSeCompareDetailExport, I
[ExporterHeader(DisplayName = "ERP目标库位")]
public string ToErpLocCode { get; set; }
}
/// <summary>
/// 印度件结算与发运对比明细物流
/// </summary>
public class PubSaSeCompareDetailExportYinDuJianWuLiu : PubSaSeCompareDetailExportYinDuJian
{
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
[ExporterHeader(IsIgnore = true)]
public override decimal? FixPrice { get; set; }
}

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs

@ -67,11 +67,6 @@ public class SaSeEdiCompareDiff
[Display(Name = "Eid数量")]
public decimal? EdiQty { get; set; }
/// <summary>
/// 定价
/// </summary>
[Display(Name = "定价")]
public decimal? FixPrice { get; set; }
/// <summary>
/// 生产号
/// </summary>
[Display(Name = "生产号")]

25
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/JisHBPOEidSeCompareReport.cs → code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs

@ -1,22 +1,13 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
namespace Win.Sfs.SettleAccount.Reports;
/// <summary>
/// JisHBPO Edi与发运对比
/// 发运、Edi与对比报告
/// </summary>
public class JisHBPOEidSeCompareReport
{
}
/// <summary>
/// JisHBPO Edi与发运对比导出
/// </summary>
[ExcelExporter(MaxRowNumberOnASheet = 500_000)]
public class JisHBPOEidSeCompareExport
public class SeEidCompareReport
{
/// <summary>
/// 类别
@ -103,12 +94,6 @@ public class JisHBPOEidSeCompareExport
[ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")]
public DateTime? ShippingDate { get; set; }
/// <summary>
/// 实际发货生产号
/// </summary>
[Display(Name = "实际发货生产号")]
[ExporterHeader(DisplayName = "实际发货生产号")]
public string RealCode { get; set; }
/// <summary>
/// 序列号
/// </summary>
[Display(Name = "序列号")]
@ -162,4 +147,10 @@ public class JisHBPOEidSeCompareExport
[Display(Name = "差异说明")]
[ExporterHeader(DisplayName = "差异说明")]
public string DiffDesc { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
[ExporterHeader(DisplayName = "备注")]
public string Remark { get; set; }
}

5777
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.Designer.cs

File diff suppressed because it is too large

190
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs

@ -0,0 +1,190 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202309071 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsCancel",
table: "Set_PriceListBJ",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsCancel",
table: "Set_PriceList",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "540d27f55bd9415bae51a264d888b256");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "f311bbe27f2d4dd088690d28c4dd8495");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "a641ae00f7db4b3cbf58dc098442c08b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "fc2fa51cd9124e2593e457241b79bc2b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "610f376ade18446f87589b9b99b16c6a");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "272db8024ec645dc837afb433687572f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "54a845290661424dbd6600f40a77ec27");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "8c5c164e5abc471a97ec8dada4195a53");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "9072cbd6edd74b80821d92e9d98d8d61");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "090f151b1c6e418299e23b7b2397a0cb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "dcd7451cfe3d4472b8eca39f7e890038");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsCancel",
table: "Set_PriceListBJ");
migrationBuilder.DropColumn(
name: "IsCancel",
table: "Set_PriceList");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "25540a425f78445b98a5590b3d708bcd");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "42328476bcab4eb38035d28596d5ecd9");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "7d49bd0d15124ee0b6de9f558fc9a429");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "4aea58b425a34947869fba8e92ade9f2");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "f65d6d2f92684535a920d7f3ed75699d");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "ec6c990fce2a4728a00c488c7757c172");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "dda70cc2fd7f4328be7860a550006ecb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "5e50b42897c1455597888da08f8587de");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "afe6ab9a36024802ba83dd3e32de0ad4");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "f98cf5180c124d88a4853f8c9e1ebece");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "2f035dd2eca74570a85ae5276cc99e1c");
}
}
}

5781
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.Designer.cs

File diff suppressed because it is too large

179
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs

@ -0,0 +1,179 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202309081 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LineStationCode",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "47fe18e0c4174614b1fcf60db5a35627");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "7ef18156df8f444b97ea9c14d54dbd42");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "12c345ad1a5146f993350fef54c3c6a7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "015197fa7217489f87d3f2aa90b88c9f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "0add991c7b55439d831a4df9d8073ea2");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "81771ab92b504c57bf3e240e41174522");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "02504a27952b462b8e294ff5886cb884");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "4962eff9d1874befaef668e046480d92");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "ac058682bcfd43a4922543012c542b0c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "be930d1502d742a8ae7d784c1a05ff60");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "e32d05eeb3ba41148010a47c05753298");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LineStationCode",
table: "Set_HBPO_SE_EDI");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "540d27f55bd9415bae51a264d888b256");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "f311bbe27f2d4dd088690d28c4dd8495");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "a641ae00f7db4b3cbf58dc098442c08b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "fc2fa51cd9124e2593e457241b79bc2b");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "610f376ade18446f87589b9b99b16c6a");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "272db8024ec645dc837afb433687572f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "54a845290661424dbd6600f40a77ec27");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "8c5c164e5abc471a97ec8dada4195a53");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "9072cbd6edd74b80821d92e9d98d8d61");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "090f151b1c6e418299e23b7b2397a0cb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "dcd7451cfe3d4472b8eca39f7e890038");
}
}
}

5790
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.Designer.cs

File diff suppressed because it is too large

201
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs

@ -0,0 +1,201 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202309082 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "MappingType",
table: "Set_PUB_SA_DETAIL",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "MappingType",
table: "Set_HBPO_SA_DETAIL",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "MappingType",
table: "Set_BBAC_SA_DETAIL",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "1aefd0b8d1ab49458c36e3932717ab35");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "6b33d7dda3f645dcbe8b4a3f51a7399f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "22c0f3b78cf8410392dbaf098eecc973");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "25d4d2fdf5e6403188ccd684459a6a47");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "9475ae5b030a480b81c539f9eeabd7d5");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "cdd7dba0132b488aa38becaebc9725eb");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "f54dc633986d4eba9ce0793f450545c0");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "d3521bfcefe94a38962bd1b7d72ed219");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "c63da47e046c4d8cbe927a450388df2f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "024d5742d21c41e4b63052f4e03f15f8");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "ff08e4cbf0c0461d8426470f9b84bf62");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MappingType",
table: "Set_PUB_SA_DETAIL");
migrationBuilder.DropColumn(
name: "MappingType",
table: "Set_HBPO_SA_DETAIL");
migrationBuilder.DropColumn(
name: "MappingType",
table: "Set_BBAC_SA_DETAIL");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
column: "ConcurrencyStamp",
value: "47fe18e0c4174614b1fcf60db5a35627");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
column: "ConcurrencyStamp",
value: "7ef18156df8f444b97ea9c14d54dbd42");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
column: "ConcurrencyStamp",
value: "12c345ad1a5146f993350fef54c3c6a7");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
column: "ConcurrencyStamp",
value: "015197fa7217489f87d3f2aa90b88c9f");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
column: "ConcurrencyStamp",
value: "0add991c7b55439d831a4df9d8073ea2");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "ConcurrencyStamp",
value: "81771ab92b504c57bf3e240e41174522");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
column: "ConcurrencyStamp",
value: "02504a27952b462b8e294ff5886cb884");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "ConcurrencyStamp",
value: "4962eff9d1874befaef668e046480d92");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "ConcurrencyStamp",
value: "ac058682bcfd43a4922543012c542b0c");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
column: "ConcurrencyStamp",
value: "be930d1502d742a8ae7d784c1a05ff60");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "ConcurrencyStamp",
value: "e32d05eeb3ba41148010a47c05753298");
}
}
}

41
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -603,6 +603,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<int>("MappingType")
.HasColumnType("int");
b.Property<string>("PN")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@ -1835,6 +1838,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<int>("MappingType")
.HasColumnType("int");
b.Property<string>("PN")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@ -2172,6 +2178,10 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("LineStationCode")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("PN")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@ -3573,6 +3583,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<int>("MappingType")
.HasColumnType("int");
b.Property<string>("PN")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
@ -4461,7 +4474,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"),
ConcurrencyStamp = "f98cf5180c124d88a4853f8c9e1ebece",
ConcurrencyStamp = "024d5742d21c41e4b63052f4e03f15f8",
Cron = "0 0 8 26 *",
IsDisabled = false,
IsRunning = false,
@ -4471,7 +4484,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
ConcurrencyStamp = "25540a425f78445b98a5590b3d708bcd",
ConcurrencyStamp = "1aefd0b8d1ab49458c36e3932717ab35",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4481,7 +4494,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("1bb02f67-ed05-6cc1-1507-502e8f6c7a31"),
ConcurrencyStamp = "42328476bcab4eb38035d28596d5ecd9",
ConcurrencyStamp = "6b33d7dda3f645dcbe8b4a3f51a7399f",
Cron = "0 0/1 * * * ?",
IsDisabled = false,
IsRunning = false,
@ -4491,7 +4504,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
ConcurrencyStamp = "dda70cc2fd7f4328be7860a550006ecb",
ConcurrencyStamp = "f54dc633986d4eba9ce0793f450545c0",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4501,7 +4514,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
ConcurrencyStamp = "7d49bd0d15124ee0b6de9f558fc9a429",
ConcurrencyStamp = "22c0f3b78cf8410392dbaf098eecc973",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4511,7 +4524,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
ConcurrencyStamp = "f65d6d2f92684535a920d7f3ed75699d",
ConcurrencyStamp = "9475ae5b030a480b81c539f9eeabd7d5",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4521,7 +4534,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
ConcurrencyStamp = "4aea58b425a34947869fba8e92ade9f2",
ConcurrencyStamp = "25d4d2fdf5e6403188ccd684459a6a47",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4531,7 +4544,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
ConcurrencyStamp = "2f035dd2eca74570a85ae5276cc99e1c",
ConcurrencyStamp = "ff08e4cbf0c0461d8426470f9b84bf62",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4541,7 +4554,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
ConcurrencyStamp = "ec6c990fce2a4728a00c488c7757c172",
ConcurrencyStamp = "cdd7dba0132b488aa38becaebc9725eb",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4551,7 +4564,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
ConcurrencyStamp = "afe6ab9a36024802ba83dd3e32de0ad4",
ConcurrencyStamp = "c63da47e046c4d8cbe927a450388df2f",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -4561,7 +4574,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new
{
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
ConcurrencyStamp = "5e50b42897c1455597888da08f8587de",
ConcurrencyStamp = "d3521bfcefe94a38962bd1b7d72ed219",
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
@ -5331,6 +5344,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<string>("LU")
.HasColumnType("nvarchar(max)");
@ -5406,6 +5422,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsCancel")
.HasColumnType("bit");
b.Property<string>("LU")
.HasColumnType("nvarchar(max)");

44
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSaSeEdiCompareExportService.cs

@ -16,6 +16,7 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectMapping;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
@ -72,33 +73,48 @@ namespace SettleAccount.Job.Services.Report
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var ediSeSaCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime);
var saSeEdiCompareDiffs = GetEdiSeSaCompareData(version, seStartDateTime, seEndDateTime);
HandleSaSeEdiCompareDiffList(ediSeSaCompareDiffs);
HandleSaSeEdiCompareDiffList(saSeEdiCompareDiffs);
#region 二次对比
//二次匹配上的记录
var secondMatchHaveSaHaveSes = HandleSecondCompare(saSeEdiCompareDiffs, businessType);
if (secondMatchHaveSaHaveSes.Any())
{
//二次匹配 匹配上的厂内零件号、PN
var secondMatchFPartCodePNs = secondMatchHaveSaHaveSes.Select(t => new { t.ReplaceFactoryPartCode, t.PN });
saSeEdiCompareDiffs.RemoveAll<SaSeEdiCompareDiff>(t => secondMatchFPartCodePNs.Contains(new { t.ReplaceFactoryPartCode, t.PN }));
saSeEdiCompareDiffs.AddRange(secondMatchHaveSaHaveSes);
//二次对比比对上的数据入库
var seCDetailEntitys = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<BBAC_SEC_DETAIL>>(secondMatchHaveSaHaveSes);
_settleAccountDbContext.Set<BBAC_SEC_DETAIL>().AddRange(seCDetailEntitys);
}
#endregion
#region 结算数据处理
HandleSaDetails<BBAC_CAN_SA_DETAIL, BBAC_NOT_SA_DETAIL>(ediSeSaCompareDiffs, businessType, version);
HandleSaDetails<BBAC_CAN_SA_DETAIL, BBAC_NOT_SA_DETAIL>(saSeEdiCompareDiffs, businessType, version);
#endregion
if (string.IsNullOrEmpty(lu) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.CustomerPartCode == lu);
}
if (string.IsNullOrEmpty(pn) == false)
{
ediSeSaCompareDiffs = ediSeSaCompareDiffs.FindAll(p => p.PN == pn);
saSeEdiCompareDiffs = saSeEdiCompareDiffs.FindAll(p => p.PN == pn);
}
ediSeSaCompareDiffs = ediSeSaCompareDiffs.OrderBy(t => t.Category).ToList();
saSeEdiCompareDiffs = saSeEdiCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
if (isWuLiu)
{
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBACWuLiu>>(ediSeSaCompareDiffs);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBACWuLiu>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBACWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(ediSeSaCompareDiffs);
var items = _objectMapper.Map<List<SaSeEdiCompareDiff>, List<SaSeEdiCompareDetailExportJisBBAC>>(saSeEdiCompareDiffs);
excelExporter = BindExcelExporter<SaSeEdiCompareDetailExportJisBBAC>(items, businessTypeDisplayName);
}
@ -126,7 +142,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -149,16 +164,17 @@ namespace SettleAccount.Job.Services.Report
//Edi
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty)
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU)
};
var seEdiGroup = from se in seGroup
join edi in ediGroup
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, CustomerPartCodeNoSpace = edi.LU }
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, edi.CustomerPartCodeNoSpace }
into ediTemp
from edi in ediTemp.DefaultIfEmpty()
select new
@ -189,7 +205,6 @@ namespace SettleAccount.Job.Services.Report
SAQty = sa.Qty,
SEQty = seEdi.Qty,
EdiQty = seEdi.EdiQty,
FixPrice = sa.Price,
ToLocCode = seEdi.ToLoc,
ToErpLocCode = seEdi.ErpToLoc,
SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace,
@ -213,7 +228,6 @@ namespace SettleAccount.Job.Services.Report
SAQty = sa.Qty,
SEQty = seEdi.Qty,
EdiQty = seEdi.EdiQty,
FixPrice = sa.Price,
ToLocCode = seEdi.ToLoc,
ToErpLocCode = seEdi.ErpToLoc,
SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace,

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

@ -1,10 +1,12 @@
using System;
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;
using SettleAccount.Job.SignalR;
using Shouldly;
@ -23,20 +25,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// BBAC发运、Edi对比导出服务
/// </summary>
public class JisBBACSeEdiCompareExportService : ITransientDependency, IExportJob
public class JisBBACSeEdiCompareExportService : SeEdiCompareExportBaseService, ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
@ -45,11 +39,9 @@ namespace SettleAccount.Job.Services.Report
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
IObjectMapper objectMapper,
SettleAccountDbContext settleAccountDbContext)
SettleAccountDbContext settleAccountDbContext) : base(settleAccountDbContext, hubContext)
{
_hubContext = hubContext;
_fileContainer = fileContainer;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
@ -63,135 +55,12 @@ namespace SettleAccount.Job.Services.Report
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = EnumBusinessType.JisBBAC.GetAttributeOfType<DisplayAttribute>()?.Name?? EnumBusinessType.JisBBAC.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
// Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(JisBBACEidSeCompareExport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (excelExporterAttribute != null)
{
maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet;
}
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<BBAC_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{
Category = "JIS",
CarModeCode = t.Max(t => t.Extend4),
LineStationcode = t.Max(t => t.LineStationCode),
SequenceNumber = t.Max(t => t.Extend3),
ParType = t.Max(t => t.Extend2),
PN = t.Key.PN,
MaterialNumber = t.Key.LU,
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<BBAC_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.CustomerPartCodeNoSpace, t.PN })
.Select(t => new JisBBACEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum),
MaterialNumber = t.Max(t => t.CustPartCode),
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<BBAC_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
Extend2 = groupItem.Max(t => t.Extend2),
Extend3 = groupItem.Max(t => t.Extend3),
Extend4 = groupItem.Max(t => t.Extend4),
LineStationCode = groupItem.Max(t => t.LineStationCode)
};
var seGroup = from se in _settleAccountDbContext.Set<BBAC_SE_DETAIL>()
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum),
CustPartCode = groupItem.Max(t => t.CustPartCode),
PartDesc = groupItem.Max(t => t.PartDesc),
InjectionCode = groupItem.Max(t => t.InjectionCode)
};
var haveEdiHaveSeList = (from edi in ediGroup
join se in seGroup
on new { edi.PN, edi.LU } equals new { se.PN, LU = se.CustomerPartCodeNoSpace }
select new JisBBACEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = se.BillNum,
CarModeCode = edi.Extend4,
LineStationcode = edi.LineStationCode,
SequenceNumber = edi.Extend3,
ParType = edi.Extend2,
MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime,
PN = se.PN,
Seq = se.Seq,
PjsNum = se.PjsNum,
MaterialNumber = se.CustPartCode,
MaterialDes = se.PartDesc,
SEQty = se.Qty,
EdiQty = edi.Qty,
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList);
haveEdiNotHaveSeList.Reverse();
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList);
notHaveEdiHaveSeList.Reverse();
var excelExporter = new ExcelExporter();
// EDI数据和发货对比
excelExporter.Append(haveEdiNotHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"BBACEDI数据和发货对比");
for (var i = 1; i < haveEdiNotHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = haveEdiNotHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"BBACEDI数据和发货对比-{i}");
}
// 发货和EDI数据对比
excelExporter.Append(notHaveEdiHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"BBAC发货和EDI数据对比");
for (var i = 1; i < notHaveEdiHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = notHaveEdiHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"BBAC发货和EDI数据对比-{i}");
}
var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, JisBBACSeEidCompareReport>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
@ -199,12 +68,5 @@ namespace SettleAccount.Job.Services.Report
Notify();
return id.ToString();
}
#region 私有方法
private void Notify()
{
this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
#endregion
}
}

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

@ -141,7 +141,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -164,16 +163,17 @@ namespace SettleAccount.Job.Services.Report
//Edi
var ediGroup = from edi in _settleAccountDbContext.Set<HBPO_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty)
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU)
};
var seEdiGroup = from se in seGroup
join edi in ediGroup
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, CustomerPartCodeNoSpace = edi.LU }
on new { se.PN, se.CustomerPartCodeNoSpace } equals new { edi.PN, edi.CustomerPartCodeNoSpace }
into ediTemp
from edi in ediTemp.DefaultIfEmpty()
select new
@ -204,7 +204,6 @@ namespace SettleAccount.Job.Services.Report
SAQty = sa.Qty,
SEQty = seEdi.Qty,
EdiQty = seEdi.EdiQty,
FixPrice = sa.Price,
ToLocCode = seEdi.ToLoc,
ToErpLocCode = seEdi.ErpToLoc,
SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace,
@ -228,7 +227,6 @@ namespace SettleAccount.Job.Services.Report
SAQty = sa.Qty,
SEQty = seEdi.Qty,
EdiQty = seEdi.EdiQty,
FixPrice = sa.Price,
ToLocCode = seEdi.ToLoc,
ToErpLocCode = seEdi.ErpToLoc,
SeCustomerPartCode = seEdi.CustomerPartCodeNoSpace,

155
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs

@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Shouldly;
@ -13,7 +13,6 @@ using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
@ -21,20 +20,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// HBPO发运、Edi对比导出服务
/// </summary>
public class JisHBPOSeEdiCompareExportService : ITransientDependency, IExportJob
public class JisHBPOSeEdiCompareExportService : SeEdiCompareExportBaseService, ITransientDependency, IExportJob
{
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
/// <summary>
/// 文件容器
/// </summary>
private readonly IBlobContainer<MyFileContainer> _fileContainer;
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// 构造
@ -42,11 +33,9 @@ namespace SettleAccount.Job.Services.Report
public JisHBPOSeEdiCompareExportService(
IHubContext<PageHub> hubContext,
IBlobContainer<MyFileContainer> fileContainer,
SettleAccountDbContext settleAccountDbContext)
SettleAccountDbContext settleAccountDbContext):base(settleAccountDbContext, hubContext)
{
_hubContext = hubContext;
_fileContainer = fileContainer;
_settleAccountDbContext = settleAccountDbContext;
}
/// <summary>
@ -60,137 +49,12 @@ namespace SettleAccount.Job.Services.Report
var strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
var businessTypeDisplayName = EnumBusinessType.JisHBPO.GetAttributeOfType<DisplayAttribute>()?.Name ?? EnumBusinessType.JisHBPO.ToString();
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
// Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(JisHBPOEidSeCompareExport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (excelExporterAttribute != null)
{
maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet;
}
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<HBPO_SE_EDI>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.LU, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
Category = "JIS",
CarModeCode = default,
LineStationcode = default,
SequenceNumber = t.Max(t => t.SeqNumber),
ParType = "01",
PN = t.Key.PN,
MaterialNumber = t.Key.LU,
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<HBPO_SE_DETAIL>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.CustomerPartCodeNoSpace, t.PN })
.Select(t => new JisHBPOEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum),
ToLoc = t.Max(t => t.ToLoc),
ErpToLoc = t.Max(t => t.ErpToLoc),
MaterialNumber = t.Max(t => t.CustPartCode),
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<HBPO_SE_EDI>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.LU } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.LU,
Qty = groupItem.Sum(t => t.Qty),
SeqNumber = groupItem.Max(t => t.SeqNumber)
};
var seGroup = from se in _settleAccountDbContext.Set<HBPO_SE_DETAIL>()
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc),
CustPartCode = groupItem.Max(t => t.CustPartCode),
PartDesc = groupItem.Max(t => t.PartDesc),
InjectionCode = groupItem.Max(t => t.InjectionCode)
};
var haveEdiHaveSeList = (from edi in ediGroup
join se in seGroup
on new { edi.PN, edi.LU } equals new { se.PN, LU = se.CustomerPartCodeNoSpace }
select new JisHBPOEidSeCompareExport()
{
Category = "JIS",
WmsBillNum = se.BillNum,
CarModeCode = default,
LineStationcode = default,
SequenceNumber = edi.SeqNumber,
ParType = "01",
MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime,
PN = se.PN,
Seq = se.Seq,
PjsNum = se.PjsNum,
ToLoc = se.ToLoc,
ErpToLoc = se.ErpToLoc,
MaterialNumber = se.CustPartCode,
MaterialDes = se.PartDesc,
SEQty = se.Qty,
EdiQty = edi.Qty,
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList);
haveEdiNotHaveSeList.Reverse();
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList);
notHaveEdiHaveSeList.Reverse();
var excelExporter = new ExcelExporter();
// EDI数据和发货对比
excelExporter.Append(haveEdiNotHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"HBPOEDI数据和发货对比");
for (var i = 1; i < haveEdiNotHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = haveEdiNotHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"HBPOEDI数据和发货对比-{i}");
}
// 发货和EDI数据对比
excelExporter.Append(notHaveEdiHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"HBPO发货和EDI数据对比");
for (var i = 1; i < notHaveEdiHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = notHaveEdiHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"HBPO发货和EDI数据对比-{i}");
}
var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, JisHBPOSeEidCompareReport>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);
@ -198,12 +62,5 @@ namespace SettleAccount.Job.Services.Report
Notify();
return id.ToString();
}
#region 私有方法
private void Notify()
{
this._hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
#endregion
}
}

16
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanBBACSaSeCompareExportService.cs

@ -72,7 +72,6 @@ namespace SettleAccount.Job.Services.Report
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var pubSaSeCompareDiffs = GetSaSeCompareData(version, seStartDateTime, seEndDateTime);
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs);
@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report
}
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianBBACWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianBBACWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianBBAC>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianBBAC>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
@ -141,7 +132,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -174,7 +164,6 @@ namespace SettleAccount.Job.Services.Report
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -196,7 +185,6 @@ namespace SettleAccount.Job.Services.Report
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,

16
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/MaiDanHBPOSaSeCompareExportService.cs

@ -72,7 +72,6 @@ namespace SettleAccount.Job.Services.Report
var seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
var pubSaSeCompareDiffs = GetSaSeCompareData(version, seStartDateTime, seEndDateTime);
HandlePubSaSeCompareDiffList(pubSaSeCompareDiffs);
@ -106,16 +105,8 @@ namespace SettleAccount.Job.Services.Report
}
pubSaSeCompareDiffs = pubSaSeCompareDiffs.OrderBy(t => t.Category).ToList();
var excelExporter = new ExcelExporter();
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPOWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPOWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportMaiDanJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportMaiDanJianHBPO>(items, businessTypeDisplayName);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
@ -141,7 +132,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -174,7 +164,6 @@ namespace SettleAccount.Job.Services.Report
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -196,7 +185,6 @@ namespace SettleAccount.Job.Services.Report
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLoc,
ToErpLocCode = se.ErpToLoc,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,

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

@ -91,7 +91,7 @@ namespace SettleAccount.Job.Services.Report
var seStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var seEndDateTime = property.Where(p => p.Name == "SeEndDateTime").FirstOrDefault().Value;
EnumBusinessType businessType = (EnumBusinessType)Enum.Parse(typeof(EnumBusinessType), strBusinessType);
var businessType = (EnumBusinessType)Enum.Parse(typeof(EnumBusinessType), strBusinessType);
var businessTypeDisplayName = businessType.ToString();
DisplayAttribute attributeOfType = businessType.GetAttributeOfType<DisplayAttribute>();
if (attributeOfType != null)
@ -99,7 +99,6 @@ namespace SettleAccount.Job.Services.Report
businessTypeDisplayName = attributeOfType.Name;
}
var filename = exportName.FirstOrDefault();
var isWuLiu = filename.StartsWith("物流");
//var pubSaSeCompareDiffs = _pubSaSeCompareDapperRepository.GetDetailDiffReportList(strBusinessType, version, seStartDateTime, seEndDateTime);
var pubSaSeCompareDiffs = GetSaSeCompareData(businessType, version, DateTime.Parse(seStartDateTime), DateTime.Parse(seEndDateTime));
@ -140,58 +139,26 @@ namespace SettleAccount.Job.Services.Report
{
case EnumBusinessType.ZhiGongJianBBAC:
{
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBACWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBACWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianBBAC>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianBBAC>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.ZhiGongJianHBPO:
{
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPOWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPOWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportZhiGongJianHBPO>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportZhiGongJianHBPO>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.BeiJian:
{
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJianWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJianWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportBeiJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportBeiJian>(items, businessTypeDisplayName);
}
break;
case EnumBusinessType.YinDuJian:
{
if (isWuLiu)
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJianWuLiu>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJianWuLiu>(items, businessTypeDisplayName);
}
else
{
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
}
var items = _objectMapper.Map<List<PubSaSeCompareDiff>, List<PubSaSeCompareDetailExportYinDuJian>>(pubSaSeCompareDiffs);
excelExporter = BindExcelExporter<PubSaSeCompareDetailExportYinDuJian>(items, businessTypeDisplayName);
}
break;
default:
@ -228,7 +195,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -261,7 +227,6 @@ namespace SettleAccount.Job.Services.Report
PN = sa.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -283,7 +248,6 @@ namespace SettleAccount.Job.Services.Report
PN = se.PN,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -310,7 +274,6 @@ namespace SettleAccount.Job.Services.Report
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
Price = groupItem.Max(t => t.Price),
SettleDate = groupItem.Max(t => t.SettleDate),
PartCode = groupItem.Max(t => t.PartCode),
};
@ -341,7 +304,6 @@ namespace SettleAccount.Job.Services.Report
CustomerOfflineTime = sa.SettleDate,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,
@ -362,7 +324,6 @@ namespace SettleAccount.Job.Services.Report
CustomerOfflineTime = sa.SettleDate,
SAQty = sa.Qty,
SEQty = se.Qty,
FixPrice = sa.Price,
ToLocCode = se.ToLocCode,
ToErpLocCode = se.ToErpLocCode,
SeCustomerPartCode = se.CustomerPartCodeNoSpace,

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

@ -4,10 +4,10 @@ using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using Microsoft.EntityFrameworkCore;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Volo.Abp;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Enums;
@ -113,7 +113,6 @@ namespace SettleAccount.Job.Services.Report
CustomerOfflineTime = haveSaNotHaveSe.CustomerOfflineTime,
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
FixPrice = haveSaNotHaveSe.FixPrice,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,
@ -184,9 +183,10 @@ namespace SettleAccount.Job.Services.Report
if (haveSaHaveSes.Any())
{
//结算详情
var saDetails = (from sa in _settleAccountDbContext.Set<T>()
where sa.BusinessType == businessType && sa.Version == version
select sa).ToList();
var saDetails = _settleAccountDbContext.Set<T>()
.Where(t => t.BusinessType == businessType)
.Where(t => t.Version == version)
.ToList();
if (saDetails.Any())
{
var saDetailsUpdate = saDetails.Join(haveSaHaveSes, o => new { o.PN, o.LU }, i => new { i.PN, LU = i.CustomerPartCode }, (o, i) =>
@ -202,6 +202,8 @@ namespace SettleAccount.Job.Services.Report
return o;
}).ToList();
_settleAccountDbContext.BulkUpdate(saDetailsUpdate);
_settleAccountDbContext.Set<BBAC_SA_DETAIL>().FromSqlInterpolated($"SELECT * FROM dbo.Blogs");
_settleAccountDbContext.Database.ExecuteSqlInterpolated($"SELECT * FROM dbo.Blogs");
}
}
}

1
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SaSeEdiCompareExportBaseService.cs

@ -116,7 +116,6 @@ namespace SettleAccount.Job.Services.Report
SAQty = haveSaNotHaveSe.SAQty,
SEQty = notHaveSaHaveSe.SEQty,
EdiQty = notHaveSaHaveSe.EdiQty,
FixPrice = haveSaNotHaveSe.FixPrice,
PN = haveSaNotHaveSe.PN,
ToLocCode = notHaveSaHaveSe.ToLocCode,
ToErpLocCode = notHaveSaHaveSe.ToErpLocCode,

200
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

@ -0,0 +1,200 @@
using System;
using System.Linq;
using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
using Win.Sfs.SettleAccount;
using Win.Sfs.SettleAccount.Consts;
using Win.Sfs.SettleAccount.Reports;
namespace SettleAccount.Job.Services.Report
{
/// <summary>
/// 发运、Edi对比服务
/// </summary>
public class SeEdiCompareExportBaseService
{
/// <summary>
/// DbContext
/// </summary>
private readonly SettleAccountDbContext _settleAccountDbContext;
/// <summary>
/// HubContext
/// </summary>
private readonly IHubContext<PageHub> _hubContext;
public SeEdiCompareExportBaseService(SettleAccountDbContext settleAccountDbContext, IHubContext<PageHub> hubContext)
{
_settleAccountDbContext = settleAccountDbContext;
_hubContext = hubContext;
}
#region 方法
/// <summary>
/// 获取发运、Eid比对数据
/// </summary>
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, string businessTypeDisplayName)
where TSe : JisSeBase
where TEdi : SE_EDI
where TCompareReport : SeEidCompareReport, new()
{
// Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
if (excelExporterAttribute != null)
{
maxRowNumberOnASheet = excelExporterAttribute.MaxRowNumberOnASheet > 0 ? excelExporterAttribute.MaxRowNumberOnASheet : maxRowNumberOnASheet;
}
//有EDI无发运
var haveEdiNotHaveSeList = _settleAccountDbContext.Set<TEdi>().Where(t => t.IsHaveSeData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport()
{
Category = "JIS",
CarModeCode = t.Max(t => t.Extend4),
LineStationcode = t.Max(t => t.LineStationCode),
SequenceNumber = t.Max(t => t.Extend3),
ParType = t.Max(t => t.Extend2),
PN = t.Key.PN,
MaterialNumber = t.Max(t => t.LU),
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.ForEach(t =>
{
t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber);
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : "";
});
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>().Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport()
{
Category = "JIS",
WmsBillNum = t.Max(t => t.BillNum),
MESConfigCode = t.Max(t => t.MESConfigCode),
ShippingDate = t.Max(t => t.BillTime),
PN = t.Max(t => t.PN),
Seq = t.Max(t => t.Seq),
PjsNum = t.Max(t => t.PjsNum),
ToLoc = t.Max(t => t.ToLoc),
ErpToLoc = t.Max(t => t.ErpToLoc),
MaterialNumber = t.Max(t => t.CustPartCode),
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
var ediGroup = from edi in _settleAccountDbContext.Set<TEdi>()
where edi.IsDeleted == false && edi.IsHaveSeData == true
group edi by new { edi.PN, edi.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
Extend2 = groupItem.Max(t => t.Extend2),
Extend3 = groupItem.Max(t => t.Extend3),
Extend4 = groupItem.Max(t => t.Extend4),
LineStationCode = groupItem.Max(t => t.LineStationCode)
};
var seGroup = from se in _settleAccountDbContext.Set<TSe>()
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
groupItem.Key.PN,
groupItem.Key.CustomerPartCodeNoSpace,
Qty = groupItem.Sum(t => t.Qty),
LU = groupItem.Max(t => t.LU),
BillNum = groupItem.Max(t => t.BillNum),
MESConfigCode = groupItem.Max(t => t.MESConfigCode),
BillTime = groupItem.Max(t => t.BillTime),
Seq = groupItem.Max(t => t.Seq),
PjsNum = groupItem.Max(t => t.PjsNum),
ToLoc = groupItem.Max(t => t.ToLoc),
ErpToLoc = groupItem.Max(t => t.ErpToLoc),
CustPartCode = groupItem.Max(t => t.CustPartCode),
PartDesc = groupItem.Max(t => t.PartDesc),
InjectionCode = groupItem.Max(t => t.InjectionCode)
};
var haveEdiHaveSeList = (from edi in ediGroup
join se in seGroup
on new { edi.PN, edi.CustomerPartCodeNoSpace } equals new { se.PN, se.CustomerPartCodeNoSpace }
select new TCompareReport()
{
Category = "JIS",
WmsBillNum = se.BillNum,
CarModeCode = edi.Extend4,
LineStationcode = edi.LineStationCode,
SequenceNumber = edi.Extend3,
ParType = edi.Extend2,
MESConfigCode = se.MESConfigCode,
ShippingDate = se.BillTime,
PN = se.PN,
Seq = se.Seq,
PjsNum = se.PjsNum,
ToLoc = se.ToLoc,
ErpToLoc = se.ErpToLoc,
MaterialNumber = se.CustPartCode,
MaterialDes = se.PartDesc,
SEQty = se.Qty,
EdiQty = edi.Qty,
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber));
haveEdiNotHaveSeList.AddRange(haveEdiHaveSeList);
haveEdiNotHaveSeList.Reverse();
notHaveEdiHaveSeList.AddRange(haveEdiHaveSeList);
notHaveEdiHaveSeList.Reverse();
var excelExporter = new ExcelExporter();
// EDI数据和发货对比
excelExporter.Append(haveEdiNotHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}EDI数据和发货对比");
for (var i = 1; i < haveEdiNotHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = haveEdiNotHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}EDI数据和发货对比-{i}");
}
// 发货和EDI数据对比
excelExporter.Append(notHaveEdiHaveSeList.Take(maxRowNumberOnASheet).ToList(), $"{businessTypeDisplayName}发货和EDI数据对比");
for (var i = 1; i < notHaveEdiHaveSeList.Count / maxRowNumberOnASheet + ((haveEdiNotHaveSeList.Count % maxRowNumberOnASheet) > 0 ? 1 : 0); i++)
{
var sheetDataItems = notHaveEdiHaveSeList.Skip(i * maxRowNumberOnASheet).Take(maxRowNumberOnASheet).ToList();
excelExporter.Append(sheetDataItems, $"{businessTypeDisplayName}发货和EDI数据对比-{i}");
}
return excelExporter;
}
/// <summary>
/// 通知
/// </summary>
public void Notify()
{
_hubContext.Clients.All.ServerToClient("SaSeCompare", "refresh", "");
}
/// <summary>
/// 获取生产码日期
/// </summary>
public string GetSequenceNumberDate(string sequenceNumber)
{
var sequenceNumberDate = sequenceNumber != null && sequenceNumber.Length >= 12 ? sequenceNumber[^12..^4] : sequenceNumber;
return sequenceNumberDate;
}
#endregion
}
}

8
code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs

@ -30,6 +30,8 @@ namespace SettleAccount.Job
{
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisBBAC>();
CreateMap<SaSeEdiCompareDiff, SaSeEdiCompareDetailExportJisHBPO>();
CreateMap<SaSeEdiCompareDiff, BBAC_SEC_DETAIL>();
CreateMap<SaSeEdiCompareDiff, HBPO_SEC_DETAIL>();
}
/// <summary>
@ -38,17 +40,11 @@ namespace SettleAccount.Job
private void CreateMapSaSeCompare()
{
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianBBACWuLiu>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportZhiGongJianHBPOWuLiu>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianBBAC>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianBBACWuLiu>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPO>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportMaiDanJianHBPOWuLiu>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportBeiJianWuLiu>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJian>();
CreateMap<PubSaSeCompareDiff, PubSaSeCompareDetailExportYinDuJianWuLiu>();
CreateMap<PubSaSeCompareDiff, PUB_SEC_DETAIL>();
}
}

Loading…
Cancel
Save