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.
793 lines
27 KiB
793 lines
27 KiB
using NFine.Application.DHAY;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using NFine.Code;
|
|
using System.Data.SqlClient;
|
|
using NFine.Data.Extensions;
|
|
using System.Data.OleDb;
|
|
using System.Configuration;
|
|
using ICS.Application.Entity;
|
|
|
|
namespace NFine.Web.Areas.DHAY.Controllers
|
|
{
|
|
public class ICSRCVIQCsController : ControllerBase
|
|
{
|
|
|
|
ICSRCVIQCsApp App = new ICSRCVIQCsApp();
|
|
// GET: WMS/ICSRCVIQCs
|
|
public ActionResult ICSRCVIQCs()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult Rejection()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult WWRejection()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSInspectionDetail()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSLookFiles()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSInspectionDetailNew()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult ICSInspectionDetailDelete()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult UpdateLeadTime()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult YLICSRCVIQCs()
|
|
{
|
|
return View();
|
|
}
|
|
public ActionResult GetBadReasonCode()
|
|
{
|
|
return View();
|
|
}
|
|
//采购
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetInspectionFile(Pagination pagination, string JYID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetInspectionFile(ref pagination, queryJson, JYID);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
//委外
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection2(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection2(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//工单
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection3(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection3(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//其他入库
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection4(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection4(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//生产退料
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection5(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection5(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//委外退料
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection6(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection6(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//销售退货
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection7(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection7(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
|
|
//不良原因
|
|
[HttpGet]
|
|
public ActionResult Select_ICSBadReason(string InvCode)
|
|
{
|
|
var data = App.Select_ICSBadReason(InvCode);
|
|
return Content(data.ToJson());
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetBadReason(string InvCode,Pagination pagination, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetBadReason(InvCode,queryJson, ref pagination);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//不良代码
|
|
[HttpGet]
|
|
public ActionResult GetSelectICSBadCode(string InvCode)
|
|
{
|
|
var data = App.GetSelectICSBadCode(InvCode);
|
|
return Content(data.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 创建检验表
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult CreateICSInspection(string keyValue, string ICSInspections)
|
|
{
|
|
string msg = App.CreateICSInspection(keyValue, ICSInspections);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 在库检验保存检验结果
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult ICSWHLotInspection(string keyValue, string ICSInspections)
|
|
{
|
|
string msg = App.ICSWHLotInspection(keyValue, ICSInspections);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("检验结果保存成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 在库检验审核
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult ApproveWHLotInspection(string keyValue, string ICSInspections)
|
|
{
|
|
string msg = App.ApproveWHLotInspection(keyValue, ICSInspections);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("审核成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 在库检验复审
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult SecApproveWHLotInspection(string keyValue, string ICSInspections)
|
|
{
|
|
try
|
|
{
|
|
string msg = App.SecApproveWHLotInspection(keyValue, ICSInspections);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("审核成功!");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
}
|
|
|
|
//生成拒收单
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult CreateRejection(string keyValue, string Type)
|
|
{
|
|
string msg = "";
|
|
if (Type == "1")
|
|
{
|
|
msg = App.CreateRejection(keyValue);
|
|
}
|
|
else if (Type == "8")
|
|
{
|
|
msg = App.CreateWLYRejection(keyValue);
|
|
}
|
|
else if (Type == "9")
|
|
{
|
|
msg = App.CreateWWWLYRejection(keyValue);
|
|
}
|
|
else
|
|
{
|
|
msg = App.CreateWWRejection(keyValue);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error("" + msg + "");
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 删除拒收单
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DelectRejection(string keyValue)
|
|
{
|
|
string msg = App.DelectRejection(keyValue);
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error(msg);
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult DelectWWRejection(string keyValue)
|
|
{
|
|
string msg = App.DelectWWRejection(keyValue);
|
|
if (string.IsNullOrEmpty(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error(msg);
|
|
}
|
|
}
|
|
|
|
[HttpGet]
|
|
public ActionResult GetInventoryInspection(Pagination pagination, string InvCode, int SampleQuantity, string ResultINp)
|
|
{
|
|
DataTable ListData = App.GetInventoryInspection(ref pagination, InvCode, SampleQuantity, ResultINp);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult SaveICSInspectionDetail(string ICSMTDOC, string InvCode, string ResultINp)
|
|
{
|
|
string msg = App.SaveICSInspectionDetail(ICSMTDOC, InvCode, ResultINp);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("保存成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 上传文件(检验信息)
|
|
/// </summary>
|
|
/// <param name="BidCode"></param>
|
|
/// <param name="ID"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public ActionResult UpLoadFileImport(string ID, string DNCode)
|
|
{
|
|
string MUSER = NFine.Code.OperatorProvider.Provider.GetCurrent().UserCode;
|
|
|
|
string UploadfileName = "";
|
|
string fileName = "";
|
|
//获取上传的文件集合
|
|
try
|
|
{
|
|
HttpFileCollection httpFile = System.Web.HttpContext.Current.Request.Files;
|
|
for (int i = 0; i < httpFile.Count; i++)
|
|
{
|
|
//获取送货单号
|
|
//string STNO = Request.Form["STNO"].ToString();
|
|
UploadfileName = Path.GetFileNameWithoutExtension(httpFile[i].FileName)
|
|
+ Path.GetExtension(httpFile[i].FileName);
|
|
fileName = DNCode + Path.GetExtension(httpFile[i].FileName);
|
|
string Paths = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\");
|
|
if (!Directory.Exists(Paths))
|
|
{
|
|
Directory.CreateDirectory(Paths);
|
|
}
|
|
string filePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\InspectionFile\\" + UploadfileName);
|
|
|
|
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();
|
|
App.InsertICSInspectionFile(ID, UploadfileName, fileName);
|
|
}
|
|
return Success("上传成功!");
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
return Error(ex.Message);
|
|
}
|
|
}
|
|
|
|
//采购到货单检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection8(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection8(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
|
|
//委外采购到货单检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection9(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection9(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//委外采购到货单检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection10(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection10(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//在库检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection11(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
try
|
|
{
|
|
DataTable ListData = App.GetICSInspection11(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return Error(ex.Message);
|
|
}
|
|
}
|
|
|
|
//采购入库单检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection22(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection22(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//委外入库单检验
|
|
[HttpGet]
|
|
public ActionResult GetICSInspection23(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSInspection23(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetInventoryInspectionNew(Pagination pagination, string InvCode, int? SampleQuantity, string ResultINp, string JYID,string LotNo)
|
|
{
|
|
DataTable ListData = App.GetInventoryInspectionNew(ref pagination, InvCode, SampleQuantity, ResultINp, JYID,LotNo);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
public ActionResult GetInventoryInspectionNew1(Pagination pagination, string InvCode, int? SampleQuantity, string ResultINp, string JYID, string LotNo)
|
|
{
|
|
DataTable ListData = App.GetInventoryInspectionNew1(ref pagination, InvCode, SampleQuantity, ResultINp, JYID, LotNo);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetRulesDetail(string LotNo)
|
|
{
|
|
DataTable ListData = App.GetRulesDetail(LotNo);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
//[HttpPost]
|
|
//[HandlerAjaxOnly]
|
|
//[ValidateInput(false)]
|
|
//public ActionResult SaveICSInspectionDetailNew( string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY,string WaiveQuantity, string BCCode, string BRCode, string ResultINp, string Lot, string Type, decimal CJQty,string ICSMTDOC)
|
|
//{
|
|
// string msg = App.SaveICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
|
|
// if (!string.IsNullOrEmpty(msg))
|
|
// {
|
|
// return Error(msg);
|
|
// }
|
|
// else
|
|
// {
|
|
// return Success("保存成功!");
|
|
// }
|
|
//}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateInput(false)]
|
|
public ActionResult SaveICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string Filtering, string SpecialNumber, string ResultINp, string SpecialPicks, string Lot, string Type, decimal CJQty, string ICSMTDOC)
|
|
{
|
|
string msg = App.SaveICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, Filtering, SpecialNumber, ResultINp, SpecialPicks,Lot, Type, CJQty);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("保存成功!");
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
[ValidateInput(false)]
|
|
public ActionResult StagingICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string BCCode, string BRCode, string ResultINp, string Lot, string Type, decimal CJQty, string ICSMTDOC)
|
|
{
|
|
string msg = App.StagingICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, BCCode, BRCode, ResultINp, Lot, Type, CJQty);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("操作成功!");
|
|
}
|
|
}
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult UpdateICSInspectionDetailNew(string InvCode, string JYID, string AllNumber, string YLOTQTY, string NLOTQTY, string WaiveQuantity, string Filtering, string SpecialNumber, string ResultINp,string SpecialPicks, string Lot, string Type, decimal CJQty, string ICSMTDOC)
|
|
{
|
|
string msg = App.UpdateICSInspectionDetailNew(ICSMTDOC, InvCode, JYID, AllNumber, YLOTQTY, NLOTQTY, WaiveQuantity, Filtering, SpecialNumber, ResultINp, SpecialPicks,Lot, Type, CJQty);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("保存成功!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取动态列
|
|
/// </summary>
|
|
/// <param name="BidCode"></param>
|
|
/// <returns></returns>
|
|
public ActionResult SelectSORRFQColumnName(string InvCode, string JYID,string LotNo)
|
|
{
|
|
var data = App.SelectSORRFQColumnName(InvCode, JYID,LotNo);
|
|
return Content(data.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 删除动态列
|
|
/// </summary>
|
|
/// <param name="InvCode"></param>
|
|
/// <param name="JYID"></param>
|
|
/// <returns></returns>
|
|
///
|
|
public ActionResult deleteSelectSORRFQColumnName(string InvCode, string JYID, string LotNo)
|
|
{
|
|
var data = App.deleteSelectSORRFQColumnName(InvCode, JYID, LotNo);
|
|
return Content(data.ToJson());
|
|
}
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetDeleteRulesDetail(string InvCode, string JYID)
|
|
{
|
|
DataTable ListData = App.GetDeleteRulesDetail(InvCode, JYID);
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
[HttpPost]
|
|
public ActionResult DeleteICSInspection(string DetailID)
|
|
{
|
|
DetailID = DetailID.Substring(1, DetailID.Length - 2);
|
|
string msg = App.DeleteICSInspection(DetailID);
|
|
if (string.IsNullOrWhiteSpace(msg))
|
|
{
|
|
return Success("删除成功!");
|
|
}
|
|
else
|
|
{
|
|
return Error("删除失败");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 数据导入
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public string UploadFile(string LotNo)
|
|
{
|
|
try
|
|
{
|
|
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") + Guid.NewGuid() + IsXls; //获取Execle文件名 DateTime日期函数
|
|
string savePath = System.Web.HttpContext.Current.Server.MapPath("~\\File\\UPLoadFile\\" + 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,LotNo);
|
|
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="MenuID"></param>
|
|
/// <param name="queryJson"></param>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
public ActionResult GetICSSSDInspection(Pagination pagination, string MenuID, string queryJson)
|
|
{
|
|
DataTable ListData = App.GetICSSSDInspection(ref pagination, MenuID, queryJson);
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
/// <summary>
|
|
/// 更新交期(咖博士使用)
|
|
/// </summary>
|
|
/// <param name="ICSMTDOC"></param>
|
|
/// <param name="JYID"></param>
|
|
/// <param name="ResultINp"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult UpdateLeadTime(string LeadModel)
|
|
{
|
|
string msg = App.UpdateLeadTime(LeadModel);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("更新成功!");
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|