Browse Source

提交

master
学 赵 4 years ago
parent
commit
6d8dfe6934
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 425
      Controller/SCP_FORECAST_CONTROLLER.cs
  3. 160
      Controller/SCP_REPORT_CONTROLLER.cs
  4. 4
      Controller/UniApiController.cs
  5. 2
      Models/ScpEntities.cs
  6. 2
      Models/ScpEntity/TB_PO_DETAIL.cs
  7. 24
      SCP/SCP.csproj
  8. 101
      SCP/Views/PlanData/SCP_FORECAST.aspx
  9. 239
      SCP/Views/PlanData/SCP_FORECAST.aspx.cs
  10. 204
      SCP/Views/PlanData/SCP_FORECAST.aspx.designer.cs
  11. 101
      SCP/Views/SupplierData/SCP_FORECAST.aspx
  12. 240
      SCP/Views/SupplierData/SCP_FORECAST.aspx.cs
  13. 204
      SCP/Views/SupplierData/SCP_FORECAST.aspx.designer.cs
  14. 87
      SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx
  15. 105
      SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx.cs
  16. 150
      SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx.designer.cs
  17. 7
      UniApiGroup/Controller/OdbcApiQadController.cs

1
Controller/CK.SCP.Controller.csproj

@ -58,7 +58,6 @@
<Compile Include="SCP_BARCODE_CONTROLLER_CUSTOM.cs" /> <Compile Include="SCP_BARCODE_CONTROLLER_CUSTOM.cs" />
<Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" /> <Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" />
<Compile Include="SCP_DC_UNI_CONTROLLER.cs" /> <Compile Include="SCP_DC_UNI_CONTROLLER.cs" />
<Compile Include="SCP_FORECAST_CONTROLLER.cs" />
<Compile Include="SCP_PALLET_CONTROLLER.cs" /> <Compile Include="SCP_PALLET_CONTROLLER.cs" />
<Compile Include="SCP_PLAN_CONTROLLER.cs" /> <Compile Include="SCP_PLAN_CONTROLLER.cs" />
<Compile Include="SCP_QUALITY_CONTROLLER.cs" /> <Compile Include="SCP_QUALITY_CONTROLLER.cs" />

425
Controller/SCP_FORECAST_CONTROLLER.cs

@ -1,425 +0,0 @@
using CK.SCP.Models;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using System;
using System.Collections.Generic;
using System.Data.Entity.Core;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Controller
{
public class SCP_FORECAST_CONTROLLER
{
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_V_TB_FORECAST_List(V_TB_FORECAST p_entity, Action<ResultObject<IQueryable<V_TB_FORECAST>>> p_action)
{
ResultObject<IQueryable<V_TB_FORECAST>> _ret = new ResultObject<IQueryable<V_TB_FORECAST>>();
try
{
using (Models.ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TB_FORECAST> q = db.V_TB_FORECAST;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode.Contains(p_entity.PartCode));
}
if (!string.IsNullOrEmpty(p_entity.VendId))
{
q = q.Where(p => p.VendId == p_entity.VendId);
}
if (p_entity.BillStateList != null && p_entity.BillStateList.Count > 0)
{
q = q.Where(p => p_entity.BillStateList.Contains((int)p.State));
}
if (!string.IsNullOrEmpty(p_entity.State_DESC))
{
q = q.Where(p => p.State_DESC.Contains(p_entity.State_DESC));
}
if (!string.IsNullOrEmpty(p_entity.Month))
{
q = q.Where(p => p.Month == p_entity.Month);
}
q = q.Where(p => p.IsDeleted == p_entity.IsDeleted);
if (p_entity.UserInAddress != null && p_entity.UserInAddress.Count > 0)
{
q = q.Where(p => p_entity.UserInAddress.Contains(p.Site));
}
if (!string.IsNullOrEmpty(p_entity.CreateUser))
{
q = q.Where(p => p.CreateUser == p_entity.CreateUser);
}
if (p_entity.UserInVendIds != null && p_entity.UserInVendIds.Count > 0)
{
q = q.Where(p => p_entity.UserInVendIds.Contains(p.VendId));
}
_ret.State = ReturnStatus.Succeed;
_ret.Result = q;
p_action(_ret);
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Get_V_TB_FORECAST_List", e.Message);
throw e;
}
}
/// <summary>
/// EXCEL导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_FORECAST_MOD(List<SCP_FORECAST_EXPORT> p_order_list, string p_creator, string site)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
int number = 1;
List<string> lineError = new List<string>();
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
_lst.ForEach
(p =>
{
var _ls = CheckExcelMode_Forecast(db, p);
if (_ls.Count > 0)
{
lineError.Add(number.ToString());
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
number++;
});
if (lineError.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
_lst.ForEach(p =>
{
var _item = db.TB_FORECAST.SingleOrDefault(t => t.PartCode == p..ToUpper() && t.VendId == p. && t.Month == p.) ??
new TB_FORECAST { PartCode = p..ToUpper(), VendId = p., Month = p., GUID = System.Guid.NewGuid() };
_item.MonthQty1 = decimal.Parse(p.1);
_item.MonthQty2 = decimal.Parse(p.2);
_item.MonthQty3 = decimal.Parse(p.3);
_item.IsDeleted = false;
_item.CreateUser = p_creator;
_item.CreateTime = DateTime.Now;
_item.State = (int)ForecastState.New;
_item.UpdateInfo = "";
_item.Site = site;
db.TB_FORECAST.AddOrUpdate(_item);
});
if (_ret.MessageList.Count == 0)
{
int state = db.SaveChanges();
if (state != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "EXCEL_FORECAST_MOD", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
/// <summary>
/// 导入验证
/// </summary>
/// <param name="db"></param>
/// <param name="p_excel"></param>
/// <returns></returns>
private static List<string> CheckExcelMode_Forecast(ScpEntities db, SCP_FORECAST_EXPORT p_excel)
{
List<string> ErrorList = new List<string>();
if (
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty(p_excel.) ||
string.IsNullOrEmpty((p_excel.).ToString()) ||
string.IsNullOrEmpty(p_excel.1) ||
string.IsNullOrEmpty(p_excel.2) ||
string.IsNullOrEmpty(p_excel.3))
{
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.));
}
return ErrorList;
}
public static ResultObject<bool> Save_TB_FORECAST_STATE(List<long> p_list, string p_user, ForecastState State)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
if (State == ForecastState.Confirm)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.New);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.Confirm;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "供应商确认";
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有已经确认的数据!";
}
}
if (State == ForecastState.Reject)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.New);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.Reject;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "作废";
p.IsDeleted = true ;
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有已经确认的数据!";
}
}
if (State == ForecastState.New)
{
var _ls = db.TB_FORECAST.Where(p => p_list.Contains(p.UID)).ToList();
int count = _ls.Count(p => p.State == (int)ForecastState.Confirm);
if (count == _ls.Count && _ls.Count > 0)
{
_ls.ForEach(p =>
{
p.State = (int)ForecastState.New;
p.UpdateTime = DateTime.Now;
p.UpdateUser = p_user;
p.UpdateInfo = "取消确认";
}
);
db.TB_FORECAST.AddOrUpdate(p => p.UID, _ls.ToArray());
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "选择的记录,有不是确认的数据!";
}
}
if (string.IsNullOrEmpty(_ret.Message))
{
if (db.SaveChanges() != -1)
{
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
}
else
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.Message = "数据更新失败!";
}
}
}
}
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{
var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList())
{
error.ValidationErrors.ToList().ForEach(i =>
{
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
});
}
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
}
catch (OptimisticConcurrencyException ex)//并发冲突异常
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
}
catch (ScpException ex)
{
_ret.State = ReturnStatus.Failed;
_ret.Result = false;
_ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{
var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
}
else
{
if (ex.InnerException != null) throw ex.InnerException;
}
}
catch (Exception e)
{
_ret.State = ReturnStatus.Failed;
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_FORECAST_CONTROLLER), "Save_TB_FORECAST_STATE", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
}
}

160
Controller/SCP_REPORT_CONTROLLER.cs

@ -761,27 +761,27 @@ namespace CK.SCP.Controller
_builder.Append(" on s1.AskBillNum=s2.AskBillNum and s1.PartCode=s2.PartCode and s1.PoLine=s2.PoLine"); _builder.Append(" on s1.AskBillNum=s2.AskBillNum and s1.PartCode=s2.PartCode and s1.PoLine=s2.PoLine");
return _builder.ToString(); return _builder.ToString();
} }
public static string Get_V_SCP_FORECAST_REPORT_SQL(V_FORECAST_REPORT p_entity) //public static string Get_V_SCP_FORECAST_REPORT_SQL(V_FORECAST_REPORT p_entity)
{ //{
StringBuilder _builder = new StringBuilder(); // StringBuilder _builder = new StringBuilder();
_builder.Append(" select B.PartCode,B.VendId,B.AskQty,B.Month, ISNULL(c.MonthQty1,0) as MonthQty1 ,ISNULL(c.MonthQty2,0) as MonthQty2 ,ISNULL(c.MonthQty3,0) as MonthQty3 from ( "); // _builder.Append(" select B.PartCode,B.VendId,B.AskQty,B.Month, ISNULL(c.MonthQty1,0) as MonthQty1 ,ISNULL(c.MonthQty2,0) as MonthQty2 ,ISNULL(c.MonthQty3,0) as MonthQty3 from ( ");
_builder.Append(" (selecT PartCode,VendId ,MONTH(BeginTime) as Month,sum(AskQty) as AskQty from V_TB_ASK_DETAIL A "); // _builder.Append(" (selecT PartCode,VendId ,MONTH(BeginTime) as Month,sum(AskQty) as AskQty from V_TB_ASK_DETAIL A ");
_builder.Append(" where A.IsDeleted=0 group by A.PartCode,A.VendId ,MONTH(A.BeginTime)) B LEFT OUTER JOIN "); // _builder.Append(" where A.IsDeleted=0 group by A.PartCode,A.VendId ,MONTH(A.BeginTime)) B LEFT OUTER JOIN ");
_builder.Append(" TB_FORECAST c on B.PartCode=c.PartCode and B.VendId=c.VendId and b.Month=c.Month and c.IsDeleted=0 and c.State=1 ) where 1=1 "); // _builder.Append(" TB_FORECAST c on B.PartCode=c.PartCode and B.VendId=c.VendId and b.Month=c.Month and c.IsDeleted=0 and c.State=1 ) where 1=1 ");
if (!string.IsNullOrEmpty(p_entity.PartCode)) // if (!string.IsNullOrEmpty(p_entity.PartCode))
{ // {
_builder.AppendFormat(" And B.PartCode='{0}'", p_entity.PartCode); // _builder.AppendFormat(" And B.PartCode='{0}'", p_entity.PartCode);
} // }
if (!string.IsNullOrEmpty(p_entity.VendId)) // if (!string.IsNullOrEmpty(p_entity.VendId))
{ // {
_builder.AppendFormat(" And B.VendId='{0}'", p_entity.VendId); // _builder.AppendFormat(" And B.VendId='{0}'", p_entity.VendId);
} // }
if (p_entity.Month!=0) // if (p_entity.Month!=0)
{ // {
_builder.AppendFormat(" And B.Month='{0}'", p_entity.Month); // _builder.AppendFormat(" And B.Month='{0}'", p_entity.Month);
} // }
return _builder.ToString(); // return _builder.ToString();
} //}
/// <summary> /// <summary>
/// 按零件编号获取及时率语句(沈阳) /// 按零件编号获取及时率语句(沈阳)
/// </summary> /// </summary>
@ -839,68 +839,68 @@ namespace CK.SCP.Controller
return _builder.ToString(); return _builder.ToString();
} }
public static void Get_V_SCP_FORECAST_REPORT_List(V_FORECAST_REPORT p_entity, Action<ResultObject<IQueryable<V_FORECAST_REPORT>>> p_action) //public static void Get_V_SCP_FORECAST_REPORT_List(V_FORECAST_REPORT p_entity, Action<ResultObject<IQueryable<V_FORECAST_REPORT>>> p_action)
{ //{
ResultObject<IQueryable<V_FORECAST_REPORT>> _ret = new ResultObject<IQueryable<V_FORECAST_REPORT>>(); // ResultObject<IQueryable<V_FORECAST_REPORT>> _ret = new ResultObject<IQueryable<V_FORECAST_REPORT>>();
try // try
{ // {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) // using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{ // {
string _sql = Get_V_SCP_FORECAST_REPORT_SQL(p_entity); // string _sql = Get_V_SCP_FORECAST_REPORT_SQL(p_entity);
IQueryable<V_FORECAST_REPORT> q = db.Database.SqlQuery<V_FORECAST_REPORT>(_sql).AsQueryable(); // IQueryable<V_FORECAST_REPORT> q = db.Database.SqlQuery<V_FORECAST_REPORT>(_sql).AsQueryable();
_ret.State = ReturnStatus.Succeed; // _ret.State = ReturnStatus.Succeed;
_ret.Result = q; // _ret.Result = q;
p_action(_ret); // p_action(_ret);
} // }
} // }
catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常 // catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)//捕获实体验证异常
{ // {
var sb = new StringBuilder(); // var sb = new StringBuilder();
foreach (var error in dbEx.EntityValidationErrors.ToList()) // foreach (var error in dbEx.EntityValidationErrors.ToList())
{ // {
error.ValidationErrors.ToList().ForEach(i => // error.ValidationErrors.ToList().ForEach(i =>
{ // {
sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage); // sb.AppendFormat("表:{0},字段:{1},信息:{2}\r\n", error.Entry.Entity.GetType().Name, i.PropertyName, i.ErrorMessage);
}); // });
} // }
_ret.State = ReturnStatus.Failed; // _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(dbEx); // _ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", sb.ToString()); // LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", sb.ToString());
throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString()); // throw new ScpException(ResultCode.DbEntityValidationException, sb.ToString(), "字段验证失败" + sb.ToString());
} // }
catch (OptimisticConcurrencyException ex)//并发冲突异常 // catch (OptimisticConcurrencyException ex)//并发冲突异常
{ // {
_ret.State = ReturnStatus.Failed; // _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); // _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", ex.ToString()); // LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", ex.ToString());
throw new ScpException(ResultCode.Exception, "9999", ex.ToString()); // throw new ScpException(ResultCode.Exception, "9999", ex.ToString());
} // }
catch (ScpException ex) // catch (ScpException ex)
{ // {
_ret.State = ReturnStatus.Failed; // _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(ex); // _ret.ErrorList.Add(ex);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", ex.ToString()); // LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", ex.ToString());
if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException)) // if (ex.InnerException != null && ex.InnerException.GetType() == typeof(UpdateException))
{ // {
var inner = (UpdateException)ex.InnerException; // var inner = (UpdateException)ex.InnerException;
throw new ScpException(ResultCode.Exception, "0000", ex.ToString()); // throw new ScpException(ResultCode.Exception, "0000", ex.ToString());
} // }
else // else
{ // {
if (ex.InnerException != null) throw ex.InnerException; // if (ex.InnerException != null) throw ex.InnerException;
} // }
} // }
catch (Exception e) // catch (Exception e)
{ // {
_ret.State = ReturnStatus.Failed; // _ret.State = ReturnStatus.Failed;
_ret.ErrorList.Add(e); // _ret.ErrorList.Add(e);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", e.Message); // LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_REPORT_CONTROLLER), "Get_V_SCP_FORECAST_REPORT_List", e.Message);
throw e; // throw e;
} // }
} //}
/// <summary> /// <summary>
/// 获取及时率数据 /// 获取及时率数据
/// </summary> /// </summary>

4
Controller/UniApiController.cs

@ -188,8 +188,8 @@ namespace CK.SCP.Controller
apiData.Domain = bill.Site; apiData.Domain = bill.Site;
apiData.Site = bill.SubSite; apiData.Site = bill.SubSite;
Extend1 = Utils.JsonHelper.GetJson(bill), apiData.Extend1 = Utils.JsonHelper.GetJson(bill);
Extend2 = Utils.JsonHelper.GetJson(detail) apiData.Extend2 = Utils.JsonHelper.GetJson(detail);
return apiData; return apiData;

2
Models/ScpEntities.cs

@ -118,7 +118,7 @@ namespace CK.SCP.Models
public virtual DbSet<V_TA_VEND_PART> V_TA_VEND_PART { get; set; } public virtual DbSet<V_TA_VEND_PART> V_TA_VEND_PART { get; set; }
public virtual DbSet<TB_PRICE> TB_PRICE { get; set; } public virtual DbSet<TB_PRICE> TB_PRICE { get; set; }
public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; } public virtual DbSet<TB_FORECAST> TB_FORECAST { get; set; }
public virtual DbSet<V_TB_FORECAST> V_TB_FORECAST { get; set; }
public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; } public virtual DbSet<TB_RECEIVE_DETAIL_QAD> TB_RECEIVE_DETAIL_QAD { get; set; }
public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; } public virtual DbSet<TB_RECEIVE_QAD> TB_RECEIVE_QAD { get; set; }

2
Models/ScpEntity/TB_PO_DETAIL.cs

@ -76,7 +76,7 @@ namespace CK.SCP.Models.ScpEntity
public string Extend3 { get; set; } public string Extend3 { get; set; }
public string SubSite { get; set; } public string SubSite { get; set; }
public string Site { get; set; }
} }
} }

24
SCP/SCP.csproj

@ -2923,7 +2923,6 @@
<Content Include="Views\PlanData\SCP_PART_LIFE.aspx" /> <Content Include="Views\PlanData\SCP_PART_LIFE.aspx" />
<Content Include="Views\PlanData\SCP_PART_LIFE_DETAIL.aspx" /> <Content Include="Views\PlanData\SCP_PART_LIFE_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_PLAN_DETAIL.aspx" /> <Content Include="Views\PlanData\SCP_PLAN_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_FORECAST.aspx" />
<Content Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx" /> <Content Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx" />
<Content Include="Views\PlanData\SCP_ASK_DETAIL.aspx" /> <Content Include="Views\PlanData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\PlanData\SCP_ASN_DETAIL_View.aspx" /> <Content Include="Views\PlanData\SCP_ASN_DETAIL_View.aspx" />
@ -2956,7 +2955,6 @@
<Content Include="Views\SupplierData\SCP_ASK_DETAIL.aspx" /> <Content Include="Views\SupplierData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\SupplierData\SCP_CLAIM_DETAIL.aspx" /> <Content Include="Views\SupplierData\SCP_CLAIM_DETAIL.aspx" />
<Content Include="Views\SupplierData\SCP_CLAIM_EDIT.aspx" /> <Content Include="Views\SupplierData\SCP_CLAIM_EDIT.aspx" />
<Content Include="Views\SupplierData\SCP_FORECAST.aspx" />
<Content Include="Views\SupplierData\SCP_INFO.aspx" /> <Content Include="Views\SupplierData\SCP_INFO.aspx" />
<Content Include="Views\SupplierData\SCP_INFO_EDIT.aspx" /> <Content Include="Views\SupplierData\SCP_INFO_EDIT.aspx" />
<Content Include="Views\SupplierData\SCP_MAKE_PAGE_BARCODE.aspx" /> <Content Include="Views\SupplierData\SCP_MAKE_PAGE_BARCODE.aspx" />
@ -4532,7 +4530,6 @@
<Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASK_DETAIL.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASN.aspx" />
<Content Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx" /> <Content Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT.aspx" />
<Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT_VendID.aspx" /> <Content Include="Views\沈阳金杯\Report\SCP_OTD_REPORT_VendID.aspx" />
@ -5179,13 +5176,6 @@
<Compile Include="Views\PlanData\SCP_PLAN_DETAIL.aspx.designer.cs"> <Compile Include="Views\PlanData\SCP_PLAN_DETAIL.aspx.designer.cs">
<DependentUpon>SCP_PLAN_DETAIL.aspx</DependentUpon> <DependentUpon>SCP_PLAN_DETAIL.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\PlanData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\PlanData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx.cs"> <Compile Include="Views\PlanData\SCP_INCOMPLETE_ASK.aspx.cs">
<DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon> <DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5408,13 +5398,6 @@
<Compile Include="Views\SupplierData\SCP_CLAIM_EDIT.aspx.designer.cs"> <Compile Include="Views\SupplierData\SCP_CLAIM_EDIT.aspx.designer.cs">
<DependentUpon>SCP_CLAIM_EDIT.aspx</DependentUpon> <DependentUpon>SCP_CLAIM_EDIT.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\SupplierData\SCP_FORECAST.aspx.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\SupplierData\SCP_FORECAST.aspx.designer.cs">
<DependentUpon>SCP_FORECAST.aspx</DependentUpon>
</Compile>
<Compile Include="Views\SupplierData\SCP_INFO.aspx.cs"> <Compile Include="Views\SupplierData\SCP_INFO.aspx.cs">
<DependentUpon>SCP_INFO.aspx</DependentUpon> <DependentUpon>SCP_INFO.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -5793,13 +5776,6 @@
<Compile Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx.designer.cs"> <Compile Include="Views\沈阳金杯\PlanData\SCP_ASN_LIST.aspx.designer.cs">
<DependentUpon>SCP_ASN_LIST.aspx</DependentUpon> <DependentUpon>SCP_ASN_LIST.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_FORECAST_REPORT.aspx.designer.cs">
<DependentUpon>SCP_FORECAST_REPORT.aspx</DependentUpon>
</Compile>
<Compile Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx.cs"> <Compile Include="Views\沈阳金杯\Report\SCP_INCOMPLETE_ASK.aspx.cs">
<DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon> <DependentUpon>SCP_INCOMPLETE_ASK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

