You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

243 lines
8.5 KiB
C#

using ibk.IPD.Common;
using ibk.IPD.Entity;
using ibk.IPD.Entity.IPD_PS;
using ibk.IPD.Entity.IPD_PS.QueryArgs;
using ibk.IPD.Entity.IPD_PS.RequestArgs;
using ibk.IPD.Entity.IPD_MR.HotRoll;
using ibk.IPD.Entity.IpdPs;
using ibk.IPD.Service;
using ibk.IPD.Service.IPD_PS;
using log4net;
using SOA.Objects;
using SOA.Persistent;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting.Contexts;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.IO;
using ibk.IPD.Service.IPD_SS;
using Consul;
using System.Diagnostics;
using System.Windows.Forms;
using Confluent.Kafka;
using ibk.IPD.Entity.IpdMr.Basic;
using ibk.IPD.Entity.IPD_MR.CapacityAndTime;
using ibk.IPD.Entity.IPD_MR.CapacityAndTime.QueryArgs;
using ibk.IPD.Entity.IPD_SS;
namespace ibk.IPD.Controller.IPD_SS
{
[RoutePrefix("ipd/AipdSS")]
public class SlabConfigController : ApiController
{
private static readonly ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//后端 Service
private static SurMatSubService SerSurMatSubService = new SurMatSubService();
/// <summary>
/// 更新板卷厂配置参数
/// </summary>
/// <param name="prTBSubRules">配置参数</param>
/// <returns></returns>
[HttpPost, Route("UpdateTBPSConfC1")]
public RequestEntity UpdateTBPSConfC1(TB_SLAB_CONFIG_C1 prTBSubRules)
{
RequestEntity result = new RequestEntity();
try
{
IList<TB_SLAB_CONFIG_C1> ilist = SerSurMatSubService.GetTBSLABRulesC1(prTBSubRules);
if (ilist[0].ID == prTBSubRules.ID && ilist[0].LOOP_CYC == prTBSubRules.LOOP_CYC && ilist[0].ORD_DAYS_DIFF == prTBSubRules.ORD_DAYS_DIFF && ilist[0].PLATE_DAYS_DIFF == prTBSubRules.PLATE_DAYS_DIFF && ilist[0].SUB_RATE == prTBSubRules.SUB_RATE && ilist[0].SPLITTING_LEN == prTBSubRules.SPLITTING_LEN && ilist[0].SUB_RATE_SPEC == prTBSubRules.SUB_RATE_SPEC)
{
SerSurMatSubService.UpdateTbSLABConfC1(prTBSubRules);
result.msg = "数据未变更无需确认";
result.code = "2";
return result;
}
SerSurMatSubService.UpdateTbSLABConfC1(prTBSubRules);
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("UpdateTBPSConfC1 报错 : ", ex);
}
return result;
}
/// <summary>
/// 获取配置参数
/// </summary>
/// <returns></returns>
[HttpPost, Route("GetTBPSConfC1")]
public RequestEntity GetTBPSConfC1()
{
RequestEntity result = new RequestEntity();
try
{
//获取替代信息
result.data = SerSurMatSubService.GetTBSLABRulesC1();
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("GetOrder 报错 : ", ex);
}
return result;
}
/// <summary>
/// 更新宽厚板厂配置参数
/// </summary>
/// <param name="prTBSubRules">配置参数</param>
/// <returns></returns>
[HttpPost, Route("UpdateTBPSConfC2")]
public RequestEntity UpdateTBPSConfC2(TB_SLAB_CONFIG_C2 prTBSubRules)
{
RequestEntity result = new RequestEntity();
try
{
IList<TB_SLAB_CONFIG_C2> ilist = SerSurMatSubService.GetTBSLABRulesC2(prTBSubRules);
if (ilist[0].ID == prTBSubRules.ID && ilist[0].LOOP_CYC == prTBSubRules.LOOP_CYC && ilist[0].ORD_DAYS_DIFF == prTBSubRules.ORD_DAYS_DIFF && ilist[0].PLATE_DAYS_DIFF == prTBSubRules.PLATE_DAYS_DIFF && ilist[0].SUB_RATE == prTBSubRules.SUB_RATE && ilist[0].SPLITTING_LEN == prTBSubRules.SPLITTING_LEN && ilist[0].SUB_RATE_SPEC == prTBSubRules.SUB_RATE_SPEC)
{
SerSurMatSubService.UpdateTbSLABConfC2(prTBSubRules);
result.msg = "数据未变更无需确认";
result.code = "2";
return result;
}
SerSurMatSubService.UpdateTbSLABConfC2(prTBSubRules);
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("UpdateTBPSConfC2 报错 : ", ex);
}
return result;
}
/// <summary>
/// 获取宽厚板厂配置参数
/// </summary>
/// <returns></returns>
[HttpPost, Route("GetTBPSConfC2")]
public RequestEntity GetTBPSConfC2()
{
RequestEntity result = new RequestEntity();
try
{
//获取替代信息
result.data = SerSurMatSubService.GetTBSLABRulesC2();
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("GetOrder 报错 : ", ex);
}
return result;
}
/// <summary>
/// 更新中板厂配置参数
/// </summary>
/// <param name="prTBSubRules">配置参数</param>
/// <returns></returns>
[HttpPost, Route("UpdateTBPSConfC3")]
public RequestEntity UpdateTBPSConfC3(TB_SLAB_CONFIG_C3 prTBSubRules)
{
RequestEntity result = new RequestEntity();
try
{
IList<TB_SLAB_CONFIG_C3> ilist = SerSurMatSubService.GetTBSLABRulesC3(prTBSubRules);
if (ilist[0].ID == prTBSubRules.ID
&& ilist[0].LOOP_CYC == prTBSubRules.LOOP_CYC
&& ilist[0].ORD_DAYS_DIFF == prTBSubRules.ORD_DAYS_DIFF
&& ilist[0].SUB_RATE == prTBSubRules.SUB_RATE
&& ilist[0].EFF_WID == prTBSubRules.EFF_WID
&& ilist[0].EFF_LEN == prTBSubRules.EFF_LEN
&& ilist[0].EFF_LEN_MIN == prTBSubRules.EFF_LEN_MIN
&& ilist[0].EFF_LEN_MAX == prTBSubRules.EFF_LEN_MAX
&& ilist[0].EFF_LEN_1 == prTBSubRules.EFF_LEN_1
&& ilist[0].EFF_LEN_2 == prTBSubRules.EFF_LEN_2
&& ilist[0].SUB_RATE1 == prTBSubRules.SUB_RATE1
&& ilist[0].SUB_RATE2 == prTBSubRules.SUB_RATE2
&& ilist[0].MAX_RATIO == prTBSubRules.MAX_RATIO
&& ilist[0].DIR_MAX_LEN == prTBSubRules.DIR_MAX_LEN
)
{
SerSurMatSubService.UpdateTbSLABConfC3(prTBSubRules);
result.msg = "数据未变更无需确认";
result.code = "2";
return result;
}
SerSurMatSubService.UpdateTbSLABConfC3(prTBSubRules);
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("UpdateTBPSConfC3 报错 : ", ex);
}
return result;
}
/// <summary>
/// 获取中板厂配置参数
/// </summary>
/// <returns></returns>
[HttpPost, Route("GetTBPSConfC3")]
public RequestEntity GetTBPSConfC3()
{
RequestEntity result = new RequestEntity();
try
{
//获取替代信息
result.data = SerSurMatSubService.GetTBSLABRulesC3();
result.msg = "操作成功!";
result.code = "1";
}
catch (Exception ex)
{
result.msg = "数据库错误!";
result.code = "0";
logger.Error("GetOrder 报错 : ", ex);
}
return result;
}
}
}