Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
eb6ddc61cc
  1. 1
      .vs/VSWorkspaceState.json
  2. 7945
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211223.txt
  3. 11
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json
  4. 10
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  5. 252
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs
  6. 12
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs
  7. 264
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSAppService.cs
  8. 8
      src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs
  9. 37
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  10. 26
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  11. 6
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs
  12. 133
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TB_BILL.cs
  13. 105
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TS_SORT_DETAIL.cs
  14. 13
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs
  15. 20
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs
  16. 11
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs
  17. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDapperRepository.cs
  18. 53
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDbContext.cs
  19. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs
  20. 6
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs
  21. 5
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs
  22. 2
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs
  23. 6
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs
  24. 17
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs
  25. 2
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

1
.vs/VSWorkspaceState.json

@ -2,6 +2,5 @@
"ExpandedNodes": [
""
],
"SelectedNode": "\\SettleAccount.sln (src\\SettleAccount.sln)",
"PreviewInSolutionExplorer": false
}

7945
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211223.txt

File diff suppressed because one or more lines are too long

11
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.Development.json

@ -6,11 +6,12 @@
// "Default": "Server=LAPTOP-V3U07C2O;Database=ABP;user id=sa;Password=1q2w!@#",
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": {
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;"
"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;"
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;"
//"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"Wms": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
},
"Logging": {
"LogLevel": {

10
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -7,11 +7,11 @@
// "SettleAccountService": "Server=LAPTOP-V3U07C2O;Database=SettleAccountService;user id=sa;Password=1q2w!@#;"
//},
"ConnectionStrings": {
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;"
"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
//"WmsService": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService1;user id=sa;Password=1;",
//"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
//"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"Wms": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
},
"Logging": {

252
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettleAccounts/SettleAccountAppService.cs

@ -108,138 +108,140 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
}
/// <summary>
/// 汇总结算明细导记录
/// 选择结算明细任务列表,选择相关任务合拼导期间出库表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("WmsJitOutPut")]
[DisableRequestSizeLimit]
//[HttpGet]
//[Route("WmsJitOutPut")]
//[DisableRequestSizeLimit]
public async Task<bool> WmsJitOutPut(List<string> fileList, string version)
{
//public async Task<bool> WmsJitOutPut(List<string> fileList, string version)
//{
List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath);
foreach (var itm in _list)
{
var list = itm.Value.Data.ToList();
_lst.AddRange(list.ToArray());
}
}
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
// List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>();
// foreach (var filename in fileList)
// {
// string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
// IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
// var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath);
// foreach (var itm in _list)
// {
// var list = itm.Value.Data.ToList();
// _lst.AddRange(list.ToArray());
// }
// }
// var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var query = from itm1 in _ls1
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber }
equals
new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1
from tm1 in temp1.DefaultIfEmpty() where tm1==null
select itm1;
await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0 });
int _count= _wmsVersionRepository.Count(p => p.Version == version);
if (_count == 0)
{
var _version = new List<WmsJitOutPut>();
_version.Add(new WmsJitOutPut { Version = version, BillNum = "T" +DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email });
await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version);
}
//_wmsRepository.Where(p=>p)
return true;
}
[HttpGet]
[Route("WmsJitOutPut-Pass")]
public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null)
{
if (p_list != null)
{
List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
if (p_list.Count() > 0)
{
_ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == version && p.State != 2).ToListAsync();
}
if (_ls.Count() > 0)
{
var _first = _ls.FirstOrDefault();
var _guid = GuidGenerator.Create();
foreach (var itm in _ls)
{
itm.TaskId = _guid;
}
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0, _guid)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
//TableName = "WmsJitOutPutDetail",
InterfaceType = "1",
Version = version,
State = 0,
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
}
//_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
//_wmsDapper.DbConnection.ConnectionTimeout = 1200;
//_wmsRepository.Where(p=>p)
return true;
}
[HttpGet]
[Route("WmsJitOutPut-Cancel")]
public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version)
{
//var _guid = GuidGenerator.Create();
//foreach (var itm in _ls)
//{
// itm.TaskId = _guid;
//}
var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync();
var _first = _ls.FirstOrDefault();
if (_ls.Count>0)
{
var _guid = GuidGenerator.Create();
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0, _guid)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsJitOutPutDetail",
InterfaceType = "1",
Version = version,
State = 0,
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
return true;
}
// var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync();
// var query = from itm1 in _ls1
// join itm2 in outPutDetail on
// new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber }
// equals
// new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1
// from tm1 in temp1.DefaultIfEmpty() where tm1==null
// select itm1;
// await _wmsRepository.GetDbContext().BulkInsertAsync(query.ToList(), new BulkConfig() { BulkCopyTimeout = 0 });
// int _count= _wmsVersionRepository.Count(p => p.Version == version);
// if (_count == 0)
// {
// var _version = new List<WmsJitOutPut>();
// _version.Add(new WmsJitOutPut { Version = version, BillNum = "T" +DateTime.Now.ToString("yyyyMMddhhmmssdddd"), Creator = CurrentUser.Email });
// await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version);
// }
// //_wmsRepository.Where(p=>p)
// return true;
//}
//[HttpGet]
//[Route("WmsJitOutPut-Pass")]
//public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null)
//{
// if (p_list != null)
// {
// List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
// if (p_list.Count() > 0)
// {
// _ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync();
// }
// else
// {
// _ls = await _wmsRepository.Where(p => p.Version == version && p.State != 2).ToListAsync();
// }
// if (_ls.Count() > 0)
// {
// var _first = _ls.FirstOrDefault();
// var _guid = GuidGenerator.Create();
// foreach (var itm in _ls)
// {
// itm.TaskId = _guid;
// }
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
// var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
// {
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// //TableName = "WmsJitOutPutDetail",
// InterfaceType = "1",
// Version = version,
// SettleAccountState = 0,
// WmsState=0
// };
// var _l = new List<TS_UNI_API>();
// _l.Add(uniapi);
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
// }
// }
// //_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
// //_wmsDapper.DbConnection.ConnectionTimeout = 1200;
// //_wmsRepository.Where(p=>p)
// return true;
//}
//[HttpGet]
//[Route("WmsJitOutPut-Cancel")]
//public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version)
//{
// //var _guid = GuidGenerator.Create();
// //foreach (var itm in _ls)
// //{
// // itm.TaskId = _guid;
// //}
// var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync();
// var _first = _ls.FirstOrDefault();
// if (_ls.Count>0)
// {
// var _guid = GuidGenerator.Create();
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
// var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
// {
// TaskId = _guid,
// SourceBillNum = _first.BillNum,
// TableName = "WmsJitOutPutDetail",
// InterfaceType = "1",
// Version = version,
// WmsState= 0,
// SettleAccountState=0
// };
// var _l = new List<TS_UNI_API>();
// _l.Add(uniapi);
// await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
// }
// return true;
//}

12
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs

@ -83,7 +83,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
[HttpPost]
[Route("versionlist")]
//[Authorize(SettleAccountPermissions.Materials.Default)]
[UnitOfWork(false)]
virtual public async Task<List<string>> GetVersionListAsync()
{
@ -91,6 +91,16 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
}
[HttpPost]
[Route("delete")]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
return await _service.DeleteListAsync(ids);
}
}
}

264
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSAppService.cs

@ -0,0 +1,264 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using AutoMapper;
using System.Linq;
using System.Text;
using Volo.Abp.Guids;
using Volo.Abp.Application.Services;
using Volo.Abp.Caching;
using Volo.Abp.ObjectMapping;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.CacheBase;
using Win.Utils;
using Volo.Abp.Application.Dtos;
using Win.Sfs.BaseData.ImportExcelCommon;
using Volo.Abp.Domain.Repositories;
using EFCore.BulkExtensions;
using System.IO;
using Microsoft.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.SettleAccountVersion;
using Win.Sfs.SettleAccount.FISes;
using Win.Sfs.Shared.Enums.SettleAccount;
using Win.Sfs.Shared.Filter;
using Shouldly;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.Data.Common;
using Volo.Abp.Uow;
using Volo.Abp;
using Win.Abp.Snowflakes;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Magicodes.ExporterAndImporter.Core.Models;
using TaskJob.Services;
using TaskJob.EventArgs;
using Win.Sfs.SettleAccount.Entities.WMS;
using Win.Sfs.SettleAccount.Entities.Wms;
using Win.Sfs.SettleAccount.Repository;
using WY.NewJit.Extends.PaiGe.WMS;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// 大众准时化结算明细导入-R3已结
/// </summary>
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
[AllowAnonymous]
[Route("api/settleaccount/wms")]
public class WMSAppService :
ApplicationService
{
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> _wmsRepository;
private readonly ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> _wmsVersionRepository;
private readonly WMSEfCoreRepository<WmsJitOutPutDetial> _wmsefRespository;
private readonly WMSEfCoreRepository<TB_BILL> _wmstbRespository;
private readonly ISettleAccountBranchEfCoreRepository<TaskJob, Guid> _job;
private readonly TaskJobService _service;
/// <summary>
/// 构建方法
/// </summary>
/// <param name="guidGenerator">构建UID</param>
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public WMSAppService(
ISettleAccountBranchEfCoreRepository<WmsJitOutPutDetial, Guid> wmsRepository,
ISettleAccountBranchEfCoreRepository<TaskJob, Guid> job,
ISettleAccountBranchEfCoreRepository<WmsJitOutPut, Guid> wmsVersionRepository,
WMSEfCoreRepository<WmsJitOutPutDetial> wmsefRespository,
WMSEfCoreRepository<TB_BILL> wmstbRespository
)
{
_job = job;
_wmstbRespository = wmstbRespository;
_wmsRepository = wmsRepository;
_wmsVersionRepository = wmsVersionRepository;
_wmsefRespository = wmsefRespository;
}
/// <summary>
/// 选择结算明细任务列表,选择相关任务合拼导期间出库表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("WmsJitOutPut")]
[DisableRequestSizeLimit]
public async Task<string> WmsJitOutPut(List<Guid> ids, string version)
{
var _joblist=_job.Where(p => ids.Contains(p.Id)).ToList();
var fileList = _joblist.Select(p => p.RealDownFileName).ToList();
List<WmsJitOutPutDetial> _lst = new List<WmsJitOutPutDetial>();
foreach (var filename in fileList)
{
string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container\" + filename;
IExcelImporter Importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();
var _list = await Importer.ImportSameSheets<WmsJitOutPutDetialDto, WmsJitOutPutDetial>(fileSavePath);
foreach (var itm in _list)
{
var list = itm.Value.Data.ToList();
_lst.AddRange(list.ToArray());
}
}
var _ls1 = _lst.Where(p => p.ParentMaterialCode == p.MaterialCode).ToList();
var outPutDetail= await _wmsRepository.Where(p => p.Version == version).ToListAsync();
var _billNum="T" + DateTime.Now.ToString("yyyyMMddhhmmssdddd");
var query = from itm1 in _ls1
join itm2 in outPutDetail on
new { itm1.MaterialCode, itm1.KennCode, itm1.ChassisNumber }
equals
new { itm2.MaterialCode, itm2.KennCode, itm2.ChassisNumber } into temp1
from tm1 in temp1.DefaultIfEmpty() where tm1==null
select itm1;
var _wmslst=query.ToList();
foreach (var itm in _wmslst)
{
itm.BillNum = _billNum;
}
await _wmsRepository.GetDbContext().BulkInsertAsync(_wmslst, new BulkConfig() { BulkCopyTimeout = 0 });
int _count= _wmsVersionRepository.Count(p => p.Version == version);
if (_count == 0)
{
var _version = new List<WmsJitOutPut>();
_version.Add(new WmsJitOutPut { Version = version, BillNum = _billNum, Creator = CurrentUser.Email });
await _wmsVersionRepository.GetDbContext().BulkInsertAsync(_version);
}
else
{
var _ls= _wmsVersionRepository.Where(p => p.Version == version).ToList();
foreach (var itm in _ls)
{
itm.BillNum = _billNum;
}
await _wmsVersionRepository.UpdateManyAsync(_ls);
}
//_wmsRepository.Where(p=>p)
return _billNum;
}
[HttpGet]
[Route("WmsJitOutPut-Pass")]
public async Task<bool> WmsJitOutPutPass( string version, List<Guid> p_list=null)
{
if (p_list != null)
{
List<WmsJitOutPutDetial> _ls = new List<WmsJitOutPutDetial>();
if (p_list.Count() > 0)
{
_ls = await _wmsRepository.Where(p => p_list.Contains(p.Id) && p.Version == version && p.State != 2).ToListAsync();
}
else
{
_ls = await _wmsRepository.Where(p => p.Version == version && p.State != 2).ToListAsync();
}
if (_ls.Count() > 0)
{
var _first = _ls.FirstOrDefault();
var _guid = GuidGenerator.Create();
foreach (var itm in _ls)
{
itm.TaskId = _guid;
}
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls);
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail",_first.BillNum, 0,0 ,_guid)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsJitOutPutDetail",
InterfaceType = "1",
Version = version,
SettleAccountState = 0,
WmsState=0
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
}
//_wmsDapper.GetListBySql<WmsJitOutPutDetial>("insert into WmsJitOutPutDetial", false);
//_wmsDapper.DbConnection.ConnectionTimeout = 1200;
//_wmsRepository.Where(p=>p)
return true;
}
[HttpGet]
[Route("WmsJitOutPut-Cancel")]
public async Task<bool> WmsJitOutPutCancel(List<Guid> ids, string version)
{
//var _guid = GuidGenerator.Create();
//foreach (var itm in _ls)
//{
// itm.TaskId = _guid;
//}
var _ls = await _wmsRepository.Where(p => ids.Contains(p.Id) && p.Version == version && p.State == 1).ToListAsync();
var _first = _ls.FirstOrDefault();
if (_ls.Count>0)
{
var _guid = GuidGenerator.Create();
await _wmsefRespository.GetDbContext().BulkInsertAsync(_ls,new BulkConfig() { BulkCopyTimeout=0 });
var uniapi = new TS_UNI_API(GuidGenerator.Create(), "1", version, "WmsJitOutPutDetail", _first.BillNum, 0,0, _guid)
{
TaskId = _guid,
SourceBillNum = _first.BillNum,
TableName = "WmsJitOutPutDetail",
InterfaceType = "1",
Version = version,
WmsState = 0,
SettleAccountState=0
};
var _l = new List<TS_UNI_API>();
_l.Add(uniapi);
await _wmsefRespository.GetDbContext().BulkInsertAsync(_l);
}
return true;
}
}
}

