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.
196 lines
6.3 KiB
196 lines
6.3 KiB
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 PickMaterialController : ControllerBase
|
|
{
|
|
// GET: WMS/PickMaterial
|
|
PickMaterialApp App = new PickMaterialApp();
|
|
public ActionResult ICSMOPickMerge()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetGridJson(Pagination pagination, string queryJson, string Type)
|
|
{
|
|
DataTable ListData = new DataTable();
|
|
if (Type == "1")//工单
|
|
{
|
|
ListData = App.GetGridJson(queryJson, ref pagination);
|
|
}
|
|
if (Type=="2")//工单发料
|
|
{
|
|
ListData = App.GetGridJson2(queryJson, ref pagination);
|
|
}
|
|
if ( Type == "12")//售后领料
|
|
{
|
|
ListData = App.GetGridJson12(queryJson, ref pagination);
|
|
}
|
|
if (Type=="3")//工单材料出库
|
|
{
|
|
ListData = App.GetGridJson3(queryJson, ref pagination);
|
|
}
|
|
if (Type == "4")//委外备料
|
|
{
|
|
ListData = App.GetGridJson4(queryJson, ref pagination);
|
|
}
|
|
if (Type == "5")//委外领料
|
|
{
|
|
ListData = App.GetGridJson5(queryJson, ref pagination);
|
|
}
|
|
if (Type == "6")//委外材料出库
|
|
{
|
|
ListData = App.GetGridJson6(queryJson, ref pagination);
|
|
}
|
|
if (Type == "7")//销售发货
|
|
{
|
|
ListData = App.GetGridJson7(queryJson, ref pagination);
|
|
}
|
|
if (Type == "8")//其它出库
|
|
{
|
|
ListData = App.GetGridJson8(queryJson, ref pagination);
|
|
}
|
|
if (Type == "9")//借用单
|
|
{
|
|
ListData = App.GetGridJson9(queryJson, ref pagination);
|
|
}
|
|
if (Type == "10")//物料调拨
|
|
{
|
|
ListData = App.GetGridJson10(queryJson, ref pagination);
|
|
}
|
|
if (Type == "11")//两步调出
|
|
{
|
|
ListData = App.GetGridJson11(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 Code, string queryJson, string Type)
|
|
{
|
|
DataTable ListData = new DataTable();
|
|
if (Type=="1"){ListData = App.GetSubGridJson1(Code); }//工单
|
|
if (Type=="2"){ListData = App.GetSubGridJson2(queryJson,Code); }//工单发料
|
|
if (Type == "12") { ListData = App.GetSubGridJson12(queryJson, Code); }//工单发料
|
|
if (Type == "3") { ListData = App.GetSubGridJson3(Code); }//材料出库
|
|
if (Type == "4") { ListData = App.GetSubGridJson4(Code); }//委外备料
|
|
if (Type == "5") { ListData = App.GetSubGridJson5(Code, queryJson); }//委外领料
|
|
if (Type == "6") { ListData = App.GetSubGridJson6(Code); }//委外材料出库
|
|
if (Type == "7") { ListData = App.GetSubGridJson7(Code, queryJson); }//销售发货
|
|
if (Type == "8") { ListData = App.GetSubGridJson8(Code, queryJson); }//其它出库
|
|
if (Type == "9") { ListData = App.GetSubGridJson9(Code); }//借用单
|
|
if (Type == "10") { ListData = App.GetSubGridJson10(Code, queryJson); }//物料调拨
|
|
if (Type == "11") { ListData = App.GetSubGridJson11(Code); }//两步调出
|
|
var JsonData = new
|
|
{
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
|
|
[HttpGet]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult GetICSMOPickMergeTemp(Pagination pagination, string ID,string Type,string flag)
|
|
{
|
|
|
|
DataTable ListData = new DataTable();
|
|
if (flag=="1")
|
|
{
|
|
ListData = App.GetICSMOPickMergeTemp(ID, Type);
|
|
}
|
|
else
|
|
{
|
|
ListData = App.GetICSMOPickMergeTemp2(ID, Type);
|
|
}
|
|
|
|
var JsonData = new
|
|
{
|
|
total = pagination.total,
|
|
page = pagination.page,
|
|
records = pagination.records,
|
|
rows = ListData,
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 合并拣料的接口
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <param name="Type"></param>
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult MergeMaterial(string keyValue,string Type)
|
|
{
|
|
string msg = App.MergeMaterial(keyValue, Type);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("添加成功!");
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 取消合并拣料的接口
|
|
/// </summary>
|
|
/// <param name="keyValue"></param>
|
|
/// <param name="Type"></param>
|
|
/// <returns></returns>
|
|
|
|
[HttpPost]
|
|
[HandlerAjaxOnly]
|
|
public ActionResult CancelMergeMaterial(string keyValue, string Type)
|
|
{
|
|
string msg = App.CancelMergeMaterial(keyValue, Type);
|
|
if (!string.IsNullOrEmpty(msg))
|
|
{
|
|
return Error(msg);
|
|
}
|
|
else
|
|
{
|
|
return Success("取消成功!");
|
|
}
|
|
}
|
|
|
|
[HttpPost]
|
|
public ActionResult CheckQty(string objArr)
|
|
{
|
|
string i = App.CheckQty(objArr);
|
|
var JsonData = new
|
|
{
|
|
count = i
|
|
};
|
|
return Content(JsonData.ToJson());
|
|
}
|
|
}
|
|
}
|