张松男
5 months ago
60 changed files with 9155 additions and 417 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,990 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMAPP.FJC.Entity.FIS; |
|||
using QMFrameWork.Data; |
|||
using QMFrameWork.Log; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
using QMAPP.DAL; |
|||
using QMAPP.FJC.Entity.TianJin; |
|||
using QMAPP.FJC.Entity.FileCopy.FIS; |
|||
//using QMAPP.FJC.Entity.FileCopy.FIS;
|
|||
|
|||
namespace QMAPP.FJC.DAL.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 注塑计划管理
|
|||
///
|
|||
///
|
|||
/// </summary>
|
|||
public class TJPaoMoPlanDAL : BaseDAL |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 获取信息
|
|||
/// </summary>
|
|||
/// <param name="">条件</param>
|
|||
/// <returns>信息</returns>
|
|||
public TJPaoMoPlan Get(TJPaoMoPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_TJFY_ORDERPLAN WHERE 1=1 "; |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
sql += " AND PID = @PID"; |
|||
parameters.Add(new DataParameter("PID", model.PID)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_NO) == false) |
|||
{ |
|||
sql += " AND PLAN_NO = @PLAN_NO"; |
|||
parameters.Add(new DataParameter("PLAN_NO", model.PLAN_NO)); |
|||
} |
|||
//if (string.IsNullOrEmpty(model.MACHINECODDE) == false)
|
|||
//{
|
|||
// sql += " AND MACHINECODDE = @MACHINECODDE";
|
|||
// parameters.Add(new DataParameter("MACHINECODDE", model.MACHINECODDE));
|
|||
//}
|
|||
if (string.IsNullOrEmpty(model.MATERIAL_CODE) == false) |
|||
{ |
|||
sql += " AND MATERIAL_CODE = @MATERIAL_CODE"; |
|||
parameters.Add(new DataParameter("MATERIAL_CODE", model.MATERIAL_CODE)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_STATES) == false) |
|||
{ |
|||
sql += " AND PLAN_STATE IN ('" + model.PLAN_STATES.Replace(",", "','") + "')"; |
|||
|
|||
} |
|||
if (BaseSession != null) |
|||
{ |
|||
//获取信息
|
|||
model = BaseSession.Get<TJPaoMoPlan>(sql, parameters.ToArray()); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
model = session.Get<TJPaoMoPlan>(sql, parameters.ToArray()); |
|||
} |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
public TJPaoMoPlan GetOne(TJPaoMoPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_ORDERPLAN_PAOMO WHERE PLAN_STATE IN ('1','2') "; |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
sql += " AND PID = @PID"; |
|||
parameters.Add(new DataParameter("PID", model.PID)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_NO) == false) |
|||
{ |
|||
sql += " AND PLAN_NO = @PLAN_NO"; |
|||
parameters.Add(new DataParameter("PLAN_NO", model.PLAN_NO)); |
|||
} |
|||
//if (string.IsNullOrEmpty(model.MACHINECODDE) == false)
|
|||
//{
|
|||
// sql += " AND MACHINECODDE = @MACHINECODDE";
|
|||
// parameters.Add(new DataParameter("MACHINECODDE", model.MACHINECODDE));
|
|||
//}
|
|||
if (string.IsNullOrEmpty(model.MATERIAL_CODE) == false) |
|||
{ |
|||
sql += " AND MATERIAL_CODE = @MATERIAL_CODE"; |
|||
parameters.Add(new DataParameter("MATERIAL_CODE", model.MATERIAL_CODE)); |
|||
} |
|||
|
|||
sql += " order by CREATEDATE desc "; |
|||
|
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
model = session.Get<TJPaoMoPlan>(sql, parameters.ToArray()); |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
public TJPaoMoPlan GetInfo(TJPaoMoPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_ORDERPLAN_PAOMO WHERE PLAN_NO = @PLAN_NO"; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PLAN_NO", DataType = DbType.String, Value = model.PLAN_NO }); |
|||
model = session.Get<TJPaoMoPlan>(sql, parameters.ToArray()); |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
public DataPage GetList(TJPaoMoPlan condition, DataPage page) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = this.GetQuerySql(condition, ref parameters); |
|||
//分页关键字段及排序
|
|||
page.KeyName = "PID"; |
|||
if (string.IsNullOrEmpty(page.SortExpression)) |
|||
{ |
|||
page.SortExpression = "CREATEDATE DESC"; |
|||
} |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
page = session.GetDataPage<TJPaoMoPlan>(sql, parameters.ToArray(), page); |
|||
} |
|||
return page; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "注塑信息数据层-获取列表" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取查询语句
|
|||
/// <summary>
|
|||
/// 获取查询语句
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <param name="parameters">参数</param>
|
|||
/// <returns>查询语句</returns>
|
|||
private string GetQuerySql(TJPaoMoPlan condition, ref List<DataParameter> parameters) |
|||
{ |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder whereBuilder = new StringBuilder(); |
|||
try |
|||
{ |
|||
//构成查询语句
|
|||
sqlBuilder.AppendLine(" SELECT DISTINCT O.PID "); |
|||
sqlBuilder.AppendLine(" ,O.FACTORY_CODE "); |
|||
sqlBuilder.AppendLine(" ,F.FACTORY_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_NO "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_SEQ "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_STATE "); |
|||
sqlBuilder.AppendLine(" ,O.MATERIAL_CODE "); |
|||
sqlBuilder.AppendLine(" ,M.MATERIAL_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.MACHINECODDE "); |
|||
sqlBuilder.AppendLine(" ,O.PBOM_CODE "); |
|||
sqlBuilder.AppendLine(" ,O.ROUTE_CODE "); |
|||
sqlBuilder.AppendLine(" ,O.REMARK "); |
|||
sqlBuilder.AppendLine(" ,O.QTY "); |
|||
sqlBuilder.AppendLine(" ,O.COMPLETE_QTY "); |
|||
sqlBuilder.AppendLine(" ,CONVERT(VARCHAR(19),O.PLAN_DATE,120) AS PLAN_DATE "); |
|||
sqlBuilder.AppendLine(" ,O.SHIFT_CODE "); |
|||
sqlBuilder.AppendLine(" ,P.PRODUCESHIFTNAME AS SHIFT_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.PLANSOURCE "); |
|||
sqlBuilder.AppendLine(" ,O.PRODUCEREQUIRE "); |
|||
//sqlBuilder.AppendLine(" ,WC.WORKCENTER_CODE ");
|
|||
sqlBuilder.AppendLine(" ,O.CREATEUSER "); |
|||
sqlBuilder.AppendLine(" ,O.CREATEDATE "); |
|||
sqlBuilder.AppendLine(" ,O.UPDATEUSER "); |
|||
sqlBuilder.AppendLine(" ,O.UPDATEDATE "); |
|||
sqlBuilder.AppendLine(" ,O.IGNORE_FISBREAK "); |
|||
sqlBuilder.AppendLine(" ,O.FIS_ASMSETCODE "); |
|||
sqlBuilder.AppendLine(" ,O.STARTTIME AS STARTTIMEVIEW "); |
|||
sqlBuilder.AppendLine(" ,O.ENDTIME AS ENDTIMEVIEW"); |
|||
sqlBuilder.AppendLine(" ,C.USERNAME AS CREATEUSERNAME "); |
|||
sqlBuilder.AppendLine(" ,U.USERNAME AS UPDATEUSERNAME "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_PAOMO O "); |
|||
//注塑所需要的表T_PP_WORKORDER
|
|||
sqlBuilder.AppendLine(" LEFT JOIN T_BD_PRODUCESHIFT P ON P.PRODUCESHIFTTCODE=O.SHIFT_CODE "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_MD_FACTORY F ON F.FACTORY_CODE=O.FACTORY_CODE "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_PP_WORKORDER W ON W.ORDERPLANID=O.PID "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_MD_MATERIAL M ON M.MATERIAL_CODE=O.MATERIAL_CODE "); |
|||
//sqlBuilder.AppendLine(" LEFT JOIN T_MD_WORKCELL WC ON WC.WORKCELL_CODE=PRW.WORKCELL_CODE ");
|
|||
sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER C ON C.USERID=O.CREATEUSER "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER U ON U.USERID=O.UPDATEUSER "); |
|||
|
|||
//whereBuilder.AppendFormat(" AND O.WORKCENTER_CODE in (select distinct WORKCENTER from T_PP_ORDERINDENTITY where ORDER_TYPE='{0}')", condition.ORDER_TYPE);
|
|||
//查询条件
|
|||
//if (string.IsNullOrEmpty(condition.FACTORY_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.FACTORY_CODE = @FACTORY_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "FACTORY_CODE", DataType = DbType.String, Value = condition.FACTORY_CODE });
|
|||
//}
|
|||
if (string.IsNullOrEmpty(condition.PLAN_NO) == false) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_NO = @PLAN_NO "); |
|||
parameters.Add(new DataParameter { ParameterName = "PLAN_NO", DataType = DbType.String, Value = condition.PLAN_NO }); |
|||
} |
|||
//物料号
|
|||
if (string.IsNullOrEmpty(condition.MATERIAL_CODE) == false) |
|||
{ |
|||
whereBuilder.Append(" AND O.MATERIAL_CODE = @MATERIAL_CODE "); |
|||
parameters.Add(new DataParameter { ParameterName = "MATERIAL_CODE", DataType = DbType.String, Value = condition.MATERIAL_CODE }); |
|||
} |
|||
//工艺路线
|
|||
//if (string.IsNullOrEmpty(condition.ROUTE_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.ROUTE_CODE = @ROUTE_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "ROUTE_CODE", DataType = DbType.String, Value = condition.ROUTE_CODE });
|
|||
//}
|
|||
//班次编码
|
|||
//if (string.IsNullOrEmpty(condition.SHIFT_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.SHIFT_CODE = @SHIFT_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "SHIFT_CODE", DataType = DbType.String, Value = condition.SHIFT_CODE });
|
|||
//}
|
|||
//设备
|
|||
//if (string.IsNullOrEmpty(condition.MACHINECODDE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.MACHINECODDE = @MACHINECODDE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "MACHINECODDE", DataType = DbType.String, Value = condition.MACHINECODDE });
|
|||
//}
|
|||
//计划时间
|
|||
if (condition.PLANTIMESTART != DateTime.MinValue) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_DATE >= @PLANTIMESTART"); |
|||
parameters.Add(new DataParameter { ParameterName = "PLANTIMESTART", DataType = DbType.String, Value = condition.PLANTIMESTART }); |
|||
} |
|||
if (condition.PLANTIMEEND != DateTime.MinValue) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_DATE <= @PLANTIMEEND"); |
|||
parameters.Add(new DataParameter { ParameterName = "PLANTIMEEND", DataType = DbType.String, Value = condition.PLANTIMEEND }); |
|||
} |
|||
|
|||
|
|||
if (whereBuilder.Length > 0) |
|||
{ |
|||
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
|||
} |
|||
return sqlBuilder.ToString(); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 信息是否重复
|
|||
/// <summary>
|
|||
/// 判断计划单号是否存在
|
|||
/// </summary>
|
|||
/// <param name="info"></param>
|
|||
/// <returns>true:已存在;fasel:不存在。</returns>
|
|||
public int ExistsOrderPlan(TJPaoMoPlan model) |
|||
{ |
|||
string PID = ""; |
|||
int count = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
|
|||
try |
|||
{ |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
PID = model.PID; |
|||
} |
|||
sqlBuilder.AppendLine("SELECT COUNT(*) FROM T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder.AppendLine(" WHERE PID <> @PID AND PLAN_NO=@PLAN_NO"); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), |
|||
new DataParameter("PID", PID), |
|||
new DataParameter { ParameterName = "PLAN_NO", Value = model.PLAN_NO })); |
|||
} |
|||
|
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 插入信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name="">信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
public int Insert(TJPaoMoPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
if (BaseSession != null) |
|||
{ |
|||
//插入基本信息
|
|||
count = BaseSession.Insert<TJPaoMoPlan>(model); |
|||
//InsertOrderPlanTrace(BaseSession, model, "新增");
|
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//插入基本信息
|
|||
count = session.Insert<TJPaoMoPlan>(model); |
|||
//InsertOrderPlanTrace(session, model, "新增");
|
|||
} |
|||
} |
|||
//using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
//{
|
|||
// //插入基本信息
|
|||
// count = session.Insert<TJPaoMoPlan>(model);
|
|||
//}
|
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 更新信息
|
|||
/// <summary>
|
|||
/// 更新信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>更新行数</returns>
|
|||
public int Update(TJPaoMoPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
var sql = $"update T_PP_TJFY_ORDERPLAN set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',PLAN_SEQ = '{model.PLAN_SEQ}',PLAN_NO = '{model.PLAN_NO}',MATERIAL_NAME = '{model.MATERIAL_NAME}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';"; |
|||
//更新基本信息
|
|||
count = session.ExecuteSql(sql); |
|||
InsertOrderPlanTrace(session, model, "修改"); |
|||
} |
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除
|
|||
/// <summary>
|
|||
/// 删除信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>删除个数</returns>
|
|||
//提交事务
|
|||
public int Delete(TJPaoMoPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//删除基本信息
|
|||
count = session.Delete<TJPaoMoPlan>(model); |
|||
//InsertOrderPlanTrace(session, model, "删除");
|
|||
} |
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除校验
|
|||
/// <summary>
|
|||
/// 删除校验
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns></returns>
|
|||
public int DelCheck(TJPaoMoPlan model) |
|||
{ |
|||
int num = 0; |
|||
int state; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
|
|||
sqlBuilder.AppendLine(" SELECT COMPLETE_QTY "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
sqlBuilder2.AppendLine(" SELECT PLAN_STATE "); |
|||
sqlBuilder2.AppendLine(" FROM T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder2.AppendLine(" WHERE PID = @PID "); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
num = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
state = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder2.ToString(), new DataParameter("PID", model.PID))); |
|||
} |
|||
return num+state; |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布
|
|||
/// <summary>
|
|||
/// 发布信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>发布个数</returns>
|
|||
public int PutOut(TJPaoMoPlan model, DataTable workOrderDt) |
|||
{ |
|||
|
|||
BaseSession = AppDataFactory.CreateMainSession(); |
|||
IDbConnection dbConn = DbManager.MainConnectionInfo.Connection; |
|||
IDbTransaction ids = dbConn.BeginTransaction(); |
|||
try |
|||
{ |
|||
if (workOrderDt.Rows != null) |
|||
{ |
|||
BaseSession.DbHelper.BulkCopyData(workOrderDt, "T_PP_WORKORDER", dbConn, ids); |
|||
ids.Commit(); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
ids.Rollback(); |
|||
throw ex; |
|||
} |
|||
int count = 0; |
|||
int count2 = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder.AppendLine(" SET PLAN_STATE='1' "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER "); |
|||
sqlBuilder2.AppendLine(" SET STATE='1' "); |
|||
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID "); |
|||
|
|||
//发布更新基本信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID }); |
|||
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
|||
count2 = session.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray()); |
|||
} |
|||
return count; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布 新
|
|||
/// <summary>
|
|||
/// 发布信息
|
|||
/// 为了事物传递新的session zxd20171101
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>发布个数</returns>
|
|||
public int PutOutBaseSession(TJPaoMoPlan model, DataTable workOrderDt) |
|||
{ |
|||
if (BaseSession==null) |
|||
{ |
|||
BaseSession = AppDataFactory.CreateMainSession(); |
|||
} |
|||
|
|||
//IDbConnection dbConn = DbManager.MainConnectionInfo.Connection;
|
|||
//IDbTransaction ids = dbConn.BeginTransaction();
|
|||
//try
|
|||
//{
|
|||
// if (workOrderDt.Rows != null)
|
|||
// {
|
|||
// BaseSession.DbHelper.BulkCopyData(workOrderDt, "T_PP_WORKORDER", dbConn, ids);
|
|||
// ids.Commit();
|
|||
// }
|
|||
//}
|
|||
//catch (Exception ex)
|
|||
//{
|
|||
// ids.Rollback();
|
|||
// throw ex;
|
|||
//}
|
|||
int count = 0; |
|||
int count2 = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
|
|||
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder.AppendLine(" SET PLAN_STATE='1' "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER "); |
|||
sqlBuilder2.AppendLine(" SET STATE='1' "); |
|||
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID "); |
|||
|
|||
//发布更新基本信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID }); |
|||
//string sqlChange = ChangeSqlByDB(sqlBuilder.ToString(), session);
|
|||
count = BaseSession.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
|||
count2 = BaseSession.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray()); |
|||
|
|||
return count; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布校验
|
|||
/// <summary>
|
|||
/// 发布校验
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns></returns>
|
|||
public int PutOutCheck(TJPaoMoPlan model) |
|||
{ |
|||
int num = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
|
|||
sqlBuilder.AppendLine(" SELECT PLAN_STATE "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_PAOMO "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
if (BaseSession != null) |
|||
{ |
|||
num = Convert.ToInt32(BaseSession.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
|
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
num = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
|
|||
} |
|||
} |
|||
return num; |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 导入
|
|||
public ImportMessage GetImportData(List<TJPaoMoPlan> list) |
|||
{ |
|||
ImportMessage em = new ImportMessage(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//设置祖先对象数据会话
|
|||
session.OpenTs(); |
|||
foreach (TJPaoMoPlan info in list) |
|||
{ |
|||
if (info.IsNewInfo == true) |
|||
{ |
|||
//插入信息
|
|||
int count = session.Insert<TJPaoMoPlan>(info); |
|||
//InsertOrderPlanTrace(session, info, "新增");
|
|||
|
|||
|
|||
////痕迹表
|
|||
FISPlanRecord record = new FISPlanRecord(); |
|||
|
|||
record.PID = Guid.NewGuid().ToString(); |
|||
record.MID = info.PID; |
|||
record.PLAN_NO = info.PLAN_NO; |
|||
record.MATERIAL_CODE = info.MATERIAL_CODE; |
|||
record.PLAN_QTY = info.QTY; |
|||
record.OPERATION_TYPE = "0"; |
|||
record.CREATEUSER = info.CREATEUSER; |
|||
record.CREATEDATE = info.CREATEDATE; |
|||
|
|||
//int no = new OrderPlanDAL().InsertRecord(record);
|
|||
|
|||
em.insertNum++; |
|||
} |
|||
else |
|||
{ |
|||
//更新信息
|
|||
int count = session.Update<TJPaoMoPlan>(info); |
|||
//InsertOrderPlanTrace(session, info, "修改");
|
|||
|
|||
//#region 插入修改信息痕迹表
|
|||
////插入修改信息痕迹表
|
|||
//FISPlanRecord record = new FISPlanRecord();
|
|||
|
|||
//record.PID = Guid.NewGuid().ToString();
|
|||
//record.MID = info.PID;
|
|||
//record.PLAN_NO = info.PLAN_NO;
|
|||
//record.MATERIAL_CODE = info.MATERIAL_CODE;
|
|||
//record.PLAN_QTY = info.QTY;
|
|||
//record.OPERATION_TYPE = "1";
|
|||
//record.CREATEUSER = info.CREATEUSER;
|
|||
//record.CREATEDATE = info.CREATEDATE;
|
|||
|
|||
//int no = new OrderPlanDAL().InsertRecord(record);
|
|||
#endregion
|
|||
|
|||
em.updateNum++; |
|||
} |
|||
} |
|||
session.CommitTs(); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
return em; |
|||
} |
|||
//#endregion
|
|||
|
|||
#region 获取导出的数据
|
|||
/// <summary>
|
|||
/// 获取导出的数据
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <returns>数据</returns>
|
|||
public DataTable GetExportData(TJPaoMoPlan model) |
|||
{ |
|||
DataTable dt = null; |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
//构成查询语句
|
|||
sql = this.GetQuerySql(model, ref parameters); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
dt = session.GetTable(sql, parameters.ToArray()); |
|||
dt.TableName = "OrderPlanExp"; |
|||
} |
|||
return dt; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除订单
|
|||
|
|||
public void DeleteOrderPlan(TJPaoMoPlan entity) |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
session.Delete<TJPaoMoPlan>(entity); |
|||
InsertOrderPlanTrace(session, entity, "删除"); |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 改变更新订单
|
|||
/// <summary>
|
|||
/// 改变更新订单
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
public void ChangeOrderPlan(TJPaoMoPlan entity) |
|||
{ |
|||
if (this.BaseSession != null) |
|||
{ |
|||
|
|||
this.BaseSession.Update<TJPaoMoPlan>(entity); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
|
|||
session.Update<TJPaoMoPlan>(entity); |
|||
} |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取流水号
|
|||
/// <summary>
|
|||
/// 获取流水号
|
|||
/// </summary>
|
|||
/// <param name = "" > 条件 </ param >
|
|||
/// < returns > *信息 </ returns >
|
|||
public FISPlan GetOrderPlanSeq(FISPlan condition) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = $"SELECT TOP 1 PLAN_SEQ as 'SEQSTR',PLAN_DATE as 'DATASTR' FROM T_PP_ORDERPLAN_PAOMO WHERE PLAN_DATE = '{condition.DATASTR}' ORDER BY PLAN_SEQ DESC "; |
|||
|
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
return session.Get<FISPlan>(sql, parameters.ToArray()); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "流水号本体-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 更新流水号信息
|
|||
/// <summary>
|
|||
/// 更新流水号信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>更新行数</returns>
|
|||
//public int UpdateFisPlan(FISPlan model)
|
|||
//{
|
|||
// int count = 0;
|
|||
// try
|
|||
// {
|
|||
// if (this.BaseSession != null)
|
|||
// {
|
|||
// count = BaseSession.Update<FISPlan>(model);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// //更新基本信息
|
|||
// count = session.Update<FISPlan>(model);
|
|||
// }
|
|||
// }
|
|||
// return count;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 插入流水号信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name=model"">物料号信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
//public int InsertFisPlan(FISPlan model)
|
|||
//{
|
|||
// int count = 0;
|
|||
// try
|
|||
// {
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// //插入基本信息
|
|||
// count = session.Insert<FISPlan>(model);
|
|||
// }
|
|||
// return count;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// LogManager.LogHelper.Error(new LogInfo()
|
|||
// {
|
|||
// ErrorInfo = ex,
|
|||
// Tag = ex.StackTrace,
|
|||
// Info = "物料号信息数据层-插入信息"
|
|||
// });
|
|||
// throw;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 插入信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name="">信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
public int InsertRecord(FISPlanRecord record) |
|||
{ |
|||
int no = 0; |
|||
try |
|||
{ |
|||
if (BaseSession != null) |
|||
{ |
|||
//插入基本信息
|
|||
no = BaseSession.Insert<FISPlanRecord>(record); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//插入基本信息
|
|||
no = session.Insert<FISPlanRecord>(record); |
|||
} |
|||
} |
|||
return no; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 配置设备人员
|
|||
|
|||
#region 配置设备人员
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
//public DataPage FisPlanRecordList(FISPlanRecord condition, DataPage page)
|
|||
//{
|
|||
// string sql = "";
|
|||
// List<DataParameter> parameters = new List<DataParameter>();
|
|||
// try
|
|||
// {
|
|||
// sql = this.GetFisPlanRecordSql(condition, ref parameters);
|
|||
|
|||
// //分页关键字段及排序
|
|||
// page.KeyName = "PID";
|
|||
// if (string.IsNullOrEmpty(page.SortExpression))
|
|||
// {
|
|||
// page.SortExpression = "CREATEDATE DESC";
|
|||
// }
|
|||
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// page = session.GetDataPage<FISPlanRecord>(sql, parameters.ToArray(), page);
|
|||
// }
|
|||
// return page;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// LogManager.LogHelper.Error(new LogInfo()
|
|||
// {
|
|||
// ErrorInfo = ex,
|
|||
// Tag = ex.StackTrace,
|
|||
// Info = "订单信息数据层-获取列表"
|
|||
// });
|
|||
// throw;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 获取查询语句
|
|||
/// <summary>
|
|||
/// 获取查询语句
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <param name="parameters">参数</param>
|
|||
/// <returns>查询语句</returns>
|
|||
//private string GetFisPlanRecordSql(FISPlanRecord condition, ref List<DataParameter> parameters)
|
|||
//{
|
|||
// StringBuilder sqlBuilder = new StringBuilder();
|
|||
// StringBuilder whereBuilder = new StringBuilder();
|
|||
// try
|
|||
// {
|
|||
// //构成查询语句
|
|||
// sqlBuilder.AppendLine(" SELECT P.PID ");
|
|||
// sqlBuilder.AppendLine(" ,P.MID ");
|
|||
// sqlBuilder.AppendLine(" ,P.PLAN_NO ");
|
|||
// sqlBuilder.AppendLine(" ,P.MATERIAL_CODE ");
|
|||
// sqlBuilder.AppendLine(" ,P.PLAN_QTY ");
|
|||
// sqlBuilder.AppendLine(" ,P.OPERATION_TYPE ");
|
|||
// sqlBuilder.AppendLine(" ,P.CREATEUSER ");
|
|||
// sqlBuilder.AppendLine(" ,P.CREATEDATE ");;
|
|||
// sqlBuilder.AppendLine(" ,C.USERNAME AS CREATEUSERNAME ");
|
|||
// sqlBuilder.AppendLine(" FROM T_AW_FISPLANRECORD P ");
|
|||
// sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER C ON C.USERID=P.CREATEUSER ");
|
|||
|
|||
// //查询条件
|
|||
// if (string.IsNullOrEmpty(condition.MID) == false)
|
|||
// {
|
|||
// whereBuilder.Append(" AND P.MID= @MID ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "MID", DataType = DbType.String, Value = condition.PLAN_NO });
|
|||
// }
|
|||
|
|||
// if (whereBuilder.Length > 0)
|
|||
// {
|
|||
// sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|||
// }
|
|||
// return sqlBuilder.ToString();
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#endregion
|
|||
|
|||
#region 插入操作记录
|
|||
|
|||
public int InsertOrderPlanTrace(IDataSession Bsession, TJPaoMoPlan model, string operatType) |
|||
{ |
|||
try |
|||
{ |
|||
var sql = $" insert into T_PP_TJFY_ORDERPLANTRACE(PID,PLAN_NO,PLAN_SEQ,PLAN_STATE,MATERIAL_CODE,QTY,PLAN_DATE,CREATEDATE,CREATEUSER,OPERATE_TYPE) " + |
|||
$" VALUES ('{Guid.NewGuid().ToString()}','{model.PLAN_NO}','{model.PLAN_SEQ}','{model.PLAN_STATE}','{model.MATERIAL_CODE}','{model.QTY}','{model.PLAN_DATE}','{model.UPDATEDATE}','{model.UPDATEUSER}','{operatType}');"; |
|||
return Bsession.ExecuteSql(sql); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,990 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMAPP.FJC.Entity.FIS; |
|||
using QMFrameWork.Data; |
|||
using QMFrameWork.Log; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
using QMAPP.DAL; |
|||
using QMAPP.FJC.Entity.TianJin; |
|||
using QMAPP.FJC.Entity.FileCopy.FIS; |
|||
//using QMAPP.FJC.Entity.FileCopy.FIS;
|
|||
|
|||
namespace QMAPP.FJC.DAL.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 注塑计划管理
|
|||
///
|
|||
///
|
|||
/// </summary>
|
|||
public class TJZhuSuPlanDAL : BaseDAL |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 获取信息
|
|||
/// </summary>
|
|||
/// <param name="">条件</param>
|
|||
/// <returns>信息</returns>
|
|||
public TJZhuSuPlan Get(TJZhuSuPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_TJFY_ORDERPLAN WHERE 1=1 "; |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
sql += " AND PID = @PID"; |
|||
parameters.Add(new DataParameter("PID", model.PID)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_NO) == false) |
|||
{ |
|||
sql += " AND PLAN_NO = @PLAN_NO"; |
|||
parameters.Add(new DataParameter("PLAN_NO", model.PLAN_NO)); |
|||
} |
|||
//if (string.IsNullOrEmpty(model.MACHINECODDE) == false)
|
|||
//{
|
|||
// sql += " AND MACHINECODDE = @MACHINECODDE";
|
|||
// parameters.Add(new DataParameter("MACHINECODDE", model.MACHINECODDE));
|
|||
//}
|
|||
if (string.IsNullOrEmpty(model.MATERIAL_CODE) == false) |
|||
{ |
|||
sql += " AND MATERIAL_CODE = @MATERIAL_CODE"; |
|||
parameters.Add(new DataParameter("MATERIAL_CODE", model.MATERIAL_CODE)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_STATES) == false) |
|||
{ |
|||
sql += " AND PLAN_STATE IN ('" + model.PLAN_STATES.Replace(",", "','") + "')"; |
|||
|
|||
} |
|||
if (BaseSession != null) |
|||
{ |
|||
//获取信息
|
|||
model = BaseSession.Get<TJZhuSuPlan>(sql, parameters.ToArray()); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
model = session.Get<TJZhuSuPlan>(sql, parameters.ToArray()); |
|||
} |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
public TJZhuSuPlan GetOne(TJZhuSuPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_ORDERPLAN_ZHUSU WHERE PLAN_STATE IN ('1','2') "; |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
sql += " AND PID = @PID"; |
|||
parameters.Add(new DataParameter("PID", model.PID)); |
|||
} |
|||
if (string.IsNullOrEmpty(model.PLAN_NO) == false) |
|||
{ |
|||
sql += " AND PLAN_NO = @PLAN_NO"; |
|||
parameters.Add(new DataParameter("PLAN_NO", model.PLAN_NO)); |
|||
} |
|||
//if (string.IsNullOrEmpty(model.MACHINECODDE) == false)
|
|||
//{
|
|||
// sql += " AND MACHINECODDE = @MACHINECODDE";
|
|||
// parameters.Add(new DataParameter("MACHINECODDE", model.MACHINECODDE));
|
|||
//}
|
|||
if (string.IsNullOrEmpty(model.MATERIAL_CODE) == false) |
|||
{ |
|||
sql += " AND MATERIAL_CODE = @MATERIAL_CODE"; |
|||
parameters.Add(new DataParameter("MATERIAL_CODE", model.MATERIAL_CODE)); |
|||
} |
|||
|
|||
sql += " order by CREATEDATE desc "; |
|||
|
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
model = session.Get<TJZhuSuPlan>(sql, parameters.ToArray()); |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
public TJZhuSuPlan GetInfo(TJZhuSuPlan model) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_PP_ORDERPLAN_ZHUSU WHERE PLAN_NO = @PLAN_NO"; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PLAN_NO", DataType = DbType.String, Value = model.PLAN_NO }); |
|||
model = session.Get<TJZhuSuPlan>(sql, parameters.ToArray()); |
|||
} |
|||
return model; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "信息数据层-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
public DataPage GetList(TJZhuSuPlan condition, DataPage page) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = this.GetQuerySql(condition, ref parameters); |
|||
//分页关键字段及排序
|
|||
page.KeyName = "PID"; |
|||
if (string.IsNullOrEmpty(page.SortExpression)) |
|||
{ |
|||
page.SortExpression = "CREATEDATE DESC"; |
|||
} |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
page = session.GetDataPage<TJZhuSuPlan>(sql, parameters.ToArray(), page); |
|||
} |
|||
return page; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "注塑信息数据层-获取列表" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取查询语句
|
|||
/// <summary>
|
|||
/// 获取查询语句
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <param name="parameters">参数</param>
|
|||
/// <returns>查询语句</returns>
|
|||
private string GetQuerySql(TJZhuSuPlan condition, ref List<DataParameter> parameters) |
|||
{ |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder whereBuilder = new StringBuilder(); |
|||
try |
|||
{ |
|||
//构成查询语句
|
|||
sqlBuilder.AppendLine(" SELECT DISTINCT O.PID "); |
|||
sqlBuilder.AppendLine(" ,O.FACTORY_CODE "); |
|||
sqlBuilder.AppendLine(" ,F.FACTORY_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_NO "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_SEQ "); |
|||
sqlBuilder.AppendLine(" ,O.PLAN_STATE "); |
|||
sqlBuilder.AppendLine(" ,O.MATERIAL_CODE "); |
|||
sqlBuilder.AppendLine(" ,M.MATERIAL_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.MACHINECODDE "); |
|||
sqlBuilder.AppendLine(" ,O.PBOM_CODE "); |
|||
sqlBuilder.AppendLine(" ,O.ROUTE_CODE "); |
|||
sqlBuilder.AppendLine(" ,O.REMARK "); |
|||
sqlBuilder.AppendLine(" ,O.QTY "); |
|||
sqlBuilder.AppendLine(" ,O.COMPLETE_QTY "); |
|||
sqlBuilder.AppendLine(" ,CONVERT(VARCHAR(19),O.PLAN_DATE,120) AS PLAN_DATE "); |
|||
sqlBuilder.AppendLine(" ,O.SHIFT_CODE "); |
|||
sqlBuilder.AppendLine(" ,P.PRODUCESHIFTNAME AS SHIFT_NAME "); |
|||
sqlBuilder.AppendLine(" ,O.PLANSOURCE "); |
|||
sqlBuilder.AppendLine(" ,O.PRODUCEREQUIRE "); |
|||
//sqlBuilder.AppendLine(" ,WC.WORKCENTER_CODE ");
|
|||
sqlBuilder.AppendLine(" ,O.CREATEUSER "); |
|||
sqlBuilder.AppendLine(" ,O.CREATEDATE "); |
|||
sqlBuilder.AppendLine(" ,O.UPDATEUSER "); |
|||
sqlBuilder.AppendLine(" ,O.UPDATEDATE "); |
|||
sqlBuilder.AppendLine(" ,O.IGNORE_FISBREAK "); |
|||
sqlBuilder.AppendLine(" ,O.FIS_ASMSETCODE "); |
|||
sqlBuilder.AppendLine(" ,O.STARTTIME AS STARTTIMEVIEW "); |
|||
sqlBuilder.AppendLine(" ,O.ENDTIME AS ENDTIMEVIEW"); |
|||
sqlBuilder.AppendLine(" ,C.USERNAME AS CREATEUSERNAME "); |
|||
sqlBuilder.AppendLine(" ,U.USERNAME AS UPDATEUSERNAME "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_ZHUSU O "); |
|||
//注塑所需要的表T_PP_WORKORDER
|
|||
sqlBuilder.AppendLine(" LEFT JOIN T_BD_PRODUCESHIFT P ON P.PRODUCESHIFTTCODE=O.SHIFT_CODE "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_MD_FACTORY F ON F.FACTORY_CODE=O.FACTORY_CODE "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_PP_WORKORDER W ON W.ORDERPLANID=O.PID "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_MD_MATERIAL M ON M.MATERIAL_CODE=O.MATERIAL_CODE "); |
|||
//sqlBuilder.AppendLine(" LEFT JOIN T_MD_WORKCELL WC ON WC.WORKCELL_CODE=PRW.WORKCELL_CODE ");
|
|||
sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER C ON C.USERID=O.CREATEUSER "); |
|||
sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER U ON U.USERID=O.UPDATEUSER "); |
|||
|
|||
//whereBuilder.AppendFormat(" AND O.WORKCENTER_CODE in (select distinct WORKCENTER from T_PP_ORDERINDENTITY where ORDER_TYPE='{0}')", condition.ORDER_TYPE);
|
|||
//查询条件
|
|||
//if (string.IsNullOrEmpty(condition.FACTORY_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.FACTORY_CODE = @FACTORY_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "FACTORY_CODE", DataType = DbType.String, Value = condition.FACTORY_CODE });
|
|||
//}
|
|||
if (string.IsNullOrEmpty(condition.PLAN_NO) == false) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_NO = @PLAN_NO "); |
|||
parameters.Add(new DataParameter { ParameterName = "PLAN_NO", DataType = DbType.String, Value = condition.PLAN_NO }); |
|||
} |
|||
//物料号
|
|||
if (string.IsNullOrEmpty(condition.MATERIAL_CODE) == false) |
|||
{ |
|||
whereBuilder.Append(" AND O.MATERIAL_CODE = @MATERIAL_CODE "); |
|||
parameters.Add(new DataParameter { ParameterName = "MATERIAL_CODE", DataType = DbType.String, Value = condition.MATERIAL_CODE }); |
|||
} |
|||
//工艺路线
|
|||
//if (string.IsNullOrEmpty(condition.ROUTE_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.ROUTE_CODE = @ROUTE_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "ROUTE_CODE", DataType = DbType.String, Value = condition.ROUTE_CODE });
|
|||
//}
|
|||
//班次编码
|
|||
//if (string.IsNullOrEmpty(condition.SHIFT_CODE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.SHIFT_CODE = @SHIFT_CODE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "SHIFT_CODE", DataType = DbType.String, Value = condition.SHIFT_CODE });
|
|||
//}
|
|||
//设备
|
|||
//if (string.IsNullOrEmpty(condition.MACHINECODDE) == false)
|
|||
//{
|
|||
// whereBuilder.Append(" AND O.MACHINECODDE = @MACHINECODDE ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "MACHINECODDE", DataType = DbType.String, Value = condition.MACHINECODDE });
|
|||
//}
|
|||
//计划时间
|
|||
if (condition.PLANTIMESTART != DateTime.MinValue) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_DATE >= @PLANTIMESTART"); |
|||
parameters.Add(new DataParameter { ParameterName = "PLANTIMESTART", DataType = DbType.String, Value = condition.PLANTIMESTART }); |
|||
} |
|||
if (condition.PLANTIMEEND != DateTime.MinValue) |
|||
{ |
|||
whereBuilder.Append(" AND O.PLAN_DATE <= @PLANTIMEEND"); |
|||
parameters.Add(new DataParameter { ParameterName = "PLANTIMEEND", DataType = DbType.String, Value = condition.PLANTIMEEND }); |
|||
} |
|||
|
|||
|
|||
if (whereBuilder.Length > 0) |
|||
{ |
|||
sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4)); |
|||
} |
|||
return sqlBuilder.ToString(); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 信息是否重复
|
|||
/// <summary>
|
|||
/// 判断计划单号是否存在
|
|||
/// </summary>
|
|||
/// <param name="info"></param>
|
|||
/// <returns>true:已存在;fasel:不存在。</returns>
|
|||
public int ExistsOrderPlan(TJZhuSuPlan model) |
|||
{ |
|||
string PID = ""; |
|||
int count = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
|
|||
try |
|||
{ |
|||
if (string.IsNullOrEmpty(model.PID) == false) |
|||
{ |
|||
PID = model.PID; |
|||
} |
|||
sqlBuilder.AppendLine("SELECT COUNT(*) FROM T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder.AppendLine(" WHERE PID <> @PID AND PLAN_NO=@PLAN_NO"); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
count = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), |
|||
new DataParameter("PID", PID), |
|||
new DataParameter { ParameterName = "PLAN_NO", Value = model.PLAN_NO })); |
|||
} |
|||
|
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 插入信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name="">信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
public int Insert(TJZhuSuPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
if (BaseSession != null) |
|||
{ |
|||
//插入基本信息
|
|||
count = BaseSession.Insert<TJZhuSuPlan>(model); |
|||
//InsertOrderPlanTrace(BaseSession, model, "新增");
|
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//插入基本信息
|
|||
count = session.Insert<TJZhuSuPlan>(model); |
|||
//InsertOrderPlanTrace(session, model, "新增");
|
|||
} |
|||
} |
|||
//using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
//{
|
|||
// //插入基本信息
|
|||
// count = session.Insert<TJZhuSuPlan>(model);
|
|||
//}
|
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 更新信息
|
|||
/// <summary>
|
|||
/// 更新信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>更新行数</returns>
|
|||
public int Update(TJZhuSuPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
var sql = $"update T_PP_TJFY_ORDERPLAN set MATERIAL_CODE = '{model.MATERIAL_CODE}',QTY = '{model.QTY}',PLAN_SEQ = '{model.PLAN_SEQ}',PLAN_NO = '{model.PLAN_NO}',MATERIAL_NAME = '{model.MATERIAL_NAME}',PLAN_STATE = '{model.PLAN_STATE}' where PID = '{model.PID}';"; |
|||
//更新基本信息
|
|||
count = session.ExecuteSql(sql); |
|||
InsertOrderPlanTrace(session, model, "修改"); |
|||
} |
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除
|
|||
/// <summary>
|
|||
/// 删除信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>删除个数</returns>
|
|||
//提交事务
|
|||
public int Delete(TJZhuSuPlan model) |
|||
{ |
|||
int count = 0; |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//删除基本信息
|
|||
count = session.Delete<TJZhuSuPlan>(model); |
|||
//InsertOrderPlanTrace(session, model, "删除");
|
|||
} |
|||
return count; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除校验
|
|||
/// <summary>
|
|||
/// 删除校验
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns></returns>
|
|||
public int DelCheck(TJZhuSuPlan model) |
|||
{ |
|||
int num = 0; |
|||
int state; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
|
|||
sqlBuilder.AppendLine(" SELECT COMPLETE_QTY "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
sqlBuilder2.AppendLine(" SELECT PLAN_STATE "); |
|||
sqlBuilder2.AppendLine(" FROM T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder2.AppendLine(" WHERE PID = @PID "); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
num = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
state = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder2.ToString(), new DataParameter("PID", model.PID))); |
|||
} |
|||
return num+state; |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布
|
|||
/// <summary>
|
|||
/// 发布信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>发布个数</returns>
|
|||
public int PutOut(TJZhuSuPlan model, DataTable workOrderDt) |
|||
{ |
|||
|
|||
BaseSession = AppDataFactory.CreateMainSession(); |
|||
IDbConnection dbConn = DbManager.MainConnectionInfo.Connection; |
|||
IDbTransaction ids = dbConn.BeginTransaction(); |
|||
try |
|||
{ |
|||
if (workOrderDt.Rows != null) |
|||
{ |
|||
BaseSession.DbHelper.BulkCopyData(workOrderDt, "T_PP_WORKORDER", dbConn, ids); |
|||
ids.Commit(); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
ids.Rollback(); |
|||
throw ex; |
|||
} |
|||
int count = 0; |
|||
int count2 = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder.AppendLine(" SET PLAN_STATE='1' "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER "); |
|||
sqlBuilder2.AppendLine(" SET STATE='1' "); |
|||
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID "); |
|||
|
|||
//发布更新基本信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID }); |
|||
count = session.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
|||
count2 = session.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray()); |
|||
} |
|||
return count; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布 新
|
|||
/// <summary>
|
|||
/// 发布信息
|
|||
/// 为了事物传递新的session zxd20171101
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>发布个数</returns>
|
|||
public int PutOutBaseSession(TJZhuSuPlan model, DataTable workOrderDt) |
|||
{ |
|||
if (BaseSession==null) |
|||
{ |
|||
BaseSession = AppDataFactory.CreateMainSession(); |
|||
} |
|||
|
|||
//IDbConnection dbConn = DbManager.MainConnectionInfo.Connection;
|
|||
//IDbTransaction ids = dbConn.BeginTransaction();
|
|||
//try
|
|||
//{
|
|||
// if (workOrderDt.Rows != null)
|
|||
// {
|
|||
// BaseSession.DbHelper.BulkCopyData(workOrderDt, "T_PP_WORKORDER", dbConn, ids);
|
|||
// ids.Commit();
|
|||
// }
|
|||
//}
|
|||
//catch (Exception ex)
|
|||
//{
|
|||
// ids.Rollback();
|
|||
// throw ex;
|
|||
//}
|
|||
int count = 0; |
|||
int count2 = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder sqlBuilder2 = new StringBuilder(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
|
|||
sqlBuilder.AppendLine(" UPDATE T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder.AppendLine(" SET PLAN_STATE='1' "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
sqlBuilder2.AppendLine(" UPDATE T_PP_WORKORDER "); |
|||
sqlBuilder2.AppendLine(" SET STATE='1' "); |
|||
sqlBuilder2.AppendLine(" WHERE ORDERPLANID = @PID "); |
|||
|
|||
//发布更新基本信息
|
|||
parameters.Add(new DataParameter { ParameterName = "PID", DataType = DbType.String, Value = model.PID }); |
|||
//string sqlChange = ChangeSqlByDB(sqlBuilder.ToString(), session);
|
|||
count = BaseSession.ExecuteSql(sqlBuilder.ToString(), parameters.ToArray()); |
|||
count2 = BaseSession.ExecuteSql(sqlBuilder2.ToString(), parameters.ToArray()); |
|||
|
|||
return count; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布校验
|
|||
/// <summary>
|
|||
/// 发布校验
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns></returns>
|
|||
public int PutOutCheck(TJZhuSuPlan model) |
|||
{ |
|||
int num = 0; |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
|
|||
sqlBuilder.AppendLine(" SELECT PLAN_STATE "); |
|||
sqlBuilder.AppendLine(" FROM T_PP_ORDERPLAN_ZHUSU "); |
|||
sqlBuilder.AppendLine(" WHERE PID = @PID "); |
|||
|
|||
if (BaseSession != null) |
|||
{ |
|||
num = Convert.ToInt32(BaseSession.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
|
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
num = Convert.ToInt32(session.ExecuteSqlScalar(sqlBuilder.ToString(), new DataParameter("PID", model.PID))); |
|||
|
|||
} |
|||
} |
|||
return num; |
|||
|
|||
} |
|||
#endregion
|
|||
|
|||
#region 导入
|
|||
public ImportMessage GetImportData(List<TJZhuSuPlan> list) |
|||
{ |
|||
ImportMessage em = new ImportMessage(); |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//设置祖先对象数据会话
|
|||
session.OpenTs(); |
|||
foreach (TJZhuSuPlan info in list) |
|||
{ |
|||
if (info.IsNewInfo == true) |
|||
{ |
|||
//插入信息
|
|||
int count = session.Insert<TJZhuSuPlan>(info); |
|||
//InsertOrderPlanTrace(session, info, "新增");
|
|||
|
|||
|
|||
////痕迹表
|
|||
FISPlanRecord record = new FISPlanRecord(); |
|||
|
|||
record.PID = Guid.NewGuid().ToString(); |
|||
record.MID = info.PID; |
|||
record.PLAN_NO = info.PLAN_NO; |
|||
record.MATERIAL_CODE = info.MATERIAL_CODE; |
|||
record.PLAN_QTY = info.QTY; |
|||
record.OPERATION_TYPE = "0"; |
|||
record.CREATEUSER = info.CREATEUSER; |
|||
record.CREATEDATE = info.CREATEDATE; |
|||
|
|||
//int no = new OrderPlanDAL().InsertRecord(record);
|
|||
|
|||
em.insertNum++; |
|||
} |
|||
else |
|||
{ |
|||
//更新信息
|
|||
int count = session.Update<TJZhuSuPlan>(info); |
|||
//InsertOrderPlanTrace(session, info, "修改");
|
|||
|
|||
//#region 插入修改信息痕迹表
|
|||
////插入修改信息痕迹表
|
|||
//FISPlanRecord record = new FISPlanRecord();
|
|||
|
|||
//record.PID = Guid.NewGuid().ToString();
|
|||
//record.MID = info.PID;
|
|||
//record.PLAN_NO = info.PLAN_NO;
|
|||
//record.MATERIAL_CODE = info.MATERIAL_CODE;
|
|||
//record.PLAN_QTY = info.QTY;
|
|||
//record.OPERATION_TYPE = "1";
|
|||
//record.CREATEUSER = info.CREATEUSER;
|
|||
//record.CREATEDATE = info.CREATEDATE;
|
|||
|
|||
//int no = new OrderPlanDAL().InsertRecord(record);
|
|||
#endregion
|
|||
|
|||
em.updateNum++; |
|||
} |
|||
} |
|||
session.CommitTs(); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
return em; |
|||
} |
|||
//#endregion
|
|||
|
|||
#region 获取导出的数据
|
|||
/// <summary>
|
|||
/// 获取导出的数据
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <returns>数据</returns>
|
|||
public DataTable GetExportData(TJZhuSuPlan model) |
|||
{ |
|||
DataTable dt = null; |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
//构成查询语句
|
|||
sql = this.GetQuerySql(model, ref parameters); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
dt = session.GetTable(sql, parameters.ToArray()); |
|||
dt.TableName = "OrderPlanExp"; |
|||
} |
|||
return dt; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 删除订单
|
|||
|
|||
public void DeleteOrderPlan(TJZhuSuPlan entity) |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
session.Delete<TJZhuSuPlan>(entity); |
|||
InsertOrderPlanTrace(session, entity, "删除"); |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 改变更新订单
|
|||
/// <summary>
|
|||
/// 改变更新订单
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
public void ChangeOrderPlan(TJZhuSuPlan entity) |
|||
{ |
|||
if (this.BaseSession != null) |
|||
{ |
|||
|
|||
this.BaseSession.Update<TJZhuSuPlan>(entity); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
|
|||
session.Update<TJZhuSuPlan>(entity); |
|||
} |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取流水号
|
|||
/// <summary>
|
|||
/// 获取流水号
|
|||
/// </summary>
|
|||
/// <param name = "" > 条件 </ param >
|
|||
/// < returns > *信息 </ returns >
|
|||
public FISPlan GetOrderPlanSeq(FISPlan condition) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = $"SELECT TOP 1 PLAN_SEQ as 'SEQSTR',PLAN_DATE as 'DATASTR' FROM T_PP_ORDERPLAN_ZHUSU WHERE PLAN_DATE = '{condition.DATASTR}' ORDER BY PLAN_SEQ DESC "; |
|||
|
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
return session.Get<FISPlan>(sql, parameters.ToArray()); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "流水号本体-获取信息" |
|||
}); |
|||
throw; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 更新流水号信息
|
|||
/// <summary>
|
|||
/// 更新流水号信息
|
|||
/// </summary>
|
|||
/// <param name=""></param>
|
|||
/// <returns>更新行数</returns>
|
|||
//public int UpdateFisPlan(FISPlan model)
|
|||
//{
|
|||
// int count = 0;
|
|||
// try
|
|||
// {
|
|||
// if (this.BaseSession != null)
|
|||
// {
|
|||
// count = BaseSession.Update<FISPlan>(model);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// //更新基本信息
|
|||
// count = session.Update<FISPlan>(model);
|
|||
// }
|
|||
// }
|
|||
// return count;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 插入流水号信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name=model"">物料号信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
//public int InsertFisPlan(FISPlan model)
|
|||
//{
|
|||
// int count = 0;
|
|||
// try
|
|||
// {
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// //插入基本信息
|
|||
// count = session.Insert<FISPlan>(model);
|
|||
// }
|
|||
// return count;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// LogManager.LogHelper.Error(new LogInfo()
|
|||
// {
|
|||
// ErrorInfo = ex,
|
|||
// Tag = ex.StackTrace,
|
|||
// Info = "物料号信息数据层-插入信息"
|
|||
// });
|
|||
// throw;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 插入信息
|
|||
/// <summary>
|
|||
/// 插入信息(单表)
|
|||
/// </summary>
|
|||
/// <param name="">信息</param>
|
|||
/// <returns>插入行数</returns>
|
|||
public int InsertRecord(FISPlanRecord record) |
|||
{ |
|||
int no = 0; |
|||
try |
|||
{ |
|||
if (BaseSession != null) |
|||
{ |
|||
//插入基本信息
|
|||
no = BaseSession.Insert<FISPlanRecord>(record); |
|||
} |
|||
else |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//插入基本信息
|
|||
no = session.Insert<FISPlanRecord>(record); |
|||
} |
|||
} |
|||
return no; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 配置设备人员
|
|||
|
|||
#region 配置设备人员
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
//public DataPage FisPlanRecordList(FISPlanRecord condition, DataPage page)
|
|||
//{
|
|||
// string sql = "";
|
|||
// List<DataParameter> parameters = new List<DataParameter>();
|
|||
// try
|
|||
// {
|
|||
// sql = this.GetFisPlanRecordSql(condition, ref parameters);
|
|||
|
|||
// //分页关键字段及排序
|
|||
// page.KeyName = "PID";
|
|||
// if (string.IsNullOrEmpty(page.SortExpression))
|
|||
// {
|
|||
// page.SortExpression = "CREATEDATE DESC";
|
|||
// }
|
|||
|
|||
// using (IDataSession session = AppDataFactory.CreateMainSession())
|
|||
// {
|
|||
// page = session.GetDataPage<FISPlanRecord>(sql, parameters.ToArray(), page);
|
|||
// }
|
|||
// return page;
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// LogManager.LogHelper.Error(new LogInfo()
|
|||
// {
|
|||
// ErrorInfo = ex,
|
|||
// Tag = ex.StackTrace,
|
|||
// Info = "订单信息数据层-获取列表"
|
|||
// });
|
|||
// throw;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 获取查询语句
|
|||
/// <summary>
|
|||
/// 获取查询语句
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <param name="parameters">参数</param>
|
|||
/// <returns>查询语句</returns>
|
|||
//private string GetFisPlanRecordSql(FISPlanRecord condition, ref List<DataParameter> parameters)
|
|||
//{
|
|||
// StringBuilder sqlBuilder = new StringBuilder();
|
|||
// StringBuilder whereBuilder = new StringBuilder();
|
|||
// try
|
|||
// {
|
|||
// //构成查询语句
|
|||
// sqlBuilder.AppendLine(" SELECT P.PID ");
|
|||
// sqlBuilder.AppendLine(" ,P.MID ");
|
|||
// sqlBuilder.AppendLine(" ,P.PLAN_NO ");
|
|||
// sqlBuilder.AppendLine(" ,P.MATERIAL_CODE ");
|
|||
// sqlBuilder.AppendLine(" ,P.PLAN_QTY ");
|
|||
// sqlBuilder.AppendLine(" ,P.OPERATION_TYPE ");
|
|||
// sqlBuilder.AppendLine(" ,P.CREATEUSER ");
|
|||
// sqlBuilder.AppendLine(" ,P.CREATEDATE ");;
|
|||
// sqlBuilder.AppendLine(" ,C.USERNAME AS CREATEUSERNAME ");
|
|||
// sqlBuilder.AppendLine(" FROM T_AW_FISPLANRECORD P ");
|
|||
// sqlBuilder.AppendLine(" LEFT JOIN T_QM_USER C ON C.USERID=P.CREATEUSER ");
|
|||
|
|||
// //查询条件
|
|||
// if (string.IsNullOrEmpty(condition.MID) == false)
|
|||
// {
|
|||
// whereBuilder.Append(" AND P.MID= @MID ");
|
|||
// parameters.Add(new DataParameter { ParameterName = "MID", DataType = DbType.String, Value = condition.PLAN_NO });
|
|||
// }
|
|||
|
|||
// if (whereBuilder.Length > 0)
|
|||
// {
|
|||
// sqlBuilder.Append(" WHERE " + whereBuilder.ToString().Substring(4));
|
|||
// }
|
|||
// return sqlBuilder.ToString();
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#endregion
|
|||
|
|||
#region 插入操作记录
|
|||
|
|||
public int InsertOrderPlanTrace(IDataSession Bsession, TJZhuSuPlan model, string operatType) |
|||
{ |
|||
try |
|||
{ |
|||
var sql = $" insert into T_PP_TJFY_ORDERPLANTRACE(PID,PLAN_NO,PLAN_SEQ,PLAN_STATE,MATERIAL_CODE,QTY,PLAN_DATE,CREATEDATE,CREATEUSER,OPERATE_TYPE) " + |
|||
$" VALUES ('{Guid.NewGuid().ToString()}','{model.PLAN_NO}','{model.PLAN_SEQ}','{model.PLAN_STATE}','{model.MATERIAL_CODE}','{model.QTY}','{model.PLAN_DATE}','{model.UPDATEDATE}','{model.UPDATEUSER}','{operatType}');"; |
|||
return Bsession.ExecuteSql(sql); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMFrameWork.Data.Attributes; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
|
|||
|
|||
namespace QMAPP.FJC.Entity.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 工单计划
|
|||
/// </summary>
|
|||
[DBTable(TableName = "T_PP_ORDERPLAN_PAOMO", TimeStampColumn = "UPDATEDATE")] |
|||
public class TJPaoMoPlan : BaseEntity |
|||
{ |
|||
///<summary>
|
|||
///
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
|||
public string PID { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划单号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_NO", DataType = DbType.String)] |
|||
public string PLAN_NO { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///计划顺序号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_SEQ", DataType = DbType.String)] |
|||
public String PLAN_SEQ { get; set; } |
|||
|
|||
///<summary>
|
|||
///车型
|
|||
///</summary>
|
|||
// [DBColumn(ColumnName = "LINENO", DataType = DbType.String)]
|
|||
// public String LINENO { get; set; }
|
|||
|
|||
///<summary>
|
|||
///计划状态
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_STATE", DataType = DbType.String)] |
|||
public string PLAN_STATE { get; set; } |
|||
public string PLAN_STATES { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///物料号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "MATERIAL_CODE", DataType = DbType.String)] |
|||
public string MATERIAL_CODE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料名称
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "MATERIAL_NAME", DataType = DbType.String)] |
|||
public string MATERIAL_NAME { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划数量
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "QTY", DataType = DbType.String)] |
|||
public int QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
///完成数量
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "COMPLETE_QTY", DataType = DbType.String)] |
|||
public int COMPLETE_QTY { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///计划日期
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_DATE", DataType = DbType.DateTime)] |
|||
public DateTime PLAN_DATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATEUSER", DataType = DbType.String)] |
|||
public string CREATEUSER { get; set; } |
|||
public string CREATEUSERNAME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATEDATE", DataType = DbType.DateTime, DefaultValue = DataDefaultValue.SysDate)] |
|||
public DateTime CREATEDATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新用户
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATEUSER", DataType = DbType.String)] |
|||
public string UPDATEUSER { get; set; } |
|||
public string UPDATEUSERNAME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATEDATE", DataType = DbType.DateTime)] |
|||
public DateTime UPDATEDATE { get; set; } |
|||
|
|||
public DateTime PLANTIMESTART { get; set; } |
|||
|
|||
public DateTime PLANTIMEEND { get; set; } |
|||
|
|||
public string STARTTIMEVIEW { get; set; } |
|||
|
|||
public string ENDTIMEVIEW { get; set; } |
|||
|
|||
public string STARTTIMEIN { get; set; } |
|||
|
|||
public string ENDTIMEIN { get; set; } |
|||
|
|||
public string PLAN_DATEIN { get; set; } |
|||
|
|||
|
|||
public string AsmSetCode { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,125 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMFrameWork.Data.Attributes; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
|
|||
|
|||
namespace QMAPP.FJC.Entity.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 工单计划
|
|||
/// </summary>
|
|||
[DBTable(TableName = "T_PP_ORDERPLAN_ZHUSU", TimeStampColumn = "UPDATEDATE")] |
|||
public class TJZhuSuPlan : BaseEntity |
|||
{ |
|||
///<summary>
|
|||
///
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
|||
public string PID { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划单号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_NO", DataType = DbType.String)] |
|||
public string PLAN_NO { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///计划顺序号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_SEQ", DataType = DbType.String)] |
|||
public String PLAN_SEQ { get; set; } |
|||
|
|||
///<summary>
|
|||
///车型
|
|||
///</summary>
|
|||
// [DBColumn(ColumnName = "LINENO", DataType = DbType.String)]
|
|||
// public String LINENO { get; set; }
|
|||
|
|||
///<summary>
|
|||
///计划状态
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_STATE", DataType = DbType.String)] |
|||
public string PLAN_STATE { get; set; } |
|||
public string PLAN_STATES { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///物料号
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "MATERIAL_CODE", DataType = DbType.String)] |
|||
public string MATERIAL_CODE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料名称
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "MATERIAL_NAME", DataType = DbType.String)] |
|||
public string MATERIAL_NAME { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划数量
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "QTY", DataType = DbType.String)] |
|||
public int QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
///完成数量
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "COMPLETE_QTY", DataType = DbType.String)] |
|||
public int COMPLETE_QTY { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///计划日期
|
|||
///</summary>
|
|||
[DBColumn(ColumnName = "PLAN_DATE", DataType = DbType.DateTime)] |
|||
public DateTime PLAN_DATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATEUSER", DataType = DbType.String)] |
|||
public string CREATEUSER { get; set; } |
|||
public string CREATEUSERNAME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATEDATE", DataType = DbType.DateTime, DefaultValue = DataDefaultValue.SysDate)] |
|||
public DateTime CREATEDATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新用户
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATEUSER", DataType = DbType.String)] |
|||
public string UPDATEUSER { get; set; } |
|||
public string UPDATEUSERNAME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATEDATE", DataType = DbType.DateTime)] |
|||
public DateTime UPDATEDATE { get; set; } |
|||
|
|||
public DateTime PLANTIMESTART { get; set; } |
|||
|
|||
public DateTime PLANTIMEEND { get; set; } |
|||
|
|||
public string STARTTIMEVIEW { get; set; } |
|||
|
|||
public string ENDTIMEVIEW { get; set; } |
|||
|
|||
public string STARTTIMEIN { get; set; } |
|||
|
|||
public string ENDTIMEIN { get; set; } |
|||
|
|||
public string PLAN_DATEIN { get; set; } |
|||
|
|||
|
|||
public string AsmSetCode { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,566 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web.Mvc; |
|||
using QMAPP.Common.Web.Controllers; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMFrameWork.Data; |
|||
using QMAPP.Entity; |
|||
using QMAPP.ServicesAgent; |
|||
using System.Data; |
|||
using QMFrameWork.WebUI.QMEChart; |
|||
using QMFrameWork.WebUI.QMEChart.Data; |
|||
using System.Text; |
|||
using QMFrameWork.Log; |
|||
using ExcelOperationHelper = QMAPP.Web.Common.ExcelOperationHelper; |
|||
|
|||
using QMFrameWork.Common.ExcelOperation; |
|||
using QMAPP.FJC.Web.Models.TianJin; |
|||
using QMAPP.MD.Entity.Bucket; |
|||
using QMAPP.FJC.Web.Models; |
|||
|
|||
namespace QMAPP.FJC.Web.Controllers |
|||
{ |
|||
/// <summary>
|
|||
/// 生产发运统计
|
|||
/// 于子清
|
|||
/// 2017-10-12
|
|||
/// </summary>
|
|||
public class InjectionCountController : QController |
|||
{ |
|||
|
|||
public ActionResult QTYInjectionCount() |
|||
{ |
|||
InjectionCountModel seachModel = new InjectionCountModel(); |
|||
seachModel.TYPE_COUNT = DateTime.Now.ToString("DAY"); |
|||
seachModel.START_DATE = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
seachModel.END_DATE = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
return View(seachModel); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 异步刷新TABLE
|
|||
/// </summary>
|
|||
/// <param name="pageIndex"></param>
|
|||
/// <returns></returns>
|
|||
public ActionResult GetTable(string TYPE_COUNT, string START_DATE, string END_DATE) |
|||
{ |
|||
|
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
RawMaterialRecord condition = new RawMaterialRecord(); |
|||
condition.TYPE_COUNT = TYPE_COUNT; |
|||
condition.START_DATE = START_DATE; |
|||
condition.END_DATE = END_DATE; |
|||
|
|||
List<RawMaterialRecord> nli = new List<RawMaterialRecord>(); |
|||
try |
|||
{ |
|||
#region wcf服务统一接口
|
|||
var dataResult = wcfAgent.InvokeServiceFunction<DataResult<List<RawMaterialRecord>>>("RawMaterialRecordBLL_GetMainListB", condition); |
|||
|
|||
nli = dataResult.Result; |
|||
|
|||
#endregion
|
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
string sss = GetHTMLStr(nli); |
|||
return Json(sss); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 拼接字符串
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public string GetHTMLStr(List<RawMaterialRecord> nli) |
|||
{ |
|||
StringBuilder html = new StringBuilder(); |
|||
|
|||
|
|||
if (nli==null) |
|||
{ |
|||
return ""; |
|||
} |
|||
//拼接表头
|
|||
|
|||
Dictionary<string, int> sumDic = new Dictionary<string, int>(); |
|||
Dictionary<string, int> timeDic = new Dictionary<string, int>(); |
|||
|
|||
html.Append("<tr><td class='L1cos'></td>"); |
|||
|
|||
|
|||
List<string> headList = nli.Select(o => o.PartCode).Distinct().OrderBy(o => o.ToString()).ToList<string>(); |
|||
List<string> materialList=nli.Select(o => o.planNumber).Distinct().OrderBy(o =>o.ToString()).ToList<string>(); |
|||
|
|||
materialList.Add("合计"); |
|||
|
|||
foreach (var str in headList) |
|||
{ |
|||
html.AppendFormat("<td>{0}</td>", str); |
|||
sumDic[str]=0; |
|||
} |
|||
|
|||
html.Append("<td style='background-color:#ECF5FF'>合计</td>"); |
|||
html.Append("</tr>"); |
|||
|
|||
|
|||
|
|||
for (int i = 0; i < materialList.Count; i++) |
|||
{ |
|||
timeDic[materialList[i]] = 0; |
|||
|
|||
if (materialList[i] != "合计") |
|||
{ |
|||
//增加行
|
|||
html.Append("<tr>"); |
|||
|
|||
//增加类型
|
|||
//html.AppendFormat("<td>{0}</td>", materialList[i]);
|
|||
|
|||
var ss = nli.Where(p => p.planNumber == materialList[i]).ToList()[0].planNumber; |
|||
|
|||
html.AppendFormat("<td>{0}</td>", ss); |
|||
|
|||
for (int j = 0; j < headList.Count; j++) |
|||
{ |
|||
int countValue=0; |
|||
if (nli.Exists(o => (o.planNumber) == materialList[i] && o.PartCode == headList[j])) |
|||
{ |
|||
var no= nli.First(o => (o.planNumber) == materialList[i] && o.PartCode == headList[j]); |
|||
html.AppendFormat("<td>{0}</td>", no.RawMaterialCount.ToString()); |
|||
countValue=Convert.ToInt32(no.RawMaterialCount); |
|||
} |
|||
else |
|||
{ |
|||
html.AppendFormat("<td></td>", materialList[i]); |
|||
} |
|||
|
|||
sumDic[headList[j]] = sumDic[headList[j]] + countValue; |
|||
timeDic[materialList[i]] = timeDic[materialList[i]] + countValue; |
|||
} |
|||
|
|||
html.AppendFormat("<td style='background-color:#ECF5FF'>{0}</td>", timeDic[materialList[i]].ToString()); |
|||
|
|||
|
|||
html.Append("</tr>"); |
|||
} |
|||
else |
|||
{ |
|||
//增加行
|
|||
html.Append("<tr style='background-color:#ECF5FF'>"); |
|||
|
|||
html.AppendFormat("<td>合计</td>"); |
|||
//html.AppendFormat("<td class='L1cos'></td>");
|
|||
|
|||
for (int j = 0; j < headList.Count; j++) |
|||
{ |
|||
html.AppendFormat("<td>{0}</td>", sumDic[headList[j]].ToString()); |
|||
} |
|||
|
|||
html.AppendFormat("<td>{0}</td>",timeDic.Values.Sum().ToString()); |
|||
|
|||
html.Append("</tr>"); |
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
return html.ToString(); |
|||
} |
|||
|
|||
#region
|
|||
/// <summary>
|
|||
/// 堆积柱状图
|
|||
/// </summary>
|
|||
/// <returns>处理结果</returns>
|
|||
[HandleException] |
|||
public ActionResult GetEchartDataBar2() |
|||
{ |
|||
InjectionCountModel seachModel = null; |
|||
DataPage page = null; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
RawMaterialRecord condition = null; |
|||
List<RawMaterialRecord> nli = new List<RawMaterialRecord>(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<InjectionCountModel>(); |
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<RawMaterialRecord, InjectionCountModel>(seachModel); |
|||
#region wcf服务统一接口
|
|||
var dataResult = wcfAgent.InvokeServiceFunction<DataResult<List<RawMaterialRecord>>>("RawMaterialRecordBLL_GetMainListB", condition); |
|||
|
|||
nli = dataResult.Result; |
|||
|
|||
#endregion
|
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
|
|||
#region 源数据定义
|
|||
|
|||
//生成数据
|
|||
List<TestEChartModel> dataList = new List<TestEChartModel>(); |
|||
|
|||
|
|||
if (nli == null) |
|||
{ |
|||
nli = new List<RawMaterialRecord>(); |
|||
dataList.Add(new TestEChartModel() { Week = "", Value = "0", TypeValue = " ", StackValue = "产品数量!" }); |
|||
} |
|||
|
|||
foreach (RawMaterialRecord item in nli) |
|||
{ |
|||
dataList.Add(new TestEChartModel() { Week = item.PartCode, Value = item.RawMaterialCount, TypeValue = item.planNumber, StackValue = "产品数量!" }); |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
#region 默认设置
|
|||
|
|||
QMEChartBar chartLBar = new QMEChartBar() { BarType = "bar2" }; |
|||
|
|||
//设置源数据列表
|
|||
chartLBar.DataList = dataList; |
|||
|
|||
#region 设置标题
|
|||
//不为空时显示Title,为空时不显示
|
|||
//chartLBar.Title = new QMECTitle();
|
|||
//chartLBar.Title.Text = "";
|
|||
//chartLBar.Title.Subtext = "";
|
|||
#endregion
|
|||
|
|||
#region Tooltip提示窗口设置
|
|||
|
|||
//是否显示ToolTip工具条
|
|||
chartLBar.HaveTooltip = true; |
|||
|
|||
#endregion
|
|||
|
|||
#region Legend图例设置
|
|||
//是否有Legend
|
|||
chartLBar.HaveLegend = true; |
|||
//Legend的自动统计字段,对应chartLine.DataList中用于统计的字段
|
|||
chartLBar.LegendField = "TypeValue"; |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
#region Toolbox工具栏设置
|
|||
//是否存在工具栏,为空时使用默认设置
|
|||
chartLBar.HaveToolBox = false; |
|||
|
|||
#endregion
|
|||
|
|||
#region XAxis横坐标轴设置
|
|||
//为空时使用默认值并从数据源中统计类型,需要设置DataList数据源
|
|||
chartLBar.HaveXAxis = true; |
|||
//设置X轴统计类型字段
|
|||
chartLBar.XAxisField = "Week"; |
|||
#endregion
|
|||
|
|||
#region YAxis纵坐标轴设置
|
|||
//设置Y轴显示格式。
|
|||
chartLBar.HaveYAxis = true; |
|||
//自定义设置
|
|||
chartLBar.YAxis = new QMECYAxis() { AxisLabel = new QMECAxisLabel() }; |
|||
chartLBar.YAxis.Type = "value"; |
|||
#endregion
|
|||
|
|||
#region 堆积字段设置
|
|||
|
|||
//堆积字段,是否是堆积图形
|
|||
chartLBar.StackField = "StackValue"; |
|||
#endregion
|
|||
|
|||
#region 生成图表所需要数据格式
|
|||
//转换数据格式,值字段
|
|||
chartLBar.ValueField = "Value"; |
|||
chartLBar.Series = QMEChartHelper.CovertDataToSeries(chartLBar); |
|||
#endregion
|
|||
|
|||
#region 辅助线设置,有则设置,没有则无需设置
|
|||
//设置辅助线
|
|||
QMECMarkLine ml = new QMECMarkLine() { ItemStyle = new QMECItemStyle() { Normal = new QMECNormal() { LineStyle = new QMECLineStyle() } }, LineData = new List<QMECPoint>() }; |
|||
ml.ItemStyle.Normal.LineStyle = new QMECLineStyle() { Type = "dashed", Width = 1 }; |
|||
List<QMECMarkPoint> mp = new List<QMECMarkPoint>(); |
|||
QMECPoint mpstart = new QMECPoint(); |
|||
QMECPoint mpend = new QMECPoint(); |
|||
mpstart.Type = "min"; |
|||
mpend.Type = "max"; |
|||
ml.LineData.Add(mpstart); |
|||
ml.LineData.Add(mpend); |
|||
|
|||
foreach (QMECSerie ser in chartLBar.Series) |
|||
{ |
|||
if (ser.Name == "搜索引擎") |
|||
{ |
|||
ser.MarkLine = ml; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
return Content(QMEChartHelper.QMECHelper<QMEChartBar>(chartLBar)); |
|||
|
|||
#endregion
|
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
|
|||
#region 导出图片
|
|||
|
|||
[HttpPost] |
|||
[HandleException] |
|||
public ActionResult ExportBanCi() |
|||
{ |
|||
string imgSend = Request.Form["hiChartImg"]; |
|||
imgSend = imgSend.Replace(" ", "+"); |
|||
string[] contents = imgSend.Split(','); |
|||
imgSend = contents[1]; |
|||
byte[] content = Convert.FromBase64String(imgSend); |
|||
|
|||
System.Web.Mvc.FileContentResult result = null; |
|||
|
|||
result = new System.Web.Mvc.FileContentResult(content, "application/png"); |
|||
|
|||
result.FileDownloadName = System.Web.HttpUtility.UrlEncode("生产发运统计.png", System.Text.Encoding.UTF8); |
|||
|
|||
return result; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导出excel
|
|||
/// <summary>
|
|||
/// 导出excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HandleException] |
|||
public ActionResult ExportExcel() |
|||
{ |
|||
InjectionCountModel seachModel = null; |
|||
RawMaterialRecord condition = null; |
|||
DataTable exportDt = new DataTable(); |
|||
string selectKey = Request["selectKey"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<InjectionCountModel>(); |
|||
condition = CopyToModel<RawMaterialRecord, InjectionCountModel>(seachModel); |
|||
//获取数据
|
|||
var dataResult = wcfAgent.InvokeServiceFunction<DataTable>("RawMaterialRecordBLL_GetExportData", condition); |
|||
exportDt = dataResult; |
|||
//通过返回dataResult判断
|
|||
//if (dataResult.Ex != null)
|
|||
//{
|
|||
// throw dataResult.Ex;
|
|||
//}
|
|||
//else if (dataResult.IsSuccess)
|
|||
//{
|
|||
// exportDt = dataResult.Result;
|
|||
//}
|
|||
//else
|
|||
//{
|
|||
// SetMessage(dataResult.Msg);
|
|||
// return View(true);
|
|||
//}
|
|||
|
|||
//根据所选信息进行导出
|
|||
//if (!String.IsNullOrEmpty(selectKey))
|
|||
//{
|
|||
// DataView dv = new DataView(exportDt);
|
|||
// string strWhere = "";
|
|||
// string[] list = selectKey.Split(":".ToCharArray());
|
|||
// foreach (string ID in list)
|
|||
// {
|
|||
// strWhere += " PID='" + ID + "' or";
|
|||
// }
|
|||
// if (strWhere != "")
|
|||
// {
|
|||
// strWhere = strWhere.Remove((strWhere.Length - 2), 2);
|
|||
// }
|
|||
// dv.RowFilter = strWhere;
|
|||
// exportDt = dv.ToTable();
|
|||
//}
|
|||
|
|||
//导出
|
|||
IEExcelHelper ieExcelHelper = new IEExcelHelper(); |
|||
var sheetInfoName = "RawMaterialRecordExp"; |
|||
|
|||
var sheetInfo = ieExcelHelper.GetMainInfo(sheetInfoName); |
|||
var fileName = System.Guid.NewGuid().ToString() + ".xlsx"; |
|||
ieExcelHelper.ExportExcel(sheetInfo, exportDt, ExcelOperationHelper.GetTempPath() + fileName, true); |
|||
return Content(fileName); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo { ErrorInfo = ex, Info = "导出excel", Tag = "电量统计" }); |
|||
SetMessage("导出excel失败"); |
|||
return View(true); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 导出文件
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public ActionResult ExportFile(int Trend) |
|||
{ |
|||
String filePath = ExcelOperationHelper.GetTempPath(); |
|||
String fileName = Request["FileName"]; |
|||
var sheetInfoName = "电量统计.xlsx"; |
|||
ExcelOperationHelper.FileDownload(Response, filePath + fileName, sheetInfoName); |
|||
return Content(""); |
|||
} |
|||
#endregion
|
|||
|
|||
//#region 导出excel
|
|||
|
|||
|
|||
//#region 导出excel
|
|||
///// <summary>
|
|||
///// 导出excel
|
|||
///// </summary>
|
|||
///// <returns>结果</returns>
|
|||
//[HttpPost]
|
|||
//public ActionResult ExportExcel()
|
|||
//{
|
|||
// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
// {
|
|||
// file.WriteLine("==1111===");
|
|||
// }
|
|||
// InjectionCountModel seachModel = null;
|
|||
// RawMaterialRecord condition = null;
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
// DataTable result = new DataTable();
|
|||
// string selectKey = Request.Form["selectKey"];
|
|||
// try
|
|||
// {
|
|||
// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
// {
|
|||
// file.WriteLine("==2222===");
|
|||
// }
|
|||
// //获取查询对象
|
|||
// seachModel = GetModel<InjectionCountModel>();
|
|||
// condition = CopyToModel<RawMaterialRecord, InjectionCountModel>(seachModel);
|
|||
// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
// {
|
|||
// file.WriteLine("==3333===");
|
|||
// }
|
|||
// //获取数据
|
|||
// result = wcfAgent.InvokeServiceFunction<DataTable>(QMAPP.ServicesAgent.B9BasicService.RawMaterialRecordBLL_GetExportData.ToString(), condition);
|
|||
// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
// {
|
|||
// file.WriteLine("==444===");
|
|||
// }
|
|||
// //导出
|
|||
// QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
|
|||
// return efTool.GetExcelFileResult("RawMaterialRecordExp", "加工信息.xlsx", result);
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
//#endregion
|
|||
|
|||
/////// <summary>
|
|||
/////// 导出excel
|
|||
/////// </summary>
|
|||
/////// <returns>结果</returns>
|
|||
////[HandleException]
|
|||
////public ActionResult ExportExcel()
|
|||
////{
|
|||
//// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
//// {
|
|||
//// file.WriteLine("==1111===");
|
|||
//// }
|
|||
|
|||
//// InjectionCountModel seachModel = null;
|
|||
//// RawMaterialRecord condition = null;
|
|||
//// DataTable exportDt = new DataTable();
|
|||
//// string selectKey = Request["selectKey"];
|
|||
//// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
//// try
|
|||
//// {
|
|||
//// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
//// {
|
|||
//// file.WriteLine("==22222===");
|
|||
//// }
|
|||
//// //获取查询对象
|
|||
//// seachModel = GetModel<InjectionCountModel>();
|
|||
//// condition = CopyToModel<RawMaterialRecord, InjectionCountModel>(seachModel);
|
|||
|
|||
//// //condition.TYPE_COUNT = TYPE_COUNT;
|
|||
//// //condition.START_DATE = START_DATE;
|
|||
//// //condition.END_DATE = END_DATE;
|
|||
//// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
//// {
|
|||
//// file.WriteLine("==33333===");
|
|||
//// }
|
|||
//// //获取数据
|
|||
//// var dataResult = wcfAgent.InvokeServiceFunction<DataTable>("RawMaterialRecordBLL_GetExportData", condition);
|
|||
//// using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"D:\ceshi\WriteLines.txt", true))
|
|||
//// {
|
|||
//// file.WriteLine("==4444===");
|
|||
//// }
|
|||
//// //通过返回dataResult判断
|
|||
//// exportDt = dataResult;
|
|||
|
|||
//// //根据所选信息进行导出
|
|||
//// //if (!String.IsNullOrEmpty(selectKey))
|
|||
//// //{
|
|||
//// // DataView dv = new DataView(exportDt);
|
|||
//// // string strWhere = "";
|
|||
//// // string[] list = selectKey.Split(":".ToCharArray());
|
|||
//// // foreach (string ID in list)
|
|||
//// // {
|
|||
//// // strWhere += " PID='" + ID + "' or";
|
|||
//// // }
|
|||
//// // if (strWhere != "")
|
|||
//// // {
|
|||
//// // strWhere = strWhere.Remove((strWhere.Length - 2), 2);
|
|||
//// // }
|
|||
//// // dv.RowFilter = strWhere;
|
|||
//// // exportDt = dv.ToTable();
|
|||
//// //}
|
|||
|
|||
//// //导出
|
|||
//// IEExcelHelper ieExcelHelper = new IEExcelHelper();
|
|||
//// var sheetInfoName = "RawMaterialRecordExp";
|
|||
|
|||
//// var sheetInfo = ieExcelHelper.GetMainInfo(sheetInfoName);
|
|||
//// var fileName = System.Guid.NewGuid().ToString() + ".xlsx";
|
|||
//// ieExcelHelper.ExportExcel(sheetInfo, exportDt, ExcelOperationHelper.GetTempPath() + fileName, true);
|
|||
//// return Content(fileName);
|
|||
//// }
|
|||
//// catch (Exception ex)
|
|||
//// {
|
|||
//// LogManager.LogHelper.Error(new LogInfo { ErrorInfo = ex, Info = "导出excel", Tag = "耗电量统计" });
|
|||
//// SetMessage("导出excel失败");
|
|||
//// return View(true);
|
|||
//// }
|
|||
////}
|
|||
|
|||
///// <summary>
|
|||
///// 导出文件
|
|||
///// </summary>
|
|||
///// <returns></returns>
|
|||
//public ActionResult ExportFile(int Trend)
|
|||
//{
|
|||
// String filePath = ExcelOperationHelper.GetTempPath();
|
|||
// String fileName = Request["FileName"];
|
|||
// var sheetInfoName = "耗电量统计.xlsx";
|
|||
// ExcelOperationHelper.FileDownload(Response, filePath + fileName, sheetInfoName);
|
|||
// return Content("");
|
|||
//}
|
|||
//#endregion
|
|||
} |
|||
} |
@ -0,0 +1,581 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.Mvc; |
|||
using QMAPP.Common.Web.Controllers; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMAPP.FJC.Web.Models.TianJin; |
|||
using QMFrameWork.Data; |
|||
using QMAPP.ServicesAgent; |
|||
using QMAPP.FJC.Entity.TianJin; |
|||
using QMAPP.Entity; |
|||
using QMFrameWork.WebUI.DataSource; |
|||
using QMFrameWork.Common.Serialization; |
|||
using System.Data; |
|||
using QMAPP.Common.Web.Models; |
|||
using QMAPP.FJC.Entity.Basic; |
|||
using QMAPP.MD.Entity; |
|||
using QMAPP.FJC.BLL.TianJin; |
|||
|
|||
namespace QMAPP.FJC.Web.Controllers |
|||
{ |
|||
/// <summary>
|
|||
/// 投入产出--泡沫计划
|
|||
/// 作 者:张松男
|
|||
/// 时 间:2021年12月28日
|
|||
/// </summary>
|
|||
public class TJPaoMoPlanController : QController |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 加载列表
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HandleException] |
|||
public ActionResult List(bool? callback) |
|||
{ |
|||
TJPaoMoPlanModel seachModel = new TJPaoMoPlanModel(); |
|||
seachModel.PLANTIMESTART = DateTime.Now.Date.AddDays(-10).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
seachModel.PLANTIMEEND = DateTime.Now.Date.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
seachModel.PLAN_STATE = "0"; |
|||
seachModel.ImmediateSearch = false; |
|||
if (callback == true) |
|||
TryGetSelectBuffer<TJPaoMoPlanModel>(out seachModel); |
|||
seachModel.rownumbers = false; |
|||
seachModel.url = "/TJPaoMoPlan/GetList"; |
|||
return View("TJPaoMoPlanList", seachModel); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="callBack">是否回调</param>
|
|||
/// <returns>列表</returns>
|
|||
[HandleException] |
|||
public ActionResult GetList(bool? callBack) |
|||
{ |
|||
TJPaoMoPlanModel seachModel = null; |
|||
DataPage page = null; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
TJPaoMoPlan condition = null; |
|||
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJPaoMoPlanModel>(); |
|||
#region 获取缓存值
|
|||
if (callBack != null) |
|||
{ |
|||
TryGetSelectBuffer<TJPaoMoPlanModel>(out seachModel); |
|||
} |
|||
else |
|||
{ |
|||
//保存搜索条件
|
|||
SetSelectBuffer<TJPaoMoPlanModel>(seachModel); |
|||
} |
|||
#endregion
|
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<TJPaoMoPlan, TJPaoMoPlanModel>(seachModel); |
|||
|
|||
#region wcf服务统一接口
|
|||
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("TJPaoMoPlanBLL_GetList", condition, page); |
|||
if (pageResult.IsSuccess == false) |
|||
{ |
|||
SetMessage(pageResult.Msg); |
|||
return List(true); |
|||
} |
|||
DateGridResult<TJPaoMoPlan> result = new DateGridResult<TJPaoMoPlan>(); |
|||
result.Total = pageResult.Result.RecordCount; |
|||
result.Rows = JsonConvertHelper.GetDeserialize<List<TJPaoMoPlan>>(pageResult.Result.Result.ToString()); |
|||
#endregion
|
|||
|
|||
return Content(result.GetJsonSource()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 编辑
|
|||
/// <summary>
|
|||
/// 编辑载入
|
|||
/// </summary>
|
|||
/// <returns>处理结果</returns>
|
|||
[HandleException] |
|||
public ActionResult Edit() |
|||
{ |
|||
TJPaoMoPlanModel model = new TJPaoMoPlanModel(); |
|||
string ID = Request.Params["PID"]; |
|||
TJPaoMoPlan Entity = new TJPaoMoPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<TJPaoMoPlan> result = new DataResult<TJPaoMoPlan>(); |
|||
try |
|||
{ |
|||
if (string.IsNullOrEmpty(ID) == false) |
|||
{ |
|||
//修改获取原数据
|
|||
Entity.PID = ID; |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<TJPaoMoPlan>>("TJPaoMoPlanBLL_Get", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return View("TJPaoMoPlanEdit", model); |
|||
} |
|||
|
|||
model = CopyToModel<TJPaoMoPlanModel, TJPaoMoPlan>(result.Result); |
|||
|
|||
} |
|||
return View("TJPaoMoPlanEdit", model); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 保存
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns>处理结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
[ValidateInput(false)] |
|||
public ActionResult Save(TJPaoMoPlanModel saveModel) |
|||
{ |
|||
TJPaoMoPlan Entity = null; |
|||
string TYPE = Request.Form["ORDER_TYPE"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
try |
|||
{ |
|||
Entity = CopyToModel<TJPaoMoPlan, TJPaoMoPlanModel>(saveModel); |
|||
if (string.IsNullOrEmpty(Entity.PID) == true) |
|||
{ |
|||
//新增
|
|||
//Entity.ORDER_TYPE = TYPE;
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJPaoMoPlanBLL_Insert", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage("计划单号已存在!"); |
|||
return View("TJPaoMoPlanEdit", saveModel); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
//修改
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJPaoMoPlanBLL_Update", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return View("TJPaoMoPlanEdit", saveModel); |
|||
} |
|||
} |
|||
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 删除
|
|||
/// <summary>
|
|||
/// 删除
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
public ActionResult Delete(TJPaoMoPlan model) |
|||
{ |
|||
string selectKey = Request.Form["selectKey"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
try |
|||
{ |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJPaoMoPlanBLL_Delete", selectKey); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return List(true); |
|||
} |
|||
SetMessage(AppResource.DeleteMessage); |
|||
return List(true); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布
|
|||
/// <summary>
|
|||
/// 发布
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
public ActionResult PutOut(TJPaoMoPlan model) |
|||
{ |
|||
string selectKey = Request.Form["selectKey"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJPaoMoPlanBLL_PutOut", selectKey); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return List(true); |
|||
} |
|||
SetMessage(AppResource.PutOutMessage); |
|||
return List(true); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导出excel
|
|||
/// <summary>
|
|||
/// 导出excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult ExportExcel() |
|||
{ |
|||
TJPaoMoPlanModel seachModel = null; |
|||
TJPaoMoPlan condition = null; |
|||
DataTable exportDt = new DataTable(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJPaoMoPlanModel>(); |
|||
condition = CopyToModel<TJPaoMoPlan, TJPaoMoPlanModel>(seachModel); |
|||
//获取数据
|
|||
TJPaoMoPlanBLL dp = new TJPaoMoPlanBLL(); |
|||
exportDt = dp.GetExportData(condition); |
|||
//exportDt = wcfAgent.InvokeServiceFunction<DataTable>("TJPaoMoPlanBLL_GetExportData", condition);
|
|||
|
|||
//导出
|
|||
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool(); |
|||
return efTool.GetExcelFileResult("TJPaoMoPlanExp", "门板计划信息.xlsx", exportDt); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导入excel
|
|||
/// <summary>
|
|||
/// 导入excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult ImportExcel() |
|||
{ |
|||
DataTable dt = null; |
|||
List<TJPaoMoPlan> list = new List<TJPaoMoPlan>(); |
|||
DataResult<ImportMessage> serviceResult = null; |
|||
string fileName = Request.Form["fileName"]; |
|||
string orderby = Request.Form["ORDER_TYPE"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
|
|||
Materiel materialmodel = new Materiel(); |
|||
ProduceShift produceshiftmodel = new ProduceShift(); |
|||
MachineInfo machine = new MachineInfo(); |
|||
//初始工作中心编号条件
|
|||
QMAPP.MD.Entity.WorkCell workcell = new QMAPP.MD.Entity.WorkCell(); |
|||
workcell.WORKCELL_CODE = orderby; |
|||
|
|||
try |
|||
{ |
|||
dt = this.GetTableByExcel("TJPaoMoPlanImp", fileName, dt); |
|||
//格式转换
|
|||
list = QMFrameWork.Common.Util.BindHelper.ConvertToList<TJPaoMoPlan>(dt).ToList(); |
|||
serviceResult = wcfAgent.InvokeServiceFunction<DataResult<ImportMessage>>("TJPaoMoPlanBLL_GetImportData", list, materialmodel,machine, produceshiftmodel, workcell); |
|||
if (serviceResult.Ex != null) |
|||
{ |
|||
throw serviceResult.Ex; |
|||
} |
|||
if (serviceResult.Result.failureNum != 0) |
|||
{ |
|||
foreach (RowError error in serviceResult.Result.Errors) |
|||
{ |
|||
dt.Rows[error.Key - 1]["InfoError"] = error.Value; |
|||
} |
|||
ImportMessageModel model = new ImportMessageModel(); |
|||
model.InfoName = "TJPaoMoPlanImp"; |
|||
model.ReturnUrl = "/TJPaoMoPlan/List?callBack=true"; |
|||
model.Message = serviceResult.Result; |
|||
model.ErrorDt = dt; |
|||
return new MessageOutputController().OutputImportMessage(model); |
|||
} |
|||
else |
|||
{ |
|||
SetMessage(serviceResult.Msg + ",如下:<br/>" |
|||
+ "插入" + serviceResult.Result.insertNum + "条," |
|||
+ "更新" + serviceResult.Result.updateNum + "条" |
|||
); |
|||
return List(true); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
finally |
|||
{ |
|||
System.IO.File.Delete(MvcApplication.TempPath + fileName); |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 下载模板
|
|||
/// <summary>
|
|||
/// 下载导入模板
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult GetTemplate() |
|||
{ |
|||
try |
|||
{ |
|||
string path = AppDomain.CurrentDomain.BaseDirectory + "App_Data/Excel/"; |
|||
string fileName = "TJPaoMoPlanImp.xlsx"; |
|||
return File(path + fileName, "application/vnd.ms-excel", Url.Encode("门板发运导入模板.xlsx")); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
|
|||
|
|||
//#region 整车添加物料信息
|
|||
///// <summary>
|
|||
///// 编辑载入
|
|||
///// </summary>
|
|||
///// <returns>处理结果</returns>
|
|||
//[HandleException]
|
|||
//public ActionResult AddMaterial()
|
|||
//{
|
|||
// TJPaoMoPlanModel model = new TJPaoMoPlanModel();
|
|||
// string ID = Request.Params["PID"];
|
|||
// string TYPE = Request.Params["ORDER_TYPE"];
|
|||
// TJPaoMoPlan Entity = new TJPaoMoPlan();
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
// DataResult<TJPaoMoPlan> result = new DataResult<TJPaoMoPlan>();
|
|||
// try
|
|||
// {
|
|||
// model.ORDER_TYPE = TYPE;
|
|||
// return View("AddMaterialEdit", model);
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
|
|||
///// <summary>
|
|||
///// 保存
|
|||
///// </summary>
|
|||
///// <param name="model"></param>
|
|||
///// <returns>处理结果</returns>
|
|||
//[HttpPost]
|
|||
//[HandleException]
|
|||
//[ValidateInput(false)]
|
|||
//public ActionResult SaveMaterial(TJPaoMoPlanModel saveModel)
|
|||
//{
|
|||
|
|||
// Material condition = new Material();
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
|
|||
// condition.MATERIAL_CODE = saveModel.MATERIAL_CODE;
|
|||
// Material material = wcfAgent.InvokeServiceFunction<Material>("MaterialBLL_GetMaterialInfo", condition);
|
|||
|
|||
// if (!string.IsNullOrEmpty(material.PID))
|
|||
// {
|
|||
// saveModel.MATERIAL_NAME = material.MATERIAL_NAME;
|
|||
// saveModel.COLOR = material.COLOR;
|
|||
// saveModel.HBTYPE = material.HBTYPE;
|
|||
// return View("AddWholeDoorEdit", saveModel);
|
|||
// }
|
|||
// return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge));
|
|||
//}
|
|||
//#endregion
|
|||
|
|||
#region 整车添加物料信息
|
|||
//[HandleException]
|
|||
//public ActionResult AddSendDetail(bool? callBack)
|
|||
//{
|
|||
// //实例化服务
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
// QMAPP.MD.Web.Models.MaterialModel seachModel = null;
|
|||
// DataResult<DataPage> pageResult = new DataResult<DataPage>();
|
|||
// DataPage page = new DataPage();
|
|||
// string Fisid = Request["MATERIAL_CODE"].ToString();
|
|||
// FISAssembly MaterialAssInfo = wcfAgent.InvokeServiceFunction<FISAssembly>("TJPaoMoPlanBLL_GetFISMaterialInfoCD", Fisid);
|
|||
// string materials = "('" + MaterialAssInfo.MESModulFL + "','" + MaterialAssInfo.MESModulFR + "','" + MaterialAssInfo.MESModulRL + "','" + MaterialAssInfo.MESModulRR + "')";
|
|||
// //物料发货明细实体
|
|||
// Material detail = new Material()
|
|||
// {
|
|||
// MaterialCodes = materials,
|
|||
// };
|
|||
// try
|
|||
// {
|
|||
// //获取查询对象
|
|||
// seachModel = GetModel<QMAPP.MD.Web.Models.MaterialModel>();
|
|||
// #region 获取缓存值
|
|||
// if (callBack != null)
|
|||
// {
|
|||
// TryGetSelectBuffer<QMAPP.MD.Web.Models.MaterialModel>(out seachModel);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// //保存搜索条件
|
|||
// SetSelectBuffer<QMAPP.MD.Web.Models.MaterialModel>(seachModel);
|
|||
// }
|
|||
// #endregion
|
|||
// //获取前台分页设置信息
|
|||
// page = this.GetDataPage(seachModel);
|
|||
// pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("MaterialBLL_GetList", detail, page);
|
|||
// if (pageResult.IsSuccess == false)
|
|||
// {
|
|||
// SetMessage(pageResult.Msg);
|
|||
// return List(true);
|
|||
// }
|
|||
// DateGridResult<Material> result = new DateGridResult<Material>();
|
|||
// result.Total = pageResult.Result.RecordCount;
|
|||
// result.Rows = JsonConvertHelper.GetDeserialize<List<Material>>(pageResult.Result.Result.ToString());
|
|||
// for (var i = 0; i < result.Total; i++)
|
|||
// {
|
|||
// result.Rows[i].AsmSetCode = MaterialAssInfo.AsmSetCode;
|
|||
// }
|
|||
// return Content(result.GetJsonSource());
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 门板顺序号编辑
|
|||
/// <summary>
|
|||
/// 门板顺序号编辑
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public ActionResult DoorPlankEditSeq() |
|||
{ |
|||
TJPaoMoPlanModel model = new TJPaoMoPlanModel(); |
|||
TJPaoMoPlan Entity = new TJPaoMoPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<TJPaoMoPlan> result = new DataResult<TJPaoMoPlan>(); |
|||
try |
|||
{ |
|||
model = GetModel<TJPaoMoPlanModel>(); |
|||
return View("DoorPlankEditSeq", model); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
|
|||
#region 获取编辑系列号列表
|
|||
/// <summary>
|
|||
/// 获取编辑系列号列表
|
|||
/// </summary>
|
|||
/// <param name="callBack"></param>
|
|||
/// <returns></returns>
|
|||
[HandleException] |
|||
public ActionResult GetTJPaoMoPlanList(bool? callBack) |
|||
{ |
|||
TJPaoMoPlanModel seachModel = null; |
|||
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
|||
DataPage page = new DataPage(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
TJPaoMoPlan condition = new TJPaoMoPlan(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJPaoMoPlanModel>(); |
|||
|
|||
//condition.PIDList =seachModel.PIDList;
|
|||
//condition.ORDER_TYPE = seachModel.ORDER_TYPE;
|
|||
|
|||
#region 获取缓存值
|
|||
if (callBack != null) |
|||
{ |
|||
TryGetSelectBuffer<TJPaoMoPlanModel>(out seachModel); |
|||
} |
|||
else |
|||
{ |
|||
//保存搜索条件
|
|||
SetSelectBuffer<TJPaoMoPlanModel>(seachModel); |
|||
} |
|||
#endregion
|
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<TJPaoMoPlan, TJPaoMoPlanModel>(seachModel); |
|||
|
|||
#region wcf服务统一接口
|
|||
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("TJPaoMoPlanBLL_GetTJPaoMoPlanList", condition, page); |
|||
if (pageResult.IsSuccess == false) |
|||
{ |
|||
SetMessage(pageResult.Msg); |
|||
return List(true); |
|||
} |
|||
DateGridResult<TJPaoMoPlan> result = new DateGridResult<TJPaoMoPlan>(); |
|||
result.Total = pageResult.Result.RecordCount; |
|||
result.Rows = JsonConvertHelper.GetDeserialize<List<TJPaoMoPlan>>(pageResult.Result.Result.ToString()); |
|||
#endregion
|
|||
return Content(result.GetJsonSource()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 保存顺序号修改
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns>处理结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
[ValidateInput(false)] |
|||
public ActionResult TJPaoMoPlanSeqSave(TJPaoMoPlanModel saveModel) |
|||
{ |
|||
TJPaoMoPlan entity = new TJPaoMoPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
|
|||
entity.PLAN_SEQ = saveModel.PLAN_SEQ; |
|||
//entity.PIDList = saveModel.PIDList;
|
|||
|
|||
entity = CopyToModel<TJPaoMoPlan, TJPaoMoPlanModel>(saveModel); |
|||
|
|||
//修改
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJPaoMoPlanBLL_UpdateTJPaoMoPlanSeq", entity); |
|||
|
|||
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,581 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.Mvc; |
|||
using QMAPP.Common.Web.Controllers; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMAPP.FJC.Web.Models.TianJin; |
|||
using QMFrameWork.Data; |
|||
using QMAPP.ServicesAgent; |
|||
using QMAPP.FJC.Entity.TianJin; |
|||
using QMAPP.Entity; |
|||
using QMFrameWork.WebUI.DataSource; |
|||
using QMFrameWork.Common.Serialization; |
|||
using System.Data; |
|||
using QMAPP.Common.Web.Models; |
|||
using QMAPP.FJC.Entity.Basic; |
|||
using QMAPP.MD.Entity; |
|||
using QMAPP.FJC.BLL.TianJin; |
|||
|
|||
namespace QMAPP.FJC.Web.Controllers |
|||
{ |
|||
/// <summary>
|
|||
/// 投入产出--注塑计划
|
|||
/// 作 者:张松男
|
|||
/// 时 间:2021年12月28日
|
|||
/// </summary>
|
|||
public class TJZhuSuPlanController : QController |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 加载列表
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HandleException] |
|||
public ActionResult List(bool? callback) |
|||
{ |
|||
TJZhuSuPlanModel seachModel = new TJZhuSuPlanModel(); |
|||
seachModel.PLANTIMESTART = DateTime.Now.Date.AddDays(-10).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
seachModel.PLANTIMEEND = DateTime.Now.Date.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"); |
|||
seachModel.PLAN_STATE = "0"; |
|||
seachModel.ImmediateSearch = false; |
|||
if (callback == true) |
|||
TryGetSelectBuffer<TJZhuSuPlanModel>(out seachModel); |
|||
seachModel.rownumbers = false; |
|||
seachModel.url = "/TJZhuSuPlan/GetList"; |
|||
return View("TJZhuSuPlanList", seachModel); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="callBack">是否回调</param>
|
|||
/// <returns>列表</returns>
|
|||
[HandleException] |
|||
public ActionResult GetList(bool? callBack) |
|||
{ |
|||
TJZhuSuPlanModel seachModel = null; |
|||
DataPage page = null; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
TJZhuSuPlan condition = null; |
|||
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJZhuSuPlanModel>(); |
|||
#region 获取缓存值
|
|||
if (callBack != null) |
|||
{ |
|||
TryGetSelectBuffer<TJZhuSuPlanModel>(out seachModel); |
|||
} |
|||
else |
|||
{ |
|||
//保存搜索条件
|
|||
SetSelectBuffer<TJZhuSuPlanModel>(seachModel); |
|||
} |
|||
#endregion
|
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<TJZhuSuPlan, TJZhuSuPlanModel>(seachModel); |
|||
|
|||
#region wcf服务统一接口
|
|||
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("TJZhuSuPlanBLL_GetList", condition, page); |
|||
if (pageResult.IsSuccess == false) |
|||
{ |
|||
SetMessage(pageResult.Msg); |
|||
return List(true); |
|||
} |
|||
DateGridResult<TJZhuSuPlan> result = new DateGridResult<TJZhuSuPlan>(); |
|||
result.Total = pageResult.Result.RecordCount; |
|||
result.Rows = JsonConvertHelper.GetDeserialize<List<TJZhuSuPlan>>(pageResult.Result.Result.ToString()); |
|||
#endregion
|
|||
|
|||
return Content(result.GetJsonSource()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 编辑
|
|||
/// <summary>
|
|||
/// 编辑载入
|
|||
/// </summary>
|
|||
/// <returns>处理结果</returns>
|
|||
[HandleException] |
|||
public ActionResult Edit() |
|||
{ |
|||
TJZhuSuPlanModel model = new TJZhuSuPlanModel(); |
|||
string ID = Request.Params["PID"]; |
|||
TJZhuSuPlan Entity = new TJZhuSuPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<TJZhuSuPlan> result = new DataResult<TJZhuSuPlan>(); |
|||
try |
|||
{ |
|||
if (string.IsNullOrEmpty(ID) == false) |
|||
{ |
|||
//修改获取原数据
|
|||
Entity.PID = ID; |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<TJZhuSuPlan>>("TJZhuSuPlanBLL_Get", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return View("TJZhuSuPlanEdit", model); |
|||
} |
|||
|
|||
model = CopyToModel<TJZhuSuPlanModel, TJZhuSuPlan>(result.Result); |
|||
|
|||
} |
|||
return View("TJZhuSuPlanEdit", model); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 保存
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns>处理结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
[ValidateInput(false)] |
|||
public ActionResult Save(TJZhuSuPlanModel saveModel) |
|||
{ |
|||
TJZhuSuPlan Entity = null; |
|||
string TYPE = Request.Form["ORDER_TYPE"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
try |
|||
{ |
|||
Entity = CopyToModel<TJZhuSuPlan, TJZhuSuPlanModel>(saveModel); |
|||
if (string.IsNullOrEmpty(Entity.PID) == true) |
|||
{ |
|||
//新增
|
|||
//Entity.ORDER_TYPE = TYPE;
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJZhuSuPlanBLL_Insert", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage("计划单号已存在!"); |
|||
return View("TJZhuSuPlanEdit", saveModel); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
//修改
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJZhuSuPlanBLL_Update", Entity); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return View("TJZhuSuPlanEdit", saveModel); |
|||
} |
|||
} |
|||
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 删除
|
|||
/// <summary>
|
|||
/// 删除
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
public ActionResult Delete(TJZhuSuPlan model) |
|||
{ |
|||
string selectKey = Request.Form["selectKey"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
try |
|||
{ |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJZhuSuPlanBLL_Delete", selectKey); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return List(true); |
|||
} |
|||
SetMessage(AppResource.DeleteMessage); |
|||
return List(true); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 发布
|
|||
/// <summary>
|
|||
/// 发布
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
public ActionResult PutOut(TJZhuSuPlan model) |
|||
{ |
|||
string selectKey = Request.Form["selectKey"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJZhuSuPlanBLL_PutOut", selectKey); |
|||
if (result.IsSuccess == false) |
|||
{ |
|||
SetMessage(result.Msg); |
|||
return List(true); |
|||
} |
|||
SetMessage(AppResource.PutOutMessage); |
|||
return List(true); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导出excel
|
|||
/// <summary>
|
|||
/// 导出excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult ExportExcel() |
|||
{ |
|||
TJZhuSuPlanModel seachModel = null; |
|||
TJZhuSuPlan condition = null; |
|||
DataTable exportDt = new DataTable(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJZhuSuPlanModel>(); |
|||
condition = CopyToModel<TJZhuSuPlan, TJZhuSuPlanModel>(seachModel); |
|||
//获取数据
|
|||
TJZhuSuPlanBLL dp = new TJZhuSuPlanBLL(); |
|||
exportDt = dp.GetExportData(condition); |
|||
//exportDt = wcfAgent.InvokeServiceFunction<DataTable>("TJZhuSuPlanBLL_GetExportData", condition);
|
|||
|
|||
//导出
|
|||
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool(); |
|||
return efTool.GetExcelFileResult("TJZhuSuPlanExp", "门板计划信息.xlsx", exportDt); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导入excel
|
|||
/// <summary>
|
|||
/// 导入excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult ImportExcel() |
|||
{ |
|||
DataTable dt = null; |
|||
List<TJZhuSuPlan> list = new List<TJZhuSuPlan>(); |
|||
DataResult<ImportMessage> serviceResult = null; |
|||
string fileName = Request.Form["fileName"]; |
|||
string orderby = Request.Form["ORDER_TYPE"]; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
|
|||
Materiel materialmodel = new Materiel(); |
|||
ProduceShift produceshiftmodel = new ProduceShift(); |
|||
MachineInfo machine = new MachineInfo(); |
|||
//初始工作中心编号条件
|
|||
QMAPP.MD.Entity.WorkCell workcell = new QMAPP.MD.Entity.WorkCell(); |
|||
workcell.WORKCELL_CODE = orderby; |
|||
|
|||
try |
|||
{ |
|||
dt = this.GetTableByExcel("TJZhuSuPlanImp", fileName, dt); |
|||
//格式转换
|
|||
list = QMFrameWork.Common.Util.BindHelper.ConvertToList<TJZhuSuPlan>(dt).ToList(); |
|||
serviceResult = wcfAgent.InvokeServiceFunction<DataResult<ImportMessage>>("TJZhuSuPlanBLL_GetImportData", list, materialmodel,machine, produceshiftmodel, workcell); |
|||
if (serviceResult.Ex != null) |
|||
{ |
|||
throw serviceResult.Ex; |
|||
} |
|||
if (serviceResult.Result.failureNum != 0) |
|||
{ |
|||
foreach (RowError error in serviceResult.Result.Errors) |
|||
{ |
|||
dt.Rows[error.Key - 1]["InfoError"] = error.Value; |
|||
} |
|||
ImportMessageModel model = new ImportMessageModel(); |
|||
model.InfoName = "TJZhuSuPlanImp"; |
|||
model.ReturnUrl = "/TJZhuSuPlan/List?callBack=true"; |
|||
model.Message = serviceResult.Result; |
|||
model.ErrorDt = dt; |
|||
return new MessageOutputController().OutputImportMessage(model); |
|||
} |
|||
else |
|||
{ |
|||
SetMessage(serviceResult.Msg + ",如下:<br/>" |
|||
+ "插入" + serviceResult.Result.insertNum + "条," |
|||
+ "更新" + serviceResult.Result.updateNum + "条" |
|||
); |
|||
return List(true); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
finally |
|||
{ |
|||
System.IO.File.Delete(MvcApplication.TempPath + fileName); |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 下载模板
|
|||
/// <summary>
|
|||
/// 下载导入模板
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult GetTemplate() |
|||
{ |
|||
try |
|||
{ |
|||
string path = AppDomain.CurrentDomain.BaseDirectory + "App_Data/Excel/"; |
|||
string fileName = "TJZhuSuPlanImp.xlsx"; |
|||
return File(path + fileName, "application/vnd.ms-excel", Url.Encode("门板发运导入模板.xlsx")); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
|
|||
|
|||
//#region 整车添加物料信息
|
|||
///// <summary>
|
|||
///// 编辑载入
|
|||
///// </summary>
|
|||
///// <returns>处理结果</returns>
|
|||
//[HandleException]
|
|||
//public ActionResult AddMaterial()
|
|||
//{
|
|||
// TJZhuSuPlanModel model = new TJZhuSuPlanModel();
|
|||
// string ID = Request.Params["PID"];
|
|||
// string TYPE = Request.Params["ORDER_TYPE"];
|
|||
// TJZhuSuPlan Entity = new TJZhuSuPlan();
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
// DataResult<TJZhuSuPlan> result = new DataResult<TJZhuSuPlan>();
|
|||
// try
|
|||
// {
|
|||
// model.ORDER_TYPE = TYPE;
|
|||
// return View("AddMaterialEdit", model);
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
|
|||
///// <summary>
|
|||
///// 保存
|
|||
///// </summary>
|
|||
///// <param name="model"></param>
|
|||
///// <returns>处理结果</returns>
|
|||
//[HttpPost]
|
|||
//[HandleException]
|
|||
//[ValidateInput(false)]
|
|||
//public ActionResult SaveMaterial(TJZhuSuPlanModel saveModel)
|
|||
//{
|
|||
|
|||
// Material condition = new Material();
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
|
|||
// condition.MATERIAL_CODE = saveModel.MATERIAL_CODE;
|
|||
// Material material = wcfAgent.InvokeServiceFunction<Material>("MaterialBLL_GetMaterialInfo", condition);
|
|||
|
|||
// if (!string.IsNullOrEmpty(material.PID))
|
|||
// {
|
|||
// saveModel.MATERIAL_NAME = material.MATERIAL_NAME;
|
|||
// saveModel.COLOR = material.COLOR;
|
|||
// saveModel.HBTYPE = material.HBTYPE;
|
|||
// return View("AddWholeDoorEdit", saveModel);
|
|||
// }
|
|||
// return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge));
|
|||
//}
|
|||
//#endregion
|
|||
|
|||
#region 整车添加物料信息
|
|||
//[HandleException]
|
|||
//public ActionResult AddSendDetail(bool? callBack)
|
|||
//{
|
|||
// //实例化服务
|
|||
// ServiceAgent wcfAgent = this.GetServiceAgent();
|
|||
// QMAPP.MD.Web.Models.MaterialModel seachModel = null;
|
|||
// DataResult<DataPage> pageResult = new DataResult<DataPage>();
|
|||
// DataPage page = new DataPage();
|
|||
// string Fisid = Request["MATERIAL_CODE"].ToString();
|
|||
// FISAssembly MaterialAssInfo = wcfAgent.InvokeServiceFunction<FISAssembly>("TJZhuSuPlanBLL_GetFISMaterialInfoCD", Fisid);
|
|||
// string materials = "('" + MaterialAssInfo.MESModulFL + "','" + MaterialAssInfo.MESModulFR + "','" + MaterialAssInfo.MESModulRL + "','" + MaterialAssInfo.MESModulRR + "')";
|
|||
// //物料发货明细实体
|
|||
// Material detail = new Material()
|
|||
// {
|
|||
// MaterialCodes = materials,
|
|||
// };
|
|||
// try
|
|||
// {
|
|||
// //获取查询对象
|
|||
// seachModel = GetModel<QMAPP.MD.Web.Models.MaterialModel>();
|
|||
// #region 获取缓存值
|
|||
// if (callBack != null)
|
|||
// {
|
|||
// TryGetSelectBuffer<QMAPP.MD.Web.Models.MaterialModel>(out seachModel);
|
|||
// }
|
|||
// else
|
|||
// {
|
|||
// //保存搜索条件
|
|||
// SetSelectBuffer<QMAPP.MD.Web.Models.MaterialModel>(seachModel);
|
|||
// }
|
|||
// #endregion
|
|||
// //获取前台分页设置信息
|
|||
// page = this.GetDataPage(seachModel);
|
|||
// pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("MaterialBLL_GetList", detail, page);
|
|||
// if (pageResult.IsSuccess == false)
|
|||
// {
|
|||
// SetMessage(pageResult.Msg);
|
|||
// return List(true);
|
|||
// }
|
|||
// DateGridResult<Material> result = new DateGridResult<Material>();
|
|||
// result.Total = pageResult.Result.RecordCount;
|
|||
// result.Rows = JsonConvertHelper.GetDeserialize<List<Material>>(pageResult.Result.Result.ToString());
|
|||
// for (var i = 0; i < result.Total; i++)
|
|||
// {
|
|||
// result.Rows[i].AsmSetCode = MaterialAssInfo.AsmSetCode;
|
|||
// }
|
|||
// return Content(result.GetJsonSource());
|
|||
// }
|
|||
// catch (Exception ex)
|
|||
// {
|
|||
// throw ex;
|
|||
// }
|
|||
//}
|
|||
#endregion
|
|||
|
|||
#region 门板顺序号编辑
|
|||
/// <summary>
|
|||
/// 门板顺序号编辑
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public ActionResult DoorPlankEditSeq() |
|||
{ |
|||
TJZhuSuPlanModel model = new TJZhuSuPlanModel(); |
|||
TJZhuSuPlan Entity = new TJZhuSuPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<TJZhuSuPlan> result = new DataResult<TJZhuSuPlan>(); |
|||
try |
|||
{ |
|||
model = GetModel<TJZhuSuPlanModel>(); |
|||
return View("DoorPlankEditSeq", model); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
|
|||
#region 获取编辑系列号列表
|
|||
/// <summary>
|
|||
/// 获取编辑系列号列表
|
|||
/// </summary>
|
|||
/// <param name="callBack"></param>
|
|||
/// <returns></returns>
|
|||
[HandleException] |
|||
public ActionResult GetTJZhuSuPlanList(bool? callBack) |
|||
{ |
|||
TJZhuSuPlanModel seachModel = null; |
|||
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
|||
DataPage page = new DataPage(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
TJZhuSuPlan condition = new TJZhuSuPlan(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<TJZhuSuPlanModel>(); |
|||
|
|||
//condition.PIDList =seachModel.PIDList;
|
|||
//condition.ORDER_TYPE = seachModel.ORDER_TYPE;
|
|||
|
|||
#region 获取缓存值
|
|||
if (callBack != null) |
|||
{ |
|||
TryGetSelectBuffer<TJZhuSuPlanModel>(out seachModel); |
|||
} |
|||
else |
|||
{ |
|||
//保存搜索条件
|
|||
SetSelectBuffer<TJZhuSuPlanModel>(seachModel); |
|||
} |
|||
#endregion
|
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<TJZhuSuPlan, TJZhuSuPlanModel>(seachModel); |
|||
|
|||
#region wcf服务统一接口
|
|||
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("TJZhuSuPlanBLL_GetTJZhuSuPlanList", condition, page); |
|||
if (pageResult.IsSuccess == false) |
|||
{ |
|||
SetMessage(pageResult.Msg); |
|||
return List(true); |
|||
} |
|||
DateGridResult<TJZhuSuPlan> result = new DateGridResult<TJZhuSuPlan>(); |
|||
result.Total = pageResult.Result.RecordCount; |
|||
result.Rows = JsonConvertHelper.GetDeserialize<List<TJZhuSuPlan>>(pageResult.Result.Result.ToString()); |
|||
#endregion
|
|||
return Content(result.GetJsonSource()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 保存顺序号修改
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="model"></param>
|
|||
/// <returns>处理结果</returns>
|
|||
[HttpPost] |
|||
[HandleException] |
|||
[ValidateInput(false)] |
|||
public ActionResult TJZhuSuPlanSeqSave(TJZhuSuPlanModel saveModel) |
|||
{ |
|||
TJZhuSuPlan entity = new TJZhuSuPlan(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
DataResult<int> result = new DataResult<int>(); |
|||
|
|||
entity.PLAN_SEQ = saveModel.PLAN_SEQ; |
|||
//entity.PIDList = saveModel.PIDList;
|
|||
|
|||
entity = CopyToModel<TJZhuSuPlan, TJZhuSuPlanModel>(saveModel); |
|||
|
|||
//修改
|
|||
result = wcfAgent.InvokeServiceFunction<DataResult<int>>("TJZhuSuPlanBLL_UpdateTJZhuSuPlanSeq", entity); |
|||
|
|||
return this.GetJsViewResult(string.Format("parent.List(1);parent.showTitle('{0}');parent.closeAppWindow1();", AppResource.SaveMessge)); |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
|
|||
namespace QMAPP.FJC.Web.Models |
|||
{ |
|||
public class TestEChartModel |
|||
{ |
|||
public string Cate { set; get; } |
|||
|
|||
public string SubCate { set; get; } |
|||
|
|||
public string Week { set; get; } |
|||
|
|||
public string Max { set; get; } |
|||
|
|||
public string Min { set; get; } |
|||
|
|||
public string TypeValue { set; get; } |
|||
|
|||
public string Value { set; get; } |
|||
|
|||
public string StackValue { set; get; } |
|||
|
|||
public string Name { set; get; } |
|||
|
|||
public double PersonHeight { set; get; } |
|||
|
|||
public double PersonWeight { set; get; } |
|||
|
|||
public double Diameter { set; get; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,76 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.Mvc; |
|||
using System.Web.Mvc.Html; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMFrameWork.WebUI; |
|||
|
|||
namespace QMAPP.FJC.Web.Models.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 注塑投入产出统计
|
|||
/// 张松男
|
|||
/// 2024-7-6
|
|||
/// </summary>
|
|||
public class InjectionCountModel : QDGModel |
|||
{ |
|||
///<summary>
|
|||
///批次号
|
|||
///</summary>
|
|||
[Description("批次号")] |
|||
[HTMLInput(UpdateRead = true, required = true, MaxLength = 20, Width = 150)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
|||
public string RawMaterialPID { get; set; } |
|||
|
|||
///<summary>
|
|||
///零件号
|
|||
///</summary>
|
|||
[Description("零件号")] |
|||
[HTMLInput(UpdateRead = true, required = true, MaxLength = 20, Width = 150)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
|||
public string MaterialCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 起始日期
|
|||
/// </summary>
|
|||
[Description("起始日期")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 20, Width = 120)] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string START_DATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结束日期
|
|||
/// </summary>
|
|||
[Description("结束日期")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 20, Width = 120)] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string END_DATE { get; set; } |
|||
|
|||
|
|||
///<summary>
|
|||
///产品条码
|
|||
///</summary>
|
|||
[Description("产品条码")] |
|||
[HTMLInput(UpdateRead = true, required = true, MaxLength = 20, Width = 150)] |
|||
[InputType(inputType.combobox)] |
|||
[DGColumn(frozenColumns = true, Sortable = true, Width = 100, DataAlign = DataAlign.center)] |
|||
public string ProductCode { get; set; } |
|||
|
|||
///<summary>
|
|||
///统计类型
|
|||
///</summary>
|
|||
[Description("统计类型")] |
|||
[HTMLInput(UpdateRead = true, required = true, JsonUtl = "/Dict/GetTJList", MaxLength = 20, Width = 110)] |
|||
[InputType(inputType.combobox)] |
|||
public string TYPE_COUNT { get; set; } |
|||
|
|||
|
|||
public string MaterialValue { get; set; } |
|||
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,153 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.Mvc.Html; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMFrameWork.WebUI; |
|||
|
|||
namespace QMAPP.FJC.Web.Models.TianJin |
|||
{ |
|||
public class TJPaoMoPlanModel : QDGModel |
|||
{ |
|||
///<summary>
|
|||
///主键
|
|||
///</summary>
|
|||
[Description("主键")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(Hidden = true, PrimaryKey = true)] |
|||
public string PID { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划单号
|
|||
///</summary>
|
|||
[Description("计划单号")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30,Width = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_NO { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划顺序号
|
|||
///</summary>
|
|||
[Description("计划顺序号")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_SEQ { get; set; } |
|||
|
|||
///<summary>
|
|||
///车型
|
|||
///</summary>
|
|||
[Description("车型")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center,Hidden = true)] |
|||
public string LINENO { get; set; } = "770"; |
|||
|
|||
///<summary>
|
|||
///计划状态
|
|||
///</summary>
|
|||
[Description("计划状态")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30, Width = 180, JsonUtl = "/Dict/GetFixedComboxSource?kind=PLAN_STATE")] |
|||
//[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)]
|
|||
[InputType(inputType.combobox)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_STATE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料号
|
|||
///</summary>
|
|||
[Description("物料号")] |
|||
[HTMLInput(UpdateRead = false, required = true, Width = 200, MaxLength = 30)] |
|||
[InputType(inputType.combotree)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 130, DataAlign = DataAlign.center)] |
|||
public string MATERIAL_CODE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料名称
|
|||
///</summary>
|
|||
[Description("物料名称")] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 240, DataAlign = DataAlign.center)] |
|||
public string MATERIAL_NAME { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划数量
|
|||
///</summary>
|
|||
[Description("计划数量")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
//完成数量
|
|||
///</summary>
|
|||
[Description("完成数量")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string COMPLETE_QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
///备注
|
|||
///</summary>
|
|||
[Description("备注")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, MaxLength = 30)] |
|||
[InputType(inputType.textArea)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 120, DataAlign = DataAlign.center)] |
|||
public string REMARK { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划日期
|
|||
///</summary>
|
|||
[Description("计划日期")] |
|||
[HTMLInput(UpdateRead = true, required = true, Width = 200, MaxLength = 30)] |
|||
[InputType(inputType.datebox)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 150, DataAlign = DataAlign.center)] |
|||
public DateTime PLAN_DATE { get; set; } |
|||
|
|||
[Description("计划日期")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 7, Width = 200, FormatDate = "yyyy-MM-dd HH:mm:ss")] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string PLANTIMESTART { get; set; } |
|||
|
|||
[Description("至")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 7, Width = 200, FormatDate = "yyyy-MM-dd HH:mm:ss")] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string PLANTIMEEND { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[Description("创建用户")] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center, Hidden = true)] |
|||
public string CREATEUSER { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[Description("创建用户")] |
|||
[DGColumn(Sortable = true, Width = 100, DataAlign = DataAlign.left,Hidden = true)] |
|||
public string CREATEUSERNAME { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
[Description("创建时间")] |
|||
[HTMLInput(UpdateRead = true, MaxLength = 20)] |
|||
[InputType(inputType.hidden)] |
|||
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss")] |
|||
public DateTime CREATEDATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Description("物料号")] |
|||
public string MaterialCodes { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,153 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Web; |
|||
using System.Web.Mvc.Html; |
|||
using QMFrameWork.WebUI.Attribute; |
|||
using QMFrameWork.WebUI; |
|||
|
|||
namespace QMAPP.FJC.Web.Models.TianJin |
|||
{ |
|||
public class TJZhuSuPlanModel : QDGModel |
|||
{ |
|||
///<summary>
|
|||
///主键
|
|||
///</summary>
|
|||
[Description("主键")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(Hidden = true, PrimaryKey = true)] |
|||
public string PID { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划单号
|
|||
///</summary>
|
|||
[Description("计划单号")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30,Width = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_NO { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划顺序号
|
|||
///</summary>
|
|||
[Description("计划顺序号")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_SEQ { get; set; } |
|||
|
|||
///<summary>
|
|||
///车型
|
|||
///</summary>
|
|||
[Description("车型")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center,Hidden = true)] |
|||
public string LINENO { get; set; } = "770"; |
|||
|
|||
///<summary>
|
|||
///计划状态
|
|||
///</summary>
|
|||
[Description("计划状态")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 30, Width = 180, JsonUtl = "/Dict/GetFixedComboxSource?kind=PLAN_STATE")] |
|||
//[HTMLInput(UpdateRead = false, required = true, MaxLength = 30)]
|
|||
[InputType(inputType.combobox)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string PLAN_STATE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料号
|
|||
///</summary>
|
|||
[Description("物料号")] |
|||
[HTMLInput(UpdateRead = false, required = true, Width = 200, MaxLength = 30)] |
|||
[InputType(inputType.combotree)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 130, DataAlign = DataAlign.center)] |
|||
public string MATERIAL_CODE { get; set; } |
|||
|
|||
///<summary>
|
|||
///物料名称
|
|||
///</summary>
|
|||
[Description("物料名称")] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 240, DataAlign = DataAlign.center)] |
|||
public string MATERIAL_NAME { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划数量
|
|||
///</summary>
|
|||
[Description("计划数量")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
//完成数量
|
|||
///</summary>
|
|||
[Description("完成数量")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, required = true, MaxLength = 30)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center)] |
|||
public string COMPLETE_QTY { get; set; } |
|||
|
|||
///<summary>
|
|||
///备注
|
|||
///</summary>
|
|||
[Description("备注")] |
|||
[HTMLInput(UpdateRead = false, Width = 196, MaxLength = 30)] |
|||
[InputType(inputType.textArea)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 120, DataAlign = DataAlign.center)] |
|||
public string REMARK { get; set; } |
|||
|
|||
///<summary>
|
|||
///计划日期
|
|||
///</summary>
|
|||
[Description("计划日期")] |
|||
[HTMLInput(UpdateRead = true, required = true, Width = 200, MaxLength = 30)] |
|||
[InputType(inputType.datebox)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 150, DataAlign = DataAlign.center)] |
|||
public DateTime PLAN_DATE { get; set; } |
|||
|
|||
[Description("计划日期")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 7, Width = 200, FormatDate = "yyyy-MM-dd HH:mm:ss")] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string PLANTIMESTART { get; set; } |
|||
|
|||
[Description("至")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 7, Width = 200, FormatDate = "yyyy-MM-dd HH:mm:ss")] |
|||
[InputType(inputType.dateTimeBox)] |
|||
public string PLANTIMEEND { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[Description("创建用户")] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 80, DataAlign = DataAlign.center, Hidden = true)] |
|||
public string CREATEUSER { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建用户
|
|||
/// </summary>
|
|||
[Description("创建用户")] |
|||
[DGColumn(Sortable = true, Width = 100, DataAlign = DataAlign.left,Hidden = true)] |
|||
public string CREATEUSERNAME { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
[Description("创建时间")] |
|||
[HTMLInput(UpdateRead = true, MaxLength = 20)] |
|||
[InputType(inputType.hidden)] |
|||
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss")] |
|||
public DateTime CREATEDATE { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Description("物料号")] |
|||
public string MaterialCodes { get; set; } |
|||
|
|||
} |
|||
} |
@ -0,0 +1,143 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.InjectionCountModel>" %> |
|||
|
|||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
|||
生产发运统计 |
|||
</asp:Content> |
|||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
|||
<%=Html.QPSeach(80,true) %> |
|||
<table id="condiTable"> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.MaterialCode)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MaterialCode)%> |
|||
</td> |
|||
|
|||
<th align="right"> |
|||
投料日期 |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.START_DATE)%> |
|||
</td> |
|||
<th align="right"> |
|||
至 |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.END_DATE)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<%=Html.QPEnd()%> |
|||
<%=Html.QPList() %> |
|||
<!--图表配置--> |
|||
<%=QMAPP.Common.Web.AppConfig.QMEChartPageConfig()%> |
|||
<%--异步获取数据生成图表--%> |
|||
<div style="overflow: auto; height: 99%;background:url(../../Content/Img/dise.jpg);"> |
|||
|
|||
<div style="width: 100%;text-align: center;"> |
|||
<table id="maintb" class="mtbtt" style="width: 90%; margin: 0px auto;"> |
|||
</table> |
|||
</div> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
function GetTable() { |
|||
$.ajax({ |
|||
type: "POST", |
|||
url: "/InjectionCount/GetTable?TYPE_COUNT=" + $("input[name='TYPE_COUNT']").val() + "&START_DATE=" + $("input[name='START_DATE']").val() + "&END_DATE=" + $("input[name='END_DATE']").val(), |
|||
dataType: "json", |
|||
data: {}, |
|||
success: function (data) { |
|||
$("#maintb").html(data); |
|||
}, |
|||
error: function (XMLHttpRequest, textStatus, errorThrown) { |
|||
//setTimeout("RefreshFisTable()", 10000); |
|||
alert(errorThrown); |
|||
} |
|||
|
|||
}); |
|||
} |
|||
function refreshEChartbar2() { |
|||
|
|||
var endtime = document.getElementById("END_DATE").value; |
|||
if (parseDate($("#START_DATE").val()) > parseDate($("#END_DATE").val()) && endtime != "") { |
|||
alert("开始时间不能大于结束时间!"); |
|||
return; |
|||
} |
|||
|
|||
GetTable(); |
|||
var ps = []; |
|||
|
|||
var TYPE_COUNT = {}; |
|||
TYPE_COUNT.key = "TYPE_COUNT"; |
|||
TYPE_COUNT.value = $("input[name='TYPE_COUNT']").val(); |
|||
ps.push(TYPE_COUNT); |
|||
|
|||
var START_DATE = {}; |
|||
START_DATE.key = "START_DATE"; |
|||
START_DATE.value = $("input[name='START_DATE']").val(); |
|||
ps.push(START_DATE); |
|||
|
|||
var END_DATE = {}; |
|||
END_DATE.key = "END_DATE"; |
|||
END_DATE.value = $("input[name='END_DATE']").val(); |
|||
ps.push(END_DATE); |
|||
|
|||
GetEchartData("/InjectionCount/GetEchartDataBar2", myEChart, ps); |
|||
|
|||
//GetTable(); |
|||
} |
|||
|
|||
//导出 |
|||
// function Export() { |
|||
// var img = myEChart.getDataURL("png"); |
|||
// $("#hiChartImg").val(img); |
|||
// submitByButton("ExportBanCi"); |
|||
// } |
|||
|
|||
//导出 |
|||
//function Export() { |
|||
// document.getElementById("selectKey").value = getSelectKey(); |
|||
// submitByButton("ExportExcel"); |
|||
//} |
|||
|
|||
function Export() { |
|||
var ids = document.getElementById("selectKey").value; |
|||
$.get("/InjectionCount/ExportExcel?Trend=0", $("form").serializeArray(), function (data) { |
|||
submitByButton("/InjectionCount/ExportFile?Trend=0&FileName=" + data); |
|||
}); |
|||
} |
|||
</script> |
|||
<%=Html.QPEnd() %> |
|||
<%=Html.Hidden("selectKey")%> |
|||
<%=Html.Hidden("PID")%> |
|||
</asp:Content> |
|||
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
|||
<style type="text/css"> |
|||
.mtbtt |
|||
{ |
|||
border-collapse: collapse; |
|||
} |
|||
|
|||
.mtbtt tr td |
|||
{ |
|||
border: 1px solid grey; |
|||
} |
|||
|
|||
.L1cos |
|||
{ |
|||
width: 160px; |
|||
} |
|||
</style> |
|||
<table cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td align="center"> |
|||
<%-- <%=Html.QTButtonSearch("InjectionCount", "QTYShipmentCount", "refreshEChartbar2()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
<%=Html.QTButton("InjectionCount", "QTYInjectionCount", QMFrameWork.WebUI.IconCls.redo, "refreshEChartbar2()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("export", "ExportBanCi", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</asp:Content> |
@ -0,0 +1,106 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.TJPaoMoPlanModel>" %> |
|||
|
|||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
|||
门板订单计划信息编辑 |
|||
</asp:Content> |
|||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
|||
<%=Html.QPEdit("信息", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%> |
|||
<% |
|||
var editable = false; |
|||
if (string.IsNullOrEmpty(Model.PLAN_STATE) || string.Equals(Model.PLAN_STATE, "0")) |
|||
{ |
|||
editable = true; |
|||
} |
|||
%> |
|||
<table id="editTable" cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td> |
|||
<table> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_DATE)%> |
|||
</th> |
|||
<td> |
|||
<input id="PLAN_DATE" name="PLAN_DATE" value="<%=string.IsNullOrEmpty(Model.PID)?DateTime.Now.ToString("yyyy-MM-dd"):Model.PLAN_DATE.ToString("yyyy-MM-dd HH:mm:ss") %>" |
|||
style=" width:200px" type="text" class="easyui-datebox" required="required" <%=editable?"":"readonly =\"readonly\"" %> /> |
|||
</td> |
|||
</tr> |
|||
|
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.MATERIAL_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MATERIAL_CODE, editable ? null : new { Readonly = "readonly" })%> |
|||
<script type="text/javascript" language="javascript"> |
|||
|
|||
</script> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.QTY)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.QTY)%> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.COMPLETE_QTY)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.COMPLETE_QTY)%> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.REMARK)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.REMARK)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<%=Html.HiddenFor(p=>p.PID) %> |
|||
<%=Html.HiddenFor(p=>p.CREATEDATE) %> |
|||
<%=Html.HiddenFor(p=>p.CREATEUSER) %> |
|||
<%=Html.HiddenFor(p => p.PLAN_STATE)%> |
|||
<%=Html.HiddenFor(p => p.PLAN_NO)%> |
|||
<%=Html.QPEnd() %> |
|||
</asp:Content> |
|||
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
|||
<table width="100%" cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td> |
|||
<%=Html.QTButtonSave("User", "Save", "return Save();")%> |
|||
<%=Html.QTButtonBack("close", "DashBoardPlanList", "parent.closeAppWindow1();return false;")%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<script type="text/javascript"> |
|||
$(function () { |
|||
//获取物料下拉数据源 |
|||
$('#MATERIAL_CODE').combotree({ |
|||
url: "/Dict/GetFisMaterialTree?ordertype=", |
|||
panelHeight: '230', |
|||
panelWidth: '470', |
|||
}); |
|||
}); |
|||
function Save() { |
|||
|
|||
var reg = /^[0-9]+$/; |
|||
var netId = $("#QTY").val(); |
|||
if (!reg.test(netId)) { |
|||
MSI("提示", "计划数量只能输入数字。"); |
|||
return; |
|||
} |
|||
|
|||
submitByButton("Save"); |
|||
} |
|||
</script> |
|||
</asp:Content> |
@ -0,0 +1,198 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.TJPaoMoPlanModel>" %> |
|||
|
|||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
|||
订单生产计划列表 |
|||
</asp:Content> |
|||
|
|||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
|||
<%=Html.QPSeach(80, true)%> |
|||
<table id="condiTable"> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_NO)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLAN_NO)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_STATE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLAN_STATE)%> |
|||
</td> |
|||
|
|||
<th align="right"> |
|||
<%=Html.QV(p => p.MATERIAL_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MATERIAL_CODE)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLANTIMESTART)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLANTIMESTART)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLANTIMEEND)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLANTIMEEND)%> |
|||
</td> |
|||
</tr> |
|||
|
|||
</table> |
|||
<%=Html.QPEnd()%> |
|||
<%=Html.QPList() %> |
|||
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.TianJin.TJPaoMoPlanModel>(Model)%> |
|||
<%=Html.QPEnd() %> |
|||
<%=Html.Hidden("selectKey")%> |
|||
<%=Html.Hidden("fileName")%> |
|||
<%=Html.Hidden("ORDER_TYPE")%> |
|||
<script language="javascript" type="text/javascript"> |
|||
$(function () { |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
//获取物料下拉数据源 |
|||
$('#MATERIAL_CODE').combotree({ |
|||
url: "/Dict/GetFisMaterialTree?ordertype=" + type, |
|||
panelHeight: '250', |
|||
panelWidth: '500', |
|||
}); |
|||
List(1); |
|||
}); |
|||
//添加 |
|||
function Add() { |
|||
openAppWindow1('信息添加', 'Edit', '500', '400'); |
|||
} |
|||
|
|||
//整车添加 |
|||
function AddWholeDoor() { |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('整车添加门板', 'AddWholeDoor?ORDER_TYPE=' + type, '650', '380'); |
|||
} |
|||
//修改 |
|||
function Update() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("提示", "请选择修改记录。"); |
|||
return; |
|||
} |
|||
if (ids.indexOf(":") > 0) { |
|||
MSI("提示", "每次只能修改一条记录。"); |
|||
return; |
|||
} |
|||
openAppWindow1('修改', 'Edit?PID=' + ids, '500', '400'); |
|||
} |
|||
//插单 |
|||
function Insert() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("提示", "请选择一条FIS计划作为插单位置。"); |
|||
return; |
|||
} |
|||
if (ids.indexOf(":") > 0) { |
|||
MSI("提示", "只能选择一条FIS计划作为插单位置。"); |
|||
return; |
|||
} |
|||
document.getElementById("selectKey").value = ids; |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('插单', 'Insert?PID=' + ids + "&ORDER_TYPE=" + type, '650', '380'); |
|||
} |
|||
//删除 |
|||
function Delete() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
} |
|||
else { |
|||
document.getElementById("selectKey").value = ids; |
|||
MSQ("提示", "确定要删除选中的记录吗?", function () { |
|||
submitByButton("Delete"); |
|||
}) |
|||
} |
|||
} |
|||
//导入 |
|||
function Import() { |
|||
var fileName = window.showModalDialog("/File/UploadFile", "", "dialogHeight: 200px; dialogWidth: 300px; center: Yes; help: Yes;status: Yes;"); |
|||
if (fileName == null) |
|||
return; |
|||
document.getElementById("fileName").value = fileName; |
|||
//处理等待 |
|||
submitByButton("ImportExcel"); |
|||
} |
|||
//导出 |
|||
function Export() { |
|||
document.getElementById("selectKey").value = getSelectKey(); |
|||
submitByButton("ExportExcel"); |
|||
} |
|||
//下载模板 |
|||
function getTemplate() { |
|||
submitByButton("GetTemplate"); |
|||
} |
|||
//查询 |
|||
function Search() { |
|||
var endtime = document.getElementById("PLANTIMEEND").value; |
|||
if (parseDate($("#PLANTIMESTART").val()) > parseDate($("#PLANTIMEEND").val()) && endtime != "") { |
|||
alert("开始时间不能大于结束时间!"); |
|||
return; |
|||
} |
|||
List(1) |
|||
} |
|||
//发布 |
|||
function Publish() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
} |
|||
else { |
|||
document.getElementById("selectKey").value = ids; |
|||
MSQ("提示", "确定要发布选中的记录吗?", function () { |
|||
submitByButton("PutOut"); |
|||
}) |
|||
} |
|||
} |
|||
|
|||
//修改计划顺序 |
|||
function EditDoorPlankPlanSeq() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
return; |
|||
} |
|||
document.getElementById("selectKey").value = ids; |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('修改门板计划顺序号', 'DoorPlankEditSeq?PIDList=' + ids+ "&ORDER_TYPE=" + type, '690', '400'); |
|||
} |
|||
$(function () { |
|||
|
|||
$('#FACTORY_CODE').combobox({ |
|||
panelWidth: '350' |
|||
|
|||
}); |
|||
|
|||
}); |
|||
|
|||
</script> |
|||
</asp:Content> |
|||
|
|||
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
|||
<table cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td align="center"> |
|||
<%=Html.QTButtonSearch("TJPaoMoPlan", "List", "Search()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButtonAdd("TJPaoMoPlan", "Add", "Add()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("AddWholeDoor", "AddWholeDoor", QMFrameWork.WebUI.IconCls.add, "AddWholeDoor()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
<%=Html.QTButtonUpdate("TJPaoMoPlan", "Edit", "Update()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("EditSeq", "EditDoorPlankPlanSeq", QMFrameWork.WebUI.IconCls.edit, "EditDoorPlankPlanSeq()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("insertorder","Insert",QMFrameWork.WebUI.IconCls.add,"Insert()", QMAPP.Common.Web.SystemLimit.isLimt)%> --%> |
|||
<%=Html.QTButtonDelete("TJPaoMoPlan", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("publish", "PutOut", "detail", "Publish()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("import", "ImportExcel", QMFrameWork.WebUI.IconCls.undo, "Import()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
<%=Html.QTButton("template", "TemplateExcel", QMFrameWork.WebUI.IconCls.template, "getTemplate()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</asp:Content> |
|||
|
@ -0,0 +1,106 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.TJZhuSuPlanModel>" %> |
|||
|
|||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
|||
门板订单计划信息编辑 |
|||
</asp:Content> |
|||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
|||
<%=Html.QPEdit("信息", string.IsNullOrEmpty(Model.PID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%> |
|||
<% |
|||
var editable = false; |
|||
if (string.IsNullOrEmpty(Model.PLAN_STATE) || string.Equals(Model.PLAN_STATE, "0")) |
|||
{ |
|||
editable = true; |
|||
} |
|||
%> |
|||
<table id="editTable" cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td> |
|||
<table> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_DATE)%> |
|||
</th> |
|||
<td> |
|||
<input id="PLAN_DATE" name="PLAN_DATE" value="<%=string.IsNullOrEmpty(Model.PID)?DateTime.Now.ToString("yyyy-MM-dd"):Model.PLAN_DATE.ToString("yyyy-MM-dd HH:mm:ss") %>" |
|||
style=" width:200px" type="text" class="easyui-datebox" required="required" <%=editable?"":"readonly =\"readonly\"" %> /> |
|||
</td> |
|||
</tr> |
|||
|
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.MATERIAL_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MATERIAL_CODE, editable ? null : new { Readonly = "readonly" })%> |
|||
<script type="text/javascript" language="javascript"> |
|||
|
|||
</script> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.QTY)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.QTY)%> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.COMPLETE_QTY)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.COMPLETE_QTY)%> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.REMARK)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.REMARK)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<%=Html.HiddenFor(p=>p.PID) %> |
|||
<%=Html.HiddenFor(p=>p.CREATEDATE) %> |
|||
<%=Html.HiddenFor(p=>p.CREATEUSER) %> |
|||
<%=Html.HiddenFor(p => p.PLAN_STATE)%> |
|||
<%=Html.HiddenFor(p => p.PLAN_NO)%> |
|||
<%=Html.QPEnd() %> |
|||
</asp:Content> |
|||
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
|||
<table width="100%" cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td> |
|||
<%=Html.QTButtonSave("User", "Save", "return Save();")%> |
|||
<%=Html.QTButtonBack("close", "DashBoardPlanList", "parent.closeAppWindow1();return false;")%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<script type="text/javascript"> |
|||
$(function () { |
|||
//获取物料下拉数据源 |
|||
$('#MATERIAL_CODE').combotree({ |
|||
url: "/Dict/GetFisMaterialTree?ordertype=", |
|||
panelHeight: '230', |
|||
panelWidth: '470', |
|||
}); |
|||
}); |
|||
function Save() { |
|||
|
|||
var reg = /^[0-9]+$/; |
|||
var netId = $("#QTY").val(); |
|||
if (!reg.test(netId)) { |
|||
MSI("提示", "计划数量只能输入数字。"); |
|||
return; |
|||
} |
|||
|
|||
submitByButton("Save"); |
|||
} |
|||
</script> |
|||
</asp:Content> |
@ -0,0 +1,198 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.TJZhuSuPlanModel>" %> |
|||
|
|||
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> |
|||
订单生产计划列表 |
|||
</asp:Content> |
|||
|
|||
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> |
|||
<%=Html.QPSeach(80, true)%> |
|||
<table id="condiTable"> |
|||
<tr> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_NO)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLAN_NO)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLAN_STATE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLAN_STATE)%> |
|||
</td> |
|||
|
|||
<th align="right"> |
|||
<%=Html.QV(p => p.MATERIAL_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MATERIAL_CODE)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLANTIMESTART)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLANTIMESTART)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.PLANTIMEEND)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.PLANTIMEEND)%> |
|||
</td> |
|||
</tr> |
|||
|
|||
</table> |
|||
<%=Html.QPEnd()%> |
|||
<%=Html.QPList() %> |
|||
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.TianJin.TJZhuSuPlanModel>(Model)%> |
|||
<%=Html.QPEnd() %> |
|||
<%=Html.Hidden("selectKey")%> |
|||
<%=Html.Hidden("fileName")%> |
|||
<%=Html.Hidden("ORDER_TYPE")%> |
|||
<script language="javascript" type="text/javascript"> |
|||
$(function () { |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
//获取物料下拉数据源 |
|||
$('#MATERIAL_CODE').combotree({ |
|||
url: "/Dict/GetFisMaterialTree?ordertype=" + type, |
|||
panelHeight: '250', |
|||
panelWidth: '500', |
|||
}); |
|||
List(1); |
|||
}); |
|||
//添加 |
|||
function Add() { |
|||
openAppWindow1('信息添加', 'Edit', '500', '400'); |
|||
} |
|||
|
|||
//整车添加 |
|||
function AddWholeDoor() { |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('整车添加门板', 'AddWholeDoor?ORDER_TYPE=' + type, '650', '380'); |
|||
} |
|||
//修改 |
|||
function Update() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("提示", "请选择修改记录。"); |
|||
return; |
|||
} |
|||
if (ids.indexOf(":") > 0) { |
|||
MSI("提示", "每次只能修改一条记录。"); |
|||
return; |
|||
} |
|||
openAppWindow1('修改', 'Edit?PID=' + ids, '500', '400'); |
|||
} |
|||
//插单 |
|||
function Insert() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("提示", "请选择一条FIS计划作为插单位置。"); |
|||
return; |
|||
} |
|||
if (ids.indexOf(":") > 0) { |
|||
MSI("提示", "只能选择一条FIS计划作为插单位置。"); |
|||
return; |
|||
} |
|||
document.getElementById("selectKey").value = ids; |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('插单', 'Insert?PID=' + ids + "&ORDER_TYPE=" + type, '650', '380'); |
|||
} |
|||
//删除 |
|||
function Delete() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
} |
|||
else { |
|||
document.getElementById("selectKey").value = ids; |
|||
MSQ("提示", "确定要删除选中的记录吗?", function () { |
|||
submitByButton("Delete"); |
|||
}) |
|||
} |
|||
} |
|||
//导入 |
|||
function Import() { |
|||
var fileName = window.showModalDialog("/File/UploadFile", "", "dialogHeight: 200px; dialogWidth: 300px; center: Yes; help: Yes;status: Yes;"); |
|||
if (fileName == null) |
|||
return; |
|||
document.getElementById("fileName").value = fileName; |
|||
//处理等待 |
|||
submitByButton("ImportExcel"); |
|||
} |
|||
//导出 |
|||
function Export() { |
|||
document.getElementById("selectKey").value = getSelectKey(); |
|||
submitByButton("ExportExcel"); |
|||
} |
|||
//下载模板 |
|||
function getTemplate() { |
|||
submitByButton("GetTemplate"); |
|||
} |
|||
//查询 |
|||
function Search() { |
|||
var endtime = document.getElementById("PLANTIMEEND").value; |
|||
if (parseDate($("#PLANTIMESTART").val()) > parseDate($("#PLANTIMEEND").val()) && endtime != "") { |
|||
alert("开始时间不能大于结束时间!"); |
|||
return; |
|||
} |
|||
List(1) |
|||
} |
|||
//发布 |
|||
function Publish() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
} |
|||
else { |
|||
document.getElementById("selectKey").value = ids; |
|||
MSQ("提示", "确定要发布选中的记录吗?", function () { |
|||
submitByButton("PutOut"); |
|||
}) |
|||
} |
|||
} |
|||
|
|||
//修改计划顺序 |
|||
function EditDoorPlankPlanSeq() { |
|||
var ids = getSelectKey(); |
|||
if (ids == "") { |
|||
MSI("错误", "至少选择一条记录"); |
|||
return; |
|||
} |
|||
document.getElementById("selectKey").value = ids; |
|||
var type = document.getElementById("ORDER_TYPE").value; |
|||
openAppWindow1('修改门板计划顺序号', 'DoorPlankEditSeq?PIDList=' + ids+ "&ORDER_TYPE=" + type, '690', '400'); |
|||
} |
|||
$(function () { |
|||
|
|||
$('#FACTORY_CODE').combobox({ |
|||
panelWidth: '350' |
|||
|
|||
}); |
|||
|
|||
}); |
|||
|
|||
</script> |
|||
</asp:Content> |
|||
|
|||
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server"> |
|||
<table cellpadding="0" cellspacing="0"> |
|||
<tr> |
|||
<td align="center"> |
|||
<%=Html.QTButtonSearch("TJZhuSuPlan", "List", "Search()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButtonAdd("TJZhuSuPlan", "Add", "Add()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("AddWholeDoor", "AddWholeDoor", QMFrameWork.WebUI.IconCls.add, "AddWholeDoor()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
<%=Html.QTButtonUpdate("TJZhuSuPlan", "Edit", "Update()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("EditSeq", "EditDoorPlankPlanSeq", QMFrameWork.WebUI.IconCls.edit, "EditDoorPlankPlanSeq()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("insertorder","Insert",QMFrameWork.WebUI.IconCls.add,"Insert()", QMAPP.Common.Web.SystemLimit.isLimt)%> --%> |
|||
<%=Html.QTButtonDelete("TJZhuSuPlan", "Delete", "Delete()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("publish", "PutOut", "detail", "Publish()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("import", "ImportExcel", QMFrameWork.WebUI.IconCls.undo, "Import()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%-- <%=Html.QTButton("export", "ExportExcel", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%>--%> |
|||
<%=Html.QTButton("template", "TemplateExcel", QMFrameWork.WebUI.IconCls.template, "getTemplate()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</asp:Content> |
|||
|
@ -1,5 +1,5 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Plan> |
|||
<PlanDetail PlanID="d53029818e5e4c69abf0d39b91c6a9db" PlanName="测试计划01" TaskID="task3" Period="1" PeriodType="d" ExecuteDay="" OnceTime="" Interval="10" IntervalType="m" DayStartTime="" DayEndTime="" PlanStartDate="2014/11/21 9:51:55" PlanEndDate="0001/1/1 0:00:00" IsUse="true" Remark="eqwewqewq"> |
|||
<PlanDetail PlanID="d53029818e5e4c69abf0d39b91c6a9db" PlanName="MFG自动回冲" TaskID="task12" Period="1" PeriodType="d" ExecuteDay="" OnceTime="" Interval="10" IntervalType="m" DayStartTime="" DayEndTime="" PlanStartDate="2014/11/21 9:51:55" PlanEndDate="0001/1/1 0:00:00" IsUse="true" Remark="eqwewqewq"> |
|||
</PlanDetail> |
|||
</Plan> |
Loading…
Reference in new issue