a
This commit is contained in:
60
08.昶东/EastChanger/Synchron2Customs.cs
Normal file
60
08.昶东/EastChanger/Synchron2Customs.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using EastChanger.STK_Inventory;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EastChanger
|
||||
{
|
||||
public class Synchron2Customs : IScheduleService
|
||||
{
|
||||
public void Run(Context ctx, Schedule schedule)
|
||||
{
|
||||
try
|
||||
{
|
||||
var paramList = new List<string>();
|
||||
if (!schedule.Parameters.IsNullOrEmpty())
|
||||
paramList = schedule.Parameters
|
||||
.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)
|
||||
.ToList();
|
||||
Logger.Info(schedule.Name, "执行同步数据至海关start...");
|
||||
|
||||
foreach (var param in paramList)
|
||||
{
|
||||
ISynchonService service = null;
|
||||
switch (param)
|
||||
{
|
||||
case "STK_Inventory"://即时库存明细
|
||||
service = new STKInventoryService(ctx);
|
||||
break;
|
||||
case "STK_MISCELLANEOUS"://其他入库单
|
||||
case "STK_MisDelivery"://其他出库单
|
||||
case "STK_StockCountGain"://盘盈单
|
||||
case "STK_StockCountLoss"://盘亏单
|
||||
break;
|
||||
}
|
||||
|
||||
if (service == null)
|
||||
continue;
|
||||
|
||||
Logger.Info(schedule.Name, $"{service.ModuleCnName}数据同步start...");
|
||||
service.HandleSyncData(null, null);
|
||||
Logger.Info(schedule.Name, $"{service.ModuleCnName}数据同步end...");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error(schedule.Name, ex.Message, ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Logger.Info(schedule.Name, "执行同步数据至海关end...");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user