using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web;
using System.Web.Http;
using VueWebApi.DLL.BLL;
using VueWebApi.Models;
using VueWebApi.Tools;
namespace VueWebApi.Controllers
{
[RoutePrefix(prefix: "api/AppQualityManagement")]
[ControllerGroup("App质量管理", "在线接口")]
[ChannelActionFilterAttributeApp]
public class AppQualityManagementController : ApiController
{
//定义全局信息返回变量
ToMessage mes = new ToMessage();
RedisHelper redis = new RedisHelper();
#region[入厂检验,扫描采购到货生成标签]
///
/// 入厂检验,扫描采购到货生成标签
///
/// 采购到货生成标签
///
[Route(template: "InFactoryCheckScanLabCode")]
[HttpGet]
public HttpResponseMessage InFactoryCheckScanLabCode(string labcode)
{
mes = AppQualityManagementBLL.InFactoryCheckScanLabCode(labcode);
return TJson.toJson(mes);
}
#endregion
#region[入厂检验,根据选择的检验方案查找检验项目]
///
/// 入厂检验,根据选择的检验方案查找检验项目
///
/// 检验方案编码
///
[Route(template: "InFactoryCheckItem")]
[HttpGet]
public HttpResponseMessage InFactoryCheckItem(string checkstandcode)
{
mes = AppQualityManagementBLL.InFactoryCheckItem(checkstandcode);
return TJson.toJson(mes);
}
#endregion
#region[入厂检验,提交]
///
/// 入厂检验,提交
///
///
[Route(template: "InFactoryCheckSave")]
[HttpPost]
public HttpResponseMessage InFactoryCheckSave()
{
string hbillno = HttpContext.Current.Request["hbillno"].ToString();//采购订单号
string labcode = HttpContext.Current.Request["labcode"].ToString();//标签编号
string checkstandcode = HttpContext.Current.Request["checkstandcode"].ToString();//质检方案编码
string check_type = HttpContext.Current.Request["check_type"].ToString();//检验类型(入厂检验(InCheck))
string sampmethod = HttpContext.Current.Request["sampmethod"].ToString();//抽检方式:固定抽检(FIXED) 比例抽检(SCARE)
string partcode = HttpContext.Current.Request["partcode"].ToString();//物料编码
string customercode = HttpContext.Current.Request["customercode"].ToString();//往来单位(外购供方编码)
string batchno = HttpContext.Current.Request["batchno"].ToString();//批次号
string qualitystatus = HttpContext.Current.Request["qualitystatus"].ToString(); //质量状态(合格、不合格)
string labqty = HttpContext.Current.Request["labqty"].ToString();//物料数量(标签数量)
string sampleqty = HttpContext.Current.Request["sampleqty"].ToString();//样本数量
string goodqty = HttpContext.Current.Request["goodqty"].ToString();//合格数量
string ngqty = HttpContext.Current.Request["ngqty"].ToString();//不合格数量
string issyncbatch = HttpContext.Current.Request["issyncbatch"].ToString();//同步相同批次
string checkitemcont = HttpContext.Current.Request["checkitemcont"].ToString();//检验项目数据
string username = HttpContext.Current.Request["admin"].ToString();//操作人员
mes = AppQualityManagementBLL.InFactoryCheckSave(hbillno, labcode, checkstandcode, check_type, sampmethod, partcode, customercode, batchno, qualitystatus, labqty, sampleqty, goodqty, ngqty, issyncbatch, checkitemcont, username);
return TJson.toJson(mes);
}
#endregion
#region[工序检验扫码获取任务信息]
///
/// 工序检验扫码获取任务信息
///
/// 组织编码
/// 扫描工序二维码信息
/// 检验方式FirstCheck(首检) PatroCheck(巡检) EndCheck(完工检)
///
[Route(template: "StepCheckSearch")]
[HttpGet]
public HttpResponseMessage StepCheckSearch(string stu_torgcode,string orderstepqrcode,string checktype)
{
mes = ProductionManagementBLL.MesOrderStepCheckSearch(stu_torgcode,orderstepqrcode, checktype);
return TJson.toJson(mes);
}
#endregion
#region[工序检验根据选择的检验方案查找检验项目]
///
/// 入厂检验,工序检验根据选择的检验方案查找检验项目
///
/// 检验方案编码
///
[Route(template: "StepCheckItemList")]
[HttpGet]
public HttpResponseMessage StepCheckItemList(string checkstandcode)
{
mes = ProductionManagementBLL.MesOrderStepCheckItemList(checkstandcode);
return TJson.toJson(mes);
}
#endregion
#region[工序检验,提交]
///
/// 工序检验,提交
///
///
[Route(template: "SaveStepCheckItem")]
[HttpPost]
public HttpResponseMessage SaveStepCheckItem()
{
string stu_torgcode = HttpContext.Current.Request["stu_torgcode"].ToString();//组织编码
string wocode = HttpContext.Current.Request["wocode"].ToString();//工单号
string partcode = HttpContext.Current.Request["partcode"].ToString();//物料编码
string stepcode = HttpContext.Current.Request["stepcode"].ToString();//工序编码
string checkstandcode = HttpContext.Current.Request["checkstandcode"].ToString();//质检方案编码
string check_type = HttpContext.Current.Request["check_type"].ToString();//检验方式FirstCheck(首检) PatroCheck(巡检) EndCheck(完工检)
string sampmethod = HttpContext.Current.Request["sampmethod"].ToString();//抽检方式:固定抽检(FIXED) 比例抽检(SCARE)
string qualitystatus = HttpContext.Current.Request["qualitystatus"].ToString(); //质量状态(合格、不合格)
string labqty = HttpContext.Current.Request["good_qty"].ToString();//工序任务合格数量
string sampleqty = HttpContext.Current.Request["sampleqty"].ToString();//样本数量
string goodqty = HttpContext.Current.Request["goodqty"].ToString();//合格数量
string ngqty = HttpContext.Current.Request["ngqty"].ToString();//不合格数量
string checkitemcont = HttpContext.Current.Request["checkitemcont"].ToString();//检验项目数据
string username = HttpContext.Current.Request["admin"].ToString();//操作人员
mes = ProductionManagementBLL.SaveMesOrderStepCheckItem(stu_torgcode,wocode, partcode,stepcode,checkstandcode,check_type,sampmethod,qualitystatus,labqty,sampleqty,goodqty,ngqty,checkitemcont,username);
return TJson.toJson(mes);
}
#endregion
}
}