|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Web;
|
|
|
using ApServerProvider;
|
|
|
using System.Collections;
|
|
|
using System.Text;
|
|
|
using System.Data;
|
|
|
using DbCommon;
|
|
|
using Estsh.Web.Util;
|
|
|
|
|
|
/***************************************************************************************************
|
|
|
*
|
|
|
* 作者:贾文涛
|
|
|
* 创建时间:2014.07.08
|
|
|
* 描述:目视单打印数据库访问类
|
|
|
* 修改日志:
|
|
|
*
|
|
|
* *************************************************************************************************/
|
|
|
namespace Estsh.Core.Repositories
|
|
|
{
|
|
|
/// <summary>
|
|
|
/// 目视单打印模块的业务数据
|
|
|
/// </summary>
|
|
|
public class InspPrintDal : BaseApp
|
|
|
{
|
|
|
public InspPrintDal(RemotingProxy remotingProxy)
|
|
|
: base(remotingProxy)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
#region 目视单打印
|
|
|
|
|
|
/// <summary>
|
|
|
/// 根据分页条件获取列表
|
|
|
/// </summary>
|
|
|
/// <param name="PageSize"></param>
|
|
|
/// <param name="PageIndex"></param>
|
|
|
/// <param name="strWhere"></param>
|
|
|
/// <param name="OrderBy"></param>
|
|
|
/// <returns></returns>
|
|
|
public Hashtable getJitListByPage(Hashtable requestHt,Boolean type)
|
|
|
{
|
|
|
lock (_remotingProxy)
|
|
|
{
|
|
|
DataTable dt = new DataTable();
|
|
|
StringBuilder SqlStringBuilder = new StringBuilder(1024);
|
|
|
string woType = "";
|
|
|
if (type)
|
|
|
{
|
|
|
woType = " AND type <> 'N' ";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
woType = " AND type <> 'N' ";
|
|
|
}
|
|
|
|
|
|
if (requestHt["@startCarNo"] != null && !"".Equals(requestHt["@startCarNo"].ToString().Trim())
|
|
|
&& requestHt["@endCarNo"] != null && !"".Equals(requestHt["@endCarNo"].ToString().Trim()))
|
|
|
{
|
|
|
SqlStringBuilder.Append("SELECT a.order_no, a.ruid, a.car_no, a.slot_no, b.part_no, ");
|
|
|
SqlStringBuilder.Append(" a.create_ymd + ' ' + a.create_hms AS create_time, c.insp_special_char, ");
|
|
|
SqlStringBuilder.Append(" RIGHT(a.order_no, 3) AS serial_no ");
|
|
|
SqlStringBuilder.Append("FROM dbo.g_workorder a ");
|
|
|
SqlStringBuilder.Append(" LEFT JOIN dbo.sys_part b ON a.part_id = b.part_id ");
|
|
|
SqlStringBuilder.Append(" LEFT JOIN dbo.sys_model_prodinfo c ON b.model_id = c.model_id ");
|
|
|
SqlStringBuilder.Append("WHERE a.car_no between @startCarNo and @endCarNo ");
|
|
|
SqlStringBuilder.Append(woType);
|
|
|
SqlStringBuilder.Append("ORDER BY a.ruid ");
|
|
|
dt = _remotingProxy.GetDataTable(SqlStringBuilder.ToString(), requestHt);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
SqlStringBuilder.Append("SELECT TOP 32 ");
|
|
|
SqlStringBuilder.Append(" a.order_no, a.ruid, a.car_no, a.slot_no, b.part_no, ");
|
|
|
SqlStringBuilder.Append(" a.create_ymd + ' ' + a.create_hms AS create_time, c.insp_special_char, ");
|
|
|
SqlStringBuilder.Append(" RIGHT(a.order_no, 3) AS serial_no ");
|
|
|
SqlStringBuilder.Append("FROM dbo.g_workorder a ");
|
|
|
SqlStringBuilder.Append(" LEFT JOIN dbo.sys_part b ON a.part_id = b.part_id ");
|
|
|
SqlStringBuilder.Append(" LEFT JOIN dbo.sys_model_prodinfo c ON b.model_id = c.model_id ");
|
|
|
SqlStringBuilder.Append("WHERE a.status = 0.00 ");
|
|
|
SqlStringBuilder.Append(woType);
|
|
|
SqlStringBuilder.Append("ORDER BY a.ruid ");
|
|
|
dt = _remotingProxy.GetDataTable(SqlStringBuilder.ToString());
|
|
|
}
|
|
|
ArrayList dataList = DataTypeConvert.NewObject.DataTableToArrayList(dt);
|
|
|
Hashtable result = new Hashtable();
|
|
|
result.Add("dataList", dataList);
|
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 获取库位列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
public DataTable getLocateList()
|
|
|
{
|
|
|
lock (_remotingProxy)
|
|
|
{
|
|
|
StringBuilder strSql = new StringBuilder();
|
|
|
strSql.Append("SELECT locate_id as [value],locate_name as [key] from sys_locate");
|
|
|
return _remotingProxy.GetDataTable(strSql.ToString());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 更新打印数据
|
|
|
/// </summary>
|
|
|
/// <param name="ids"></param>
|
|
|
/// <returns></returns>
|
|
|
public int updatePrintData(String ids)
|
|
|
{
|
|
|
lock (_remotingProxy)
|
|
|
{
|
|
|
string strSql = "update g_workorder set status='0.1' where ruid in (" + ids + ")";
|
|
|
|
|
|
return _remotingProxy.ExecuteNonQuery(strSql);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
}
|
|
|
} |