CNCEC_SUBQHSE_WUHUAN/SGGL/WebAPI/Controllers/IDP/IDPController.cs

144 lines
4.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
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;
}
/// <summary>
/// 每天夜间同步获取OA系统项目设计图纸数据蓝图寄出信息
/// </summary>
/// <returns></returns>
[HttpPost]
public Model.ResponeData SynOADesignDrawingDataBlueprintInfo()
{
var responeData = new Model.ResponeData();
try
{
responeData.message = IDPDataService.GetDesignDrawingDataBlueprintInfo();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.ToString();
}
return responeData;
}
/// <summary>
/// 每天夜间同步获取OA系统项目设计图纸数据蓝图打印信息
/// </summary>
/// <returns></returns>
[HttpPost]
public Model.ResponeData SynOADesignDrawingDataPrintInfo()
{
var responeData = new Model.ResponeData();
try
{
responeData.message = IDPDataService.GetDesignDrawingDataPrintInfo();
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.ToString();
}
return responeData;
}
#endregion
#region IDP系统项目开车数据
/// <summary>
/// 获取IDP系统项目开车数据【测试用接口不上线】
/// </summary>
/// <returns></returns>
[HttpPost]
public Model.ReturnData SynIDPPreRunData()
{
var responeData = new Model.ReturnData();
responeData.time = DateTime.Now.ToString();
try
{
var session = IDPDataService.GetAuthenticationSession();
//ErrLogInfo.WriteLog($"Session——name{session.name}value{session.value}");
string pipingMsg = IDPDataService.GetIDPProjectPreRunDataPiping(session, "32d0bca0-7693-4bd6-813d-6ee174ba29d3");
string equipmentMsg = IDPDataService.GetIDPProjectPreRunDataEquipment(session, "32d0bca0-7693-4bd6-813d-6ee174ba29d3");
string instrumentationMsg = IDPDataService.GetIDPProjectPreRunDataInstrumentation(session, "32d0bca0-7693-4bd6-813d-6ee174ba29d3");
responeData.message = $"管道一览表:{pipingMsg};设备一览表:{equipmentMsg};索引表:{instrumentationMsg}";
//responeData.message = $"管道一览表:{pipingMsg};设备一览表:{equipmentMsg}";
//responeData.message = $"索引表:{instrumentationMsg}";
}
catch (Exception ex)
{
responeData.code = 0;
responeData.message = ex.ToString();
}
return responeData;
}
#endregion
}
}