8
src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs

@ -74,6 +74,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
}
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
return await _mng.DeleteListAsync(ids);
}
[UnitOfWork(false)]
virtual public async Task<List<JobDto>> GetListAsync(JobRequestDto input)

37
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -192,6 +192,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
var _taskid = await _service.ExportEnqueueAsync("大众备件结算核对明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
@ -335,19 +336,15 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
//{
// throw new BusinessException("8989", string.Format("不存发票{0}期间", version));
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
//customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
//customConditionList.Add(new CustomCondition() { Name = "Factory", Value = factory ?? string.Empty });
//customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "sapCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "结算与开票数据对比" });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() });
var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对汇总表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
}
@ -380,8 +377,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
// str1 = string.Join(',', materialGroup.ToArray());
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value =string.IsNullOrEmpty(version) ?string.Empty:version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(materialCode) ?string.Empty: materialCode });
@ -393,9 +388,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
@ -422,11 +414,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string chassisNumber,
string materialGroup,
string sapCode
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(materialCode) ? string.Empty : materialCode });
@ -439,7 +428,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Mater", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众准时化结算数量差异比对表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
@ -458,7 +446,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpGet]
[Route("UnsettledDetailReportService-Make")]
[DisableRequestSizeLimit]
public async Task<string> UnsettledDetailReportServiceMake(
string version,
string materialCode,
@ -489,17 +476,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
}
/// <summary>
///6.大众准时化未结差异比对表
/// </summary>
@ -508,9 +484,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
[HttpGet]
[Route("UnSettleDiffExport-Make")]
[DisableRequestSizeLimit]
public async Task<string> UnSettleDiffExportServiceMake(
string version,
string materialCode,
string begin,
@ -519,8 +493,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string chassisNumber,
string materialGroup,
string sapCode
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
@ -533,9 +505,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结差异比对表", ExportExtentsion.Excel,version,string.Empty, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) =>
{
});

26
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -1410,9 +1410,9 @@
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccountAppService.WmsJitOutPut(System.Collections.Generic.List{System.String},System.String)">
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccountAppService.testUploadBeginInvoke(Microsoft.AspNetCore.Http.IFormFileCollection)">
<summary>
汇总结算明细导记录
选择结算明细任务列表,选择相关任务合拼导期间出库表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
@ -1587,6 +1587,26 @@
<param name="input">请求条件</param>
<returns>实体DTO列表</returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSAppService">
<summary>
大众准时化结算明细导入-R3已结
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSAppService.#ctor(Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.TaskJob,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPut,System.Guid},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{Win.Sfs.SettleAccount.Entities.WMS.WmsJitOutPutDetial},Win.Sfs.SettleAccount.Repository.WMSEfCoreRepository{WY.NewJit.Extends.PaiGe.WMS.TB_BILL})">
<summary>
构建方法
</summary>
<param name="guidGenerator">构建UID</param>
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.SettleAccounts.WMSAppService.WmsJitOutPut(System.Collections.Generic.List{System.Guid},System.String)">
<summary>
选择结算明细任务列表,选择相关任务合拼导期间出库表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePart.SettlementPakAndSparePartsAppService">
<summary>
结算包与散件对应关系服务
@ -2735,7 +2755,7 @@
<param name="state"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.InvoiceSettledDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.InvoiceSettledDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
1.大众发票与结算核对汇总表
</summary>

