0
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using DocumentFormat.OpenXml.Bibliography;
|
||||
using Gatedge.Enpower.BOS.PlugIn.Utils;
|
||||
using GZ_LTHPilot_ORDER.Models.VO;
|
||||
using GZ_LTHPilot_ORDER.Service;
|
||||
using GZ_LTHPilot_ORDER.Services;
|
||||
@@ -10,6 +11,7 @@ using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.BOS.WebApi.FormService;
|
||||
using Kingdee.K3.FIN.App.Core.Match.Object;
|
||||
using Newtonsoft.Json;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -27,12 +29,21 @@ namespace GZ_LTHPilot_ORDER.ScheduleService
|
||||
int Cycle = 12;
|
||||
public void Run(Context ctx, Schedule schedule)
|
||||
{
|
||||
TempTableService tempTableService = new TempTableService(ctx);
|
||||
OrgService orgService = new OrgService(ctx);
|
||||
SaleOrderService saleOrderService = new SaleOrderService(ctx);
|
||||
var ctxString = JsonConvert.SerializeObject(ctx);
|
||||
Context newCtx = DataCenterService.GetDataCenterContextByID(ctx.DBId);
|
||||
newCtx.UserId = 131409; //服务操作用户暂时记为Administrator
|
||||
newCtx.UserName = "ERP6";
|
||||
newCtx.ServiceType = WebType.WebSite;
|
||||
newCtx.CurrentOrganizationInfo.ID = 1;
|
||||
|
||||
LogUtil.Log("UserContext", ctxString);
|
||||
|
||||
TempTableService tempTableService = new TempTableService(newCtx);
|
||||
OrgService orgService = new OrgService(newCtx);
|
||||
SaleOrderService saleOrderService = new SaleOrderService(newCtx);
|
||||
var orgList = orgService.GetOrgList();
|
||||
var tableName = tempTableService.CreateTempTable();
|
||||
CreateTempTable(ctx, tableName);
|
||||
CreateTempTable(newCtx, tableName);
|
||||
var advanceAays = GetAdvanceAays(schedule);
|
||||
var planStartDate = DateTime.Now;
|
||||
Dictionary<string, string> orgDict = new Dictionary<string, string>();
|
||||
@@ -55,14 +66,14 @@ namespace GZ_LTHPilot_ORDER.ScheduleService
|
||||
var receiveAmountList = saleOrderService.GetSaleOrderReceiveAmountByDate(saleOrgIds, startDate, endDate);
|
||||
if (receiveAmountList.Count > 0)
|
||||
{
|
||||
InsertDataToTempTable(ctx, tableName, orgDict, receiveAmountList);
|
||||
InsertDataToTempTable(newCtx, tableName, orgDict, receiveAmountList);
|
||||
|
||||
}
|
||||
startDate = startDate.AddMonths(Cycle);
|
||||
endDate = startDate.AddMonths(Cycle);
|
||||
}
|
||||
|
||||
UpdateSaleOrderReceiveAmount(ctx, tableName);
|
||||
|
||||
UpdateSaleOrderReceiveAmount(newCtx, tableName);
|
||||
tempTableService.DropTempTable(tableName);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user