Browse Source

更新版本

FoShanPG
Administrator 3 years ago
parent
commit
d4562e2f23
  1. 39
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs

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

@ -11,6 +11,15 @@ using Volo.Abp.EntityFrameworkCore;
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; }
}
/// <summary>
/// 红旗H平台输出报表
/// </summary>
@ -99,7 +108,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.WmsBillNum AS 交货单号,\n" +
" '' AS 交货单号,\n" +
" CONVERT ( VARCHAR ( 100 ), b.LastModificationTime, 23 ) AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
" a.StorageLocation AS 收货仓库,\n" +
@ -130,6 +139,34 @@ 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 WHERE temp1.[交货单号] is not null ";
var _sql = string.Format(str, version, condition);
var sql2 = "SELECT\n" +
" a.WmsBillNum,\n" +
" a.MaterialCode,\n" +
" a.Kanban \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;
}
}
var _query = DbConnection.Query<HQHSettledDetailDiff>(_sql, null, null, true, 1200, null);
_list = _query.ToList();
return _list;

Loading…
Cancel
Save