6
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs

@ -113,7 +113,11 @@ namespace Win.Sfs.SettleAccount.Entities
public virtual async Task<bool> DeleteListAsync(List<Guid> ids)
{
return await _repository.DeleteListAsync(ids);
var _ls= _repository.Where(p => ids.Contains(p.Id));
int _count=await _ls.BatchDeleteAsync();
return true;
}

133
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TB_BILL.cs

@ -0,0 +1,133 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Domain.Entities;
namespace WY.NewJit.Extends.PaiGe.WMS
{
public partial class TB_BILL:IEntity
{
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
[Display(AutoGenerateField = false)]
[ScaffoldColumn(false)]
public int UID { get; set; }
[Key]
[StringLength(50)]
[DisplayName("单据编号")]
[ExporterHeader(DisplayName = "单据编号")]
[ImporterHeader(Name = "单据编号")]
public string BillNum { get; set; } = "";
public int State { get; set; }
[DisplayName("原始单据")]
[ExporterHeader(DisplayName = "原始单据")]
public string SourceBillNum { get; set; } = "";
//[StringLength(50)]
[DisplayName("原始单据2")]
[ExporterHeader(DisplayName = "原始单据2")]
public string SourceBillNum2 { get; set; } = "";
//[StringLength(50)]
[DisplayName("原始单据3")]
[ExporterHeader(DisplayName = "原始单据3")]
public string SourceBillNum3 { get; set; } = "";
[DisplayName("单据类型")]
[ExporterHeader(DisplayName = "单据类型")]
[NotMapped]
public string BillType { get; set; }
[DisplayName("单据子类型")]
[ExporterHeader(DisplayName = "单据子类型")]
[NotMapped]
public string SubBillType { get; set; }
[DisplayName("单据时间")]
[ExporterHeader(DisplayName = "单据时间")]
public DateTime BillTime { get; set; }
[StringLength(50)]
[DisplayName("开始时间")]
[ExporterHeader(DisplayName = "开始时间")]
public string StartTime { get; set; }
[StringLength(50)]
[DisplayName("结束时间")]
[ExporterHeader(DisplayName = "结束时间")]
public string FinishTime { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("操作员")]
[ExporterHeader(DisplayName = "操作员")]
public string OperName { get; set; }
[DisplayName("明细数量")]
[ExporterHeader(DisplayName = "明细数量")]
public int DetailQty { get; set; }
[StringLength(50)]
[DisplayName("供应商编号")]
[ExporterHeader(DisplayName = "供应商编号")]
public string VendId { get; set; }
[StringLength(50)]
[DisplayName("客户编号")]
[ExporterHeader(DisplayName = "客户编号")]
public string CustId { get; set; }
[StringLength(50)]
[DisplayName("项目编号")]
[ExporterHeader(DisplayName = "项目编号")]
public string ProjectId { get; set; }
[StringLength(50)]
[DisplayName("运输方式")]
[ExporterHeader(DisplayName = "运输方式")]
public string TransportType { get; set; }
[StringLength(50)]
[DisplayName("车牌号")]
[ExporterHeader(DisplayName = "运输方式")]
public string TruckNum { get; set; }
[StringLength(50)]
[DisplayName("到货门编号")]
[ExporterHeader(DisplayName = "到货门编号")]
public string GateCode { get; set; }
[StringLength(50)]
[DisplayName("到货门名称")]
[ExporterHeader(DisplayName = "到货门名称")]
public string GateName { get; set; }
//[StringLength(50)]
[DisplayName("到货口编号")]
[ExporterHeader(DisplayName = "到货口编号")]
public string DockCode { get; set; }
[DisplayName("备注")]
[ExporterHeader(DisplayName = "备注")]
public string Remark { get; set; }
public DateTime? AccountDate { get; set; }
public Guid GUID { get; set; } = Guid.NewGuid();
public TB_BILL()
{
}
public object[] GetKeys()
{
throw new NotImplementedException();
}
}
}

