王 垚
2021-09-02 7af4d9d0181f2442bc60b218ec65bfaf831d0422
src/BLL/Demo.TimedTaskPlugIn/PRD/StockChangeDynamicAlignment.cs
@@ -1,5 +1,4 @@
using System.ComponentModel;
using Kingdee.BOS.Contracts;
using Kingdee.BOS;
using Kingdee.BOS.Core;
using Kingdee.BOS.ServiceHelper;
@@ -9,12 +8,12 @@
using System;
using Kingdee.BOS.Util;
using System.Linq;
using ZD.Cloud.WebApi;
using Demo.Model.Model;
using Demo.Model.Model.PODemandPlan;
using System.Diagnostics;
using System.Collections.Generic;
using ZD.Share.Common;
using ZD.Cloud.WebApi;
namespace Demo.TimedTaskPlugIn.PRD
{
@@ -22,7 +21,7 @@
    [HotUpdate]
    public class StockChangeDynamicAlignment : Kingdee.BOS.Contracts.IScheduleService
    {
        CloudClient cloudClient = new CloudClient("http://localhost/K3Cloud/");
        CloudClient cloudClient = new CloudClient("http://localhost//k3cloud/");
        public Context Context;
        List<PRD_Inventory> ListInventory;//库存明细
        List<PRD_Inventory> ListInventoryByStockOrgId;//物料总库存
@@ -34,7 +33,7 @@
                Context = ctx;
                string sql = @"/*dialect*/ select count(*) from 
(
select a.FSTOCKORGID,sum(b.FACTUALQTY)FACTUALQTY,b.FMATERIALID from T_PRD_PICKMTRL A
select a.FSTOCKORGID,sum(b.FACTUALQTY)FACTUALQTY,b.FMATERIALID from T_PRD_FEEDMTRL A
join T_PRD_PICKMTRLDATA b on a.FID =b.FID 
where a.FAPPROVEDATE is not null and DATEDIFF(D,GETDATE(),FDATE)=0
group by FSTOCKORGID,FMATERIALID
@@ -366,6 +365,7 @@
                            ModelEnty.Add("FHSourceID", new JObject() { ["Fnumber"] = _item.FHSourceID });//生产资源FHSourceID
                            ModelEnty.Add("FNumerator", _item.FNumerator);//分母
                            ModelEnty.Add("FDenominator", _item.FDenominator);//分子
                            ModelEnty.Add("FDwyl", Convert.ToDecimal(_item.FNumerator) / Convert.ToDecimal(_item.FDenominator));//单位用料
                            ModelEnty.Add("FFIXSCRAPQTY", _item.FFIXSCRAPQTY);//固定损耗
                            ModelEnty.Add("FHQtyScrap", _item.FHQtyScrap);//变动损耗率%
                            Entry.Add(ModelEnty);
@@ -766,5 +766,7 @@
            }
            DBServiceHelper.ExecuteBatch(Context, sqlList);
        }
    }
}