Browse Source

更新版本

branch_ccpg_220107
Administrator 3 years ago
parent
commit
63adad2c4f
  1. 131
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs
  2. 75
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs
  3. BIN
      src/Shared/Win.Abp.Snowflakes/obj/Debug/netcoreapp5/Win.Abp.Snowflakes.csproj.AssemblyReference.cache
  4. BIN
      src/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.csproj.AssemblyReference.cache
  5. BIN
      src/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.csproj.AssemblyReference.cache

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

@ -0,0 +1,131 @@
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
using Win.Sfs.SettleAccount.Reports;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class UnSettleDiff: ReportDetailBase
{
[ExporterHeader(DisplayName = "结算平台未结数量")]
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "大众R3未结数量")]
public decimal UNSettleQty { set; get; }
[ExporterHeader(DisplayName = "定价")]
public decimal Price { set; get; }
[ExporterHeader(DisplayName = "金额")]
public decimal Amt { set; get; }
[ExporterHeader(DisplayName = "差异")]
public decimal DiffQty { set; get; }
[ExporterHeader(DisplayName = "差异金额")]
public decimal DiffAmt { set; get; }
//交货单号 实际发货日期 KENN号 底盘号 底盘格式整理 M100交货状态 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 结算平台未结数量 定价 金额 大众R3未结数量 差异 差异金额
}
public class UnSettleDiffDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public UnSettleDiffDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider) : base(dbContextProvider)
{
}
public virtual List<UnSettleDiff> GetDiffReport(int type,string year, string begin, string end, string materialCode, string sapCode)
{
string str1 = "where 1=1 ";
string sql1 = "SELECT\n" +
" a.MaterialCode,\n" +
" a.KENNCode,\n" +
" a.ChassisNumber,\n" +
" a.qty unsettleQty,\n" +
" b.qty \n" +
" a.Cp5Time \n"+
"FROM\n" +
" Set_unsettle a\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" sum( qty ) qty \n" +
" FROM\n" +
" Set_fis \n" +
" WHERE\n" +
" state = 0 \n" +
" OR state = 4 \n" +
" GROUP BY\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2 \n" +
" ) b ON a.ChassisNumber = b.ChassisNumber2 \n" +
" AND a.MaterialCode = b.ItemCode \n" +
" AND a.KENNCode = b.KENNCode {0}";
string sql2 =
"SELECT\n" +
" a.*,\n" +
" b.Qty unsettleQty \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" WMSState,\n" +
" WMSBillNum,\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" sum( qty ) qty,\n" +
" ErpMaterialCode,\n" +
" ChassisNumber \n" +
" FROM\n" +
" Set_fis \n" +
" WHERE\n" +
" state = 0 \n" +
" GROUP BY\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" WMSState,\n" +
" WMSBillNum,\n" +
" ErpMaterialCode,\n" +
" ChassisNumber \n" +
" Cp5Time \n" +
" ) a\n" +
" LEFT JOIN Set_unsettle b ON a.ChassisNumber2 = b.ChassisNumber \n" +
" AND b.MaterialCode = a.ItemCode \n" +
" AND a.KENNCode = b.KENNCode {0}";
string _sql = string.Empty;
if (type == 1 )
{
_sql = string.Format(sql2, str1);
}
else
{
_sql = string.Format(sql1, str1);
}
var _query = DbConnection.Query<UnSettleDiff>(_sql);
return _query.ToList();
}
}
}

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

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace SettleAccount.Job.Services.Report
{
public class UnSettleDiffExportService : ITransientDependency, IExportJob
{
private readonly UnSettleDiffDapperRepository _dapper;
private readonly OutputService _outputService;
public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService)
{
_dapper = dapper;
_outputService = outputService;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
var type = p_list.Where(p => p.Name == "Type").FirstOrDefault().Value;
var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value;
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _first = exportName.FirstOrDefault();
var _ls = new List<UnSettleDiff>();
_ls = _dapper.GetDiffReport(int.Parse(type),year,beginTime,endTime, materialCode,sapCode);
var _id = Guid.NewGuid();
List<UnSettleDiff> _lsExport = new List<UnSettleDiff>();
//foreach (var itm in _ls)
//{
// var dto = new FISExportDto()
// {
// ChassisNumber = itm.ChassisNumber,
// ChassisNumber2 = itm.ChassisNumber2,
// CP5Time = itm.CP5Time,
// ItemCode = itm.ItemCode,
// CP7Time = itm.CP7Time,
// KENNCode = itm.KENNCode,
// OrderBillNum = itm.OrderBillNum,
// //Model = itm.Model,
// SequenceNumber = itm.SequenceNumber,
// ErpMaterialCode = itm.ErpMaterialCode,
// SettledQty = itm.SettledQty,
// //State = itm.State,
// Qty = itm.Qty,
// Version = itm.Version,
// };
// _lsExport.Add(dto);
//}
_outputService.Export<UnSettleDiff>(id, _first, _lsExport);
return id.ToString();
}
}
}

BIN
src/Shared/Win.Abp.Snowflakes/obj/Debug/netcoreapp5/Win.Abp.Snowflakes.csproj.AssemblyReference.cache

Binary file not shown.

BIN
src/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.csproj.AssemblyReference.cache

Binary file not shown.

BIN
src/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.csproj.AssemblyReference.cache

Binary file not shown.
Loading…
Cancel
Save