|
|
@ -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 |
|
|
|
{ |
|
|
|