101
SCP/Views/PlanData/SCP_FORECAST.aspx

@ -1,101 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.PlanData.SCP_FORECAST" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnSave" runat="server" Hidden="true" Text="确认" Icon="CssValid" OnClick="btnSave_Click" ></f:Button>
<f:Button ID="btnCancleSave" runat="server" Hidden="true" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button>
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="50px" ID="extForm1"
runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="33% 33% 33% 33%" ID="FormRow_2" runat="server">
<Items>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId">
</f:TextBox>
<f:DropDownList ID="ddl_Day" runat="server" Label="查询月份">
<f:ListItem Text="全部" Value="0" Selected="true" />
<f:ListItem Text="1月" Value="1" />
<f:ListItem Text="2月" Value="2" />
<f:ListItem Text="3月" Value="3" />
<f:ListItem Text="4月" Value="4" />
<f:ListItem Text="5月" Value="5" />
<f:ListItem Text="6月" Value="6" />
<f:ListItem Text="7月" Value="7" />
<f:ListItem Text="8月" Value="8" />
<f:ListItem Text="9月" Value="9" />
<f:ListItem Text="10月" Value="10" />
<f:ListItem Text="11月" Value="11" />
<f:ListItem Text="12月" Value="12" />
</f:DropDownList>
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已确认" Value="1" />
</f:DropDownList>
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true"
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="月份" ColumnID="" DataField="Month" />
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" />
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" />
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" />
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" />
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" />
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

239
SCP/Views/PlanData/SCP_FORECAST.aspx.cs

@ -1,239 +0,0 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
namespace SCP.Views.PlanData
{
public partial class SCP_FORECAST : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TB_FORECAST_Data((result) =>
{
Grid_V_TB_FORECAST.RecordCount = result.Count();
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST);
Grid_V_TB_FORECAST.DataSource = list;
Grid_V_TB_FORECAST.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action)
{
V_TB_FORECAST _entity = new V_TB_FORECAST();
_entity.IsDeleted = false;
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextVendId.Text))
{
_entity.VendId = TextVendId.Text;
}
if (ddl_Day.SelectedValue != "0")
{
_entity.Month = ddl_Day.SelectedValue;
}
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) };
}
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
try
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
/// <summary>
/// 确认数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 取消确认
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnCancleSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
}
}

204
SCP/Views/PlanData/SCP_FORECAST.aspx.designer.cs

