学 赵 1 year ago
parent
commit
8096c298d6
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  2. 28
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/settle/_check.js
  3. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs
  4. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs
  5. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs
  6. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
  7. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs
  8. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs
  9. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs
  10. 14
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SeEdiCompareExportBaseService.cs

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

@ -39,7 +39,7 @@ export default {
</template>
<div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
<div class="cell">
<template v-if="item.input==='datetime'">{{dayjs(model[prop]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-if="item.input==='datetime'">{{dayjs(model[key]).format('YYYY-MM-DD HH:mm:ss')}}</template>
<template v-else>{{row[key]}}</template>
</div>
</div>

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

@ -8,6 +8,7 @@ import extraProperties from "../../models/_extraProperties.js";
import { getUrl } from "../../request/index.js";
import businessTypes from "../../models/_options.js";
import { required, trim } from "../../utils/validation.js";
import { delay } from "../../utils/index.js";
export default {
components: { AppForm, AppTable },
@ -51,6 +52,7 @@ export default {
<el-button type="primary" @click="showSetupDialog" v-if="isBusiness&&data.invbillNum&&model.adJ_DETAIL.length===0&&row.invoiceState===1&&(row.state===3||row.state===4)">
报废重开
</el-button>
<el-button type="primary" @click="showSetupDialog"> 报废重开 </el-button>
</span>
</template>
</el-drawer>
@ -62,6 +64,7 @@ export default {
<el-step title="发票预览" />
<el-step title="重开成功" />
</el-steps>
<div v-loading="loading">
<div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);">
<el-row style="padding:14px 0;height:60px;">
<el-col>
@ -97,11 +100,11 @@ export default {
<el-col style="height:100%;padding:0 5px 0 0;">
<el-scrollbar>
<el-tabs style="height:100%;">
<template v-for="item in setup3Model">
<el-tab-pane :label="item.invbillNum??'null'">
<template v-for="(item,index) in setup3Model">
<el-tab-pane :label="item.invbillNum??('发票'+(index+1))">
<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="业务类型">{{businessTypes.options.find(o=>o.value===item.businessType)?.label}}</el-descriptions-item>
<el-descriptions-item label="未税金额">{{item.amt}}</el-descriptions-item>
<el-descriptions-item label="税后金额">{{item.taxAmt}}</el-descriptions-item>
<el-descriptions-item label="税额">{{item.realAmt }}</el-descriptions-item>
@ -128,12 +131,13 @@ export default {
</el-col>
</el-row>
</div>
</div>
<template #footer v-if="setupRef!==4">
<span class="dialog-footer">
<el-button type="primary" @click="setupRef-=1" v-if="setupRef>1&&setupRef<4">上一步</el-button>
<el-button type="primary" @click="setupRef-=1" :disabled="loading" v-if="setupRef>1&&setupRef<4">上一步</el-button>
</span>
<span class="dialog-footer">
<el-button type="primary" @click="next" v-if="setupRef<4">下一步</el-button>
<el-button type="primary" @click="next" :disabled="loading" v-if="setupRef<4">下一步</el-button>
</span>
</template>
</el-dialog>
@ -155,7 +159,7 @@ export default {
<el-dialog style="width:480px;height:480px;" align-center destroy-on-close :close-on-click-modal="false" v-model="importDialogVisible">
<template #header>导入调整明细</template>
<el-scrollbar>
<el-row v-loading="loading">
<el-row>
<el-col>
<app-form ref="importAdjFromRef" v-if="importDialogVisible&&importAdjModel" :schema="importAdjSchema" v-model="importAdjModel" :hideButton="true" inline />
</el-col>
@ -581,6 +585,8 @@ export default {
} else {
service = "pub_ba_service";
}
try {
loading.value = true;
if (setupRef.value === 1) {
try {
// setupRef.value += 1;
@ -603,11 +609,7 @@ export default {
addDiff(o, list1, ".amt");
});
});
} else if (result.data?.code === 400) {
// ElMessage({
// type: "error",
// message: "操作失败",
// });
} else if (result.data?.code === 400 && result.data.fileName) {
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} catch (e) {
@ -638,6 +640,10 @@ export default {
refreshRef.value = true;
});
}
} finally {
await delay(5000);
loading.value = false;
}
};
const drawerClosed = () => {
context.emit("complete");

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

@ -114,7 +114,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
AssemblyDate = DateTime.Now,
MatchNumber = i.ToString(),
InjectionCode = i.ToString(),
MateType = "是",
DiffDesc = "WMS有发货EDI有订单"
});
}

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

@ -18,10 +18,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
{
private readonly IServiceProvider _serviceProvider;
private readonly EnumBusinessType _businessType;
public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_businessType = EnumBusinessType.JisBBAC;
}
/// <summary>
@ -35,6 +37,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
@ -53,6 +56,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<BBAC_SE_DETAIL>()

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

@ -19,10 +19,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
{
private readonly IServiceProvider _serviceProvider;
private readonly EnumBusinessType _businessType;
public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_businessType = EnumBusinessType.JisHBPO;
}
/// <summary>
@ -36,6 +38,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key);
@ -54,6 +57,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN))
.AsEnumerable<HBPO_SE_DETAIL>()

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs

@ -12,49 +12,41 @@ public enum EnumBusinessType
/// </summary>
[Display(Name = "未定义")]
None = 0,
/// <summary>
/// JisBBAC
/// </summary>
[Display(Name = "JisBBAC")]
JisBBAC = 1,
/// <summary>
/// JisHBPO
/// </summary>
[Display(Name = "JisHBPO")]
JisHBPO = 2,
/// <summary>
/// 直供件BBAC
/// </summary>
[Display(Name = "直供件BBAC")]
ZhiGongJianBBAC = 3,
/// <summary>
/// 直供件HBPO
/// </summary>
[Display(Name = "直供件HBPO")]
ZhiGongJianHBPO = 4,
/// <summary>
/// 买单件BBAC
/// </summary>
[Display(Name = "买单件BBAC")]
MaiDanJianBBAC = 5,
/// <summary>
/// 买单件HBPO
/// </summary>
[Display(Name = "买单件HBPO")]
MaiDanJianHBPO = 6,
/// <summary>
/// 备件
/// </summary>
[Display(Name = "备件")]
BeiJian = 7,
/// <summary>
/// 印度件
/// </summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs

@ -136,11 +136,13 @@ public class SeEidCompareReport
[ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { get; set; }
/// <summary>
/// 是否完全匹配
/// 匹配类型
/// </summary>
[Display(Name = "是否完全匹配")]
[Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; }
[ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0m;
/// <summary>
/// 差异说明
/// </summary>

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

@ -52,12 +52,11 @@ 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();
var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, SeEidCompareReportJisBBAC>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var excelExporter = GetSeEdiCompareData<BBAC_SE_DETAIL, BBAC_SE_EDI, SeEidCompareReportJisBBAC>(seStartDateTime, seEndDateTime, EnumBusinessType.JisBBAC);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);

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

@ -49,12 +49,11 @@ 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();
var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, SeEidCompareReportJisHBPO>(seStartDateTime, seEndDateTime, businessTypeDisplayName);
var excelExporter = GetSeEdiCompareData<HBPO_SE_DETAIL, HBPO_SE_EDI, SeEidCompareReportJisHBPO>(seStartDateTime, seEndDateTime, EnumBusinessType.JisHBPO);
var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true);

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

@ -1,8 +1,10 @@
using System;
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.Bases;
using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR;
@ -36,11 +38,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary>
/// 获取发运、Eid比对数据
/// </summary>
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, string businessTypeDisplayName)
public ExcelExporter GetSeEdiCompareData<TSe, TEdi, TCompareReport>(DateTime seStartDateTime, DateTime seEndDateTime, EnumBusinessType businessType)
where TSe : JisSeBase
where TEdi : SE_EDI
where TCompareReport : SeEidCompareReport, new()
{
var businessTypeDisplayName = businessType.GetAttributeOfType<DisplayAttribute>()?.Name ?? businessType.ToString();
// Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
@ -63,7 +66,6 @@ namespace SettleAccount.Job.Services.Report
EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default,
MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单"
}).ToList();
haveEdiNotHaveSeList.ForEach(t =>
@ -72,7 +74,9 @@ namespace SettleAccount.Job.Services.Report
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : "";
});
//无EDI有发运
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>().Where(t => t.IsHaveEdiData == false)
var notHaveEdiHaveSeList = _settleAccountDbContext.Set<TSe>()
.Where(t => t.BusinessType == businessType)
.Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport()
{
@ -89,7 +93,6 @@ namespace SettleAccount.Job.Services.Report
MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单"
}).ToList();
//有EDI有发运
@ -107,7 +110,7 @@ namespace SettleAccount.Job.Services.Report
LineStationCode = groupItem.Max(t => t.LineStationCode)
};
var seGroup = from se in _settleAccountDbContext.Set<TSe>()
where se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
where se.BusinessType == businessType && se.IsHaveEdiData == true && se.BillTime >= seStartDateTime && se.BillTime <= seEndDateTime
group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new
{
@ -151,7 +154,6 @@ namespace SettleAccount.Job.Services.Report
AssemblyDate = default,
MatchNumber = default,
InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单"
}).ToList();
haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber));

Loading…
Cancel
Save