Administrator 3 years ago
parent
commit
a2e9f7ef5b
  1. 4
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
  2. 6
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs
  3. 173
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
  4. 7
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs

4
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs

@ -57,7 +57,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 版本
/// </summary>
[Display(Name = "版本")]
[ExporterHeader(DisplayName = "版本")]
[ExporterHeader(DisplayName = "版本",IsIgnore =true)]
public string Version { set; get; }
[ExporterHeader(DisplayName = "有效从")]
public DateTime BeginDate { get; set; }
@ -79,7 +79,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// <summary>
///价格类型
/// </summary>
[ExporterHeader(DisplayName = "*分销渠道")]
[ExporterHeader(DisplayName = "*分销渠道",IsIgnore =true)]
public int Type { get; set; }
[ExporterHeader(DisplayName = "*客户")]
public string CustomerCode { get; set; }

6
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/WMSSharePartAppService.cs

@ -52,7 +52,7 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
/// <summary>
/// wms出库
/// 大众备件无单号出库单
/// </summary>
//[AllowAnonymous]
@ -651,7 +651,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePartOutPutDetial>(files, _excelImportService);
var result_org = await _exportImporter.ExtendExcelOfSheetOneImport<WmsSharePartOutPutDetial>(files, _excelImportService);
//过滤掉隐藏的空白行20220527
var result = result_org.Where(p => !string.IsNullOrEmpty(p.MaterialCode)).ToList();
//检验1:导入模板中的第一页签数据不能为空
if (result == null || result.Count == 0)
{

173
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

@ -280,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//var listCompare = DbConnection.Query<CompareExtend>(sql2);
var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
var listCompare = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
@ -299,7 +299,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//"WHERE\n" +
//" B.Kanban IS NULL";
var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
var listCompare1 = DbConnection.Query<CompareExtend>("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure);
@ -408,54 +408,54 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
List<CompareExtend> _ls = new List<CompareExtend>();
foreach (var itm in listCompare.ToList())
{
var first = _ls.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode);
if (first != null)
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
//List<CompareExtend> _ls = new List<CompareExtend>();
//foreach (var itm in listCompare.ToList())
//{
// var first = _ls.FirstOrDefault(p => p.Kanban == itm.Kanban && p.MaterialCode == itm.MaterialCode);
// if (first != null)
// {
// if (!string.IsNullOrEmpty(itm.WmsDate))
// {
// itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
// }
first.WmsBillNum += "," + itm.WmsBillNum;
first.WmsDate += "," + itm.WmsDate;
}
else
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls.Add(itm);
}
// first.WmsBillNum += "," + itm.WmsBillNum;
// first.WmsDate += "," + itm.WmsDate;
// }
// else
// {
// if (!string.IsNullOrEmpty(itm.WmsDate))
// {
// itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
// }
// _ls.Add(itm);
// }
}
//}
foreach (var itm in listCompare1.ToList())
{
if (!string.IsNullOrEmpty(itm.WmsDate))
{
itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
}
_ls.Add(itm);
}
//foreach (var itm in listCompare1.ToList())
//{
// if (!string.IsNullOrEmpty(itm.WmsDate))
// {
// itm.WmsDate = DateTime.Parse(itm.WmsDate).ToShortDateString();
// }
// _ls.Add(itm);
//}
//var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);
//又变了,要求发运和退货直接去比对WMS发运和退货视图
var _query = DbConnection.Query<HQHSettledDetailDiff>("[dbo].[p_hq_unsettle]", new { version = version }, null, true, 1200, CommandType.StoredProcedure);
var _query = DbConnection.Query<HQHSettledDetailDiff>("[dbo].[p_hq_unsettle_1]", new { version = version }, null, true, 1200, CommandType.StoredProcedure);
_list = _query.ToList();
foreach (var itm1 in _list)
{
var itm = _ls.FirstOrDefault(p => p.Kanban == itm1. && p.MaterialCode == itm1.Sap编码);
if (itm != null)
{
itm1. = itm.WmsBillNum;
itm1. = itm.WmsDate;
}
//var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码);
//if (itm != null)
//{
// itm1.交货单号 = itm.WmsBillNum;
// itm1.交货时间 = itm.WmsDate;
//}
var itmcopy = _lscopy.FirstOrDefault(p => p.HQHKanBan == itm1. && p.MaterialCode == itm1.Sap编码);
if (itmcopy != null)
@ -476,7 +476,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
List<HQHSettledDetailDiffDto> _list = new List<HQHSettledDetailDiffDto>();
var _query = DbConnection.Query<HQHSettledDetailDiffDto>("[dbo].[p_hq_unsettle_settleNofayun]", new { version = version }, null, true, 1200, CommandType.StoredProcedure);
var _query = DbConnection.Query<HQHSettledDetailDiffDto>("[dbo].[p_hq_unsettle_settleNofayun_1]", new { version = version }, null, true, 1200, CommandType.StoredProcedure);
_list = _query.ToList();
return _list;
@ -1711,10 +1711,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
/// <param name="end"></param>
/// <param name="materialGroup"></param>
/// <returns></returns>
public virtual List<HQHSharePartSettledDetailDiff> GetSharePartSumSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
public virtual List<HQHSharePartSettledDetailDiffSum> GetSharePartSumSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup)
{
List<HQHSharePartSettledDetailDiff> _list = new List<HQHSharePartSettledDetailDiff>();
List<HQHSharePartSettledDetailDiffSum> _list = new List<HQHSharePartSettledDetailDiffSum>();
//string condition = " where 1=1 ";
@ -1786,7 +1786,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
// var _sql = string.Format(str, version, condition);
var _sql = string.Format(str, version);
var _query = DbConnection.Query<HQHSharePartSettledDetailDiff>(_sql, null, null, true, 1200, null);
var _query = DbConnection.Query<HQHSharePartSettledDetailDiffSum>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;
@ -1846,8 +1846,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
[ExporterHeader(DisplayName = "验收单日期")]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "外部单号")]
public string { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
@ -1874,6 +1874,89 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public class HQHSharePartSettledDetailDiffSum
{
public HQHSharePartSettledDetailDiffSum()
{
}
public HQHSharePartSettledDetailDiffSum(string sapMaterialCode, string materialCode, string materialDesc, decimal price,
string storageLocation, string storageLocationDesc, decimal selprice, decimal diffprice, decimal sumprice, decimal settleprice, decimal qty,
decimal sockQty,string materialgroup)
{
Sap编码 = sapMaterialCode;
= materialDesc;
= materialCode;
= sockQty;
= price;
= storageLocation;
= storageLocationDesc;
= selprice;
= diffprice;
= sumprice;
= qty;
= settleprice;
= materialgroup;
}
[ExporterHeader(DisplayName = "工厂",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库")]
public string { set; get; }
[ExporterHeader(DisplayName = "收货仓库描述")]
public string { set; get; }
[ExporterHeader(DisplayName = "订货看板编号")]
public string { set; get; }
[ExporterHeader(DisplayName = "Sap编码")]
public string Sap编码 { set; get; }
[ExporterHeader(DisplayName = "结算物料号")]
public string { set; get; }
[ExporterHeader(DisplayName = "物料组(车型)")]
public string { set; get; }
[ExporterHeader(DisplayName = "零件中文名称")]
public string { set; get; }
[ExporterHeader(DisplayName = "验收单日期",IsIgnore =true)]
public string { set; get; }
[ExporterHeader(DisplayName = "结算验收单号", IsIgnore = true)]
public string { set; get; }
[ExporterHeader(DisplayName = "发货定价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算数量")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算单价")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "结算金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "价格差异")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "差异总金额")]
public decimal { set; get; }
[ExporterHeader(DisplayName = "寄销库数量")]
public decimal { set; get; }
}
public class HQHSettledDetailDiff
{

7
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs

@ -70,10 +70,10 @@ namespace SettleAccount.Job.Services.Report
var queryStockList = from itm in _ls_sum
join itm1 in stockList on itm.Sap编码 equals itm1.SapCode into temp1
from tm1 in temp1.DefaultIfEmpty()
select new HQHSharePartSettledDetailDiff(
select new HQHSharePartSettledDetailDiffSum(
itm.Sap编码,
itm.,
itm.,
itm.,
itm.,
itm.,
itm.,
@ -82,7 +82,8 @@ namespace SettleAccount.Job.Services.Report
itm.,
itm.,
itm.,
tm1 == null ? 0 : tm1.Qty
tm1 == null ? 0 : tm1.Qty,
itm.
);
//var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup);

Loading…
Cancel
Save