93 lines
2.5 KiB
C#
93 lines
2.5 KiB
C#
using BLL;
|
|
using Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.Http;
|
|
|
|
namespace WebAPI.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 五环IDP平台
|
|
/// </summary>
|
|
public class IDPController : ApiController
|
|
{
|
|
#region IDP系统项目设计图纸数据
|
|
|
|
/// <summary>
|
|
/// 每天夜间同步获取IDP系统项目设计图纸数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Model.ResponeData SynIDPDesignDrawingData()
|
|
{
|
|
var responeData = new Model.ResponeData();
|
|
try
|
|
{
|
|
var lst = DesignDrawingService.GetIDPDesignDrawingFile();
|
|
if (lst.Any())
|
|
{
|
|
string date = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
|
|
IDPDataService.GetIDPProjectDesignDrawingData("", date);
|
|
}
|
|
else
|
|
{
|
|
IDPDataService.GetIDPProjectDesignDrawingData();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
responeData.code = 0;
|
|
responeData.message = ex.ToString();
|
|
}
|
|
return responeData;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 每天夜间接收OA系统项目设计图纸数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Model.ResponeData SynOADesignDrawingData([FromBody] List<OADesignDrawingDataItem> items)
|
|
{
|
|
var responeData = new Model.ResponeData();
|
|
try
|
|
{
|
|
responeData.message = IDPDataService.SaveDesignDrawingData(items);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
responeData.code = 0;
|
|
responeData.message = ex.ToString();
|
|
}
|
|
return responeData;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IDP系统项目开车数据
|
|
|
|
/// <summary>
|
|
/// 每天夜间同步获取IDP系统项目开车数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public Model.ResponeData SynIDPPreRunData()
|
|
{
|
|
var responeData = new Model.ResponeData();
|
|
try
|
|
{
|
|
IDPDataService.GetIDPProjectMasterData();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
responeData.code = 0;
|
|
responeData.message = ex.ToString();
|
|
}
|
|
return responeData;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |