学 赵 1 year ago
parent
commit
8096c298d6
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/table/index.js
  2. 240
      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> </template>
<div class="cell el-table__cell" :class="key" v-else-if="!item.hidden"> <div class="cell el-table__cell" :class="key" v-else-if="!item.hidden">
<div class="cell"> <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> <template v-else>{{row[key]}}</template>
</div> </div>
</div> </div>

240
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 { getUrl } from "../../request/index.js";
import businessTypes from "../../models/_options.js"; import businessTypes from "../../models/_options.js";
import { required, trim } from "../../utils/validation.js"; import { required, trim } from "../../utils/validation.js";
import { delay } from "../../utils/index.js";
export default { export default {
components: { AppForm, AppTable }, 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 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>
<el-button type="primary" @click="showSetupDialog"> 报废重开 </el-button>
</span> </span>
</template> </template>
</el-drawer> </el-drawer>
@ -62,78 +64,80 @@ export default {
<el-step title="发票预览" /> <el-step title="发票预览" />
<el-step title="重开成功" /> <el-step title="重开成功" />
</el-steps> </el-steps>
<div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);"> <div v-loading="loading">
<el-row style="padding:14px 0;height:60px;"> <div class="setup1" v-show="setupRef===1" style="height:calc(100% - 120px);">
<el-col> <el-row style="padding:14px 0;height:60px;">
<el-button type="primary" @click="showAddAdjDialog">新建</el-button> <el-col>
<el-button type="primary" @click="showImportAdjDialog">导入</el-button> <el-button type="primary" @click="showAddAdjDialog">新建</el-button>
<el-button type="primary" @click="deleteAdj">删除</el-button> <el-button type="primary" @click="showImportAdjDialog">导入</el-button>
</el-col> <el-button type="primary" @click="deleteAdj">删除</el-button>
</el-row>
<el-scrollbar ref="scrollRef">
<el-row style="height:100%;">
<el-col style="height:calc(100% - 60px);">
<app-table ref="adjListRef" :data="adjList" :columns="columns5" />
</el-col> </el-col>
</el-row> </el-row>
</el-scrollbar> <el-scrollbar ref="scrollRef">
</div> <el-row style="height:100%;">
<div class="setup2" v-show="setupRef===2" style="height:calc(100% - 60px);background:#ebeef5;"> <el-col style="height:calc(100% - 60px);">
<el-row style="width:100%;height:100%;padding:10px;"> <app-table ref="adjListRef" :data="adjList" :columns="columns5" />
<el-col :span="12" style="height:100%;padding:0 5px 0 0;"> </el-col>
<el-scrollbar> </el-row>
<app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL??model.invoicE_WAIT_DETAIL_BBAC??model.invoicE_WAIT_DETAIL_BJ" :columns="setup2columns" /> </el-scrollbar>
</el-scrollbar> </div>
</el-col> <div class="setup2" v-show="setupRef===2" style="height:calc(100% - 60px);background:#ebeef5;">
<el-col :span="12" style="height:100%;padding:0 0 0 5px;"> <el-row style="width:100%;height:100%;padding:10px;">
<el-scrollbar> <el-col :span="12" style="height:100%;padding:0 5px 0 0;">
<app-table ref="setup2table2Ref" :data="adjList2" :columns="setup2columns" /> <el-scrollbar>
</el-scrollbar> <app-table ref="setup2table1Ref" :data="model.invoicE_WAIT_DETAIL??model.invoicE_WAIT_DETAIL_BBAC??model.invoicE_WAIT_DETAIL_BJ" :columns="setup2columns" />
</el-col> </el-scrollbar>
</el-row> </el-col>
</div> <el-col :span="12" style="height:100%;padding:0 0 0 5px;">
<div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);"> <el-scrollbar>
<el-row style="width:100%;height:100%;padding:10px;"> <app-table ref="setup2table2Ref" :data="adjList2" :columns="setup2columns" />
<el-col style="height:100%;padding:0 5px 0 0;"> </el-scrollbar>
<el-scrollbar> </el-col>
<el-tabs style="height:100%;"> </el-row>
<template v-for="item in setup3Model"> </div>
<el-tab-pane :label="item.invbillNum??'null'"> <div class="setup3" v-show="setupRef===3" style="height:calc(100% - 60px);">
<el-descriptions border> <el-row style="width:100%;height:100%;padding:10px;">
<el-descriptions-item label="发票号">{{item.invbillNum}}</el-descriptions-item> <el-col style="height:100%;padding:0 5px 0 0;">
<el-descriptions-item label="业务类型">{{businessTypes.options.find(o=>o.value===item.businesType)?.label}}</el-descriptions-item> <el-scrollbar>
<el-descriptions-item label="未税金额">{{item.amt}}</el-descriptions-item> <el-tabs style="height:100%;">
<el-descriptions-item label="税后金额">{{item.taxAmt}}</el-descriptions-item> <template v-for="(item,index) in setup3Model">
<el-descriptions-item label="税额">{{item.realAmt }}</el-descriptions-item> <el-tab-pane :label="item.invbillNum??('发票'+(index+1))">
<el-descriptions-item label="税率">{{item.tax}}</el-descriptions-item> <el-descriptions border>
</el-descriptions> <el-descriptions-item label="发票号">{{item.invbillNum}}</el-descriptions-item>
<app-table :data="item.detail" :columns="setup2columns" /> <el-descriptions-item label="业务类型">{{businessTypes.options.find(o=>o.value===item.businessType)?.label}}</el-descriptions-item>
</el-tab-pane> <el-descriptions-item label="未税金额">{{item.amt}}</el-descriptions-item>
</template> <el-descriptions-item label="税后金额">{{item.taxAmt}}</el-descriptions-item>
</el-tabs> <el-descriptions-item label="税额">{{item.realAmt }}</el-descriptions-item>
</el-scrollbar> <el-descriptions-item label="税率">{{item.tax}}</el-descriptions-item>
</el-col> </el-descriptions>
</el-row> <app-table :data="item.detail" :columns="setup2columns" />
</div> </el-tab-pane>
<div class="setup4" v-show="setupRef===4" style="height:calc(100% - 60px);"> </template>
<el-row style="width:100%;height:100%;padding:10px;"> </el-tabs>
<el-col style="height:100%;padding:0 5px 0 0;"> </el-scrollbar>
<el-scrollbar> </el-col>
<el-result icon="success" title="重开完成"> </el-row>
<template #extra> </div>
<el-button type="primary" @click="drawerClosed">返回</el-button> <div class="setup4" v-show="setupRef===4" style="height:calc(100% - 60px);">
</template> <el-row style="width:100%;height:100%;padding:10px;">
</el-result> <el-col style="height:100%;padding:0 5px 0 0;">
</el-scrollbar> <el-scrollbar>
</el-col> <el-result icon="success" title="重开完成">
</el-row> <template #extra>
<el-button type="primary" @click="drawerClosed">返回</el-button>
</template>
</el-result>
</el-scrollbar>
</el-col>
</el-row>
</div>
</div> </div>
<template #footer v-if="setupRef!==4"> <template #footer v-if="setupRef!==4">
<span class="dialog-footer"> <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>
<span class="dialog-footer"> <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> </span>
</template> </template>
</el-dialog> </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"> <el-dialog style="width:480px;height:480px;" align-center destroy-on-close :close-on-click-modal="false" v-model="importDialogVisible">
<template #header>导入调整明细</template> <template #header>导入调整明细</template>
<el-scrollbar> <el-scrollbar>
<el-row v-loading="loading"> <el-row>
<el-col> <el-col>
<app-form ref="importAdjFromRef" v-if="importDialogVisible&&importAdjModel" :schema="importAdjSchema" v-model="importAdjModel" :hideButton="true" inline /> <app-form ref="importAdjFromRef" v-if="importDialogVisible&&importAdjModel" :schema="importAdjSchema" v-model="importAdjModel" :hideButton="true" inline />
</el-col> </el-col>
@ -581,62 +585,64 @@ export default {
} else { } else {
service = "pub_ba_service"; service = "pub_ba_service";
} }
if (setupRef.value === 1) { try {
try { loading.value = true;
// setupRef.value += 1; if (setupRef.value === 1) {
// return; //临时 try {
//发到服务的校验 // setupRef.value += 1;
const result = await request(`settleaccount/${service}/reissue-invoice-list`, adjList.value, { method: "POST" }); // return; //临时
//发到服务的校验
const result = await request(`settleaccount/${service}/reissue-invoice-list`, adjList.value, { method: "POST" });
if (!result.errors) {
adjList2.value = result.data.data;
setupRef.value += 1;
//处理高亮
nextTick(() => {
const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => {
addDiff(o, list2, ".qty");
addDiff(o, list2, ".amt");
});
list2.forEach((o) => {
addDiff(o, list1, ".qty");
addDiff(o, list1, ".amt");
});
});
} else if (result.data?.code === 400 && result.data.fileName) {
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
}
} catch (e) {
console.log(e);
}
} else if (setupRef.value === 2) {
const url = `settleaccount/${service}/reissue-invoice-list-ext`;
const result = await request(url, adjList.value, { method: "POST" });
if (!result.errors) { if (!result.errors) {
adjList2.value = result.data.data; //setup3的数据来源
setup3Model.value = result.data.data;
setupRef.value += 1; setupRef.value += 1;
//处理高亮 } else if (result.data?.code === 400 && result.data.fileName) {
nextTick(() => {
const list1 = setup2table1Ref.value.tableRef.querySelectorAll(".row.data");
const list2 = setup2table2Ref.value.tableRef.querySelectorAll(".row.data");
list1.forEach((o) => {
addDiff(o, list2, ".qty");
addDiff(o, list2, ".amt");
});
list2.forEach((o) => {
addDiff(o, list1, ".qty");
addDiff(o, list1, ".amt");
});
});
} else if (result.data?.code === 400) {
// ElMessage({
// type: "error",
// message: "操作失败",
// });
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
} }
} catch (e) { } else if (setupRef.value === 3) {
console.log(e); const url = `settleaccount/${service}/reissue-invoice-extend`;
} const result = await request(url, adjList.value, { method: "POST" });
} else if (setupRef.value === 2) { if (!result.errors) {
const url = `settleaccount/${service}/reissue-invoice-list-ext`; setupRef.value += 1;
const result = await request(url, adjList.value, { method: "POST" }); } else if (result.data?.code === 400 && result.data.fileName) {
if (!result.errors) { window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
//setup3的数据来源 }
setup3Model.value = result.data.data; } else if (setupRef.value === 4) {
setupRef.value += 1; setupDialogVisable.value = false;
} else if (result.data?.code === 400 && result.data.fileName) { refreshRef.value = false;
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`)); nextTick(() => {
} refreshRef.value = true;
} else if (setupRef.value === 3) { });
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) {
window.open(getUrl(`settleaccount/getblobfile/download/${result.data.fileName}`));
} }
} else if (setupRef.value === 4) { } finally {
setupDialogVisable.value = false; await delay(5000);
refreshRef.value = false; loading.value = false;
nextTick(() => {
refreshRef.value = true;
});
} }
}; };
const drawerClosed = () => { const drawerClosed = () => {

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, AssemblyDate = DateTime.Now,
MatchNumber = i.ToString(), MatchNumber = i.ToString(),
InjectionCode = i.ToString(), InjectionCode = i.ToString(),
MateType = "是",
DiffDesc = "WMS有发货EDI有订单" 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 public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
{ {
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly EnumBusinessType _businessType;
public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider) public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider)
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_businessType = EnumBusinessType.JisBBAC;
} }
/// <summary> /// <summary>
@ -35,6 +37,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false); await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<BBAC_SE_DETAIL>() var seDetailGroup = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false) .Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key); .Select(t => t.Key);
@ -53,6 +56,7 @@ public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable
var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = db.Set<BBAC_SE_DETAIL>() var seDetails = db.Set<BBAC_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false) .Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN)) .Where(t => pns.Contains(t.PN))
.AsEnumerable<BBAC_SE_DETAIL>() .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 public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
{ {
private readonly IServiceProvider _serviceProvider; private readonly IServiceProvider _serviceProvider;
private readonly EnumBusinessType _businessType;
public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider) public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider)
{ {
_serviceProvider = serviceProvider; _serviceProvider = serviceProvider;
_businessType = EnumBusinessType.JisHBPO;
} }
/// <summary> /// <summary>
@ -36,6 +38,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
await HandDelEdiDataAsync().ConfigureAwait(false); await HandDelEdiDataAsync().ConfigureAwait(false);
var seDetailGroup = db.Set<HBPO_SE_DETAIL>() var seDetailGroup = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false) .Where(t => t.IsHaveEdiData == false)
.GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => t.Key); .Select(t => t.Key);
@ -54,6 +57,7 @@ public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable
var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); var pns = keyCodes.Select(t => t.PN).Distinct().ToList();
var seDetails = db.Set<HBPO_SE_DETAIL>() var seDetails = db.Set<HBPO_SE_DETAIL>()
.Where(t => t.BusinessType == _businessType)
.Where(t => t.IsHaveEdiData == false) .Where(t => t.IsHaveEdiData == false)
.Where(t => pns.Contains(t.PN)) .Where(t => pns.Contains(t.PN))
.AsEnumerable<HBPO_SE_DETAIL>() .AsEnumerable<HBPO_SE_DETAIL>()

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

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

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

@ -136,11 +136,13 @@ public class SeEidCompareReport
[ExporterHeader(DisplayName = "注塑码")] [ExporterHeader(DisplayName = "注塑码")]
public string InjectionCode { get; set; } public string InjectionCode { get; set; }
/// <summary> /// <summary>
/// 是否完全匹配 /// 匹配类型
/// </summary> /// </summary>
[Display(Name = "是否完全匹配")] [Display(Name = "匹配类型")]
[ExporterHeader(DisplayName = "是否完全匹配")] [ExporterHeader(DisplayName = "是否完全匹配")]
public string MateType { get; set; } [ValueMapping("是", true)]
[ValueMapping("否", false)]
public bool MateType => DiffQty == 0m;
/// <summary> /// <summary>
/// 差异说明 /// 差异说明
/// </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 strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").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 seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); 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(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _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 strSeStartDateTime = property.Where(p => p.Name == "SeStartDateTime").FirstOrDefault().Value;
var strSeEndDateTime = property.Where(p => p.Name == "SeEndDateTime").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 seStartDateTime = DateTime.Parse(strSeStartDateTime);
var seEndDateTime = DateTime.Parse(strSeEndDateTime); var seEndDateTime = DateTime.Parse(strSeEndDateTime);
var filename = exportName.FirstOrDefault(); 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(); var result = excelExporter.ExportAppendDataAsByteArray();
result.ShouldNotBeNull(); result.ShouldNotBeNull();
_fileContainer.SaveAsync(filename, result.Result, true); _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;
using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using Magicodes.ExporterAndImporter.Core.Extension; using Magicodes.ExporterAndImporter.Core.Extension;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.OpenApi.Extensions;
using SettleAccount.Bases; using SettleAccount.Bases;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using SettleAccount.Job.SignalR; using SettleAccount.Job.SignalR;
@ -36,11 +38,12 @@ namespace SettleAccount.Job.Services.Report
/// <summary> /// <summary>
/// 获取发运、Eid比对数据 /// 获取发运、Eid比对数据
/// </summary> /// </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 TSe : JisSeBase
where TEdi : SE_EDI where TEdi : SE_EDI
where TCompareReport : SeEidCompareReport, new() where TCompareReport : SeEidCompareReport, new()
{ {
var businessTypeDisplayName = businessType.GetAttributeOfType<DisplayAttribute>()?.Name ?? businessType.ToString();
// Sheet行数 // Sheet行数
var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet; var maxRowNumberOnASheet = AppConst.DefaultRowNumberOnASheet;
var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true); var excelExporterAttribute = typeof(TCompareReport).GetAttribute<ExcelExporterAttribute>(inherit: true);
@ -63,7 +66,6 @@ namespace SettleAccount.Job.Services.Report
EdiQty = t.Sum(t => t.Qty), EdiQty = t.Sum(t => t.Qty),
AssemblyDate = default, AssemblyDate = default,
MatchNumber = default, MatchNumber = default,
MateType = "否",
DiffDesc = "WMS漏发货EDI有订单" DiffDesc = "WMS漏发货EDI有订单"
}).ToList(); }).ToList();
haveEdiNotHaveSeList.ForEach(t => haveEdiNotHaveSeList.ForEach(t =>
@ -72,7 +74,9 @@ namespace SettleAccount.Job.Services.Report
t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : ""; t.Remark = string.IsNullOrEmpty(t.SequenceNumber) ? "PJIS出单,AJIS未上" : "";
}); });
//无EDI有发运 //无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 }) .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace })
.Select(t => new TCompareReport() .Select(t => new TCompareReport()
{ {
@ -89,7 +93,6 @@ namespace SettleAccount.Job.Services.Report
MaterialDes = t.Max(t => t.PartDesc), MaterialDes = t.Max(t => t.PartDesc),
SEQty = t.Sum(t => t.Qty), SEQty = t.Sum(t => t.Qty),
InjectionCode = t.Max(t => t.InjectionCode), InjectionCode = t.Max(t => t.InjectionCode),
MateType = "否",
DiffDesc = "WMS有发货EDI无订单" DiffDesc = "WMS有发货EDI无订单"
}).ToList(); }).ToList();
//有EDI有发运 //有EDI有发运
@ -107,7 +110,7 @@ namespace SettleAccount.Job.Services.Report
LineStationCode = groupItem.Max(t => t.LineStationCode) LineStationCode = groupItem.Max(t => t.LineStationCode)
}; };
var seGroup = from se in _settleAccountDbContext.Set<TSe>() 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 group se by new { se.PN, se.CustomerPartCodeNoSpace } into groupItem
select new select new
{ {
@ -151,7 +154,6 @@ namespace SettleAccount.Job.Services.Report
AssemblyDate = default, AssemblyDate = default,
MatchNumber = default, MatchNumber = default,
InjectionCode = se.InjectionCode, InjectionCode = se.InjectionCode,
MateType = se.Qty == edi.Qty ? "是" : "否",
DiffDesc = "WMS有发货EDI有订单" DiffDesc = "WMS有发货EDI有订单"
}).ToList(); }).ToList();
haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber)); haveEdiHaveSeList.ForEach(t => t.SequenceNumber = GetSequenceNumberDate(t.SequenceNumber));

Loading…
Cancel
Save