0
This commit is contained in:
parent
6bab550029
commit
ec10996079
@ -23,8 +23,8 @@ namespace GZ_LTHPilot_ORDER.Models.K3Request
|
|||||||
public class Model
|
public class Model
|
||||||
{
|
{
|
||||||
public string FSaleOrgList { get; set; }
|
public string FSaleOrgList { get; set; }
|
||||||
public DateTime FSoFromDate { get; set; }
|
public string FSoFromDate { get; set; }
|
||||||
public DateTime FSoToDate { get; set; }
|
public string FSoToDate { get; set; }
|
||||||
|
|
||||||
public string FSaleOFrom { get; set; }
|
public string FSaleOFrom { get; set; }
|
||||||
public string FSaleOTo { get; set; }
|
public string FSaleOTo { get; set; }
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using DocumentFormat.OpenXml.Bibliography;
|
using DocumentFormat.OpenXml.Bibliography;
|
||||||
|
using Gatedge.Enpower.BOS.PlugIn.Utils;
|
||||||
using GZ_LTHPilot_ORDER.Models.VO;
|
using GZ_LTHPilot_ORDER.Models.VO;
|
||||||
using GZ_LTHPilot_ORDER.Service;
|
using GZ_LTHPilot_ORDER.Service;
|
||||||
using GZ_LTHPilot_ORDER.Services;
|
using GZ_LTHPilot_ORDER.Services;
|
||||||
@ -10,6 +11,7 @@ using Kingdee.BOS.ServiceHelper;
|
|||||||
using Kingdee.BOS.Util;
|
using Kingdee.BOS.Util;
|
||||||
using Kingdee.BOS.WebApi.FormService;
|
using Kingdee.BOS.WebApi.FormService;
|
||||||
using Kingdee.K3.FIN.App.Core.Match.Object;
|
using Kingdee.K3.FIN.App.Core.Match.Object;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using NPOI.SS.Formula.Functions;
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -27,12 +29,21 @@ namespace GZ_LTHPilot_ORDER.ScheduleService
|
|||||||
int Cycle = 12;
|
int Cycle = 12;
|
||||||
public void Run(Context ctx, Schedule schedule)
|
public void Run(Context ctx, Schedule schedule)
|
||||||
{
|
{
|
||||||
TempTableService tempTableService = new TempTableService(ctx);
|
var ctxString = JsonConvert.SerializeObject(ctx);
|
||||||
OrgService orgService = new OrgService(ctx);
|
Context newCtx = DataCenterService.GetDataCenterContextByID(ctx.DBId);
|
||||||
SaleOrderService saleOrderService = new SaleOrderService(ctx);
|
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 orgList = orgService.GetOrgList();
|
||||||
var tableName = tempTableService.CreateTempTable();
|
var tableName = tempTableService.CreateTempTable();
|
||||||
CreateTempTable(ctx, tableName);
|
CreateTempTable(newCtx, tableName);
|
||||||
var advanceAays = GetAdvanceAays(schedule);
|
var advanceAays = GetAdvanceAays(schedule);
|
||||||
var planStartDate = DateTime.Now;
|
var planStartDate = DateTime.Now;
|
||||||
Dictionary<string, string> orgDict = new Dictionary<string, string>();
|
Dictionary<string, string> orgDict = new Dictionary<string, string>();
|
||||||
@ -55,14 +66,14 @@ namespace GZ_LTHPilot_ORDER.ScheduleService
|
|||||||
var receiveAmountList = saleOrderService.GetSaleOrderReceiveAmountByDate(saleOrgIds, startDate, endDate);
|
var receiveAmountList = saleOrderService.GetSaleOrderReceiveAmountByDate(saleOrgIds, startDate, endDate);
|
||||||
if (receiveAmountList.Count > 0)
|
if (receiveAmountList.Count > 0)
|
||||||
{
|
{
|
||||||
InsertDataToTempTable(ctx, tableName, orgDict, receiveAmountList);
|
InsertDataToTempTable(newCtx, tableName, orgDict, receiveAmountList);
|
||||||
|
|
||||||
}
|
}
|
||||||
startDate = startDate.AddMonths(Cycle);
|
startDate = startDate.AddMonths(Cycle);
|
||||||
endDate = startDate.AddMonths(Cycle);
|
endDate = startDate.AddMonths(Cycle);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateSaleOrderReceiveAmount(ctx, tableName);
|
UpdateSaleOrderReceiveAmount(newCtx, tableName);
|
||||||
tempTableService.DropTempTable(tableName);
|
tempTableService.DropTempTable(tableName);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,8 +137,8 @@ WHERE
|
|||||||
Model = new Model()
|
Model = new Model()
|
||||||
{
|
{
|
||||||
FSaleOrgList = orgId,
|
FSaleOrgList = orgId,
|
||||||
FSoFromDate = date.AddDays(-30),
|
FSoFromDate = date.AddDays(-30).ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
FSoToDate = date.AddDays(30),
|
FSoToDate = date.AddDays(30).ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
FSaleOFrom = billNo,
|
FSaleOFrom = billNo,
|
||||||
FSaleOTo = billNo,
|
FSaleOTo = billNo,
|
||||||
FFormCloseStatus = "ALL",
|
FFormCloseStatus = "ALL",
|
||||||
@ -154,7 +154,8 @@ WHERE
|
|||||||
FIncludedFree = true
|
FIncludedFree = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var paramString = JsonConvert.SerializeObject(param);
|
var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||||
|
var paramString = JsonConvert.SerializeObject(param, Formatting.Indented, jsonSetting);
|
||||||
var resultDict = WebApiServiceCall.GetSysReportData(this.ctx, "SAL_DetailReport", paramString);
|
var resultDict = WebApiServiceCall.GetSysReportData(this.ctx, "SAL_DetailReport", paramString);
|
||||||
var resultString = JsonConvert.SerializeObject(resultDict);
|
var resultString = JsonConvert.SerializeObject(resultDict);
|
||||||
var result = JsonConvert.DeserializeObject<KingdeeResult<SaleExecuteOut>>(resultString);
|
var result = JsonConvert.DeserializeObject<KingdeeResult<SaleExecuteOut>>(resultString);
|
||||||
@ -202,8 +203,8 @@ WHERE
|
|||||||
Model = new Model()
|
Model = new Model()
|
||||||
{
|
{
|
||||||
FSaleOrgList = orgId,
|
FSaleOrgList = orgId,
|
||||||
FSoFromDate = startDate,
|
FSoFromDate = startDate.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
FSoToDate = endDate,
|
FSoToDate = endDate.ToString("yyyy-MM-dd HH:mm:ss"),
|
||||||
FFormCloseStatus = "ALL",
|
FFormCloseStatus = "ALL",
|
||||||
FFormStatus = "ALL",
|
FFormStatus = "ALL",
|
||||||
FPriceFrom = "SALORDERBILL",
|
FPriceFrom = "SALORDERBILL",
|
||||||
@ -217,7 +218,8 @@ WHERE
|
|||||||
FIncludedFree = true
|
FIncludedFree = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var paramString = JsonConvert.SerializeObject(param);
|
var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
|
||||||
|
var paramString = JsonConvert.SerializeObject(param, Formatting.Indented, jsonSetting);
|
||||||
LogUtil.Log("paramString", paramString);
|
LogUtil.Log("paramString", paramString);
|
||||||
var resultDict = WebApiServiceCall.GetSysReportData(this.ctx, "SAL_DetailReport", paramString);
|
var resultDict = WebApiServiceCall.GetSysReportData(this.ctx, "SAL_DetailReport", paramString);
|
||||||
var resultString = JsonConvert.SerializeObject(resultDict);
|
var resultString = JsonConvert.SerializeObject(resultDict);
|
||||||
|
|||||||
@ -32,8 +32,8 @@ namespace Gatedge.Enpower.BOS.PlugIn.Utils
|
|||||||
{
|
{
|
||||||
var dateTime = DateTime.Now;
|
var dateTime = DateTime.Now;
|
||||||
var fileName = "\\KD_Gatedge_" + dateTime.ToString("yyyy-MM-dd_HH-mm-ss") + ".log";
|
var fileName = "\\KD_Gatedge_" + dateTime.ToString("yyyy-MM-dd_HH-mm-ss") + ".log";
|
||||||
return "\\" + string.Empty;
|
//return "\\" + string.Empty;
|
||||||
//return fileName;
|
return fileName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user