using System;
using BP.DA;
using BP.Port;
using BP.En;
namespace BP.GPM.DTalk.DTS
{
///
/// 钉钉组织结构增量同步
///
public class OrgInit_DingIcreMent : Method
{
///
/// 钉钉组织结构增量同步
///
public OrgInit_DingIcreMent()
{
this.Title = "同步增量钉钉通讯录到CCGPM";
this.Help = "增量同步钉钉通讯录,需要时间比较长,请耐心等待。
钉钉相关配置写入Web.config,配置正确才可以被执行";
}
///
/// 设置执行变量
///
///
public override void Init()
{
}
///
/// 当前的操纵员是否可以执行这个方法
///
public override bool IsCanDo
{
get
{
if (BP.WF.Glo.IsEnable_DingDing == true)
return true;
return false;
}
}
///
/// 执行
///
/// 返回执行结果
public override object Do()
{
Emp emp = new BP.Port.Emp();
emp.CheckPhysicsTable();
DingDing ding = new DingDing();
string result = ding.AnsyIncrementOrgToGPM();
if (DataType.IsNullOrEmpty(result))
{
return "执行成功,没有发生变化...";
}
else if (result.Contains("钉钉获取部门出错"))
{
return result;
}
else if (result.Length > 0)
{
string webPath = "Log/Ding_GPM" + DateTime.Now.ToString("yyyy_MM_dd") + ".log";
string savePath = BP.Difference.SystemConfig.PathOfDataUser + webPath;
BP.DA.Log.DebugWriteInfo(result);
return "执行成功下载日志";
}
else
return "执行失败...";
}
}
}