You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
411 lines
16 KiB
C#
411 lines
16 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using Estsh.Web.Util;
|
|
using System.Collections;
|
|
using Estsh.Web.Service;
|
|
using System.Data;
|
|
using System.Web.UI.WebControls;
|
|
using System.IO;
|
|
using System.Text;
|
|
using Estsh.Web.Models;
|
|
|
|
/***************************************************************************************************
|
|
*
|
|
* 作者:王勇
|
|
*
|
|
* *************************************************************************************************/
|
|
namespace Estsh.Core.Web.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 目视单打印模块的控制类
|
|
/// </summary>
|
|
public partial class MonthOrderListController : Controller
|
|
{
|
|
private MonthOrderListService service = new MonthOrderListService();
|
|
|
|
public ActionResult Index()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public ActionResult getStockMonthOrderListByPage(Pager pager, string direction, String sort, string type, string cbFactory, string cbVendor, string VendorNo, string Part, string StartDeliverTime, string EndDeliverTime)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
result.Add("pager.pageNo", pager.pageNo);
|
|
|
|
UserInfo user = Session["loginedUser"] as UserInfo;
|
|
|
|
int empType = user.empType;
|
|
string company = user.company;
|
|
|
|
string str = " 1=1";
|
|
|
|
if (!(string.IsNullOrEmpty(type)) && type != "null")
|
|
{
|
|
str += " and a.STAFLG in (" + type + ") ";
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(company))
|
|
{
|
|
str += " and a.LIFNR='" + company + "' ";
|
|
}
|
|
|
|
if (!(string.IsNullOrEmpty(cbFactory)) && cbFactory != "null")
|
|
{
|
|
str += " and a.werks='" + cbFactory + "' ";
|
|
}
|
|
|
|
if (!(string.IsNullOrEmpty(cbVendor)) && cbVendor != "null")
|
|
{
|
|
str += " and a.LIFNR='" + cbVendor + "' ";
|
|
}
|
|
|
|
|
|
if (!(string.IsNullOrEmpty(VendorNo)) && VendorNo != "null")
|
|
{
|
|
str += " and a.LIFNR='" + VendorNo + "' ";
|
|
}
|
|
|
|
if (!(string.IsNullOrEmpty(Part)) && Part != "null")
|
|
{
|
|
str += " and b.part_no LIKE '%" + Part + "%' ";
|
|
}
|
|
|
|
if (!(string.IsNullOrEmpty(StartDeliverTime) && string.IsNullOrEmpty(EndDeliverTime)) && StartDeliverTime != "null" && EndDeliverTime != "null")
|
|
{
|
|
str += " and (RECYMD+' '+RECHMS) BETWEEN '" + StartDeliverTime + "' and '" + EndDeliverTime + "' ";
|
|
}
|
|
|
|
Hashtable dataHt = this.service.getStockMonthOrderListByPage(pager, direction, str);
|
|
result.Add("rows", dataHt["dataList"]);
|
|
result.Add("pager.totalRows", dataHt["totalCount"]);
|
|
return Json(result);
|
|
}
|
|
|
|
public ActionResult getStockOrderDetailByPage(Pager pager, String direction, String sort, string EBELN, string TIME)
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
result.Add("pager.pageNo", pager.pageNo);
|
|
|
|
string str = " 1=1 ";
|
|
|
|
if (string.IsNullOrEmpty(EBELN) && string.IsNullOrEmpty(TIME))
|
|
{
|
|
EBELN = "-1";
|
|
TIME = " ";
|
|
}
|
|
|
|
str += " AND a.ebeln='" + EBELN + "' ";
|
|
str += " AND zdate='" + TIME.Remove(4,1) + "' ";
|
|
|
|
|
|
|
|
|
|
Hashtable dataHt = this.service.getStockOrderDetailByPage(pager, direction, str);
|
|
result.Add("rows", dataHt["dataList"]);
|
|
result.Add("pager.totalRows", dataHt["totalCount"]);
|
|
return Json(result);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取工厂
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult GetFactory()
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
ArrayList list = this.service.GetFactory();
|
|
result.Add("list", list);
|
|
return Json(result, JsonRequestBehavior.AllowGet);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取供应商
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult GetVendor()
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
ArrayList list = this.service.GetVendor();
|
|
result.Add("list", list);
|
|
return Json(result, JsonRequestBehavior.AllowGet);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 订单确认
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult dingDanQueRen(string EBELN)
|
|
{
|
|
string str = "";
|
|
|
|
EBELN = EBELN.Substring(0, EBELN.Length - 1);
|
|
|
|
//string[] str = ebeln.Split(',');
|
|
|
|
Hashtable result = new Hashtable();
|
|
bool bool_1 = this.service.dingDanQueRen(EBELN);
|
|
|
|
if (bool_1 == true)
|
|
{
|
|
str = "订单确认成功!";
|
|
}
|
|
else
|
|
{ str = "订单确认失败!"; }
|
|
|
|
result.Add("list", str);
|
|
return Json(result, JsonRequestBehavior.AllowGet);
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 发运确认
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ActionResult shipQueRen(string EBELN)
|
|
{
|
|
string str = "";
|
|
|
|
EBELN = EBELN.Substring(0, EBELN.Length - 1);
|
|
|
|
//string[] str = ebeln.Split(',');
|
|
|
|
Hashtable result = new Hashtable();
|
|
bool bool_1 = this.service.shipQueRen(EBELN);
|
|
|
|
if (bool_1 == true)
|
|
{
|
|
str = "发运确认成功!";
|
|
}
|
|
else
|
|
{ str = "发运确认失败!"; }
|
|
|
|
result.Add("list", str);
|
|
return Json(result, JsonRequestBehavior.AllowGet);
|
|
|
|
}
|
|
|
|
//#region
|
|
//public ActionResult printTest(string ebeln)
|
|
//{
|
|
// if (string.IsNullOrEmpty(ebeln))
|
|
// {
|
|
// return Json("请选择打印数据!");
|
|
// }
|
|
|
|
// ebeln = ebeln.Substring(0, ebeln.Length - 1);
|
|
|
|
// DataTable dt = new DataTable();
|
|
|
|
|
|
// //string[] str = order_id.Split(',');
|
|
|
|
// #region 定义变量
|
|
|
|
// #region 打印页面数值变量
|
|
|
|
// //页头数据
|
|
// string YeMa = "";//页码
|
|
// string SongHuoDanHao = "";//送货单号
|
|
// string GongYingShangBianHao = "";//供应商编号
|
|
// string SongHuoRiQi = "";//送货日期
|
|
|
|
// string GongYingShangJiFaHuoRen = "";//供应商及发货人
|
|
// string DingDanHao = "";//订单号
|
|
// string ChengYunDanWei = "";//承运单位
|
|
|
|
// string ZhuangHuoDiDan = ""; //装货地点
|
|
// string XieHuoDiDian = "";//卸货地点
|
|
// string BeiZhu = "";//备注
|
|
// string DaYingShiJian = "";//打印时间
|
|
|
|
// //明细数据
|
|
// string XuHao = "";//序号
|
|
// string LingJianHao = "";//零件号
|
|
// string LiuShuiHao = "";//流水号
|
|
// string LingJianMingCheng = "";//零件名称
|
|
// string ShuLiang = "";//数量
|
|
// string BeiZhu_2 = "";//备注
|
|
|
|
// #endregion
|
|
|
|
// #endregion
|
|
|
|
// StringBuilder SqlStringBuilder = new StringBuilder(1024);
|
|
// SqlStringBuilder.Append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"> ");
|
|
// SqlStringBuilder.Append("<html> ");
|
|
// SqlStringBuilder.Append("<head> ");
|
|
// SqlStringBuilder.Append(" <meta content=\"text/html;charset=gb2312\" http-equiv=\"Content-Type\" /> ");
|
|
// SqlStringBuilder.Append(" <title></title> ");
|
|
// SqlStringBuilder.Append(" <style media=\"print\"> ");
|
|
// SqlStringBuilder.Append(" .Noprint ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" display: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" .PageNext ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" page-break-after: always; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" <style type=\"text/css\"> ");
|
|
// SqlStringBuilder.Append(" body ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" font-family: Arial; ");
|
|
// SqlStringBuilder.Append(" width: 207mm; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" table ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-collapse: collapse; ");
|
|
// SqlStringBuilder.Append(" border: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.border1px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border: 1px dotted #000000; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.border0px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.leftborder0px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-left: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.leftborder1px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-left: 1px dotted #000000; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.rightborder0px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-right: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.rightborder1px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-right: 1px dotted #000000; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" td.bottomborder0px ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" border-bottom: none; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" .NOPRINT ");
|
|
// SqlStringBuilder.Append(" { ");
|
|
// SqlStringBuilder.Append(" font-family: \"宋体\"; ");
|
|
// SqlStringBuilder.Append(" font-size: 9pt; ");
|
|
// SqlStringBuilder.Append(" } ");
|
|
// SqlStringBuilder.Append(" </style> ");
|
|
// SqlStringBuilder.Append(" </head> ");
|
|
// SqlStringBuilder.Append("<body> ");
|
|
|
|
// //存储条码信息
|
|
// DataTable _barcode = new DataTable();
|
|
// _barcode.Columns.Add("name_1", Type.GetType("System.String"));
|
|
// _barcode.Columns.Add("name_2", Type.GetType("System.String"));
|
|
// _barcode.Columns.Add("name_3", Type.GetType("System.String"));
|
|
|
|
// dt = this.service.updatePrintData(ebeln);
|
|
|
|
// //string sum = this.service.getShipNo("ShipNumber");
|
|
|
|
// SqlStringBuilder.Append("</body> ");
|
|
// SqlStringBuilder.Append("<script type=\"text/javascript\"> ");
|
|
// SqlStringBuilder.Append(" var LODOP; ");
|
|
// SqlStringBuilder.Append(" var pLODOP; ");
|
|
// SqlStringBuilder.Append(" function myShow1() { ");
|
|
|
|
// for (int k = 0; k < _barcode.Rows.Count; k++)
|
|
// {
|
|
// SqlStringBuilder.Append(" LODOP = getLodop(document.getElementById('" + _barcode.Rows[k]["name_1"].ToString() + "'), document.getElementById('" + _barcode.Rows[k]["name_2"].ToString() + "')); ");
|
|
// SqlStringBuilder.Append(" LODOP.PRINT_INIT(\"打印控件功能演示_Lodop功能_内嵌显示演示11\"); ");
|
|
// SqlStringBuilder.Append(" LODOP.ADD_PRINT_BARCODE(0, 0, 190, 50, \"128A\", \"" + _barcode.Rows[k]["name_3"].ToString() + "\"); ");
|
|
// SqlStringBuilder.Append(" LODOP.SHOW_CHART(); ");
|
|
// }
|
|
|
|
// SqlStringBuilder.Append(" }; ");
|
|
// SqlStringBuilder.Append(" window.onload = myShow1; ");
|
|
// SqlStringBuilder.Append("</script> ");
|
|
// SqlStringBuilder.Append("</html> ");
|
|
|
|
// //int count = this.service.UpdateCount(order_id);
|
|
|
|
// Hashtable result = new Hashtable();
|
|
// result.Add("data", SqlStringBuilder.ToString());
|
|
// return Json(result);
|
|
//}
|
|
|
|
//#endregion
|
|
|
|
//public ActionResult printTest(string ebeln)
|
|
//{
|
|
|
|
// string tmpmethod = "";
|
|
// try
|
|
// {
|
|
// tmpmethod = "try\n"
|
|
// + "{\n"
|
|
// + " xlApp = new ActiveXObject(\"Excel.Application\");\n"
|
|
// + " xlBook = xlApp.workbooks.add(\"D:/项目/武汉项目/代码库/02Source/trunk/Estsh/Estsh.Web/Template/pullsheet.xls" + "\");\n"
|
|
// + " xlSheet1 = xlBook.Worksheets(1);\n";
|
|
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(3,9).value = \"*" + 1 + "*\";\n";//订单号
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(4,10).value = \"*" + 2 + "*\";\n";//订单号
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(5,10).value = \"" + 3 + " " + 4 + ":" + 5 + "\";\n";//发单时间
|
|
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(7,4).value = \"" + 6 + "\";\n";//供应商代码
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(8,4).value = \"" + 6 + "\";\n";//供应商名称
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(9,4).value = \"" + 6 + "\";\n";//供应商地址
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(10,4).value = \"" + 7 + "\";\n";//联系人
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(11,4).value = \"" + 7 + "\";\n";//联系电话
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(12,4).value = \"" + 8 + "\";\n";//传真
|
|
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(7,9).value = \"" + 1 + "\";\n";//窗口日期
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(8,9).value = \"" + 2 + "\";\n";//窗口时间
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(9,9).value = \"" + 3 + "\";\n";//交货道口
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(11,9).value = \"" + 4 + "\";\n";//电话
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(12,9).value = \"" + 5 + "\";\n";//传真
|
|
// //tmpmethod = tmpmethod + "xlSheet1.Cells(50,4).value = \"该窗口时间订单序号:" + om.GettheNumOfOrerByWindowTime(od.WindowTime.ToString("yyyy-MM-dd")) + "\";\n";//订单序号
|
|
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(4,6).value = \"√\";\n";
|
|
|
|
// tmpmethod = tmpmethod + "xlSheet1.Cells(52,11).value = \"第" + 1 + "页/共" + 2 + "页\";\n";
|
|
|
|
|
|
// tmpmethod = tmpmethod + " xlBook.Saved = true;\n";
|
|
|
|
// //if (!isPrint)
|
|
// //{
|
|
// // tmpmethod = tmpmethod + " xlSheet1.Application.Visible = true;\n }catch(error) {} finally {}"; //为了给用户自行调整格式而增
|
|
// //}
|
|
// //else
|
|
// //{
|
|
// tmpmethod = tmpmethod + " xlSheet1.printout();\n";
|
|
// //}
|
|
|
|
// tmpmethod = tmpmethod + " xlBook.Close;\n"
|
|
// + " xlApp.Close;\n"
|
|
// + " }\n"
|
|
// + " catch(error) \n"
|
|
// + " {\n"
|
|
// + " alert(\"错误发生,其名称:\" + error.name + \",信息为:\" + error.message)\n"
|
|
// + " } \n"
|
|
// + " finally \n"
|
|
// + " {\n"
|
|
// + " DistoryObject();\n"
|
|
// + " }";
|
|
// }
|
|
// catch
|
|
// {
|
|
// tmpmethod = "";
|
|
// }
|
|
|
|
|
|
// Hashtable result = new Hashtable();
|
|
// result.Add("data", tmpmethod.ToString());
|
|
// return Json(result);
|
|
//}
|
|
|
|
}
|
|
}
|