|
using HH.WCS.Mobox3.FJJT.device;
|
using HH.WCS.Mobox3.FJJT.util;
|
using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Web.Http;
|
using static HH.WCS.Mobox3.FJJT.api.ApiHelper;
|
using static HH.WCS.Mobox3.FJJT.api.ApiModel;
|
using static HH.WCS.Mobox3.FJJT.api.OtherModel;
|
using static HH.WCS.Mobox3.FJJT.device.S7Helper;
|
|
namespace HH.WCS.Mobox3.FJJT.api {
|
/// <summary>
|
/// 测试用,如果项目中要和设备对接,前期设备无法测试,用接口模拟
|
/// </summary>
|
[RoutePrefix("api")]
|
public class DebugController : System.Web.Http.ApiController {
|
|
|
[HttpPost]
|
[Route("s7SetInt")]
|
public SimpleResult s7SetInt(DBWModel model) {
|
S7Helper.s7SetInt(model);
|
return new SimpleResult();
|
|
}
|
|
|
[HttpPost]
|
[Route("s7SetBit")]
|
public SimpleResult s7SetBit(DBXModel model) {
|
S7Helper.s7SetBit(model);
|
return new SimpleResult();
|
|
}
|
[HttpPost]
|
[Route("s7SetString")]
|
public SimpleResult s7SetString(DBBModel model) {
|
S7Helper.s7SetStr(model);
|
return new SimpleResult();
|
|
}
|
|
|
public SimpleResult testOracle()
|
{
|
try
|
{
|
// 调用X5系统查询
|
var db = new SqlHelper<object>().GetOracleInstance(Settings.OracleServer);
|
List<Location> locations = db.Queryable<Location>().ToList();
|
}
|
catch (Exception ex)
|
{
|
LogHelper.Info("调用X5系统错误,错误原因:" + ex.Message, "Mobox");
|
}
|
return new SimpleResult();
|
}
|
}
|
}
|