105
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TS_SORT_DETAIL.cs

@ -0,0 +1,105 @@
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace ChangKeTec.Wms.Models.Wms
{
public partial class TS_SORT_DETAIL
{
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public long UID { get; set; }
[Key]
[Column(Order = 0)]
[StringLength(50)]
[DisplayName("单据编号")]
public string BillNum { get; set; }
[DisplayName("行号")]
public int LineNum { get; set; }
[Key]
[Column(Order = 1)]
[StringLength(50)]
[DisplayName("VIN码")]
public string VinCode { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("顺序号")]
public string SeqNum { get; set; }
/// <summary>
/// SAP物料号
/// </summary>
[Key]
[Column(Order = 2)]
[StringLength(50)]
[DisplayName("物料号")]
public string PartCode { get; set; }
[DisplayName("箱码")]
public string BarCode { get; set; }
[StringLength(50)]
[DisplayName("客户物料号")]
public string CustPartCode { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("项目编号")]
public string ProjectId { get; set; }
[StringLength(50)]
[DisplayName("FYON NUMBER")]
public string FyonNum { get; set; }
[StringLength(50)]
[DisplayName("SUPPLIER")]
public string VendId { get; set; }
[StringLength(50)]
[DisplayName("DOCK")]
public string Dock { get; set; }
[StringLength(50)]
[DisplayName("DISPATCH DATE")]
public string DispatchDate { get; set; }
[Required(AllowEmptyStrings = true)]
[StringLength(50)]
[DisplayName("状态")]
public string State { get; set; }
[StringLength(200)]
[DisplayName("备注")]
public string Remark { get; set; }
[Column(TypeName = "money")]
[DisplayName("计划数量")]
public decimal PlanQty { get; set; } = 0;
[Column(TypeName = "money")]
[DisplayName("发货数量")]
public decimal Qty { get; set; } = 0;
[StringLength(200)]
[DisplayName("客户条码")]
public string CustBarCode { get; set; } = string.Empty;
[Column(TypeName = "money")]
[DisplayName("回执数量")]
public decimal ReceiptQty { get; set; } = 0;
[StringLength(200)]
[DisplayName("箱码(Full)")]
public string FullBarCode { get; set; } = string.Empty;
[NotMapped]
public string PartGroup { get; set; }
}
}

13
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WMS/TaskList.cs

@ -10,14 +10,14 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
{
public partial class TS_UNI_API: FullAuditedAggregateRootBase<Guid>
{
public TS_UNI_API(Guid id,string interfaceType, string version, string tableName, string sourceBillNum,int state,Guid taskId)
public TS_UNI_API(Guid guid ,string interfaceType, string version, string tableName, string sourceBillNum, int wmsState, int settleAccountState, Guid taskId)
{
Id = id;
InterfaceType = interfaceType;
Version = version;
TableName = tableName;
SourceBillNum = sourceBillNum;
State = state;
WmsState = wmsState;
SettleAccountState = settleAccountState;
TaskId = taskId;
}
/// <summary>
@ -41,8 +41,11 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
/// <summary>
/// 状态
/// </summary>
public int State { set; get; }
public int WmsState { set; get; }
/// <summary>
/// 状态
/// </summary>
public int SettleAccountState { set; get; }
/// <summary>
/// 状态

20
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs

@ -28,26 +28,6 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureSettleAccount();
}
}
[ConnectionStringName("WMSService")]
public class WmsDbContext : AbpDbContext<WmsDbContext>, IWmsDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
// public DbSet<>
public WmsDbContext(DbContextOptions<WmsDbContext> options)
: base(options)
{
this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30));
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
}
}
}

11
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs

@ -55,6 +55,16 @@ namespace Win.Sfs.SettleAccount
//options.AddDefaultRepositories(includeAllEntities: true);
});
context.Services.AddAbpDbContext<WMSDbContext>(options =>
{
options.AddDefaultRepositories();
});
// context.Services.AddTransient(typeof(IInventoryDetailRepository),
//typeof(InventoryDetailRepository));
@ -73,6 +83,7 @@ namespace Win.Sfs.SettleAccount
private void ConfigureDbContext()
{
Configure<AbpDbContextOptions>(options => { options.UseSqlServer(); });
}
private void ConfigureEntity()

2
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDapperRepository.cs

@ -15,6 +15,8 @@ namespace Win.Sfs.SettleAccount
{
public class WMSDapperRepository : DapperRepository<WMSDbContext>, ITransientDependency
{
public WMSDapperRepository(IDbContextProvider<WMSDbContext> dbContextProvider)
: base(dbContextProvider)
{

53
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSDbContext.cs

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Entities.WMS;
using WY.NewJit.Extends.PaiGe.WMS;
namespace Win.Sfs.SettleAccount
{
@ -16,11 +17,11 @@ namespace Win.Sfs.SettleAccount
[ConnectionStringName("WMS")]
[ConnectionStringName("Wms")]
public class WMSDbContext : AbpDbContext<WMSDbContext>
{
#region DbSet
//public virtual DbSet<TB_BILL> TB_BILL { get; set; }
public virtual DbSet<WmsJitOutPutDetial> WmsJitOutPutDetial { get; set; }
//public virtual DbSet<TS_SORT_DETAIL> TS_SORT_DETAIL { get; set; }
#endregion
@ -31,55 +32,19 @@ namespace Win.Sfs.SettleAccount
public WMSDbContext(DbContextOptions<WMSDbContext> options)
: base(options)
{
this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30));
}
//protected override void OnModelCreating(ModelBuilder builder)
//{
// base.OnModelCreating(builder);
// builder.Entity<WmsJitOutPutDetial>(b =>
// {
// b.ToTable("WmsJitOutPutDetial");
// b.HasKey(x => x.Id);
// b.Property(x => x.WmsBillNum).HasMaxLength(50).IsRequired();
// b.Property(x => x.Remark).HasMaxLength(200).IsRequired();
// b.Property(x => x.ParentMaterialCode).HasMaxLength(50).IsRequired();
// b.Property(x => x.MaterialCode).HasMaxLength(50).IsRequired();
// b.Property(x => x.MaterialGroup).HasMaxLength(200);
// b.Property(x => x.OutPut).HasMaxLength(50);
// b.Property(x => x.Extend1).HasMaxLength(50);
// b.Property(x => x.Extend2).HasMaxLength(50);
// b.Property(x => x.Extend3).HasMaxLength(50);
// b.Property(x => x.ChassisNumber).HasMaxLength(50);
// b.Property(x => x.KennCode).HasMaxLength(50);
// b.Property(x => x.MaterialDesc).HasMaxLength(50);
// });
// builder.Entity<TS_UNI_API>(b =>
// {
// b.ToTable("TS_UNI_API");
// b.HasKey(x => x.Id);
// b.Property(x => x.Remark).HasMaxLength(200).IsRequired();
// b.Property(x => x.SourceBillNum).HasMaxLength(50).IsRequired();
// b.Property(x => x.TableName).HasMaxLength(50).IsRequired();
// b.Property(x => x.Version).HasMaxLength(50).IsRequired();
// b.Property(x => x.TableName).HasMaxLength(50).IsRequired();
// b.Property(x => x.TableName).HasMaxLength(50).IsRequired();
// });
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
// //在这里配置共享表
// //builder.Entity<TS_SORT_DETAIL>(b =>
// //{
// // b.HasIndex(x => new { x.BillNum, x.VinCode, x.PartCode }).IsUnique();
}
// //});
//}
}
}

2
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs

@ -78,7 +78,7 @@ namespace Win.Sfs.SettleAccount.Repository
foreach (var id in ids)
{
await DeleteAsync(id, false, cancellationToken);
await DeleteAsync(id,false, cancellationToken);
}
return true;

6
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs

