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.
231 lines
7.1 KiB
C#
231 lines
7.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Estsh.Web.Util;
|
|
using System.Data;
|
|
using Estsh.Web.Dal;
|
|
using System.Collections;
|
|
using Estsh.Web.Models;
|
|
|
|
/***************************************************************************************************
|
|
*
|
|
* 作者:王勇
|
|
*
|
|
* *************************************************************************************************/
|
|
namespace Estsh.Core.Services
|
|
{
|
|
/// <summary>
|
|
/// 菜单业务处理类
|
|
/// </summary>
|
|
public class ProcessOutputService
|
|
{
|
|
private ProcessOutputDal dal = new ProcessOutputDal(RemotingProxyProvider._remotingProxy);
|
|
|
|
/// <summary>
|
|
/// 根据分页条件获取分页菜单数据
|
|
/// </summary>
|
|
/// <param name="ProcessOutputName"></param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction"></param>
|
|
/// <param name="sort"></param>
|
|
/// <returns></returns>
|
|
public DataTable getProcessOutputListByPage(string part, string process, string shift, string pdline, string satrtDate, string stopDate,ref Pager pager)
|
|
{
|
|
//Hashtable result = new Hashtable();
|
|
String strWhere = string.Empty;
|
|
|
|
if (string.IsNullOrEmpty(part) == false)
|
|
{
|
|
strWhere += string.Format(" b.part_no in ({0}) and", part);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(process) == false)
|
|
{
|
|
strWhere += string.Format(" e.process_name in ({0}) and", process);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(shift) == false)
|
|
{
|
|
strWhere += string.Format(" f.shift_name in ({0}) and", shift);
|
|
}
|
|
if (string.IsNullOrEmpty(pdline) == false)
|
|
{
|
|
strWhere += string.Format(" c.pdline_name in ({0}) and", pdline);
|
|
}
|
|
|
|
strWhere += string.Format(" work_date BETWEEN '{0}' AND '{1}' ", satrtDate, stopDate);
|
|
|
|
DataTable dt = dal.getListByPage(ref pager, strWhere);
|
|
return dt;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 保存菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int saveProcessOutput(Hashtable htParams)
|
|
{
|
|
return dal.saveProcessOutput(htParams);
|
|
}
|
|
/// <summary>
|
|
/// 更新菜单数据
|
|
/// </summary>
|
|
/// <param name="htParams"></param>
|
|
/// <returns></returns>
|
|
public int updateProcessOutput(Hashtable htParams)
|
|
{
|
|
return dal.updateProcessOutput(htParams);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查看详情
|
|
/// </summary>
|
|
/// <param name="ruid"></param>
|
|
/// <returns></returns>
|
|
public ArrayList getProcessOutput(String part_id)
|
|
{
|
|
part_id = "part_id = " + part_id;
|
|
DataTable dt = dal.getList(part_id, "");
|
|
ArrayList result = DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除菜单
|
|
/// </summary>
|
|
/// <param name="ids"></param>
|
|
/// <returns></returns>
|
|
public int deleteProcessOutput(String ids)
|
|
{
|
|
String[] idArray = ids.Split(',');
|
|
int count = 0;
|
|
foreach (String id in idArray)
|
|
{
|
|
if (!"".Equals(id))
|
|
{
|
|
count += this.dal.deleteProcessOutput(id);
|
|
}
|
|
}
|
|
return count;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取下拉框中的菜单数据
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList getSelectProcessOutput()
|
|
{
|
|
Hashtable result = new Hashtable();
|
|
|
|
DataTable dt = dal.getSelectProcessOutput();
|
|
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据分页条件获取分页客户订单数据
|
|
/// </summary>
|
|
/// <param name="menuName">查询条件</param>
|
|
/// <param name="pager"></param>
|
|
/// <param name="direction">排序方式</param>
|
|
/// <param name="sort">排序字段</param>
|
|
/// <returns></returns>
|
|
public DataTable getTableListByPage(String part_no, String cust_order, Pager pager, String direction, String sort, Boolean isPage)
|
|
{
|
|
DataTable result = null;
|
|
String strWhere = " 1=1 ";
|
|
int rowCount = 0;
|
|
if (part_no != null && !part_no.Trim().Equals(""))
|
|
{
|
|
strWhere = " b.part_no like '%" + part_no.Trim() + "%' ";
|
|
}
|
|
if (cust_order != null && !cust_order.Trim().Equals(""))
|
|
{
|
|
strWhere += " AND a.cust_order like '%" + cust_order.Trim() + "%'";
|
|
}
|
|
String orderBy = "";
|
|
if (sort != null && !"".Equals(sort.Trim()))
|
|
{
|
|
orderBy += sort + " " + direction;
|
|
}
|
|
else
|
|
{
|
|
orderBy += " a.part_id " + direction;
|
|
}
|
|
if (isPage)
|
|
{
|
|
rowCount = pager.pageSize;
|
|
}
|
|
else
|
|
{
|
|
rowCount = pager.pageSize;
|
|
}
|
|
result = dal.getTableListByPage(rowCount, pager.pageNo, strWhere, sort + " " + direction);
|
|
return result;
|
|
}
|
|
/// <summary>
|
|
/// 获得产线
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetPdline(string pdName)
|
|
{
|
|
DataTable dt = dal.GetPdline(pdName);
|
|
if (dt != null)
|
|
{
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
return null;
|
|
}
|
|
/// <summary>
|
|
/// 获得班别
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetShiftData(string shift_name)
|
|
{
|
|
DataTable dt = dal.GetShiftData(shift_name);
|
|
if (dt != null)
|
|
{
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 获得制程
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetProcessData(string process_name)
|
|
{
|
|
DataTable dt = dal.GetProcessData(process_name);
|
|
if (dt != null)
|
|
{
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获得零件号
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public ArrayList GetPartNo()
|
|
{
|
|
DataTable dt = dal.GetPartNo();
|
|
if (dt != null)
|
|
{
|
|
return DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |