Browse Source

Merge branch 'master' of https://e.coding.net/ccwin-in/PG/Win.sfs.SmartSettlementSystem.PG

# Conflicts:
#	src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs
FoShanPG
44673626 3 years ago
parent
commit
065969dc55
  1. 41
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

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

@ -11,6 +11,17 @@ using Volo.Abp.EntityFrameworkCore;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{ {
public class CompareExtend
{
public string WmsBillNum { set; get; }
public string MaterialCode { set; get; }
public string Kanban { set; get; }
public string WmsDate { set; get; }
}
/// <summary> /// <summary>
/// 红旗H平台输出报表 /// 红旗H平台输出报表
/// </summary> /// </summary>
@ -130,6 +141,36 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode"; " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE ( Version = ( SELECT MAX ( Version ) FROM Set_PriceList ) ) ) AS TEMP2 ON temp1.Sap编码 = TEMP2.MaterialCode";
var _sql = string.Format(str, version, condition); var _sql = string.Format(str, version, condition);
var sql2 = "SELECT\n" +
" a.WmsBillNum,\n" +
" a.MaterialCode,\n" +
" a.Kanban ,\n" +
" a.A.LastModificationTime WmsDate \n" +
"FROM\n" +
" Set_HQ_H_Kanban A\n" +
" INNER JOIN ( SELECT MaterialCode, Kanban FROM Set_HQ_H_Kanban GROUP BY MaterialCode, Kanban HAVING COUNT(*)> 1 ) B ON A.Kanban = B.Kanban \n" +
" AND A.MaterialCode = B.MaterialCode";
var listCompare= DbConnection.Query<CompareExtend>(sql2);
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)
{
first.WmsBillNum += itm.WmsBillNum;
first.WmsDate += itm.WmsDate;
}
}
var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null); var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList(); _list = _query.ToList();
return _list; return _list;

Loading…
Cancel
Save