using NFine.Application.WMS;
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.WMS.Controllers
{
public class WMSCreateItemLotController : ControllerBase
{
// GET: WMS/WMSCreateItemLot
private WMSCreateItemLotApp App = new WMSCreateItemLotApp();
public ActionResult CreateItemLot()
{
return View();
}
public ActionResult From()
{
return View();
}
[HttpGet]
public ActionResult SelectICSExtensionEnable(string BeginTime, string EndTime)
{
var data = App.SelectICSExtensionEnable(BeginTime, EndTime);
return Content(data.ToJson());
}
///
/// 生产退料单
///
///
///
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJson(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJson(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 领料退料子查询
///
///
///
///
///
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJson(string ApplyNegCode, string Sequence, string Type, Pagination pagination)
{
DataTable ListData = App.GetSubGridJson(ApplyNegCode, Sequence, Type, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonByCreate(ApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetVendorLotNo(string VenCode, string WorkPoint)
{
DataTable ListData = App.GetVendorLotNo(VenCode, WorkPoint);
var JsonData = new
{
VendorLotNo = ListData.Rows[0][0].ToString(),
};
return Content(JsonData.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitForm(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.CreateItemLotNo(ApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult DeleteItemLot(string keyValue)
{
keyValue = keyValue.Substring(1, keyValue.Length - 2);
//WorkPoint = WorkPoint.Substring(1, WorkPoint.Length - 2);
string msg = App.DeleteItemLot(keyValue);
if (string.IsNullOrWhiteSpace(msg))
{
return Success("删除成功!");
}
else
{
return Error(msg);
}
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormWeiWai(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormWeiWai(OApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//成品
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormChengPing(string MOCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormChengPing(MOCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//销售退货
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormXiaoShou(string SDNCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormXiaoShou(SDNCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//其他
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormQiTa(string InCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormQiTa(InCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
///
/// 打印数据参数:服务器的URL+打印的文件名,转化为Base64编码
///
protected string strPrintData;
///
/// 标识是否安装了控件
///
protected bool bIsInstallPrintControl = true;
///
/// 打印控件的Cookie值
///
protected string strPrintControlCookie = "";
///
/// 获取Url中去掉文件名的路径
///
///
private string GetUrlPath()
{
string strUrl = Request.Url.ToString();
int iEnd = strUrl.LastIndexOf("/");
strUrl = strUrl.Substring(0, iEnd + 1);
return strUrl;
}
//打印
[HttpPost]
[HandlerAjaxOnly]
public ActionResult PrintItemLot(string keyValue, string WorkPoint, string Type)
{
// string WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
keyValue = keyValue.Substring(1, keyValue.Length - 2);
WorkPoint = NFine.Code.OperatorProvider.Provider.GetCurrent().Location;
string strPrintFileName = Server.MapPath("/ReportFile/") + "纷纷无法b_成品条码.fr3";
PrintJson pJson = new PrintJson(Server.MapPath("./PrintTemp"), strPrintFileName);
pJson.CheckRegister("苏州智合诚信息科技有限公司", "56DD3B4C172D0D140841CAC98A58A819F4E28EDA5D6E45711DDD64F6A439F68B6A7870CD7DAFD69A919CB870207FE4BB206F92BE3D53C221B019E0797E739EBA4"); //注册信息
//pJson.CheckRegister("注册姓名", "8ECCCD6A1302DFEE1A6456A5D"); //注册信息
//pJson.AddPrintParam("ShopName", "测试酒楼");
//pJson.AddPrintParam("PrintDepositAdd", "说明:本单据为贵客押金收取凭证,盖章有效。退房时请出示,遗失者自负,请妥善保存。退房时间为12:00时,延时退房18:00时以前按半天房费收取,18:00时以后算全天房价。押金单有效期为一个月,过期作废。 贵重物品请交前台寄存,未寄存丢失自负。 谢谢!");
SetCookieAndURL(pJson);// 设置控件调用的Cookie值,判断是否安装了打印控件
string strSql = "";
if (Type == "1")
{
strSql = @"select a.LotNo, c.ApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSMOApplyNegDetail c on b.TransCode=c.ApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "2")
{
strSql = @"select a.LotNo, c.OApplyNegCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSOApplyNegDetail c on b.TransCode=c.OApplyNegCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "3")
{
strSql = @"select a.LotNo, c.MOCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSMO c on b.TransCode=c.MOCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "5")
{
strSql = @"select a.LotNo, c.InCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSOtherIn c on b.TransCode=c.InCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "6")
{
strSql = @"select a.LotNo, c.ReturnCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSReturn c on b.TransCode=c.ReturnCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "7")
{
strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "8")
{
strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "9")
{
strSql = @" select a.LotNo, c.RCVCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSManufactureReceive c on b.TransCode=c.RCVCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "10")
{
strSql = @"select a.LotNo, c.DNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSDeliveryNotice c on b.TransCode=c.DNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
if (Type == "11")
{
strSql = @"select a.LotNo, c.ODNCode,a.InvCode,d.InvName,d.InvStd,C.Quantity,D.InvUnit
FROM dbo.ICSInventoryLot a
left join ICSInventoryLotDetail b on a.LotNo=b.LotNo and a.WorkPoint=b.WorkPoint
left join ICSODeliveryNotice c on b.TransCode=c.ODNCode and b.TransSequence=c.Sequence and b.WorkPoint=c.WorkPoint
left join ICSInventory d on a.InvCode=d.InvCode and a.WorkPoint=d.WorkPoint
where a.ID IN (" + keyValue.TrimEnd(',') + ") and a.WorkPoint in ('" + WorkPoint.Trim(',') + "')";
}
//string strSql = @"Select * From CashLog";
DataTable dtCashLog = DbHelper.ExecuteTable(DbHelper.ConnectionString, CommandType.Text, strSql, true, null);
// string strPrintTempFile = pJson.ShowReport(dtCashLog); //产生JSON文件内容
string strPrintTempFile = pJson.ShowReport(dtCashLog); //导出PDF文件
//把服务器的URL + 此文件名 传递给控件,由控件下载还原数据进行打印
string strServerURL = GetUrlPath() + "PrintTemp/";
string strData = strServerURL + strPrintTempFile;
strPrintData = PrintFunction.EnBase64(strData);
var JsonData = new
{
strPrintData_1 = strPrintData,
bIsInstallPrintControl_1 = bIsInstallPrintControl,
strPrintControlCookie_1 = strPrintControlCookie
};
//多站点
string sql = @"UPDATE dbo.ICSInventoryLot
SET PrintTimes=ISNULL(PrintTimes,0)+1,
LastPrintUser='',
LastPrintTime=GETDATE()
WHERE ID IN (" + keyValue.TrimEnd(',') + ") and WorkPoint in ('" + WorkPoint.TrimEnd(',') + "')";
SqlHelper.ExecuteNonQuery(sql);
return Content(JsonData.ToJson());
}
///
/// 设置控件调用的Cookie值,判断是否安装了打印控件
///
///
private void SetCookieAndURL(PrintJson pJson)
{
bIsInstallPrintControl = false;
strPrintControlCookie = "";
HttpCookie pCookieInstall = Request.Cookies["InstallPrintControl"];
if (pCookieInstall != null)
{ //Cookie存在
strPrintControlCookie = pCookieInstall.Value.ToString();
//以Cookie值查找在数据表中是否存在
string strSql = @"Select * From sys_SRM_CheckInstall Where Cookie = @Cookie";
SqlParameter[] pmcCookie = { new SqlParameter("Cookie", strPrintControlCookie) };
using (SqlDataReader drCookie = DbHelper.ExecuteReader(DbHelper.ConnectionString, CommandType.Text, strSql, pmcCookie))
{
if (drCookie.Read())
{ //标识为已经安装
bIsInstallPrintControl = true;
}
drCookie.Close();
}
//更新Cookie的保存时间
pCookieInstall.Expires = DateTime.Now.AddYears(10);
Response.SetCookie(pCookieInstall);
}
else
{//Cookie不存在,则新建Cookie
strPrintControlCookie = System.Guid.NewGuid().ToString();
pCookieInstall = new HttpCookie("InstallPrintControl", strPrintControlCookie);
pCookieInstall.Expires = DateTime.Now.AddYears(10);
Response.Cookies.Add(pCookieInstall);
}
string strUrl = Server.MapPath("/PrintTemp/") + "IsCheckInstall";
pJson.SetCookieAndURL(strPrintControlCookie, strUrl);
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonWeiWai(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonWeiWai(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWeiWai(string OApplyNegCode, string Sequence, Pagination pagination)
{
DataTable ListData = App.GetSubGridJsonWeiWai(OApplyNegCode, Sequence, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWeiWaiByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonWeiWaiByCreate(OApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
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());
}
///
/// 点击生成条码查询(成品)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonChengPingByCreate(string MOCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonChengPingByCreate(MOCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 销售退货生成条码
///
///
///
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonXiaoShou(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonXiaoShou(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonQiTa(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonQiTa(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(销售退货)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonXiaoShouByCreate(string SDNCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonXiaoShouByCreate(SDNCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(其他入库)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonQiTaByCreate(string InCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonQiTaByCreate(InCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//归还
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonGuiHuan(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonGuiHuan(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//审核到货单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonSHDH(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonSHDH(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//审核到货单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonWWSHDH(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonWWSHDH(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//审核到货单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonKLCPRK(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonKLCPRK(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(审核到货单)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonSHDHByCreate(string DNCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonSHDHByCreate(DNCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(审核委外到货单)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWWSHDHByCreate(string ODNCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonWWSHDHByCreate(ODNCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(审核委外到货单)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonKLCPRKByCreate(string RCVCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonKLCPRKByCreate(RCVCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(归还)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonGuiHuanByCreate(string ReturnCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonGuiHuanByCreate(ReturnCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//归还
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormGuiHuan(string ReturnCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormGuiHuan(ReturnCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//审核到货单
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormSHDH(string DNCode, string Sequence, string INVCode, string keyValue, string WorkPoint)
{
try
{
int i = App.SubmitFormSHDH(DNCode, Sequence, INVCode, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
catch (Exception ex)
{
return Error(ex.Message);
}
}
//审核委外到货单
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormWWSHDH(string ODNCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormWWSHDH(ODNCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//开立成品入库
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormKLCPRK(string RCVCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormKLCPRK(RCVCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//委外拒收单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonWWJSD(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonWWJSD(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//拒收单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonJSD(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonJSD(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//审核到货单
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormJSD(string DNCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormJSD(DNCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//审核委外到货单
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormWWJSD(string ODNCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormWWJSD(ODNCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//领料申请退料
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonLLSQTL(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonLLSQTL(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(领料申请退料)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonJSDByCreate(string DNCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonJSDByCreate(DNCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
///
/// 点击生成条码查询(领料申请退料)
///
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWWJSDByCreate(string ODNCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonWWJSDByCreate(ODNCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonLLSQDByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonLLSQDByCreate(ApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//领料申请退料生成条码
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormLLSQTL(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormLLSQTL(ApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//材料出库退料
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonCLCK(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonCLCK(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//材料出库退料
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonCLCKByCreate(string ApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonCLCKByCreate(ApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//材料出库退料生成条码
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormCLCKT(string ApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormCLCKT(ApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//委外领料
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonWWLLTL(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonWWLLTL(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//委外领料
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWWLLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonWWLLByCreate(OApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
//委外领料申请退料
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormWWLL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormWWLL(OApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//委外材料出库
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonWWCLCK(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonWWCLCK(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
//委外材料出库
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonWWCLByCreate(string OApplyNegCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonWWCLByCreate(OApplyNegCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormWWCL(string OApplyNegCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormWWCL(OApplyNegCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
//返工工单
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetGridJsonFGGD(Pagination pagination, string queryJson)
{
DataTable ListData = App.GetGridJsonFGGD(queryJson, ref pagination);
var JsonData = new
{
total = pagination.total,
page = pagination.page,
records = pagination.records,
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public ActionResult GetSubGridJsonFGGDCreate(string FGGDMOCode, string Sequence, string WorkPoint)
{
DataTable ListData = App.GetSubGridJsonFGGDCreate(FGGDMOCode, Sequence, WorkPoint);
var JsonData = new
{
rows = ListData,
};
return Content(JsonData.ToJson());
}
[HttpPost]
[HandlerAjaxOnly]
[ValidateAntiForgeryToken]
public ActionResult SubmitFormFGGD(string FGGDMOCode, string Sequence, string keyValue, string WorkPoint)
{
int i = App.SubmitFormFGGD(FGGDMOCode, Sequence, keyValue, WorkPoint);
if (i > 0)
{
return Success("生成成功!");
}
else
{
return Error("生成失败!");
}
}
public ActionResult GetQiSetNum(string keyValue)
{
var rows = App.GetQiSetNum(keyValue);
return Content(rows.ToJson());
}
}
}