张松男
4 months ago
50 changed files with 2569 additions and 1013 deletions
@ -0,0 +1,141 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using QMAPP.BLL; |
|||
using QMAPP.Entity; |
|||
using QMAPP.FJC.BLL.Dict; |
|||
using QMAPP.FJC.DAL.ProduceManage; |
|||
using QMAPP.FJC.Entity.ProduceManage; |
|||
using QMFrameWork.Data; |
|||
using QMFrameWork.Log; |
|||
using QMAPP.FJC.Entity; |
|||
using QMAPP.MD.Entity.TianJin; |
|||
using QMAPP.FJC.DAL.TianJin; |
|||
using System.Data; |
|||
|
|||
namespace QMAPP.FJC.BLL.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 模块名称:库存日志信息
|
|||
/// 作 者:张松男
|
|||
/// 编写日期:2022年02月17日
|
|||
/// </summary>
|
|||
public class MonitordataBLL : BaseBLL |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 获取信息
|
|||
/// </summary>
|
|||
/// <param name="">条件</param>
|
|||
/// <returns>信息</returns>
|
|||
public DataResult<Monitordata> Get(Monitordata model) |
|||
{ |
|||
DataResult<Monitordata> result = new DataResult<Monitordata>(); |
|||
try |
|||
{ |
|||
result.Result = new MonitordataDAL().Get(model); |
|||
result.IsSuccess = true; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "获取异常!" |
|||
}); |
|||
result.IsSuccess = false; |
|||
result.Ex = ex; |
|||
result.Msg = "获取异常"; |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
public DataResult<DataPage> GetList(Monitordata condition, DataPage page) |
|||
{ |
|||
DataResult<DataPage> result = new DataResult<DataPage>(); |
|||
try |
|||
{ |
|||
DataPage dataPage = new MonitordataDAL().GetList(condition, page); |
|||
|
|||
result.IsSuccess = true; |
|||
result.Result = dataPage; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "获取列表异常!" |
|||
}); |
|||
result.IsSuccess = false; |
|||
result.Ex = ex; |
|||
result.Msg = "获取列表异常!"; |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <returns>全部集合</returns>
|
|||
public List<Monitordata> GetAllList() |
|||
{ |
|||
try |
|||
{ |
|||
//获取信息列表
|
|||
return new MonitordataDAL().GetALL(); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "获取列表异常!" |
|||
}); |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
|
|||
#endregion
|
|||
|
|||
#region 导出数据
|
|||
/// <summary>
|
|||
/// 获取导出的数据
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <returns>数据</returns>
|
|||
public DataTable GetExportData(Monitordata model) |
|||
{ |
|||
try |
|||
{ |
|||
return new MonitordataDAL().GetExportData(model); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
LogManager.LogHelper.Error(new LogInfo() |
|||
{ |
|||
ErrorInfo = ex, |
|||
Tag = ex.StackTrace, |
|||
Info = "导出库存信息" |
|||
}); |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,613 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Data; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMAPP.DAL; |
|||
using QMAPP.FJC.Entity.Common.Constants; |
|||
using QMAPP.FJC.Entity.CompleteStatistics; |
|||
using QMFrameWork.Data; |
|||
|
|||
namespace QMAPP.FJC.DAL.CompleteStatistics |
|||
{ |
|||
public class TJCompleteStatisticsDAL : BaseDAL |
|||
{ |
|||
public DataPage GetList(TJCompleteStatisticsEntity condition, DataPage page) |
|||
{ |
|||
DataParameter[] parameters; |
|||
string sql = this.GetQuerySql(condition, out parameters); |
|||
//分页关键字段及排序
|
|||
page.KeyName = "PID"; |
|||
page.SortExpression = "ORDERNO ASC"; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) { |
|||
page = session.GetDataPage<TJCompleteStatisticsEntity>(sql, parameters, page); |
|||
} |
|||
return page; |
|||
|
|||
} |
|||
|
|||
public List<TJCompleteStatisticsEntity> GetList(TJCompleteStatisticsEntity condition) |
|||
{ |
|||
DataParameter[] parameters; |
|||
string sql = this.GetQuerySql(condition, out parameters); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
return session.GetList<TJCompleteStatisticsEntity>(sql, parameters).ToList(); |
|||
} |
|||
} |
|||
|
|||
public TJCompleteStatisticsEntity Get(TJCompleteStatisticsEntity model) |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) { |
|||
return session.Get(model); |
|||
} |
|||
} |
|||
|
|||
public int Insert(TJCompleteStatisticsEntity model) |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) { |
|||
return session.Insert(model); |
|||
} |
|||
} |
|||
|
|||
public int Select_Get(string ProductCode) |
|||
{ |
|||
var sql = $"select * from T_AW_COMPLETE_TJSTATISTICS where ORDERNO = '{ProductCode}' and DELFLAG = '0'"; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
return session.GetList<TJCompleteStatisticsEntity>(sql, new DataParameter[] { }).ToList().Count; |
|||
} |
|||
} |
|||
|
|||
public bool ExistCompleteStatistics(TJCompleteStatisticsEntity model) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
protected string ExistQureySql() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("SELECT *"); |
|||
sql.AppendLine(" FROM T_AW_MAINOPERATION T"); |
|||
sql.AppendLine(" WHERE INFO.BARCODEIDENTIFY IS NOT NULL"); |
|||
sql.AppendLine(" AND T.OPERATEDDATE > @StartTime"); |
|||
sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime"); |
|||
return sql.ToString(); |
|||
} |
|||
|
|||
public int Update(TJCompleteStatisticsEntity model) |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) { |
|||
return session.Update(model); |
|||
} |
|||
} |
|||
|
|||
public int GenericCompleteStatistics(DateTime starTime, DateTime endTime) |
|||
{ |
|||
int count = 0; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
|
|||
//DataParameter[] parameters = {
|
|||
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
|
|||
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
|
|||
//};
|
|||
try { |
|||
session.OpenTs(); |
|||
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
|
|||
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
|
|||
//成品
|
|||
//string sql = GetGenericStatisticsSqlForBORA();
|
|||
//count = session.ExecuteSql(sql, parameters);
|
|||
////注塑件
|
|||
//sql = GetGenericStatisticsSqlForINJECT();
|
|||
//count += session.ExecuteSql(sql, parameters);
|
|||
|
|||
|
|||
this.UpdateLastGenericTime(endTime, session); |
|||
session.CommitTs(); |
|||
} |
|||
catch (Exception) { |
|||
session.RollbackTs(); |
|||
throw; |
|||
} |
|||
} |
|||
return count; |
|||
} |
|||
|
|||
public int FrmPlaceCompleteStatistics(DateTime starTime, DateTime endTime) |
|||
{ |
|||
int count = 0; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
|
|||
//DataParameter[] parameters = {
|
|||
// new DataParameter {ParameterName = "StartTime", DataType = DbType.DateTime, Value = starTime},
|
|||
// new DataParameter {ParameterName = "EndTime", DataType = DbType.DateTime, Value = endTime}
|
|||
//};
|
|||
try |
|||
{ |
|||
session.OpenTs(); |
|||
//string location = this.GetSystemConfig(CompleteStatisticsConstants.COMP_STATIS_SITE).CODEVALUE;
|
|||
//string sql = location.Equals("080121") ? this.GetGenericStatisticsSqlForCC() : this.GetGenericStatisticsSqlForCD();
|
|||
//成品
|
|||
//string sql = GetGenericStatisticsSqlForBORA();
|
|||
//count = session.ExecuteSql(sql, parameters);
|
|||
////注塑件
|
|||
//sql = GetGenericStatisticsSqlForINJECT();
|
|||
//count += session.ExecuteSql(sql, parameters);
|
|||
|
|||
|
|||
this.UpdateLastGenericTime(endTime, session); |
|||
session.CommitTs(); |
|||
} |
|||
catch (Exception) |
|||
{ |
|||
session.RollbackTs(); |
|||
throw; |
|||
} |
|||
} |
|||
return count; |
|||
} |
|||
|
|||
|
|||
public SystemConfig GetSystemConfig(string codeType) |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("SELECT *"); |
|||
sql.AppendLine(" FROM T_SYSTEM_CONFIG"); |
|||
sql.AppendLine(" WHERE CODETYPE = @CodeType"); |
|||
DataParameter[] parameters = { |
|||
new DataParameter {ParameterName = "CodeType", DataType = DbType.String, Value = codeType} |
|||
}; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
return session.Get<SystemConfig>(sql.ToString(), parameters); |
|||
} |
|||
} |
|||
|
|||
public string GetMFGMaterialCode(string MaterialCode) |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("SELECT *"); |
|||
sql.AppendLine(" FROM T_PP_TJFY_ExchangeType"); |
|||
sql.AppendLine(" WHERE MaterialCode = @MaterialCode"); |
|||
DataParameter[] parameters = { |
|||
new DataParameter {ParameterName = "MaterialCode", DataType = DbType.String, Value = MaterialCode} |
|||
}; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
var date = session.GetTable(sql.ToString(), parameters); |
|||
if (date.Rows.Count > 0) |
|||
{ |
|||
return date.Rows[0]["MFGMaterialCode"].ToString(); |
|||
} |
|||
else |
|||
return ""; |
|||
} |
|||
} |
|||
|
|||
protected int UpdateLastGenericTime(DateTime endTime, IDataSession session) |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("UPDATE T_SYSTEM_CONFIG"); |
|||
sql.AppendLine(" SET CODEVALUE = @EndTime"); |
|||
sql.AppendLine(" WHERE CODETYPE = @CodeType"); |
|||
DataParameter[] parameters = |
|||
{ |
|||
new DataParameter {ParameterName = "EndTime", DataType = DbType.String, Value = endTime.ToString("yyyy/MM/dd HH:mm:ss")}, |
|||
new DataParameter {ParameterName = "CodeType", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_LSTTIME} |
|||
}; |
|||
return session.ExecuteSql(sql.ToString(), parameters); |
|||
} |
|||
/// <summary>
|
|||
/// 成都工厂适用SQL
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
protected string GetGenericStatisticsSqlForCD() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("INSERT INTO T_AW_COMPLETE_TJSTATISTICS"); |
|||
sql.AppendLine("SELECT NEWID(),"); |
|||
sql.AppendLine(" REPLACE(T.CUSTOMERSPAREPARTS, ' ', '') AS MATERIALNO,"); |
|||
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,"); |
|||
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,"); |
|||
sql.AppendLine(" @StartTime AS STARTTIME,"); |
|||
sql.AppendLine(" @EndTime AS ENDTIME,"); |
|||
sql.AppendLine(" CNFG.CODEVALUE + "); |
|||
sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) +"); |
|||
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + "); |
|||
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY T.CUSTOMERSPAREPARTS))) + CAST (ROW_NUMBER() OVER (ORDER BY T.CUSTOMERSPAREPARTS) AS VARCHAR) AS ORDERNO,"); |
|||
sql.AppendLine(" GETDATE() AS CREATETIME,"); |
|||
sql.AppendLine(" USR.USERID AS CREATEUSER,"); |
|||
sql.AppendLine(" GETDATE() AS UPDATETIME,"); |
|||
sql.AppendLine(" USR.USERID AS UPDATEUSER,"); |
|||
sql.AppendLine(" '0' AS DELFLAG"); |
|||
sql.AppendLine(" FROM T_DAS_BARCODEVIBPAR T"); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER USR"); |
|||
sql.AppendLine(" ON USR.USERID = 'SYSTEM'"); |
|||
sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG"); |
|||
sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER'"); |
|||
sql.AppendLine(" WHERE T.SCANTIME > @StartTime"); |
|||
sql.AppendLine(" AND T.SCANTIME <= @EndTime"); |
|||
sql.AppendLine(" AND SUBSTRING(T.ABARCODE, 9, 2) <> '99'"); |
|||
sql.AppendLine(" GROUP BY T.CUSTOMERSPAREPARTS, USR.USERID, CNFG.CODEVALUE"); |
|||
return sql.ToString(); |
|||
} |
|||
//长春
|
|||
protected string GetGenericStatisticsSqlForCC() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("INSERT INTO T_AW_COMPLETE_TJSTATISTICS"); |
|||
sql.AppendLine("SELECT NEWID(),"); |
|||
sql.AppendLine(" INFO.MATERIALNO AS MATERIALNO,"); |
|||
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,"); |
|||
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,"); |
|||
sql.AppendLine(" @StartTime AS STARTTIME,"); |
|||
sql.AppendLine(" @EndTime AS ENDTIME,"); |
|||
sql.AppendLine(" CNFG.CODEVALUE + "); |
|||
sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) +"); |
|||
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + "); |
|||
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY INFO.MATERIALNO))) + CAST (ROW_NUMBER() OVER (ORDER BY INFO.MATERIALNO) AS VARCHAR) AS ORDERNO,"); |
|||
sql.AppendLine(" GETDATE() AS CREATETIME,"); |
|||
sql.AppendLine(" USR.USERID AS CREATEUSER,"); |
|||
sql.AppendLine(" GETDATE() AS UPDATETIME,"); |
|||
sql.AppendLine(" USR.USERID AS UPDATEUSER,"); |
|||
sql.AppendLine(" '0' AS DELFLAG"); |
|||
sql.AppendLine(" FROM T_AW_MAINOPERATION T"); |
|||
sql.AppendLine(" LEFT JOIN T_BD_BARCODE_PRODUCT_RELATION RELATION"); |
|||
sql.AppendLine(" ON T.PRODUCTTYPE = RELATION.PRODUCTTYPE"); |
|||
sql.AppendLine(" AND T.PROCESSTYPE = RELATION.PROCESSTYPE"); |
|||
sql.AppendLine(" LEFT JOIN T_BD_MATERIAL_BARCODE_INFO INFO"); |
|||
sql.AppendLine(" ON INFO.PROCESSTYPE = RELATION.PROCESSTYPE"); |
|||
sql.AppendLine(" AND INFO.PRODUCTTYPE = RELATION.PRODUCTTYPE"); |
|||
sql.AppendLine(" AND SUBSTRING(T.PRODUCTCODE, RELATION.STARTINDEX, RELATION.SUBLENGTH) = INFO.BARCODEIDENTIFY"); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER USR"); |
|||
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM'"); |
|||
sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG"); |
|||
sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER'"); |
|||
sql.AppendLine(" WHERE INFO.BARCODEIDENTIFY IS NOT NULL"); |
|||
sql.AppendLine(" AND T.OPERATEDDATE > @StartTime"); |
|||
sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime"); |
|||
sql.AppendLine(" GROUP BY INFO.MATERIALNO, USR.USERID, CNFG.CODEVALUE"); |
|||
return sql.ToString(); |
|||
} |
|||
//青岛仪表板/门板的成品
|
|||
//protected string GetGenericStatisticsSqlForBORA()
|
|||
//{
|
|||
// StringBuilder sql = new StringBuilder();
|
|||
// sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS ");
|
|||
// sql.AppendLine(" SELECT NEWID(), ");
|
|||
// sql.AppendLine(" T.MATERIAL_CODE AS MATERIALNO, ");
|
|||
// sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT, ");
|
|||
// sql.AppendLine(" COUNT(*) AS COMPLETECOUNT, ");
|
|||
// sql.AppendLine(" @StartTime AS STARTTIME, ");
|
|||
// sql.AppendLine(" @EndTime AS ENDTIME, ");
|
|||
// sql.AppendLine(" CNFG.CODEVALUE + ");
|
|||
// sql.AppendLine(" REPLACE(CONVERT(VARCHAR(100), GETDATE(), 112) + ");
|
|||
// sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + ");
|
|||
// sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY T.MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY T.MATERIAL_CODE) AS VARCHAR) AS ORDERNO, ");
|
|||
// sql.AppendLine(" GETDATE() AS CREATETIME, ");
|
|||
// sql.AppendLine(" USR.USERID AS CREATEUSER, ");
|
|||
// sql.AppendLine(" GETDATE() AS UPDATETIME, ");
|
|||
// sql.AppendLine(" USR.USERID AS UPDATEUSER, ");
|
|||
// sql.AppendLine(" '0' AS DELFLAG ");
|
|||
// sql.AppendLine(" FROM T_AW_MAINOPERATION T ");
|
|||
// sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS C ON C.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE_CODE ");
|
|||
// sql.AppendLine(" LEFT JOIN T_QM_USER USR ");
|
|||
// sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' ");
|
|||
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG CNFG ");
|
|||
// sql.AppendLine(" ON CNFG.CODETYPE = 'COMP_STATIS_ORDER' ");
|
|||
// sql.AppendLine(" WHERE T.OPERATEDDATE > @StartTime ");
|
|||
// sql.AppendLine(" AND T.OPERATEDDATE <= @EndTime ");
|
|||
// sql.AppendLine(" AND C.MATERIAL_ATTRIBUTE='2' ");
|
|||
// sql.AppendLine(" GROUP BY T.MATERIAL_CODE, USR.USERID, CNFG.CODEVALUE ");
|
|||
// return sql.ToString();
|
|||
//}
|
|||
//青岛注塑件
|
|||
protected string GetGenericStatisticsSqlForBORA() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS "); |
|||
sql.AppendLine(" SELECT NEWID(),"); |
|||
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO,"); |
|||
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,"); |
|||
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,"); |
|||
sql.AppendLine(" @StartTime AS STARTTIME,"); |
|||
sql.AppendLine(" @EndTime AS ENDTIME,"); |
|||
sql.AppendLine(" C.ORDERIDENTITY + "); |
|||
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + "); |
|||
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + "); |
|||
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, "); |
|||
sql.AppendLine(" GETDATE() AS CREATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS CREATEUSER, "); |
|||
sql.AppendLine(" GETDATE() AS UPDATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS UPDATEUSER, "); |
|||
sql.AppendLine(" '0' AS DELFLAG "); |
|||
sql.AppendLine(" FROM T_AW_PRODUCT T "); |
|||
sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS S ON S.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE "); |
|||
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE "); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER USR "); |
|||
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' "); |
|||
sql.AppendLine(" WHERE S.MATERIAL_ATTRIBUTE='2' "); |
|||
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL "); |
|||
sql.AppendLine(" AND T.CREATEDATE > @StartTime "); |
|||
sql.AppendLine(" AND T.CREATEDATE <= @EndTime "); |
|||
sql.AppendLine(" AND T.MACHINECODDE IS NOT NULL "); |
|||
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY "); |
|||
return sql.ToString(); |
|||
} |
|||
//天津770发运 MFG回冲
|
|||
protected string GetFrmPlaceStatisticsSql() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS "); |
|||
sql.AppendLine(" SELECT NEWID(),"); |
|||
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO,"); |
|||
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT,"); |
|||
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT,"); |
|||
sql.AppendLine(" @StartTime AS STARTTIME,"); |
|||
sql.AppendLine(" @EndTime AS ENDTIME,"); |
|||
sql.AppendLine(" C.ORDERIDENTITY + "); |
|||
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + "); |
|||
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + "); |
|||
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, "); |
|||
sql.AppendLine(" GETDATE() AS CREATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS CREATEUSER, "); |
|||
sql.AppendLine(" GETDATE() AS UPDATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS UPDATEUSER, "); |
|||
sql.AppendLine(" '0' AS DELFLAG "); |
|||
sql.AppendLine(" FROM T_AW_PRODUCT T "); |
|||
sql.AppendLine(" LEFT JOIN T_MD_MATERIAL_CLASS S ON S.MATERIAL_TYPE_CODE=T.MATERIAL_TYPE "); |
|||
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE "); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER USR "); |
|||
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' "); |
|||
sql.AppendLine(" WHERE S.MATERIAL_ATTRIBUTE='2' "); |
|||
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL "); |
|||
sql.AppendLine(" AND T.CREATEDATE > @StartTime "); |
|||
sql.AppendLine(" AND T.CREATEDATE <= @EndTime "); |
|||
sql.AppendLine(" AND T.MACHINECODDE IS NOT NULL "); |
|||
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY "); |
|||
return sql.ToString(); |
|||
} |
|||
|
|||
protected string GetGenericStatisticsSqlForINJECT() |
|||
{ |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine(" INSERT INTO T_AW_COMPLETE_TJSTATISTICS "); |
|||
sql.AppendLine(" SELECT NEWID(), "); |
|||
sql.AppendLine(" C.MFG_MATERIAL_CODE AS MATERIALNO, "); |
|||
sql.AppendLine(" COUNT(*) AS SYSCOMPLETECOUNT, "); |
|||
sql.AppendLine(" COUNT(*) AS COMPLETECOUNT, "); |
|||
sql.AppendLine(" @StartTime AS STARTTIME, "); |
|||
sql.AppendLine(" @EndTime AS ENDTIME, "); |
|||
sql.AppendLine(" C.ORDERIDENTITY + "); |
|||
sql.AppendLine(" REPLACE(substring(CONVERT(VARCHAR(100), GETDATE(), 112),3,6) + "); |
|||
sql.AppendLine(" CONVERT(VARCHAR(100), GETDATE(), 8),':','') + "); |
|||
sql.AppendLine(" REPLICATE('0', 2 - LEN(ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE))) + "); |
|||
sql.AppendLine(" CAST (ROW_NUMBER() OVER (ORDER BY C.MFG_MATERIAL_CODE) AS VARCHAR) AS ORDERNO, "); |
|||
sql.AppendLine(" GETDATE() AS CREATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS CREATEUSER, "); |
|||
sql.AppendLine(" GETDATE() AS UPDATETIME, "); |
|||
sql.AppendLine(" USR.USERID AS UPDATEUSER, "); |
|||
sql.AppendLine(" '0' AS DELFLAG "); |
|||
sql.AppendLine(" FROM T_TM_MonitorCode T "); |
|||
sql.AppendLine(" LEFT JOIN T_AW_COMPLETE_MFG_CONFIG C "); |
|||
sql.AppendLine(" ON C.MES_MATERIAL_CODE = T.MATERIAL_CODE "); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER USR "); |
|||
sql.AppendLine(" ON USR.USERNAME = 'SYSTEM' "); |
|||
sql.AppendLine(" WHERE T.CurrentMode='3' "); |
|||
sql.AppendLine(" AND C.MFG_MATERIAL_CODE IS NOT NULL "); |
|||
sql.AppendLine(" AND T.CREATEDATE > @StartTime "); |
|||
sql.AppendLine(" AND T.CREATEDATE <= @EndTime "); |
|||
sql.AppendLine(" GROUP BY C.MFG_MATERIAL_CODE, USR.USERID, C.ORDERIDENTITY "); |
|||
return sql.ToString(); |
|||
} |
|||
protected string GetQuerySql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters) |
|||
{ |
|||
List<DataParameter> parametersList = new List<DataParameter>(); |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("SELECT T.PID, "); |
|||
sql.AppendLine(" T.MATERIALNO, "); |
|||
sql.AppendLine(" MAT.MATERIALNAME, "); |
|||
sql.AppendLine(" MAT.PRODUCTLINE, "); |
|||
sql.AppendLine(" T.SYSCOMPLETECOUNT,"); |
|||
sql.AppendLine(" T.COMPLETECOUNT,"); |
|||
sql.AppendLine(" T.STARTTIME, "); |
|||
sql.AppendLine(" T.ENDTIME, "); |
|||
sql.AppendLine(" T.ORDERNO, "); |
|||
sql.AppendLine(" T.CREATETIME,"); |
|||
sql.AppendLine(" T.CREATEUSER,"); |
|||
sql.AppendLine(" T.UPDATETIME,"); |
|||
sql.AppendLine(" T.UPDATEUSER,"); |
|||
sql.AppendLine(" T.DELFLAG,"); |
|||
sql.AppendLine(" CUSER.USERNAME AS CREATEUSER_DISPLAY,"); |
|||
sql.AppendLine(" UUSER.USERNAME AS UPDATEUSER_DISPLAY"); |
|||
sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T"); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER CUSER"); |
|||
sql.AppendLine(" ON T.CREATEUSER = CUSER.USERID"); |
|||
sql.AppendLine(" LEFT JOIN T_QM_USER UUSER"); |
|||
sql.AppendLine(" ON T.UPDATEUSER = UUSER.USERID"); |
|||
sql.AppendLine(" INNER JOIN T_BD_MATERIAL_BARCODE_INFO MAT"); |
|||
sql.AppendLine(" ON T.MATERIALNO = MAT.MATERIALNO"); |
|||
sql.AppendLine(" WHERE 1 = 1"); |
|||
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO)) |
|||
{ |
|||
sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo"); |
|||
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) }); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(condition.DELFLAG)) |
|||
{ |
|||
if(condition.DELFLAG == "是") |
|||
sql.AppendLine(" AND T.DELFLAG = '1'"); |
|||
else if(condition.DELFLAG == "否") |
|||
sql.AppendLine(" AND T.DELFLAG = '0'"); |
|||
} |
|||
|
|||
if (!string.IsNullOrWhiteSpace(condition.SENDTIME)) |
|||
{ |
|||
sql.AppendLine(" AND T.ENDTIME >= @SEndTime"); |
|||
parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) }); |
|||
} |
|||
if (!string.IsNullOrWhiteSpace(condition.EENDTIME)) |
|||
{ |
|||
sql.AppendLine(" AND T.ENDTIME <= @EEndTime"); |
|||
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.EENDTIME) }); |
|||
} |
|||
parameters = parametersList.ToArray(); |
|||
return sql.ToString(); |
|||
} |
|||
|
|||
|
|||
public List<TJCompleteStatisticsEntity> GetExportData(TJCompleteStatisticsEntity model, IDataSession session) |
|||
{ |
|||
DataParameter[] parameters; |
|||
string sql = this.GetExportSql(model, out parameters); |
|||
DataParameter[] unableParameters; |
|||
//数据上传状态回填
|
|||
string unableSql = this.unableExportDataString(model, out unableParameters); |
|||
|
|||
List<TJCompleteStatisticsEntity> rtn = session.GetList<TJCompleteStatisticsEntity>(sql, parameters).ToList(); |
|||
|
|||
//var count = session.ExecuteSql(unableSql, unableParameters);
|
|||
|
|||
using (IDataSession session2 = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
var count = session2.ExecuteSql(unableSql, unableParameters); |
|||
} |
|||
return rtn; |
|||
} |
|||
|
|||
private string unableExportDataString(TJCompleteStatisticsEntity condition, out DataParameter[] parameters) |
|||
{ |
|||
List<DataParameter> parametersList = new List<DataParameter>(); |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("UPDATE [dbo].[T_AW_COMPLETE_TJSTATISTICS] "); |
|||
sql.AppendLine(" SET DELFLAG = '1'"); |
|||
sql.AppendLine(" WHERE DELFLAG = '0'"); |
|||
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO)) |
|||
{ |
|||
sql.AppendLine(" AND MATERIALNO LIKE @MaterialNo"); |
|||
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) }); |
|||
} |
|||
//20211214重传后DELFLAG状态修改
|
|||
//if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
|
|||
//{
|
|||
// sql.AppendLine(" AND ENDTIME >= @SEndTime");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
|
|||
//}
|
|||
if (!string.IsNullOrWhiteSpace(condition.EENDTIME)) |
|||
{ |
|||
sql.AppendLine(" AND ENDTIME <= @EEndTime"); |
|||
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.EENDTIME) }); |
|||
} |
|||
parameters = parametersList.ToArray(); |
|||
return sql.ToString(); |
|||
} |
|||
|
|||
//protected string GetExportSql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters)
|
|||
//{
|
|||
// List<DataParameter> parametersList = new List<DataParameter>();
|
|||
// StringBuilder sql = new StringBuilder();
|
|||
// sql.AppendLine("SELECT EM.CODEVALUE AS EMPLOYEE, ");
|
|||
// sql.AppendLine(" SI.CODEVALUE AS SITE, ");
|
|||
// sql.AppendLine(" '' AS SHIFT, ");
|
|||
// sql.AppendLine(" T.MATERIALNO, ");
|
|||
// sql.AppendLine(" MAT.PRODUCTLINE, ");
|
|||
// sql.AppendLine(" '' AS EDIMAT, ");
|
|||
// sql.AppendLine(" '' AS SERIAL, ");
|
|||
// sql.AppendLine(" USR.CODEVALUE AS USERID, ");
|
|||
// sql.AppendLine(" T.ORDERNO, ");
|
|||
// sql.AppendLine(" T.COMPLETECOUNT,");
|
|||
// sql.AppendLine(" T.STARTTIME");
|
|||
// sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T");
|
|||
// sql.AppendLine(" INNER JOIN T_BD_MATERIAL_BARCODE_INFO MAT");
|
|||
// sql.AppendLine(" ON T.MATERIALNO = MAT.MATERIALNO");
|
|||
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG EM");
|
|||
// sql.AppendLine(" ON EM.CODETYPE = @Employee");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "Employee", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_EMPLOYEE });
|
|||
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG SI");
|
|||
// sql.AppendLine(" ON SI.CODETYPE = @Site");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "Site", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_SITE });
|
|||
|
|||
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG USR");
|
|||
// sql.AppendLine(" ON USR.CODETYPE = @UserId");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "UserId", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_USER });
|
|||
|
|||
// sql.AppendLine(" LEFT JOIN T_SYSTEM_CONFIG ORD");
|
|||
// sql.AppendLine(" ON ORD.CODETYPE = @OrderNo");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "OrderNo", DataType = DbType.String, Value = CompleteStatisticsConstants.COMP_STATIS_ORDER });
|
|||
|
|||
// sql.AppendLine(" WHERE T.DELFLAG = '0'");
|
|||
// if (!string.IsNullOrWhiteSpace(condition.MATERIALNO))
|
|||
// {
|
|||
// sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) });
|
|||
// }
|
|||
// if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
|
|||
// {
|
|||
// sql.AppendLine(" AND T.ENDTIME >= @SEndTime");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
|
|||
// }
|
|||
// if (!string.IsNullOrWhiteSpace(condition.EENDTIME))
|
|||
// {
|
|||
// sql.AppendLine(" AND T.ENDTIME <= @EEndTime");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = string.Format("{0}", condition.EENDTIME) });
|
|||
// }
|
|||
// sql.AppendLine(" ORDER BY T.ORDERNO ASC");
|
|||
|
|||
// parameters = parametersList.ToArray();
|
|||
// return sql.ToString();
|
|||
//}
|
|||
protected string GetExportSql(TJCompleteStatisticsEntity condition, out DataParameter[] parameters) |
|||
{ |
|||
List<DataParameter> parametersList = new List<DataParameter>(); |
|||
StringBuilder sql = new StringBuilder(); |
|||
sql.AppendLine("SELECT (select top 1 MFG_USERCODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS EMPLOYEE, "); |
|||
sql.AppendLine(" (select top 1 MFG_LOCATIONCODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS SITE, "); |
|||
sql.AppendLine(" '' AS SHIFT, "); |
|||
sql.AppendLine(" T.MATERIALNO, "); |
|||
sql.AppendLine(" (select top 1 PRODUCELINECODE from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO) AS PRODUCTLINE, "); |
|||
sql.AppendLine(" '' AS EDIMAT, "); |
|||
sql.AppendLine(" '' AS SERIAL, "); |
|||
sql.AppendLine(" (select top 1 USERID from T_AW_COMPLETE_MFG_CONFIG where MFG_MATERIAL_CODE = T.MATERIALNO), "); |
|||
sql.AppendLine(" T.ORDERNO, "); |
|||
sql.AppendLine(" T.COMPLETECOUNT,"); |
|||
sql.AppendLine(" T.STARTTIME,"); |
|||
sql.AppendLine(" T.ENDTIME"); |
|||
sql.AppendLine(" FROM T_AW_COMPLETE_TJSTATISTICS T"); |
|||
|
|||
sql.AppendLine(" WHERE T.DELFLAG = '0'"); |
|||
if (!string.IsNullOrWhiteSpace(condition.MATERIALNO)) |
|||
{ |
|||
sql.AppendLine(" AND T.MATERIALNO LIKE @MaterialNo"); |
|||
parametersList.Add(new DataParameter { ParameterName = "MaterialNo", DataType = DbType.String, Value = string.Format("%{0}%", condition.MATERIALNO) }); |
|||
} |
|||
//20211214如网络中断,重连后数据重传
|
|||
//if (!string.IsNullOrWhiteSpace(condition.SENDTIME))
|
|||
//{
|
|||
// sql.AppendLine(" AND T.ENDTIME >= @SEndTime");
|
|||
// parametersList.Add(new DataParameter { ParameterName = "SEndTime", DataType = DbType.DateTime, Value = Convert.ToDateTime(condition.SENDTIME) });
|
|||
//}
|
|||
if (!string.IsNullOrWhiteSpace(condition.EENDTIME)) |
|||
{ |
|||
sql.AppendLine(" AND T.ENDTIME <= @EEndTime"); |
|||
parametersList.Add(new DataParameter { ParameterName = "EEndTime", DataType = DbType.DateTime, Value = string.Format("{0}", condition.EENDTIME) }); |
|||
} |
|||
sql.AppendLine(" ORDER BY T.ORDERNO ASC"); |
|||
|
|||
parameters = parametersList.ToArray(); |
|||
return sql.ToString(); |
|||
} |
|||
|
|||
public DataTable ExportExcelData(TJCompleteStatisticsEntity model) |
|||
{ |
|||
DataParameter[] parameters; |
|||
string sql = this.GetQuerySql(model, out parameters); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
return session.GetTable(sql, parameters); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,201 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMAPP.FJC.Entity.MD; |
|||
using QMFrameWork.Data; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
using QMAPP.MD.Entity.Bucket; |
|||
using QMAPP.MD.Entity.TianJin; |
|||
|
|||
namespace QMAPP.FJC.DAL.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 模块名称:库存日志信息
|
|||
/// 作 者:张松男
|
|||
/// 编写日期:2022年02月17日
|
|||
/// </summary>
|
|||
public class MonitordataDAL |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 获取信息
|
|||
/// </summary>
|
|||
/// <param name="">条件</param>
|
|||
/// <returns>*信息</returns>
|
|||
public Monitordata Get(Monitordata info) |
|||
{ |
|||
try |
|||
{ |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
info = session.Get<Monitordata>(info); |
|||
} |
|||
return info; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
/// <summary>
|
|||
/// 获取信息
|
|||
/// </summary>
|
|||
/// <param name="">条件</param>
|
|||
/// <returns>*信息</returns>
|
|||
public Monitordata Get(string materialcode) |
|||
{ |
|||
try |
|||
{ |
|||
string sql = "SELECT top1 * FROM [T_AW_Monitordata] WHERE [ProductCode]=@ProductCode"; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
parameters.Add(new DataParameter("ProductCode", materialcode)); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
//获取信息
|
|||
var info = session.Get<Monitordata>(sql, parameters.ToArray()); |
|||
return info; |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
public DataPage GetList(Monitordata condition, DataPage page) |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = this.GetQuerySql(condition, ref parameters); |
|||
//分页关键字段及排序
|
|||
page.KeyName = "id"; |
|||
if (string.IsNullOrEmpty(page.SortExpression)) |
|||
page.SortExpression = "RecordDate DESC"; |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
page = session.GetDataPage<Monitordata>(sql, parameters.ToArray(), page); |
|||
} |
|||
return page; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="condition">条件</param>
|
|||
/// <param name="page">数据页</param>
|
|||
/// <returns>数据页</returns>
|
|||
public List<Monitordata> GetALL() |
|||
{ |
|||
string sql = null; |
|||
List<DataParameter> parameters = new List<DataParameter>(); |
|||
try |
|||
{ |
|||
sql = "SELECT * FROM T_AW_Monitordata "; |
|||
//分页关键字段及排序
|
|||
var LIST = new List<Monitordata>(); |
|||
using (IDataSession session = AppDataFactory.CreateMainSession()) |
|||
{ |
|||
LIST = session.GetList<Monitordata>(sql, parameters.ToArray()).ToList(); |
|||
} |
|||
return LIST; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取查询语句
|
|||
/// <summary>
|
|||
/// 获取查询语句
|
|||
/// </summary>
|
|||
/// <param name="user">查询条件</param>
|
|||
/// <param name="parameters">参数</param>
|
|||
/// <returns>查询语句</returns>
|
|||
private string GetQuerySql(Monitordata condition, ref List<DataParameter> parameters) |
|||
{ |
|||
StringBuilder sqlBuilder = new StringBuilder(); |
|||
StringBuilder whereBuilder = new StringBuilder(); |
|||
try |
|||
{ |
|||
|
|||
//构成查询语句
|
|||
sqlBuilder.Append("SELECT * "); |
|||
sqlBuilder.Append("FROM monitordata "); |
|||
|
|||
if (string.IsNullOrEmpty(condition.QrCodeContent) == false) |
|||
{ |
|||
whereBuilder.Append(" AND QrCodeContent = @QrCodeContent"); |
|||
parameters.Add(new DataParameter { ParameterName = "QrCodeContent", DataType = DbType.String, Value = condition.QrCodeContent }); |
|||
} |
|||
|
|||
if (condition.BeginTime != DateTime.MinValue) |
|||
whereBuilder.Append($" and RecordDate >= '{condition.BeginTime}' "); |
|||
if (condition.EndTime != DateTime.MinValue) |
|||
whereBuilder.Append($" and RecordDate <= '{condition.EndTime}' "); |
|||
|
|||
//查询条件
|
|||
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="user">查询条件</param>
|
|||
/// <returns>数据</returns>
|
|||
public DataTable GetExportData(Monitordata 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 = "T_AW_Monitordata"; |
|||
} |
|||
return dt; |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,80 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using QMAPP.FJC.Entity.CompleteStatistics.Table; |
|||
using QMFrameWork.Data.Attributes; |
|||
|
|||
namespace QMAPP.FJC.Entity.CompleteStatistics |
|||
{ |
|||
/// <summary>
|
|||
/// 完工统计表
|
|||
/// </summary>
|
|||
[DBTable(TableName = "T_AW_COMPLETE_TJSTATISTICS", TimeStampColumn = "UPDATETIME")] |
|||
public class TJCompleteStatisticsEntity : T_AW_COMPLETE_TJSTATISTICS |
|||
{ |
|||
public string MATERIALNAME { get; set; } |
|||
public string PRODUCTLINE { get; set; } |
|||
public string CREATEUSER_DISPLAY { get; set; } |
|||
public string UPDATEUSER_DISPLAY { get; set; } |
|||
public string SENDTIME { get; set; } |
|||
public string EENDTIME { get; set; } |
|||
public string DOESEXPORT |
|||
{ |
|||
get |
|||
{ |
|||
if (!string.IsNullOrEmpty(this.DELFLAG) && this.DELFLAG.Equals("1")) |
|||
{ |
|||
return "是"; |
|||
} |
|||
return "否"; |
|||
} |
|||
} |
|||
|
|||
//For File
|
|||
public string EMPLOYEE { get; set; } |
|||
public string SITE { get; set; } |
|||
public string SHIFT { get; set; } |
|||
public string EDIMAT { get; set; } |
|||
public string SERIAL { get; set; } |
|||
public string USERID { get; set; } |
|||
|
|||
public override string ToString() |
|||
{ |
|||
string format = "\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",{6},\"{7}\",\"{8}\",{9},{10}"; |
|||
return string.Format(format, this.EMPLOYEE, this.SITE, this.SHIFT, this.MATERIALNO.Trim(), this.PRODUCTLINE, this.EDIMAT, this.SERIAL, this.USERID |
|||
, this.ORDERNO, this.COMPLETECOUNT, this.STARTTIME.ToString("MM/dd/yy")); |
|||
} |
|||
|
|||
public string ToSQL() |
|||
{ |
|||
System.Text.StringBuilder sql = new System.Text.StringBuilder(); |
|||
sql.Append("INSERT INTO xxmes_bk_det(xxmes_bk_site,xxmes_bk_part,xxmes_bk_qty,xxmes_bk_line,xxmes_bk_doc,xxmes_bk_shift,xxmes_bk_emp,xxmes_bk_effdate,xxmes_bk_prod,xxmes_bk_qadread) "); |
|||
sql.Append("values "); |
|||
sql.AppendFormat("('{0}'", this.SITE);//xxmes_bk_site
|
|||
sql.AppendFormat(",'{0}'", this.MATERIALNO);//xxmes_bk_part
|
|||
sql.AppendFormat(",'{0}'", this.COMPLETECOUNT);//xxmes_bk_qty
|
|||
sql.AppendFormat(",'{0}'", this.PRODUCTLINE);//xxmes_bk_line
|
|||
sql.AppendFormat(",'{0}'", this.ORDERNO);//xxmes_bk_doc
|
|||
sql.AppendFormat(",'{0}'", "A");//xxmes_bk_shift
|
|||
sql.AppendFormat(",'{0}'", this.EMPLOYEE);//xxmes_bk_emp
|
|||
sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", this.STARTTIME);//xxmes_bk_effdate
|
|||
//sql.AppendFormat(",'{0:yyyy-MM-dd HH:mm:ss}'", DateTime.Now.ToString("yyyyMMddHHmmss"));//xxmes_bk_effdate
|
|||
sql.AppendFormat(",'{0}'", "DP20");//xxmes_bk_prod
|
|||
sql.AppendFormat(",'0')");//xxmes_bk_qadread
|
|||
|
|||
//string format = "\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",{6},\"{7}\",\"{8}\",{9},{10}";
|
|||
//return string.Format(format, this.EMPLOYEE, this.SITE, this.SHIFT, this.MATERIALNO.Trim(), this.PRODUCTLINE, this.EDIMAT, this.SERIAL, this.USERID
|
|||
// , this.ORDERNO, this.COMPLETECOUNT, this.STARTTIME.ToString("MM/dd/yy"));
|
|||
return sql.ToString(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 根据GUID获取16位的唯一字符串
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
private string GuidTo16String() |
|||
{ |
|||
long i = Guid.NewGuid().ToByteArray().Aggregate<byte, long>(1, (current, b) => current*((int) b + 1)); |
|||
return string.Format("{0:x}", i - DateTime.Now.Ticks).PadRight(16, '0').ToUpper(); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,92 @@ |
|||
using System; |
|||
using System.Data; |
|||
using QMAPP.Entity; |
|||
using QMFrameWork.Data.Attributes; |
|||
|
|||
namespace QMAPP.FJC.Entity.CompleteStatistics.Table |
|||
{ |
|||
/// <summary>
|
|||
/// 完工统计表
|
|||
/// </summary>
|
|||
[DBTable(TableName = "T_AW_COMPLETE_TJSTATISTICS", TimeStampColumn = "UPDATETIME")] |
|||
public class T_AW_COMPLETE_TJSTATISTICS : BaseEntity |
|||
{ |
|||
/// <summary>
|
|||
/// 设备信息主键
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "PID", DataType = DbType.String, IsKey = true)] |
|||
public string PID { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 零件号
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "MATERIALNO", DataType = DbType.String)] |
|||
public string MATERIALNO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 系统统计数量
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "SYSCOMPLETECOUNT", DataType = DbType.Int32)] |
|||
public int SYSCOMPLETECOUNT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 人工统计数量
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "COMPLETECOUNT", DataType = DbType.Int32)] |
|||
public int COMPLETECOUNT { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 开始时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "STARTTIME", DataType = DbType.DateTime)] |
|||
public DateTime STARTTIME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结束时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "ENDTIME", DataType = DbType.DateTime)] |
|||
public DateTime ENDTIME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 订单号
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "ORDERNO", DataType = DbType.String)] |
|||
public string ORDERNO { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATETIME", DataType = DbType.DateTime)] |
|||
public DateTime CREATETIME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 创建者
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "CREATEUSER", DataType = DbType.String)] |
|||
public string CREATEUSER { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新时间
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATETIME", DataType = DbType.DateTime)] |
|||
public DateTime UPDATETIME { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 更新者
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "UPDATEUSER", DataType = DbType.String)] |
|||
public string UPDATEUSER { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 删除标识
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "DELFLAG", DataType = DbType.String)] |
|||
public string DELFLAG { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 产线
|
|||
/// </summary>
|
|||
[DBColumn(ColumnName = "line", DataType = DbType.String)] |
|||
public string line { get; set; } |
|||
} |
|||
} |
@ -0,0 +1,183 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using QMAPP.Entity; |
|||
using QMFrameWork.Data.Attributes; |
|||
using System.ComponentModel; |
|||
using System.Data; |
|||
|
|||
namespace QMAPP.MD.Entity.TianJin |
|||
{ |
|||
/// <summary>
|
|||
/// 模块名称:注塑设备参数
|
|||
/// 作 者:张松男
|
|||
/// 编写日期:2024年07月12日
|
|||
/// </summary>
|
|||
[DBTable(TableName = "monitordata")] |
|||
public class Monitordata : BaseEntity |
|||
{ |
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
[Description("主键")] |
|||
[DBColumn(ColumnName = "id", DataType = DbType.String, IsKey = true)] |
|||
public string id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 条码
|
|||
/// </summary>
|
|||
[Description("条码")] |
|||
[DBColumn(ColumnName = "QrCodeContent", DataType = DbType.String)] |
|||
public string QrCodeContent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// IpAddr
|
|||
/// </summary>
|
|||
[Description("IpAddr")] |
|||
[DBColumn(ColumnName = "IpAddr", DataType = DbType.String)] |
|||
public string IpAddr { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生产时间
|
|||
/// </summary>
|
|||
[Description("生产时间")] |
|||
[DBColumn(ColumnName = "RecordDate", DataType = DbType.String)] |
|||
public string RecordDate { get; set; } |
|||
public DateTime EndTime { get; set; } |
|||
public DateTime BeginTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 注塑开始位置
|
|||
/// </summary>
|
|||
[Description("注塑开始位置")] |
|||
[DBColumn(ColumnName = "InjectStartPos", DataType = DbType.String)] |
|||
public string InjectStartPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 保压结束位置
|
|||
/// </summary>
|
|||
[Description("保压结束位置")] |
|||
[DBColumn(ColumnName = "HoldEndPos", DataType = DbType.String)] |
|||
public string HoldEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 储料完成位置
|
|||
/// </summary>
|
|||
[Description("储料完成位置")] |
|||
[DBColumn(ColumnName = "ChargeEndPos", DataType = DbType.String)] |
|||
public string ChargeEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 产品膜具
|
|||
/// </summary>
|
|||
[Description("产品膜具")] |
|||
[DBColumn(ColumnName = "sv_RecentMoldData", DataType = DbType.String)] |
|||
public string sv_RecentMoldData { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生产班次
|
|||
/// </summary>
|
|||
[Description("生产班次")] |
|||
[DBColumn(ColumnName = "tour", DataType = DbType.String)] |
|||
public string tour { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务编号
|
|||
/// </summary>
|
|||
[Description("任务编号")] |
|||
[DBColumn(ColumnName = "TaskNo", DataType = DbType.String)] |
|||
public string TaskNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CutOffPressure
|
|||
/// </summary>
|
|||
[Description("CutOffPressure")] |
|||
[DBColumn(ColumnName = "TasCutOffPressurekNo", DataType = DbType.String)] |
|||
public string CutOffPressure { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// HoldPresSPos
|
|||
/// </summary>
|
|||
[Description("HoldPresSPos")] |
|||
[DBColumn(ColumnName = "HoldPresSPos", DataType = DbType.String)] |
|||
public string HoldPresSPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjectMaxPressure
|
|||
/// </summary>
|
|||
[Description("InjectMaxPressure")] |
|||
[DBColumn(ColumnName = "InjectMaxPressure", DataType = DbType.String)] |
|||
public string InjectMaxPressure { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjectMaxSP
|
|||
/// </summary>
|
|||
[Description("InjectMaxSP")] |
|||
[DBColumn(ColumnName = "InjectMaxSP", DataType = DbType.String)] |
|||
public string InjectMaxSP { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// ChargeMaxRPM
|
|||
/// </summary>
|
|||
[Description("ChargeMaxRPM")] |
|||
[DBColumn(ColumnName = "ChargeMaxRPM", DataType = DbType.String)] |
|||
public string ChargeMaxRPM { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldOpenEndPos
|
|||
/// </summary>
|
|||
[Description("MoldOpenEndPos")] |
|||
[DBColumn(ColumnName = "MoldOpenEndPos", DataType = DbType.String)] |
|||
public string MoldOpenEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldProTime
|
|||
/// </summary>
|
|||
[Description("MoldProTime")] |
|||
[DBColumn(ColumnName = "MoldProTime", DataType = DbType.String)] |
|||
public string MoldProTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjSwitchTime
|
|||
/// </summary>
|
|||
[Description("InjSwitchTime")] |
|||
[DBColumn(ColumnName = "InjSwitchTime", DataType = DbType.String)] |
|||
public string InjSwitchTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// ChargeTime
|
|||
/// </summary>
|
|||
[Description("ChargeTime")] |
|||
[DBColumn(ColumnName = "ChargeTime", DataType = DbType.String)] |
|||
public string ChargeTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjHoldTime
|
|||
/// </summary>
|
|||
[Description("InjHoldTime")] |
|||
[DBColumn(ColumnName = "InjHoldTime", DataType = DbType.String)] |
|||
public string InjHoldTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldCloseTime
|
|||
/// </summary>
|
|||
[Description("MoldCloseTime")] |
|||
[DBColumn(ColumnName = "MoldCloseTime", DataType = DbType.String)] |
|||
public string MoldCloseTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldOpenTime
|
|||
/// </summary>
|
|||
[Description("MoldOpenTime")] |
|||
[DBColumn(ColumnName = "MoldOpenTime", DataType = DbType.String)] |
|||
public string MoldOpenTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CycleTime
|
|||
/// </summary>
|
|||
[Description("CycleTime")] |
|||
[DBColumn(ColumnName = "CycleTime", DataType = DbType.String)] |
|||
public string CycleTime { get; set; } |
|||
} |
|||
} |
Binary file not shown.
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<DataInfoMains> |
|||
<DataInfoMain InfoName="TJPaoMoPlanImp" InfoTitle="泡沫计划信息" TemplateFile="TJPaoMoPlanImp.xlsx" RecordCount="n"> |
|||
<DataInfoItems> |
|||
|
|||
<DataInfoItem ColumnName="PLAN_NO" ColumnTitle="计划单号" XPosition="A" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="MATERIAL_CODE" ColumnTitle="物料号" XPosition="B" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="PLAN_DATE" ColumnTitle="计划日期" XPosition="C" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="QTY" ColumnTitle="计划数量" XPosition="D" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="SHIFT_CODE" ColumnTitle="班次编码" XPosition="E" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="PRODUCEREQUIRE" ColumnTitle="生产要求" XPosition="F" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
</DataInfoItems> |
|||
</DataInfoMain> |
|||
</DataInfoMains> |
Binary file not shown.
@ -0,0 +1,43 @@ |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<DataInfoMains> |
|||
<DataInfoMain InfoName="TJZhuSuPlanImp" InfoTitle="注塑计划信息" TemplateFile="TJZhuSuPlanImp.xlsx" RecordCount="n"> |
|||
<DataInfoItems> |
|||
|
|||
<DataInfoItem ColumnName="PLAN_NO" ColumnTitle="计划单号" XPosition="A" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="MATERIAL_CODE" ColumnTitle="物料号" XPosition="B" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="PLAN_DATE" ColumnTitle="计划日期" XPosition="C" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="QTY" ColumnTitle="计划数量" XPosition="D" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="SHIFT_CODE" ColumnTitle="班次编码" XPosition="E" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
|
|||
<DataInfoItem ColumnName="PRODUCEREQUIRE" ColumnTitle="生产要求" XPosition="F" YPosition="3" > |
|||
<Observers> |
|||
<Observer name="Required" ></Observer> |
|||
</Observers> |
|||
</DataInfoItem> |
|||
</DataInfoItems> |
|||
</DataInfoMain> |
|||
</DataInfoMains> |
@ -0,0 +1,131 @@ |
|||
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.Basic; |
|||
using QMFrameWork.Data; |
|||
using QMAPP.FJC.Entity.Basic; |
|||
using QMAPP.ServicesAgent; |
|||
using QMAPP.Entity; |
|||
using QMAPP.MD.Entity; |
|||
using QMAPP.MD.Web.Models; |
|||
using QMFrameWork.WebUI.DataSource; |
|||
using QMFrameWork.Common.Serialization; |
|||
using QMAPP.MD.Entity.TianJin; |
|||
using QMAPP.FJC.Web.Models.TianJin; |
|||
using System.Data; |
|||
using QMAPP.FJC.BLL.TianJin; |
|||
|
|||
namespace QMAPP.FJC.Web.Controllers |
|||
{ |
|||
public class MonitordataController : QController |
|||
{ |
|||
#region 获取信息
|
|||
/// <summary>
|
|||
/// 加载列表
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HandleException] |
|||
public ActionResult List(bool? callback) |
|||
{ |
|||
MonitordataModel seachModel = new MonitordataModel(); |
|||
if (callback == true) |
|||
TryGetSelectBuffer<MonitordataModel>(out seachModel); |
|||
seachModel.rownumbers = false; |
|||
seachModel.url = "/Monitordata/GetList"; |
|||
return View("MonitordataList", seachModel); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 获取列表
|
|||
/// <summary>
|
|||
/// 获取列表
|
|||
/// </summary>
|
|||
/// <param name="callBack">是否回调</param>
|
|||
/// <returns>列表</returns>
|
|||
[HandleException] |
|||
public ActionResult GetList(bool? callBack) |
|||
{ |
|||
MonitordataModel seachModel = null; |
|||
DataPage page = null; |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
Monitordata condition = null; |
|||
DataResult<DataPage> pageResult = new DataResult<DataPage>(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<MonitordataModel>(); |
|||
#region 获取缓存值
|
|||
if (callBack != null) |
|||
{ |
|||
TryGetSelectBuffer<MonitordataModel>(out seachModel); |
|||
} |
|||
else |
|||
{ |
|||
//保存搜索条件
|
|||
SetSelectBuffer<MonitordataModel>(seachModel); |
|||
} |
|||
#endregion
|
|||
//获取前台分页设置信息
|
|||
page = this.GetDataPage(seachModel); |
|||
condition = CopyToModel<Monitordata, MonitordataModel>(seachModel); |
|||
#region wcf服务统一接口
|
|||
|
|||
pageResult = wcfAgent.InvokeServiceFunction<DataResult<DataPage>>("MonitordataBLL_GetList", condition, page); |
|||
if (pageResult.IsSuccess == false) |
|||
{ |
|||
SetMessage(pageResult.Msg); |
|||
return List(true); |
|||
} |
|||
DateGridResult<Monitordata> result = new DateGridResult<Monitordata>(); |
|||
result.Total = pageResult.Result.RecordCount; |
|||
result.Rows = JsonConvertHelper.GetDeserialize<List<Monitordata>>(pageResult.Result.Result.ToString()); |
|||
#endregion
|
|||
return Content(result.GetJsonSource()); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
#region 导出excel
|
|||
/// <summary>
|
|||
/// 导出excel
|
|||
/// </summary>
|
|||
/// <returns>结果</returns>
|
|||
[HttpPost] |
|||
public ActionResult ExportExcel() |
|||
{ |
|||
MonitordataModel seachModel = null; |
|||
Monitordata condition = null; |
|||
DataTable exportDt = new DataTable(); |
|||
ServiceAgent wcfAgent = this.GetServiceAgent(); |
|||
try |
|||
{ |
|||
//获取查询对象
|
|||
seachModel = GetModel<MonitordataModel>(); |
|||
condition = CopyToModel<Monitordata, MonitordataModel>(seachModel); |
|||
//condition.PIDList = Request.Form["selectKey"];
|
|||
//获取数据
|
|||
MonitordataBLL op = new MonitordataBLL(); |
|||
|
|||
//exportDt = op.GetExportData(condition);
|
|||
exportDt = wcfAgent.InvokeServiceFunction<DataTable>("MonitordataBLL_GetExportData", condition); |
|||
|
|||
//导出
|
|||
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool(); |
|||
return efTool.GetExcelFileResult("MonitordataExp", "库存日志信息.xlsx", exportDt); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw ex; |
|||
} |
|||
} |
|||
#endregion
|
|||
} |
|||
} |
@ -0,0 +1,242 @@ |
|||
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 |
|||
{ |
|||
/// <summary>
|
|||
/// 模块名称:注塑信息
|
|||
/// 作 者:张松男
|
|||
/// 编写日期:2022年02月17日
|
|||
/// </summary>
|
|||
public class MonitordataModel : QDGModel |
|||
{ |
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
[Description("主键")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 36)] |
|||
[DGColumn(Hidden = true, PrimaryKey = true)] |
|||
public string id { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 条码
|
|||
/// </summary>
|
|||
[Description("条码")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string QrCodeContent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// IpAddr
|
|||
/// </summary>
|
|||
[Description("IpAddr")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string IpAddr { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生产时间
|
|||
/// </summary>
|
|||
[Description("生产时间")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public DateTime RecordDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 注塑开始位置
|
|||
/// </summary>
|
|||
[Description("注塑开始位置")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string InjectStartPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 保压结束位置
|
|||
/// </summary>
|
|||
[Description("保压结束位置")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string HoldEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 储料完成位置
|
|||
/// </summary>
|
|||
[Description("储料完成位置")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string ChargeEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 产品膜具
|
|||
/// </summary>
|
|||
[Description("产品膜具")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string sv_RecentMoldData { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 生产班次
|
|||
/// </summary>
|
|||
[Description("生产班次")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string tour { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务编号
|
|||
/// </summary>
|
|||
[Description("任务编号")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string TaskNo { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CutOffPressure
|
|||
/// </summary>
|
|||
[Description("CutOffPressure")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string CutOffPressure { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// HoldPresSPos
|
|||
/// </summary>
|
|||
[Description("HoldPresSPos")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string HoldPresSPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjectMaxPressure
|
|||
/// </summary>
|
|||
[Description("InjectMaxPressure")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string InjectMaxPressure { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjectMaxSP
|
|||
/// </summary>
|
|||
[Description("InjectMaxSP")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string InjectMaxSP { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// ChargeMaxRPM
|
|||
/// </summary>
|
|||
[Description("ChargeMaxRPM")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string ChargeMaxRPM { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldOpenEndPos
|
|||
/// </summary>
|
|||
[Description("MoldOpenEndPos")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string MoldOpenEndPos { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldProTime
|
|||
/// </summary>
|
|||
[Description("MoldProTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string MoldProTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjSwitchTime
|
|||
/// </summary>
|
|||
[Description("InjSwitchTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string InjSwitchTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// ChargeTime
|
|||
/// </summary>
|
|||
[Description("ChargeTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string ChargeTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// InjHoldTime
|
|||
/// </summary>
|
|||
[Description("InjHoldTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string InjHoldTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldCloseTime
|
|||
/// </summary>
|
|||
[Description("MoldCloseTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string MoldCloseTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// MoldOpenTime
|
|||
/// </summary>
|
|||
[Description("MoldOpenTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string MoldOpenTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// CycleTime
|
|||
/// </summary>
|
|||
[Description("CycleTime")] |
|||
[HTMLInput(UpdateRead = false, required = true, MaxLength = 200)] |
|||
[InputType(inputType.text)] |
|||
[DGColumn(frozenColumns = false, Sortable = true, Width = 200, DataAlign = DataAlign.center)] |
|||
public string CycleTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 开始时间
|
|||
/// </summary>
|
|||
[Description("开始时间")] |
|||
[HTMLInput(UpdateRead = true, MaxLength = 20)] |
|||
[InputType(inputType.dateTimeBox)] |
|||
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss", Hidden = true)] |
|||
public string BeginTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结束时间
|
|||
/// </summary>
|
|||
[Description("结束时间")] |
|||
[HTMLInput(UpdateRead = true, MaxLength = 20)] |
|||
[InputType(inputType.dateTimeBox)] |
|||
[DGColumn(Sortable = true, Width = 150, DataAlign = DataAlign.center, FormatDate = "yyyy-MM-dd hh:mm:ss", Hidden = true)] |
|||
public string EndTime { get; set; } |
|||
} |
|||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,91 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.FJC.Web.Models.TianJin.MonitordataModel>" %> |
|||
|
|||
<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.QrCodeContent)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.QrCodeContent)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.BeginTime)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.BeginTime)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.EndTime)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.EndTime)%> |
|||
</td> |
|||
</tr> |
|||
|
|||
</table> |
|||
<%=Html.QPEnd()%> |
|||
<%=Html.QPList() %> |
|||
<%=Html.QDateGrid<QMAPP.FJC.Web.Models.TianJin.MonitordataModel>(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 Export() { |
|||
document.getElementById("selectKey").value = getSelectKey(); |
|||
submitByButton("ExportExcel"); |
|||
} |
|||
|
|||
//查询 |
|||
function Search() { |
|||
//var endtime = document.getElementById("PLANTIMEEND").value; |
|||
//if (parseDate($("#PLANTIMESTART").val()) > parseDate($("#PLANTIMEEND").val()) && endtime != "") { |
|||
// alert("开始时间不能大于结束时间!"); |
|||
// return; |
|||
//} |
|||
List(1) |
|||
} |
|||
|
|||
$(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("Monitordata", "List", "Search()", 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,170 @@ |
|||
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" |
|||
Inherits="System.Web.Mvc.ViewPage<QMAPP.MESReport.Web.Models.LineQTY.QTYCompletionRateVModel>" %> |
|||
|
|||
<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.MATERIAL_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.MATERIAL_CODE)%> |
|||
</td> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.TYPE_COUNT)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.TYPE_COUNT)%> |
|||
</td>--%> |
|||
<th align="right"> |
|||
<%=Html.QV(p => p.WORKCENTER_CODE)%> |
|||
</th> |
|||
<td> |
|||
<%=Html.QC(p => p.WORKCENTER_CODE)%> |
|||
</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.MESReport.Web.Controllers.EChartExampleController.QMEChartPageConfig()%> |
|||
<div style="overflow: auto; height: 99%;"> |
|||
<div style="width: 100%; text-align: center;"> |
|||
<%--异步获取数据生成图表--%> |
|||
<%=QMFrameWork.WebUI.QMEChart.QMEChartHelper.CreateEchart("echartID", "/QTYCompletionRateCount/GetEchartDataBar2", new string[] { "line", "bar" } |
|||
, "myEChart",400, QMFrameWork.WebUI.QMEChart.QMEChartHelper.echartEventEnum.click, "")%> |
|||
</div> |
|||
<div style="width: 100%; text-align: center;padding: 15px 0 0 0;"> |
|||
<table id="maintb" class="mtbtt" style="width:90%; margin:0px auto;"> |
|||
|
|||
</table> |
|||
</div> |
|||
</div> |
|||
|
|||
<script type="text/javascript"> |
|||
function GetTable() { |
|||
$.ajax({ |
|||
type: "POST", |
|||
url: "/QTYCompletionRateCount/GetTable?WORKCENTER_CODE=" + $("input[name='WORKCENTER_CODE']").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) { |
|||
//alert(errorThrown); |
|||
} |
|||
|
|||
}); |
|||
} |
|||
|
|||
function refreshEChartbar2() { |
|||
var endtime = document.getElementById("END_DATE").value; |
|||
if (parseDate($("#START_DATE").val()) > parseDate($("#END_DATE").val()) && endtime != "") { |
|||
alert("开始时间不能大于结束时间!"); |
|||
return; |
|||
} |
|||
var ps = []; |
|||
|
|||
var WORKCENTER_CODE = {}; |
|||
WORKCENTER_CODE.key = "WORKCENTER_CODE"; |
|||
WORKCENTER_CODE.value = $("input[name='WORKCENTER_CODE']").val(); |
|||
ps.push(WORKCENTER_CODE); |
|||
|
|||
// var MATERIAL_CODE = {}; |
|||
// MATERIAL_CODE.key = "MATERIAL_CODE"; |
|||
// MATERIAL_CODE.value = $("input[name='MATERIAL_CODE']").val(); |
|||
// ps.push(MATERIAL_CODE); |
|||
|
|||
// 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("/QTYCompletionRateCount/GetEchartDataBar2", myEChart, ps); |
|||
GetTable(); |
|||
} |
|||
|
|||
//导出图片 |
|||
// function Export() { |
|||
// var img = myEChart.getDataURL("png"); |
|||
// $("#hiChartImg").val(img); |
|||
// submitByButton("ExportBanCi"); |
|||
// } |
|||
|
|||
//导出Excel |
|||
function Export() { |
|||
var ids = document.getElementById("selectKey").value; |
|||
$.get("/QTYCompletionRateCount/ExportExcel", $("form").serializeArray(), function (data) { |
|||
submitByButton("/QTYCompletionRateCount/ExportFile?FileName=" + data); |
|||
}); |
|||
} |
|||
</script> |
|||
<input id="hiChartImg" name="hiChartImg" type="hidden" /> |
|||
|
|||
|
|||
|
|||
|
|||
<%=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("QTYCompletionRateCount", "QTYCompletionRateCountView", "refreshEChartbar2()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
<%=Html.QTButton("export", "ExportBanCi", QMFrameWork.WebUI.IconCls.redo, "Export()", QMAPP.Common.Web.SystemLimit.isLimt)%> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
</asp:Content> |
Loading…
Reference in new issue