Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
809dcc016b
  1. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs
  2. 24
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailUnInterface.cs
  3. 28
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs
  4. 109
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSum.cs

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs

@ -122,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
[Display(Name = "状态")] [Display(Name = "状态")]
public int State { set; get; } public int State { set; get; }
[Display(Name = "期")] [ExporterHeader(DisplayName = "账期", IsIgnore = true)]
public DateTime AccountDate { set; get; } public DateTime AccountDate { set; get; }
} }
@ -193,8 +193,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput
{ {
} }
[Display(Name = "版本号")] [Display(Name = "版本号")]
public string Version { set; get; } public string Version { set; get; }

24
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsDetailUnInterface.cs

@ -3,6 +3,7 @@ using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel; using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Shouldly; using Shouldly;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -130,8 +131,29 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[HttpPost] [HttpPost]
[Route("ModifyTaskState")] [Route("ModifyTaskState")]
public virtual async Task<bool> SyncInterface() public virtual async Task<bool> ModifyTaskState(List<Guid> guids)
{ {
if (guids != null && guids.Count() > 0)
{
var str = "DECLARE @return_value int \n" +
"EXEC @return_value = [dbo].[p_wms_output_modify]\n" +
"@billnum = N'{0}', \n" +
"@type = {1}, \n" +
"@date = N'{2}', \n" +
"@switchcode = N'{3}', \n" +
"@partcode = N'{4}' \n" +
"SELECT 'Return Value' = @return_value ";
var _ls= _wmsRepository.Where(p => guids.Contains(p.Id));
foreach (var itm in _ls)
{
var sql = string.Format(str, itm.BillNum, itm.Type, DateTime.Now, itm.SwitchCode, itm.MaterialCode);
_wmsRepository.GetDbContext().Database.SetCommandTimeout(300);
await _wmsRepository.GetDbContext().Database.ExecuteSqlRawAsync(
sql
);
}
}
//_wmsRepository.Where(p => p.BillNum ==) //_wmsRepository.Where(p => p.BillNum ==)
return true; return true;
} }

28
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WmsUnInterface.cs

@ -86,11 +86,12 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
List<WmsDetailReport> _lst = new List<WmsDetailReport>(); List<WmsDetailReport> _lst = new List<WmsDetailReport>();
if (_difflst != null && _difflst.Count() > 0) if (_difflst != null && _difflst.Count() > 0)
{ {
int line= _maxLine+1;
foreach (var itm in _difflst) foreach (var itm in _difflst)
{ {
_maxLine = _maxLine++; line = line++;
_lst.Add(new WmsDetailReport(Guid.NewGuid(), _lst.Add(new WmsDetailReport(Guid.NewGuid(),
_maxLine, line,
itm., itm.,
itm., itm.,
itm., itm.,
@ -297,8 +298,6 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
return false; return false;
} }
foreach (var itm in entities) foreach (var itm in entities)
{ {
itm.State = 2; itm.State = 2;
@ -331,6 +330,27 @@ namespace Win.Sfs.SettleAccount.Entities.WMS
[Route("Export")] [Route("Export")]
virtual public async Task<string> ExportAsync(WmsRequestDetailReportDto input) virtual public async Task<string> ExportAsync(WmsRequestDetailReportDto input)
{ {
if (!string.IsNullOrEmpty(input.Client))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Client", Logic = EnumFilterLogic.And, Value = input.Client });
}
if (!string.IsNullOrEmpty(input.Type))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Type", Logic = EnumFilterLogic.And, Value = input.Type });
}
if (!string.IsNullOrEmpty(input.MaterialGroup))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "MaterialGroup", Logic = EnumFilterLogic.And, Value = input.MaterialGroup });
}
if (!string.IsNullOrEmpty(input.BillNum))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "BillNum", Logic = EnumFilterLogic.And, Value = input.BillNum });
}
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, var entities = await _wmsRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue,
0, true); 0, true);

109
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSum.cs

@ -0,0 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class UnSettledSumService
{
private readonly UnSettledDetailDapperRepository _dapper;
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpDapper;
public UnSettledSumService(
UnSettledDetailDapperRepository dapper,
OutputService outputService,
ErpPartDapperRepository erpDapper
)
{
_dapper = dapper;
_outputService = outputService;
_erpDapper = erpDapper;
}
//public string GetFisSum(Guid id, List<string> exportName, List<CustomCondition> p_list)
//{
// var _first = exportName.FirstOrDefault();
// var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
// var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value;
// var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
// var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
// var sapcode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
// var begin = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value;
// var end = p_list.Where(p => p.Name == "End").FirstOrDefault().Value;
// var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value;
// var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value;
// var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
// //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value;
// //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value;
// var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version, materailCode, materialGroup, sapcode);
// var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList();
// var _lst = _erpDapper.GetSapList(_ls, version, false);
// _lst.ForEach(p =>
// {
// p.Qty = 1;
// p.DiffAMT = Math.Round(p.Qty * p.Price, 2);
// p.DiffQty = 1;
// }
// );
// if (!string.IsNullOrEmpty(materialGroup))
// {
// var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(kenncode))
// {
// var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(chassisNumber))
// {
// var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(sapCode))
// {
// var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
// }
// }
// if (!string.IsNullOrEmpty(materailCode))
// {
// var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList();
// if (_groupList.Count() > 0)
// {
// _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
// }
// }
// _lst.GroupBy(p=>sapcode).Select()
//}
}
}
Loading…
Cancel
Save