You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.6 KiB
85 lines
2.6 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Http;
|
|
using System.Text.RegularExpressions;
|
|
using System.Web.Http;
|
|
using Warehouse.DAL.WorkorderSetting;
|
|
|
|
namespace Warehouse.WebApi
|
|
{
|
|
[RoutePrefix("api/WorkorderSetting")]
|
|
public class WorkorderSettingController : ApiController
|
|
{
|
|
WorkorderSettingDal DT = new WorkorderSettingDal();
|
|
|
|
[Route("InsertGradePower")]
|
|
[HttpPost]
|
|
public IHttpActionResult InsertGradePower(dynamic para)
|
|
{
|
|
try
|
|
{
|
|
var dataInfo = para.dataInfo;
|
|
string workorder = para.workorder;
|
|
var createtime = System.DateTime.Now;
|
|
DT.DeleteWorkSet(workorder);//删除已经存在的工单功率组
|
|
foreach (var item in dataInfo)
|
|
{
|
|
if (item.finalgrade == "其他")
|
|
{
|
|
item.finalgrade = "";
|
|
}
|
|
item.originator = System.Web.HttpContext.Current.Request.Cookies["userid"].Value;
|
|
item.createtime = createtime;
|
|
DT.InsertGradePower(item);
|
|
}
|
|
return Json(new { result = "success" });
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Json(new { result = "fail", info = ex.ToString() });
|
|
}
|
|
|
|
|
|
}
|
|
|
|
[Route("QueryPowerGroup")]
|
|
[HttpPost]
|
|
public IHttpActionResult QueryPowerGroup(dynamic para)
|
|
{
|
|
try
|
|
{
|
|
string powerGroup = para.powerGroup;
|
|
var PowerGrade = DT.QueryPowerGrade(powerGroup);//查询功率档详细信息
|
|
var CurrentGrade = DT.QueryCurrentGrade(powerGroup);//查询电流档详细信息
|
|
return Json(new { PowerGrades = PowerGrade, CurrentGrades = CurrentGrade });
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Json(new { result = "fail", info = ex.ToString() });
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
[Route("WorkSetInfo")]
|
|
[HttpPost]
|
|
public IHttpActionResult QueryWorkSetInfo(dynamic para)
|
|
{
|
|
try
|
|
{
|
|
string Workorder = para.workorder;
|
|
var WorkSetInfo = DT.QueryWorkSetInfo(Workorder);//查询功率档详细信息
|
|
return Json(new { WorkSetInfo = WorkSetInfo });
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Json(new { result = "fail", info = ex.ToString() });
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|