@ -118,7 +118,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<UnSettleDiff> GetDiffReport(int type, string begin, string end, string materialCode, string kennCode,string chassisNumber)
public virtual List<UnSettleDiff> GetDiffReport(int type, string begin, string end, string materialCode, string kennCode,string chassisNumber,string version)
{
string condition = " where 1=1 ";
@ -180,7 +180,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" b.WMSBillNum, \n" +
" a.UnsettledReason " +
" FROM\n" +
" Set_unsettle a\n" +
" (select * from Set_unsettle where Version='{1}') a\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" OrderBillNum,\n" +
@ -367,7 +367,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var _sql = string.Format(sql1, condition);
var _sql = string.Format(sql1, condition,version);

5
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs

@ -108,7 +108,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" 1 = 1 \n" +
" AND STATE = 4 {0}\n" +
" ) A\n" +
" left join Set_Unsettle f on a.MaterialCode=f.MaterialCode and a.KENNCode=f.KENNCode and a.ChassisNumber=f.ChassisNumber \n"+
" left join (select * from Set_Unsettle where version='{1}') f \n" +
" on a.MaterialCode=f.MaterialCode and a.KENNCode=f.KENNCode and a.ChassisNumber=f.ChassisNumber \n"+
" LEFT JOIN Set_material B ON a.MaterialCode = b.CustomerPartCode \n" +
" LEFT JOIN Set_material d ON a.ParentSapMaterialCode = d.MaterialCode \n" +
" ) temp1\n" +
@ -119,7 +120,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//var _priceList = DbConnection.Query<PriceList>("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList();
string _sql = string.Format(sqlString, str);
string _sql = string.Format(sqlString, str,version);
;
var _query = DbConnection.Query<UnSettleDetailReport>(_sql);

2
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs

@ -122,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount
}
BulkConfig cfg = new BulkConfig() { BulkCopyTimeout=600, BatchSize=1000};
BulkConfig cfg = new BulkConfig() { BulkCopyTimeout=0, BatchSize=10000,};
DbContext.BulkInsert(_insertls,cfg);
}
catch (Exception e)

6
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs

@ -57,7 +57,7 @@ namespace SettleAccount.Job.Services
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).Distinct().ToList();
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
@ -78,8 +78,6 @@ namespace SettleAccount.Job.Services
//_list.Add(new InvoiceSettledDiff(Guid.NewGuid(), _id, itm.MaterialCode, itm.InvoiceQty, itm.SettleQty));
_lsExport.Add(new InvoiceSettledDiffExportDto()
{
Version =itm. Version ,
MaterialCode =itm. MaterialCode ,
InvoiceQty =itm. InvoiceQty ,
@ -88,7 +86,7 @@ namespace SettleAccount.Job.Services
SettleQty =itm. SettleQty ,
CP7ScrapQty =itm. CP7ScrapQty ,
ClaimQty =itm. ClaimQty ,
DiffQty = itm.InvoiceQty-itm.SettleQty-itm.CP7ScrapQty-itm.ClaimQty,//开票数量-结算数量-CP7报废数量-索赔数量
DiffQty =itm.InvoiceQty-itm.SettleQty-itm.CP7ScrapQty-itm.ClaimQty,//开票数量-结算数量-CP7报废数量-索赔数量
SalePrice =itm. SalePrice ,
DiffPrice =itm. DiffPrice ,
SapMaterialCode =itm.SapMaterialCode ,

17
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs

@ -78,7 +78,7 @@ namespace SettleAccount.Job.Services.Report
var _first = exportName.FirstOrDefault();
var _ls = new List<UnSettleDiff>();
_ls = _dapper.GetDiffReport(0,begin,end, materialCode,kenncode,chassisNumber);
_ls = _dapper.GetDiffReport(0,begin,end, materialCode,kenncode,chassisNumber,version);
var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode && !string.IsNullOrEmpty(p.ParentSapMaterialCode)).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => p.FirstOrDefault()).ToList();
@ -120,21 +120,6 @@ namespace SettleAccount.Job.Services.Report
_ls.AddRange(rangeList);
if (!string.IsNullOrEmpty(materialGroup))

2
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

@ -17,9 +17,7 @@ namespace SettleAccount.Job.Services.Report
{
private readonly UnSettledDetailDapperRepository _dapper;
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpDapper;
public UnsettledDetailReportService(
UnSettledDetailDapperRepository dapper,
OutputService outputService,

Loading…
Cancel
Save