@ -1,204 +0,0 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.PlanData {
public partial class SCP_FORECAST {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSave;
/// <summary>
/// btnCancleSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancleSave;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDelete;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// ddl_Day 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddl_Day;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid_V_TB_FORECAST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_FORECAST;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

101
SCP/Views/SupplierData/SCP_FORECAST.aspx

@ -1,101 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST.aspx.cs" Inherits="SCP.Views.SupplierData.SCP_FORECAST" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<f:Button ID="btnSave" runat="server" Text="确认" Icon="CssValid" OnClick="btnSave_Click" ></f:Button>
<f:Button ID="btnCancleSave" runat="server" Text="取消确认" Icon="CssGo" OnClick="BtnCancleSave_Click" OnClientClick="if(!confirm('是否取消确认?'))return false;"></f:Button>
<f:Button ID="btnDelete" runat="server" Hidden="true" Text="删除" Icon="CssDelete" OnClick="btnDelete_Click" OnClientClick="if(!confirm('是否删除?'))return false;" ></f:Button>
<f:ToolbarSeparator runat="server" />
<f:FileUpload runat="server" ID="FileUp" EmptyText="请选择要货单据" Required="true" Hidden="true" Width="200" ButtonIcon="Add" ShowRedStar="true"></f:FileUpload>
<f:Button ID="btnInput" runat="server" Text="导入" Icon="PageExcel" Hidden="true" OnClick="btnInput_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="50px" ID="extForm1"
runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="33% 33% 33% 33%" ID="FormRow_2" runat="server">
<Items>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编码" ID="TextVendId">
</f:TextBox>
<f:DropDownList ID="ddl_Day" runat="server" Label="查询月份">
<f:ListItem Text="全部" Value="0" Selected="true" />
<f:ListItem Text="1月" Value="1" />
<f:ListItem Text="2月" Value="2" />
<f:ListItem Text="3月" Value="3" />
<f:ListItem Text="4月" Value="4" />
<f:ListItem Text="5月" Value="5" />
<f:ListItem Text="6月" Value="6" />
<f:ListItem Text="7月" Value="7" />
<f:ListItem Text="8月" Value="8" />
<f:ListItem Text="9月" Value="9" />
<f:ListItem Text="10月" Value="10" />
<f:ListItem Text="11月" Value="11" />
<f:ListItem Text="12月" Value="12" />
</f:DropDownList>
<f:DropDownList runat="server" ID="DDL_State" Label="状态">
<f:ListItem Text="-" Value=""/>
<f:ListItem Text="新建" Value="0" />
<f:ListItem Text="已确认" Value="1" />
</f:DropDownList>
<f:Button runat="server" ID="Button1" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid_V_TB_FORECAST" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid" EnableCheckBoxSelect="true"
runat="server" DataKeyNames="UID,PartCode,Month,MonthQty1,MonthQty2,MonthQty3,State,CreateUser,CreateTime"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_V_TB_FORECAST_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True">
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="UID" Hidden="true" ColumnID="" DataField="UID" />
<f:BoundField runat="server" HeaderText="状态" ColumnID="" DataField="State_DESC" />
<f:BoundField runat="server" HeaderText="供应商编号" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="零件编号" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="月份" ColumnID="" DataField="Month" />
<f:BoundField runat="server" HeaderText="N+1" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty1" />
<f:BoundField runat="server" HeaderText="N+2" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty2" />
<f:BoundField runat="server" HeaderText="N+3" DataFormatString="{0:F0}" ColumnID="" DataField="MonthQty3" />
<f:BoundField runat="server" HeaderText="状态" Hidden="true" ColumnID="" DataField="State" />
<f:BoundField runat="server" HeaderText="创建者" ColumnID="" DataField="CreateUser" />
<f:BoundField Width="100px" DataField="CreateTime" DataFormatString="{0:yyyy-MM-dd}" HeaderText="创建日期" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

240
SCP/Views/SupplierData/SCP_FORECAST.aspx.cs

@ -1,240 +0,0 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using CK.SCP.Utils;
using FineUI;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CK.SCP.Models.Enums;
namespace SCP.Views.SupplierData
{
public partial class SCP_FORECAST : PageBase
{
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_TB_FORECAST_Data((result) =>
{
Grid_V_TB_FORECAST.RecordCount = result.Count();
var list = SortAndPage<V_TB_FORECAST>(result, Grid_V_TB_FORECAST);
Grid_V_TB_FORECAST.DataSource = list;
Grid_V_TB_FORECAST.DataBind();
});
}
/// <summary>
/// 获取数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_TB_FORECAST_Data(Action<IQueryable<V_TB_FORECAST>> p_action)
{
V_TB_FORECAST _entity = new V_TB_FORECAST();
_entity.IsDeleted = false;
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextVendId.Text))
{
_entity.VendId = TextVendId.Text;
}
if (ddl_Day.SelectedValue != "0")
{
_entity.Month = ddl_Day.SelectedValue;
}
_entity.UserInAddress = CurrentUser.FactoryList;
_entity.UserInVendIds = CurrentUser.VenderList;
if (!string.IsNullOrEmpty(DDL_State.SelectedValue))
{
_entity.BillStateList = new List<int>() { int.Parse(DDL_State.SelectedValue) };
}
SCP_FORECAST_CONTROLLER.Get_V_TB_FORECAST_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
protected void Grid_V_TB_FORECAST_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid_V_TB_FORECAST.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
try
{
string _fileName = FileUp.FileName;
if (string.IsNullOrEmpty(_fileName))
{
Alert.Show("选择文件为空!");
return;
}
string _lx = _fileName.Split('.')[1];
Stream _stream = FileUp.PostedFile.InputStream;
DataTable _dt = new DataTable();
if (_lx == "xls")
{
_dt = ExcelHelper.GetDataTable(_stream);
}
else
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
var list = ConvertHelper.ToList<SCP_FORECAST_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_FORECAST_CONTROLLER.EXCEL_FORECAST_MOD(list, CurrentUser.Name, CurrentUser.FactoryList[0]);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
BindData();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
/// <summary>
/// 确认数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Confirm);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 删除数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.Reject);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
/// <summary>
/// 取消确认
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnCancleSave_Click(object sender, EventArgs e)
{
int[] _selections = Grid_V_TB_FORECAST.SelectedRowIndexArray;
List<long> _UidList = new List<long>();
for (int i = 0, count = Grid_V_TB_FORECAST.Rows.Count; i < count; i++)
{
if (_selections.Contains(i))
{
object[] rowDataKeys = Grid_V_TB_FORECAST.DataKeys[i];
if (!string.IsNullOrEmpty(rowDataKeys[0].ToString()))
{
_UidList.Add(long.Parse(rowDataKeys[0].ToString()));
}
}
}
var ret = SCP_FORECAST_CONTROLLER.Save_TB_FORECAST_STATE(_UidList, CurrentUser.Name, ForecastState.New);
if (ret.State == ReturnStatus.Succeed)
{
BindData();
}
else
{
Alert.Show(ret.Message);
}
}
}
}

204
SCP/Views/SupplierData/SCP_FORECAST.aspx.designer.cs

@ -1,204 +0,0 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.SupplierData {
public partial class SCP_FORECAST {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSave;
/// <summary>
/// btnCancleSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnCancleSave;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnDelete;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_2;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// ddl_Day 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddl_Day;
/// <summary>
/// DDL_State 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_State;
/// <summary>
/// Button1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid_V_TB_FORECAST 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid_V_TB_FORECAST;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

87
SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx

@ -1,87 +0,0 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_FORECAST_REPORT.aspx.cs" Inherits="SCP.Views.沈阳金杯.Report.SCP_FORECAST_REPORT" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" AutoScroll="True">
<Items>
<f:Form runat="server">
<Toolbars>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:Button ID="btnRefresh" runat="server" Text="刷新" EnablePostBack="True" Icon="Reload" OnClientClick="location.reload();">
</f:Button>
<%--<f:Button ID="btnOutput" runat="server" Text="导出" Hidden="true" Icon="PageExcel">
</f:Button>--%>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Form BodyPadding="10px" Height="40px" ID="extForm1" runat="server" Title="" ShowHeader="false">
<Rows>
<f:FormRow ColumnWidths="33% 33% 33% " ID="FormRow_1" runat="server">
<Items>
<f:TextBox runat="server" Label="零件号" ID="TextPartCode">
</f:TextBox>
<f:TextBox runat="server" Label="供应商编号" ID="TextVendId">
</f:TextBox>
<f:DropDownList runat="server" ID="TextM" Label="订货月份">
<f:ListItem Text="全部" Value="0" />
<f:ListItem Text="一月" Value="1" />
<f:ListItem Text="二月" Value="2" />
<f:ListItem Text="三月" Value="3" />
<f:ListItem Text="四月" Value="4" />
<f:ListItem Text="五月" Value="5" />
<f:ListItem Text="六月" Value="6" />
<f:ListItem Text="七月" Value="7" />
<f:ListItem Text="八月" Value="8" />
<f:ListItem Text="九月" Value="9" />
<f:ListItem Text="十月" Value="10" />
<f:ListItem Text="十一月" Value="11" />
<f:ListItem Text="十二月" Value="12" />
</f:DropDownList>
<f:Button runat="server" ID="btnQuery" Text="查询" OnClick="btnSearch_Click"></f:Button>
</Items>
</f:FormRow>
</Rows>
</f:Form>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="true" PageSize="100" BoxFlex="1" CssClass="maingrid"
runat="server" DataKeyNames="PartCode,VendId,VendName,AskQty,MonthQty1,MonthQty2,MonthQty3,Month"
IsDatabasePaging="true" AllowPaging="true" SortField="PartCode" SortDirection="DESC" OnPageIndexChange="Grid_PageIndexChange"
AutoScroll="True" EnableRowDoubleClickEvent="True" >
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="200" Value="200" />
</f:DropDownList>
</PageItems>
<Columns>
<f:BoundField runat="server" HeaderText="零件号" Width="150px" ColumnID="" DataField="PartCode" />
<f:BoundField runat="server" HeaderText="供应商编号" Width="100px" ColumnID="" DataField="VendId" />
<f:BoundField runat="server" HeaderText="供应商名称" Width="150px" ColumnID="" DataField="VendName" />
<f:BoundField runat="server" HeaderText="订单要货数量" Width="100px" ColumnID="" DataField="AskQty" DataFormatString="{0:F0}"/>
<f:BoundField runat="server" HeaderText="N+1" Width="100px" ColumnID="" DataField="MonthQty1" DataFormatString="{0:F0}"/>
<f:BoundField runat="server" HeaderText="N+2" Width="100px" ColumnID="" DataField="MonthQty2" DataFormatString="{0:F0}"/>
<f:BoundField runat="server" HeaderText="N+3" Width="100px" ColumnID="" DataField="MonthQty3" DataFormatString="{0:F0}"/>
<f:BoundField runat="server" HeaderText="月份" Width="100px" ColumnID="" DataField="Month" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>

105
SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx.cs

@ -1,105 +0,0 @@
using CK.SCP.Controller;
using CK.SCP.Models.ScpEntity;
using FineUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace SCP.Views..Report
{
public partial class SCP_FORECAST_REPORT : PageBase
{
/// <summary>
/// 加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextM.SelectedValue = DateTime.Now.Month.ToString();
LoadData();
}
}
/// <summary>
/// 加载数据
/// </summary>
public void LoadData()
{
BindData();
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindData()
{
SearchV_FORECAST_REPORT_Data((result) =>
{
Grid1.RecordCount = result.Count();
var list = SortAndPage(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
/// <summary>
/// 查询数据
/// </summary>
/// <param name="p_action"></param>
public void SearchV_FORECAST_REPORT_Data(Action<IQueryable<V_FORECAST_REPORT>> p_action)
{
V_FORECAST_REPORT _entity = new V_FORECAST_REPORT();
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.PartCode = TextPartCode.Text;
}
if (!string.IsNullOrEmpty(TextPartCode.Text))
{
_entity.VendId = TextVendId.Text;
}
if (!string.IsNullOrEmpty(TextM.SelectedValue))
{
_entity.Month = int.Parse(TextM.SelectedValue);
}
SCP_REPORT_CONTROLLER.Get_V_SCP_FORECAST_REPORT_List( _entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
/// <summary>
/// 查询事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 分页条数change事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
/// <summary>
/// 页面索引change事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);
BindData();
}
}
}

150
SCP/Views/沈阳金杯/Report/SCP_FORECAST_REPORT.aspx.designer.cs

@ -1,150 +0,0 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views..Report {
public partial class SCP_FORECAST_REPORT {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// btnRefresh 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnRefresh;
/// <summary>
/// extForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Form extForm1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// TextPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextPartCode;
/// <summary>
/// TextVendId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TextVendId;
/// <summary>
/// TextM 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList TextM;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnQuery;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator2;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
}
}

7
UniApiGroup/Controller/OdbcApiQadController.cs

@ -919,6 +919,7 @@ namespace CK.SCP.GrupUniApi.Controller
ModType = Int32.TryParse(firstqadData.xxqad_pod_modtype, out temp) ? temp : (int?)null, //单据类型(1:日程单,2:离散订单) ModType = Int32.TryParse(firstqadData.xxqad_pod_modtype, out temp) ? temp : (int?)null, //单据类型(1:日程单,2:离散订单)
Contacter = firstqadData.xxqad_pod_attn,//联系人 Contacter = firstqadData.xxqad_pod_attn,//联系人
Site = firstqadData.xxqad_pod_domain,//地点 Site = firstqadData.xxqad_pod_domain,//地点
SubSite=firstqadData.xxqad_pod_site,
State = (int)FormState.,//状态 State = (int)FormState.,//状态
CreateTime = firstqadData.xxqad_pod_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_pod_createdt,//创建日期 CreateTime = firstqadData.xxqad_pod_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_pod_createdt,//创建日期
CreateUser = firstqadData.xxqad_pod_createur,//创建用户 CreateUser = firstqadData.xxqad_pod_createur,//创建用户
@ -944,7 +945,7 @@ namespace CK.SCP.GrupUniApi.Controller
var lineNum = Convert.ToInt32(qadData.xxqad_pod_line); var lineNum = Convert.ToInt32(qadData.xxqad_pod_line);
var wmsPoDetail = var wmsPoDetail =
wdb.TB_PO_DETAIL.SingleOrDefault( wdb.TB_PO_DETAIL.SingleOrDefault(
p => p.PoBillNum == qadData.xxqad_pod_nbr && p.PoLine == lineNum && p.Remark == qadData.xxqad_pod_domain); p => p.PoBillNum == qadData.xxqad_pod_nbr && p.PoLine == lineNum && p.Site== qadData.xxqad_pod_domain);
if (wmsPoDetail == null) if (wmsPoDetail == null)
{ {
wmsPoDetail = new TB_PO_DETAIL wmsPoDetail = new TB_PO_DETAIL
@ -971,7 +972,9 @@ namespace CK.SCP.GrupUniApi.Controller
wmsPoDetail.UnConv = qadData.xxqad_pod_um_conv;//转换率 wmsPoDetail.UnConv = qadData.xxqad_pod_um_conv;//转换率
wmsPoDetail.DockCode = qadData.xxqad_pod_loc; wmsPoDetail.DockCode = qadData.xxqad_pod_loc;
wmsPoDetail.State = Convert.ToInt32(qadData.xxqad_pod_status);//状态 wmsPoDetail.State = Convert.ToInt32(qadData.xxqad_pod_status);//状态
wmsPoDetail.Remark = qadData.xxqad_pod_domain;//ą¸×˘ wmsPoDetail.Site = qadData.xxqad_pod_domain;//±¸×¢
wmsPoDetail.SubSite = qadData.xxqad_pod_site;
wmsPoDetail.CreateTime = firstqadData.xxqad_pod_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_pod_createdt;//创建日期 wmsPoDetail.CreateTime = firstqadData.xxqad_pod_createdt == null ? DateTime.Now : (DateTime)firstqadData.xxqad_pod_createdt;//创建日期
wmsPoDetail.CreateUser = firstqadData.xxqad_pod_buyer;//创建用户 wmsPoDetail.CreateUser = firstqadData.xxqad_pod_buyer;//创建用户
wmsPoDetail.UpdateTime = firstqadData.xxqad_pod_updatedt;//更新日期 wmsPoDetail.UpdateTime = firstqadData.xxqad_pod_updatedt;//更新日期

Loading…
Cancel
Save