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.
1766 lines
53 KiB
1766 lines
53 KiB
using NFine.Application.WMS;
|
|
using NFine.Code;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Configuration;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
|
|
namespace NFine.Web.Areas.WMS.Controllers
|
|
{
|
|
/// <summary>
|
|
/// IQC来料检验(咖博士)
|
|
/// </summary>
|
|
public class IQCQualityController : ControllerBase
|
|
{
|
|
private IQCQualityApp app = new IQCQualityApp();
|
|
|
|
|
|
public ActionResult GetICSInventory2()
|
|
{
|
|
return View();
|
|
}
|
|
// GET: WMS/IQCQuality
|
|
public ActionResult AqlQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult AqlEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2AqlQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2AqlEdit()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2AqlEditSingle(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2AqlFileView(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialCheckLog(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult BadCodeGroupQuery()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult BadCodeGroupEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult BadReasonGroupQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult BadReasonGroupEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult CheckItemGroupQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult CheckItemGroupEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
public ActionResult UpdateTime()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult Item2CheckItemGroupQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2CheckItemGroupBind()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult Item2CheckItemEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialInStorageCheckQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialInStorageCheckEdit(string ids,decimal qty,string docType)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
ViewData["qty"] = qty;
|
|
ViewData["docType"] = docType;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialDestoryExperimentEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialInStorageFinalQuery()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialReJudgeEdit(string ids,string judgeRole)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
ViewData["judgeRole"] = judgeRole;
|
|
return View();
|
|
}
|
|
public ActionResult MaterialReJudgeView(string ids, string judgeRole)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
ViewData["judgeRole"] = judgeRole;
|
|
return View();
|
|
}
|
|
public ActionResult MaterialDoJudge(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
public ActionResult MaterialCheckDoJudge(string ids, decimal qty, string docType)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
ViewData["qty"] = qty;
|
|
ViewData["docType"] = docType;
|
|
return View();
|
|
}
|
|
|
|
public ActionResult MaterialFinalJudgeEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
|
|
public ActionResult MaterialHasReturnItemEdit(string ids)
|
|
{
|
|
ViewData["ids"] = ids;
|
|
return View();
|
|
}
|
|
|
|
|
|
public ActionResult PDMFile(string materialCode)
|
|
{
|
|
ViewData["materialCode"] = materialCode;
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询检验项目组列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetCheckItemGroupPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetCheckItemGroupPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询检验项目
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
|
|
public ActionResult GetCheckItemDetailList(string id, Pagination pagination)
|
|
{
|
|
DataTable ListData = app.GetCheckItemDetailList(id, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = 1,
|
|
page = 1,
|
|
records = 0,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询Aql列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetGridJsonChengPing(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetGridJsonChengPing(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询不良状态组列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetBadCodeGroupPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetBadCodeGroupPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询不良状态列表
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
|
|
public ActionResult GetBadCodeGroupDetailList(string id, Pagination pagination)
|
|
{
|
|
DataTable ListData = app.GetBadCodeGroupDetailList(id, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = 1,
|
|
page = 1,
|
|
records = 0,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询Aql明细
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
|
|
public ActionResult GetAqlSubGridJsonList(string id, Pagination pagination)
|
|
{
|
|
DataTable ListData = app.GetAqlSubGridJsonList(id, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = 1,
|
|
page = 1,
|
|
records = 0,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveAql(string keyValue)
|
|
{
|
|
string msg = app.SaveAql(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetAql(string keyValue)
|
|
{
|
|
var dt = app.GetAql(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteAql(string keyValue)
|
|
{
|
|
var msg = app.DeleteAql(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllAqlList(string RulesCode, string RulesName, string Enable)
|
|
{
|
|
DataTable dt = app.ExportAllAqlList(RulesCode, RulesName, Enable);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询物料Aql关系列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetItem2RuleList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetItem2RuleList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取所有物料(条件)
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetAllItemList(string code)
|
|
{
|
|
var dt = app.GetAllItemList(code);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取所有Aql(条件)
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetAllAqlList(string code)
|
|
{
|
|
var dt = app.GetAllAqlList(code);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取所有检验类型(条件)
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetAllCheckGroupList(string code)
|
|
{
|
|
var dt = app.GetAllCheckGroupList(code);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetItem2Aql(string keyValue)
|
|
{
|
|
var dt = app.GetItem2Aql(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveItem2Aql(string keyValue)
|
|
{
|
|
string msg = app.SaveItem2Aql(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveItem2AqlSingle(string keyValue)
|
|
{
|
|
string msg = app.SaveItem2AqlSingle(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导入列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public string UploadFile()
|
|
{
|
|
try
|
|
{
|
|
//string str_Year = Request.Form["txt_Year"];
|
|
//String UPLoadType = Request.Form["UPLoadType"];
|
|
HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
|
|
if (hpFiles != null && hpFiles.Count > 0)
|
|
{
|
|
|
|
string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
|
|
if (IsXls != ".xls" && IsXls != ".xlsx")
|
|
{
|
|
|
|
return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
|
|
}
|
|
string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
|
|
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
|
|
|
|
int iLen = hpFiles[0].ContentLength;
|
|
if (Directory.Exists(savePath)) return "文件已存在";
|
|
byte[] bData = new byte[iLen];
|
|
hpFiles[0].InputStream.Read(bData, 0, iLen);
|
|
|
|
|
|
FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
|
|
newFile.Write(bData, 0, bData.Length);
|
|
newFile.Flush();
|
|
int _FileSizeTemp = hpFiles[0].ContentLength;
|
|
|
|
newFile.Close();
|
|
newFile.Dispose();
|
|
//bool del = false;
|
|
string mess = "";
|
|
mess = app.SetData_PR(savePath);
|
|
if (System.IO.File.Exists(savePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(savePath);
|
|
}
|
|
return mess;
|
|
|
|
}
|
|
else
|
|
{
|
|
return "获取文件失败";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
return ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出物料关联Aql列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllItem2AqlList(string RulesCode, string RulesName, string InvCode, string InvName)
|
|
{
|
|
DataTable dt = app.ExportAllItem2AqlList(RulesCode, RulesName, InvCode, InvName);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteItem2Aql(string keyValue)
|
|
{
|
|
var msg = app.DeleteItem2Aql(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
public ActionResult UpLoadItemRuleFile()
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
//获取上传的文件集合
|
|
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
|
|
//获取送货单号
|
|
string ID = Request.Form["ID"].ToString();
|
|
//string LableName = Request.Form["LableName"].ToString();
|
|
|
|
string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
|
|
+ Path.GetExtension(httpFile[0].FileName);
|
|
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
|
|
if (System.IO.File.Exists(filePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(filePath);
|
|
}
|
|
|
|
int iLen = httpFile[0].ContentLength;
|
|
byte[] bData = new byte[iLen];
|
|
httpFile[0].InputStream.Read(bData, 0, iLen);
|
|
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
|
|
fs.Write(bData, 0, bData.Length);
|
|
fs.Flush();
|
|
fs.Close();
|
|
fs.Dispose();
|
|
|
|
int count = app.UpLoadItemRuleFile(ID, fileName);
|
|
if (count > 0)
|
|
{
|
|
return Success("上传成功!");
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 检验异常文件
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult UpLoadMaterialCheckExFile()
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
//获取上传的文件集合
|
|
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
|
|
//获取送货单号
|
|
string ID = Request.Form["ID"].ToString();
|
|
//string LableName = Request.Form["LableName"].ToString();
|
|
|
|
string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
|
|
+ Path.GetExtension(httpFile[0].FileName);
|
|
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
|
|
if (System.IO.File.Exists(filePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(filePath);
|
|
}
|
|
|
|
int iLen = httpFile[0].ContentLength;
|
|
byte[] bData = new byte[iLen];
|
|
httpFile[0].InputStream.Read(bData, 0, iLen);
|
|
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
|
|
fs.Write(bData, 0, bData.Length);
|
|
fs.Flush();
|
|
fs.Close();
|
|
fs.Dispose();
|
|
|
|
//int count = app.UpLoadItemRuleFile(ID, fileName);
|
|
//if (count > 0)
|
|
//{
|
|
// return Success("上传成功!");
|
|
//}
|
|
//else
|
|
//{
|
|
// throw new Exception("");
|
|
//}
|
|
return Success("上传成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
[HttpPost]
|
|
public ActionResult UpLoadFinalJudgeFile()
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
//获取上传的文件集合
|
|
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
|
|
//获取送货单号
|
|
string ID = Request.Form["ID"].ToString();
|
|
//string LableName = Request.Form["LableName"].ToString();
|
|
|
|
string fileName = Path.GetFileNameWithoutExtension(httpFile[0].FileName)
|
|
+ Path.GetExtension(httpFile[0].FileName);
|
|
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
|
|
if (System.IO.File.Exists(filePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(filePath);
|
|
}
|
|
|
|
int iLen = httpFile[0].ContentLength;
|
|
byte[] bData = new byte[iLen];
|
|
httpFile[0].InputStream.Read(bData, 0, iLen);
|
|
FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate);
|
|
fs.Write(bData, 0, bData.Length);
|
|
fs.Flush();
|
|
fs.Close();
|
|
fs.Dispose();
|
|
|
|
int count = app.UpLoadFinalJudgeFile(ID, fileName);
|
|
if (count > 0)
|
|
{
|
|
return Success("上传成功!");
|
|
}
|
|
else
|
|
{
|
|
throw new Exception("");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
[HttpGet]
|
|
public ActionResult GetItem2AqlFileList(string keyValue)
|
|
{
|
|
var dt = app.GetItem2AqlFileList(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckLog(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialCheckLog(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除物料规则文件
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteItem2AqlFile(string keyValue)
|
|
{
|
|
var msg = app.DeleteItem2AqlFile(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取文件预览路径
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetItem2AqlFilePath(string fileName)
|
|
{
|
|
try
|
|
{
|
|
string fileServerPath = CommonHelper.GetBaseUrl(Request.Url)+ @"/File/IQC/"+ fileName;
|
|
|
|
//string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
|
|
return Success(fileServerPath);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetBadCodeGroup(string keyValue)
|
|
{
|
|
var dt = app.GetBadCodeGroup(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存不良状态组
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveBadCodeGroup(string keyValue)
|
|
{
|
|
string msg = app.SaveBadCodeGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteBadCodeGroup(string keyValue)
|
|
{
|
|
var msg = app.DeleteBadCodeGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllBadCodeGroup(string BCGCode, string BCGDesc)
|
|
{
|
|
DataTable dt = app.ExportAllBadCodeGroup(BCGCode, BCGDesc);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询不良现象组列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetBadReasonGroupPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetBadReasonGroupPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询不良现象列表
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
|
|
public ActionResult GetBadReasonDetailList(string id, Pagination pagination)
|
|
{
|
|
DataTable ListData = app.GetBadReasonDetailList(id, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = 1,
|
|
page = 1,
|
|
records = 0,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetBadReasonGroup(string keyValue)
|
|
{
|
|
var dt = app.GetBadReasonGroup(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存不良现象组
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveBadReasonGroup(string keyValue)
|
|
{
|
|
string msg = app.SaveBadReasonGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteBadReasonGroup(string keyValue)
|
|
{
|
|
var msg = app.DeleteBadReasonGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllBadReasonGroup(string BRGCode, string BRGDesc)
|
|
{
|
|
DataTable dt = app.ExportAllBadReasonGroup(BRGCode, BRGDesc);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetCheckItemGroup(string keyValue)
|
|
{
|
|
var dt = app.GetCheckItemGroup(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存检验类型
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveCheckItemGroup(string keyValue)
|
|
{
|
|
string msg = app.SaveCheckItemGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteCheckItemGroup(string keyValue)
|
|
{
|
|
var msg = app.DeleteCheckItemGroup(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllCheckItemGroup(string GroupCode, string GroupName)
|
|
{
|
|
DataTable dt = app.ExportAllCheckItemGroup(GroupCode, GroupName);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 导入列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public string ImportCheckItem()
|
|
{
|
|
try
|
|
{
|
|
//string str_Year = Request.Form["txt_Year"];
|
|
//String UPLoadType = Request.Form["UPLoadType"];
|
|
HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
|
|
if (hpFiles != null && hpFiles.Count > 0)
|
|
{
|
|
|
|
string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
|
|
if (IsXls != ".xls" && IsXls != ".xlsx")
|
|
{
|
|
|
|
return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
|
|
}
|
|
string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
|
|
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
|
|
|
|
int iLen = hpFiles[0].ContentLength;
|
|
if (Directory.Exists(savePath)) return "文件已存在";
|
|
byte[] bData = new byte[iLen];
|
|
hpFiles[0].InputStream.Read(bData, 0, iLen);
|
|
|
|
|
|
FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
|
|
newFile.Write(bData, 0, bData.Length);
|
|
newFile.Flush();
|
|
int _FileSizeTemp = hpFiles[0].ContentLength;
|
|
|
|
newFile.Close();
|
|
newFile.Dispose();
|
|
//bool del = false;
|
|
string mess = "";
|
|
mess = app.ImportCheckItem(savePath);
|
|
if (System.IO.File.Exists(savePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(savePath);
|
|
}
|
|
return mess;
|
|
|
|
}
|
|
else
|
|
{
|
|
return "获取文件失败";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
return ex.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 查询物料检验类型列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetItem2CheckItemPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetItem2CheckItemPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存物料检验类型
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveItem2CheckItem(string keyValue)
|
|
{
|
|
string msg = app.SaveItem2CheckItem(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetItem2CheckItem(string keyValue)
|
|
{
|
|
var dt = app.GetItem2CheckItem(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存物料检验类型
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveItem2CheckItemSingle(string keyValue)
|
|
{
|
|
string msg = app.SaveItem2CheckItemSingle(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteItem2CheckItem(string keyValue)
|
|
{
|
|
var msg = app.DeleteItem2CheckItem(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导入列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public string ImportItem2CheckGroup()
|
|
{
|
|
try
|
|
{
|
|
//string str_Year = Request.Form["txt_Year"];
|
|
//String UPLoadType = Request.Form["UPLoadType"];
|
|
HttpFileCollection hpFiles = System.Web.HttpContext.Current.Request.Files;
|
|
if (hpFiles != null && hpFiles.Count > 0)
|
|
{
|
|
|
|
string IsXls = System.IO.Path.GetExtension(hpFiles[0].FileName).ToString().ToLower();//System.IO.Path.GetExtension获得文件的扩展名
|
|
if (IsXls != ".xls" && IsXls != ".xlsx")
|
|
{
|
|
|
|
return "只可以选择Excel(.xls .xlsx)文件";//当选择的不是Excel文件时,返回
|
|
}
|
|
string filename = DateTime.Now.ToString("yyyyMMddhhmmss") + IsXls; //获取Execle文件名 DateTime日期函数
|
|
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + filename);//Server.MapPath 获得虚拟服务器相对路径
|
|
|
|
int iLen = hpFiles[0].ContentLength;
|
|
if (Directory.Exists(savePath)) return "文件已存在";
|
|
byte[] bData = new byte[iLen];
|
|
hpFiles[0].InputStream.Read(bData, 0, iLen);
|
|
|
|
|
|
FileStream newFile = new FileStream(savePath, FileMode.OpenOrCreate);
|
|
newFile.Write(bData, 0, bData.Length);
|
|
newFile.Flush();
|
|
int _FileSizeTemp = hpFiles[0].ContentLength;
|
|
|
|
newFile.Close();
|
|
newFile.Dispose();
|
|
//bool del = false;
|
|
string mess = "";
|
|
mess = app.ImportItem2CheckGroup(savePath);
|
|
if (System.IO.File.Exists(savePath))//删除文件
|
|
{
|
|
|
|
System.IO.File.Delete(savePath);
|
|
}
|
|
return mess;
|
|
|
|
}
|
|
else
|
|
{
|
|
return "获取文件失败";
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
return ex.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllItem2CheckItem(string InvCode, string InvName,string ListCode, string ListName)
|
|
{
|
|
DataTable dt = app.ExportAllItem2CheckItem(InvCode, InvName, ListCode, ListName);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取出货报告预览路径
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetOutReportFilePath(string fileName)
|
|
{
|
|
try
|
|
{
|
|
//获取SRM虚拟路径
|
|
var baseUrl = ConfigurationManager.ConnectionStrings["SRMURL"].ConnectionString;
|
|
if (baseUrl.IsNullOrEmpty())
|
|
{
|
|
throw new Exception("没有维护SRM站点信息");
|
|
}
|
|
|
|
//fileName F:\桌面\Git\基础版\SRM\NFine.Web\File\VendorFile\01000000\DN0100000024000010101000001202406050001\222.txt
|
|
|
|
|
|
string fileServerPath = baseUrl+@"/"+ fileName.Substring( fileName.IndexOf("File"));
|
|
fileServerPath = fileServerPath.Replace(@"\", @"/");
|
|
//string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
|
|
return Success(fileServerPath);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取异常预览路径
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialExFilePath(string fileName)
|
|
{
|
|
try
|
|
{
|
|
//获取SRM虚拟路径
|
|
//var baseUrl = ConfigurationManager.ConnectionStrings["SRMURL"].ConnectionString;
|
|
//if (baseUrl.IsNullOrEmpty())
|
|
//{
|
|
// throw new Exception("没有维护SRM站点信息");
|
|
//}
|
|
|
|
//fileName F:\桌面\Git\基础版\SRM\NFine.Web\File\VendorFile\01000000\DN0100000024000010101000001202406050001\222.txt
|
|
var baseUrl = new StringBuilder()
|
|
.Append(Request.Url.Scheme)
|
|
.Append("://")
|
|
.Append(Request.Url.Host)
|
|
.Append(":")
|
|
.Append(Request.Url.Port)
|
|
.ToString();
|
|
|
|
//string fileServerPath = baseUrl + @"/" + fileName.Substring(fileName.IndexOf("File"));
|
|
//fileServerPath = fileServerPath.Replace(@"\", @"/");
|
|
// string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\IQC\\" + fileName);
|
|
string filePath = baseUrl+ @"/File/IQC/"+ fileName;
|
|
|
|
return Success(filePath);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询来料送检列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetMaterialInStorageCheckPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetMaterialInStorageCheckPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询来料检验明细
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
|
|
public ActionResult GetMaterialInStorageCheckDetailList(string code,string lotno, string InvCode,Pagination pagination)
|
|
{
|
|
DataTable ListData = app.GetMaterialInStorageCheckDetailList(code, lotno, InvCode, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = 1,
|
|
page = 1,
|
|
records = 0,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllMaterialInStorageCheck(string InvCode,string InvName, string StartDate, string EndDate, string IsCheck,string CheckStartDate,string CheckEndDate)
|
|
{
|
|
|
|
//return;
|
|
DataTable dt = app.ExportAllMaterialInStorageCheck(InvCode, InvName, IsCheck, StartDate, EndDate, CheckStartDate, CheckEndDate);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportMaterialInStorageFinalList(string InvCode, string InvName, string StartDate, string EndDate, string ASNCode, string VenCode, string VenName
|
|
, string InvBatcgNo, string IsCheckComplete, string JuegeProgess, string BcgCode)
|
|
{
|
|
|
|
//return;
|
|
DataTable dt = app.ExportMaterialInStorageFinalList(InvCode, InvName, IsCheckComplete, StartDate, EndDate, ASNCode, VenCode, VenName, InvBatcgNo, JuegeProgess, BcgCode);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
/// <summary>
|
|
/// 导出列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public void ExportAllMaterialCheckLog(string keyValue)
|
|
{
|
|
|
|
//return;
|
|
DataTable dt = app.ExportAllMaterialCheckLog(keyValue);
|
|
AsposeCell.Export(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询破坏性实验记录
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="pagination"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialInStorageCheckDetailList2(string code, string lotno,string invCode)
|
|
{
|
|
Pagination pagination = null;
|
|
DataTable ListData = app.GetMaterialInStorageCheckDetailList(code, lotno, invCode, ref pagination);
|
|
//var JsonData = new
|
|
//{
|
|
// total = 1,
|
|
// page = 1,
|
|
// records = 0,
|
|
// rows = ListData,
|
|
//};
|
|
return Content(ListData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 来料检验加急
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult UpdateUrgent(string keyValue)
|
|
{
|
|
string msg = app.UpdateUrgent(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult DeleteMatCheck(string keyValue)
|
|
{
|
|
var msg = app.DeleteMatCheck(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 仓库已退实物
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult UpdateMaterialHasReturnItem(string keyValue)
|
|
{
|
|
string msg = app.UpdateMaterialHasReturnItem(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 复盘加急
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult UpdateMaterialReUrgent(string keyValue,string time)
|
|
{
|
|
string msg = app.UpdateMaterialReUrgent(keyValue,time);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult IQC1Back(string keyValue)
|
|
{
|
|
string msg = app.IQC1Back(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckMain(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialCheckMain(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckMain2(string keyValue,decimal qty)
|
|
{
|
|
var dt = app.GetMaterialCheckMain2(keyValue, qty);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取尺寸检验项目
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckMain4CC(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialCheckMain4CC(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取外观检验项目
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckMain4WG(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialCheckMain4WG(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取性能检验项目
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialCheckMain4XN(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialCheckMain4XN(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存来料检验
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveMaterialCheckResult(string keyValue)
|
|
{
|
|
string msg = app.SaveMaterialCheckResult(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询来料复判列表
|
|
/// </summary>
|
|
/// <param name="pagination"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
|
|
public ActionResult GetMaterialInStorageFinalPageList(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetMaterialInStorageFinalPageList(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取单个复判表头
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetMaterialReJudgeMain(string keyValue)
|
|
{
|
|
var dt = app.GetMaterialReJudgeMain(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存复判结果
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveMaterialCheckReJudgeResult(string keyValue)
|
|
{
|
|
string msg = app.SaveMaterialCheckReJudgeResult(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存最终复判结果
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult SaveMaterialCheckFinalJudgeResult(string keyValue)
|
|
{
|
|
string msg = app.SaveMaterialCheckFinalJudgeResult(keyValue);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取所有不良状态
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetSelectBadCodeGroupList()
|
|
{
|
|
var dt = app.GetSelectBadCodeGroupList();
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取所有不良现象
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetSelectBadReasonGroupList()
|
|
{
|
|
var dt = app.GetSelectBadReasonGroupList();
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取不良现象明细
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetSelectBadReasonList(string keyValue)
|
|
{
|
|
var dt = app.GetSelectBadReasonList(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取自定义档案列表
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetSelectItemList(string keyValue)
|
|
{
|
|
var dt = app.GetSelectItemList(keyValue);
|
|
return Content(dt.ToJson());
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取尺寸检验项目
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetFTPFile(string keyValue)
|
|
{
|
|
var rows = app.GetFTPFile(keyValue);
|
|
|
|
return Content(rows.ToJson());
|
|
|
|
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetFTPToPath(string pathName, string FTPTopPath, string materialCode, string version)
|
|
{
|
|
var rows = app.GetFTPToPath(pathName, FTPTopPath, materialCode, version);
|
|
|
|
return Content(rows.ToJson());
|
|
|
|
|
|
}
|
|
|
|
public ActionResult GetInvcode(Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = app.GetInvcode(queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
}
|
|
}
|