Browse Source

容差加期货合同

SCP_CYJ
qian 1 month ago
parent
commit
eafd4aeac9
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 19
      Controller/SCP_ASK_CONTROLLER.cs
  3. 1460
      Controller/SCP_PO_CONTROLLER.cs
  4. 330
      Controller/SCP_ToleranceProportion_Controller.cs
  5. 5
      Models/CK.SCP.Models.csproj
  6. 35
      Models/ScpEntities.cs
  7. 15
      Models/ScpEntity/ExcelExportEnttity/SCP_PART_ToleranceProportion.cs
  8. 2
      Models/ScpEntity/TA_PART.cs
  9. 26
      Models/ScpEntity/TA_ToleranceProportion.cs
  10. 13
      Models/ScpEntity/TB_MAXPO_DETAIL.cs
  11. 20
      Models/ScpEntity/V_TA_ToleranceProportion.cs
  12. 18
      Models/ScpEntity/V_TB_MAXPO_DETAIL.cs
  13. 8
      SCP/SCP.csproj
  14. 2
      SCP/Views/BasicData/Part.aspx
  15. 19
      SCP/Views/BasicData/Part.aspx.cs
  16. 59
      SCP/Views/BasicData/Part.aspx.designer.cs
  17. 61
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx
  18. 143
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs
  19. 107
      SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs
  20. 216
      SCP/Views/SupplierData/SCP_ASN_CREATE.aspx.cs
  21. 34
      SCP/Views/SupplierData/SCP_ASN_MANYCREATE.aspx.cs
  22. 4
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx
  23. 14
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx.cs
  24. 18
      SCP/Views/富维冲压件/SCP_PO_MAX.aspx.designer.cs
  25. 112
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx
  26. 74
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.cs
  27. 26
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.designer.cs
  28. 18
      UniApiGroup/Controller/OdbcApiQadController.cs
  29. 1
      UniApiGroup/Controller/PoBillNumcontroller.cs

1
Controller/CK.SCP.Controller.csproj

@ -77,6 +77,7 @@
<Compile Include="SCP_BARCODE_CONTROLLER _SYJB.cs" />
<Compile Include="SCP_DC_UNI_CONTROLLER.cs" />
<Compile Include="SCP_FORECAST_CONTROLLER.cs" />
<Compile Include="SCP_ToleranceProportion_Controller.cs" />
<Compile Include="SCP_MoldSharing_Controller.cs" />
<Compile Include="SCP_PALLET_CONTROLLER.cs" />
<Compile Include="SCP_PLAN_CONTROLLER.cs" />

19
Controller/SCP_ASK_CONTROLLER.cs

@ -1628,7 +1628,15 @@ namespace CK.SCP.Controller
}
/// <summary>
/// 多组件看板生成发货单
/// </summary>
/// <param name="p_ask"></param>
/// <param name="p_order_list"></param>
/// <param name="p_PlateNumber"></param>
/// <param name="p_buyer"></param>
/// <param name="p_buyerPhone"></param>
/// <returns></returns>
public static ResultObject<bool> Save_ASK_TO_WWDZJASN(V_TB_ASK p_ask, List<V_TB_ASK_DETAIL> p_order_list, string p_PlateNumber
, string p_buyer, string p_buyerPhone)
{
@ -1844,6 +1852,15 @@ namespace CK.SCP.Controller
}
return _ret;
}
/// <summary>
/// 普通生成发货单
/// </summary>
/// <param name="p_ask"></param>
/// <param name="p_order_list"></param>
/// <param name="p_PlateNumber"></param>
/// <param name="p_buyer"></param>
/// <param name="p_buyerPhone"></param>
/// <returns></returns>
public static ResultObject<bool> Save_ASK_TO_ASN(V_TB_ASK p_ask, List<V_TB_ASK_DETAIL> p_order_list, string p_PlateNumber
, string p_buyer, string p_buyerPhone)
{

1460
Controller/SCP_PO_CONTROLLER.cs

File diff suppressed because it is too large

330
Controller/SCP_ToleranceProportion_Controller.cs

@ -0,0 +1,330 @@
using System;
using System.Linq;
using CK.SCP.Models.Enums;
using CK.SCP.Models.ScpEntity;
using CK.SCP.Utils;
using CK.SCP.Models;
using System.Data;
using System.Data.Entity.Core;
using System.Text;
using CK.SCP.Models.ScpEntity.ExcelExportEnttity;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
namespace CK.SCP.Controller
{
public class SCP_ToleranceProportion_Controller
{
/// <summary>
/// 获取容差控制列表
/// </summary>
/// <param name="p_entity"></param>
/// <param name="p_action"></param>
public static void Get_TA_ToleranceProportion_List(TA_ToleranceProportion p_entity, Action<ResultObject<IQueryable<V_TA_ToleranceProportion>>> p_action)
{
ResultObject<IQueryable<V_TA_ToleranceProportion>> _ret = new ResultObject<IQueryable<V_TA_ToleranceProportion>>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
IQueryable<V_TA_ToleranceProportion> q = db.V_TA_ToleranceProportion;
if (!string.IsNullOrEmpty(p_entity.PartCode))
{
q = q.Where(p => p.PartCode == p_entity.PartCode);
}
_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_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_ToleranceProportion_Controller), "Get_TA_ToleranceProportion_List", e.Message);
}
}
/// <summary>
/// 模具分摊导入
/// </summary>
/// <param name="p_order_list"></param>
/// <param name="site"></param>
/// <param name="p_creator"></param>
/// <returns></returns>
public static ResultObject<bool> EXCEL_MOLDSHARING_MOD(List<SCP_PART_ToleranceProportion> p_order_list, string site, string p_creator)
{
ResultObject<bool> _ret = new ResultObject<bool>();
List<TA_ToleranceProportion> list = new List<TA_ToleranceProportion>();
_ret.State = ReturnStatus.Succeed;
_ret.Result = true;
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
List<string> ErrorList = new List<string>();
var _lst = p_order_list;
_lst.ForEach(p =>
{
var _ls = CheckExcelMode_MoldSharing(db, p, site);
if (_ls.Count > 0)
{
ErrorList.Add(string.Join("<br>", _ls.ToArray()));
}
});
if (ErrorList.Count > 0)
{
_ret.State = ReturnStatus.Failed;
_ret.MessageList.AddRange(ErrorList);
_ret.Result = false;
}
else
{
_lst.ForEach(p =>
{
var mold = db.TA_ToleranceProportion.FirstOrDefault(t => t.PartCode.ToUpper() == p..ToUpper() && t.Site == p..Trim());
if (mold == null)
{
mold = new TA_ToleranceProportion
{
PartCode = p..ToUpper(),
CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
CreateUser = p_creator,
Site = p..Trim(),
ToleranceProportion = decimal.Parse(p.),
};
}
else
{
mold.ToleranceProportion = decimal.Parse(p.);
mold.UpdateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
mold.UpdateUser = p_creator;
}
list.Add(mold);
});
if (_ret.MessageList.Count == 0)
{
db.TA_ToleranceProportion.AddOrUpdate(q => q.UID, list.ToArray());
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_ToleranceProportion_Controller), "EXCEL_MOLDSHARING_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_ToleranceProportion_Controller), "EXCEL_MOLDSHARING_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_ToleranceProportion_Controller), "EXCEL_MOLDSHARING_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_ToleranceProportion_Controller), "EXCEL_MOLDSHARING_MOD", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
_ret.MessageList.Add("保存失败" + e.Message);
}
return _ret;
}
/// <summary>
/// 数据检验
/// </summary>
/// <param name="db"></param>
/// <param name="p_excel"></param>
/// <param name="site"></param>
/// <returns></returns>
public static List<string> CheckExcelMode_MoldSharing(ScpEntities db, SCP_PART_ToleranceProportion p_excel, string site)
{
List<string> ErrorList = new List<string>();
if (string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.) || string.IsNullOrEmpty(p_excel.))
{
ErrorList.Add(string.Format("零件编号【{0}】有填写为空!", p_excel.));
}
else
{
int count = db.TA_PART.Count(p => p.PartCode == p_excel. && p.Site == site);
if (count <= 0)
{
ErrorList.Add(string.Format("零件编号{0}不存在!", p_excel.));
}
decimal ty = 0.00m;
if (!decimal.TryParse(p_excel., out ty))
{
ErrorList.Add(string.Format("零件编号{0},容差填写不正确,不是数字类型!", p_excel.));
}
else
{
if (ty > 1 || ty < 0)
{
ErrorList.Add(string.Format("零件编号{0},容差填写不正确,只能填写0到1之间小数!", p_excel.));
}
}
}
return ErrorList;
}
/// <summary>
/// 检查是否超出容差数据
/// </summary>
/// <param name="entity"></param>
/// <param name="QtyAll"></param>
/// <returns></returns>
public static List<string> CheckToleranceProportion(V_TB_ASK_DETAIL entity, decimal QtyAll)
{
List<string> ErrorList = new List<string>();
var canQty = entity.AskQty - entity.ShippedQty - entity.ReduceQty;
// WS 和 WG 类型物料 填写的 发货数 不能大于 (要货数量-已发数量)
if (entity.DockCode == "WS" || entity.DockCode == "WG")
{
if (canQty > 0)
{
if (QtyAll > canQty)
{
ErrorList.Add(entity.PartCode + "发货数量>可发数量");
}
}
}
// YC 和 WT 填写的 发货数 能大于 (要货数 - 已发数量) 但是 不能 大于容差范围 并且 要货数 - 已发数量 不能小于等于0
else if (entity.DockCode == "YC" || entity.DockCode == "WT")
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
var toleranceProportion = db.TA_ToleranceProportion.FirstOrDefault(q => q.PartCode == entity.PartCode);
if (toleranceProportion == null)
{
ErrorList.Add(entity.PartCode + "没有容差控制,请联系管理员进行填写");
}
else
{
decimal maxqty = entity.AskQty * (1 + toleranceProportion.ToleranceProportion);
if (canQty <= 0)
{
ErrorList.Add(entity.PartCode + "只能超发一次哦");
}
// 最大要货数量(要货数* 1+容差) - 累计发货数量 <当前填写的 要货数量
else if ((maxqty - entity.ShippedQty - entity.ReduceQty )< QtyAll)
{
ErrorList.Add(entity.PartCode + "容差控制为"+ (toleranceProportion.ToleranceProportion * 100)+"% ,本次填写发货数量超出"+ Math.Abs((maxqty - entity.ShippedQty - QtyAll).Value));
}
}
}
}
else if ((canQty <= 0) && (QtyAll > 0))
{
ErrorList.Add(entity.PartCode + "只能超发一次哦");
}
return ErrorList;
}
}
}

5
Models/CK.SCP.Models.csproj

@ -348,6 +348,7 @@
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_MOLDSHARING_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_VendId_REPORT_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_ToleranceProportion.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" />
@ -360,6 +361,9 @@
<Compile Include="ScpEntity\TA_CarModel.cs" />
<Compile Include="ScpEntity\TA_MoldSharing.cs" />
<Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.cs" />
<Compile Include="ScpEntity\TA_Part_User.cs" />
<Compile Include="ScpEntity\V_TA_ToleranceProportion.cs" />
<Compile Include="ScpEntity\TA_ToleranceProportion.cs" />
<Compile Include="ScpEntity\V_MPO_PRINT.cs" />
<Compile Include="ScpEntity\V_TB_MPO_DETAIL.cs" />
<Compile Include="ScpEntity\TB_MATERIALORDERS_DETAIL.cs" />
@ -430,7 +434,6 @@
<Compile Include="ScpEntity\TB_FACTORY.cs" />
<Compile Include="ScpEntity\TA_INFO.cs" />
<Compile Include="ScpEntity\TA_LANGUAGE.cs" />
<Compile Include="ScpEntity\TA_Part_User.cs" />
<Compile Include="ScpEntity\TA_REVICE_PORT.cs" />
<Compile Include="ScpEntity\TA_VEND_USER.cs" />
<Compile Include="ScpEntity\TB_ASK.cs" />

35
Models/ScpEntities.cs

@ -30,7 +30,7 @@ namespace CK.SCP.Models
public ScpEntities(string strConn)
: base(strConn)
{
}
public virtual DbSet<V_TB_REEEE> V_TB_REEEE { set; get; }
public virtual DbSet<TB_SUPPLIER_MAIL> TB_SUPPLIER_MAIL { set; get; }
@ -72,10 +72,10 @@ namespace CK.SCP.Models
public virtual DbSet<TB_REJECT_DETAIL> TB_REJECT_DETAIL { get; set; }
public virtual DbSet<TA_FACTORY_CONFIG> TA_FACTORY_CONFIG { get; set; }
public virtual DbSet<TL_BASEDATA> TL_BASEDATA { get; set; }
public virtual DbSet<TL_BILL> TL_BILL { get; set; }
public virtual DbSet<TL_BILL> TL_BILL { get; set; }
public virtual DbSet<TL_OPER> TL_OPER { get; set; }
public virtual DbSet<TS_BARCODE> TS_BARCODE { get; set; }
public virtual DbSet<V_TS_BARCODE> V_TS_BARCODE { get; set; }
public virtual DbSet<V_TS_BARCODE> V_TS_BARCODE { get; set; }
public virtual DbSet<TS_BARCODE_SMALL> TS_BARCODE_SMALL { get; set; }
public virtual DbSet<TS_STOCK> TS_STOCK { get; set; }
public virtual DbSet<TS_UNI_API> TS_UNI_API { get; set; }
@ -96,7 +96,7 @@ namespace CK.SCP.Models
public virtual DbSet<TA_VEND_USER> TA_VEND_USER { get; set; }
public virtual DbSet<TA_Part_User> TA_Part_User { get; set; }
public virtual DbSet<TA_REVICE_PORT> TA_REVICE_PORT { get; set; }
public virtual DbSet<TB_PENING_ITEMS> TB_PENING_ITEMS { get; set; }
public virtual DbSet<TB_PENING_ITEMS> TB_PENING_ITEMS { get; set; }
public virtual DbSet<TB_ASK> TB_ASK { get; set; }
public virtual DbSet<V_TB_ASK> V_TB_ASK { get; set; }
public virtual DbSet<TB_ASK_DETAIL> TB_ASK_DETAIL { get; set; }
@ -120,7 +120,7 @@ namespace CK.SCP.Models
public virtual DbSet<V_TB_ARRIVE_DETAIL> V_TB_ARRIVE_DETAIL { get; set; }
public virtual DbSet<V_TB_REJECT> V_TB_REJECT { get; set; }
public virtual DbSet<V_TB_REJECT_DETAIL> V_TB_REJECT_DETAIL { get; set; }
public virtual DbSet<TS_BARCODE_RULE> TS_BARCODE_RULE { get; set; }
public virtual DbSet<TS_BARCODE_RULE> TS_BARCODE_RULE { get; set; }
public virtual DbSet<TS_BARCODE_RULE_SMALL> TS_BARCODE_RULE_SMALL { get; set; }
public virtual DbSet<TB_PALLETS_RULL> TB_PALLETS_RULL { get; set; }
public virtual DbSet<V_TB_INVOICE_DETAIL> V_TB_INVOICE_DETAIL { get; set; }
@ -130,10 +130,10 @@ namespace CK.SCP.Models
public virtual DbSet<V_TB_RECEIVE_LIST> V_TB_RECEIVE_LIST { get; set; }
public virtual DbSet<TB_PRINT_COUNT> TB_PRINT_COUNT { get; set; }
public virtual DbSet<V_TB_ASN_DETAIL_VIEW> V_TB_ASN_DETAIL_VIEW { get; set; }
public virtual DbSet<V_TA_VENDER> V_TA_VENDER { get; set; }
public virtual DbSet<V_TB_INCOMPLETE_ASK> V_TB_INCOMPLETE_ASK { get; set; }
public virtual DbSet<V_ARRIVE_PO_REPORT> V_ARRIVE_PO_REPORT { get; set; }
public virtual DbSet<V_ARRIVE_PO_REPORT> V_ARRIVE_PO_REPORT { get; set; }
public virtual DbSet<V_TB_PALLET_DETAIL> V_TB_PALLET_DETAIL { get; set; }
public virtual DbSet<V_TB_PALLET> V_TB_PALLET { get; set; }
public virtual DbSet<TB_PALLET_DETAIL> TB_PALLET_DETAIL { get; set; }
@ -174,6 +174,8 @@ namespace CK.SCP.Models
public virtual DbSet<V_TB_MPO> V_TB_MPO { get; set; }
public virtual DbSet<V_TB_MPO_DETAIL> V_TB_MPO_DETAIL { get; set; }
public virtual DbSet<TS_Email> TS_Email { get; set; }
public virtual DbSet<TA_ToleranceProportion> TA_ToleranceProportion { get; set; }
public virtual DbSet<V_TA_ToleranceProportion> V_TA_ToleranceProportion { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<TA_MOLDSHARING>()
@ -185,7 +187,7 @@ namespace CK.SCP.Models
modelBuilder.Entity<TA_REVICE_PORT>()
.Property(e => e.PORT_NO)
.IsUnicode(false);
modelBuilder.Entity<TA_BILLTYPE>()
.Property(e => e.Sep)
.IsUnicode(false);
@ -293,7 +295,7 @@ namespace CK.SCP.Models
.HasPrecision(18, 2);
modelBuilder.Entity<TS_UNI_API>()
.Property(e => e.Qty)
.HasPrecision(18,5);
.HasPrecision(18, 5);
modelBuilder.Entity<TS_UNI_API_HIS>()
.Property(e => e.Qty)
.HasPrecision(18, 2);
@ -345,6 +347,21 @@ namespace CK.SCP.Models
modelBuilder.Entity<TB_MAXPO_CONSUME>()
.Property(e => e.PoQty)
.HasPrecision(18, 6);
modelBuilder.Entity<TB_MAXPO_DETAIL>()
.Property(e => e.ReductionQtyOne)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_MAXPO_DETAIL>()
.Property(e => e.ReductionQtyTwo)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_MAXPO_DETAIL>()
.Property(e => e.ReductionQtyThree)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_MAXPO_DETAIL>()
.Property(e => e.ReductionQtyFour)
.HasPrecision(18, 5);
modelBuilder.Entity<TB_MAXPO_DETAIL>()
.Property(e => e.ReductionQtyFive)
.HasPrecision(18, 5);
}
}
}

15
Models/ScpEntity/ExcelExportEnttity/SCP_PART_ToleranceProportion.cs

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CK.SCP.Models.ScpEntity.ExcelExportEnttity
{
public class SCP_PART_ToleranceProportion
{
public string { get; set; }
public string { get; set; }
public string { get; set; }
}
}

2
Models/ScpEntity/TA_PART.cs

@ -68,6 +68,8 @@ namespace CK.SCP.Models.ScpEntity
[NotMapped]
public string ReceivedPort_Desc => ScpCache.GetRevicePort(ReceivePort);
[NotMapped]
public decimal? ToleranceProportion { get; set; } = 0.20m;
}

26
Models/ScpEntity/TA_ToleranceProportion.cs

@ -0,0 +1,26 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public class TA_ToleranceProportion
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public long UID { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[DisplayName("容差控制默认0.2 20%")]
public decimal ToleranceProportion { get; set; }
[StringLength(20)]
public string CreateUser { get; set; }
public string CreateTime { get; set; }
public string UpdateUser { get; set; }
public string UpdateTime { get; set; }
[DisplayName("地点")]
public string Site { get; set; }
}
}

13
Models/ScpEntity/TB_MAXPO_DETAIL.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
@ -54,5 +55,17 @@ namespace CK.SCP.Models.ScpEntity
public decimal ReceQty { get; set; }
public bool IsDeleted { get; set; }
public decimal ReturnQty { get; set; }
[DisplayName("第一次削减量")]
public decimal? ReductionQtyOne { get; set; }
[DisplayName("第二次削减量")]
public decimal? ReductionQtyTwo { get; set; }
[DisplayName("第三次削减量")]
public decimal? ReductionQtyThree { get; set; }
[DisplayName("第四次削减量")]
public decimal? ReductionQtyFour { get; set; }
[DisplayName("第五次削减量")]
public decimal? ReductionQtyFive { get; set; }
[NotMapped]
public Decimal? ReductionQty { get; set; } = 0;
}
}

20
Models/ScpEntity/V_TA_ToleranceProportion.cs

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace CK.SCP.Models.ScpEntity
{
public class V_TA_ToleranceProportion
{
[Key]
public long UID { get; set; }
[StringLength(50)]
public string PartCode { get; set; }
[DisplayName("容差控制默认0.2 20%")]
public string VToleranceProportion { get; set; }
[DisplayName("零件名称")]
public string PartName { get; set; }
}
}

18
Models/ScpEntity/V_TB_MAXPO_DETAIL.cs

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
@ -59,6 +60,23 @@ namespace CK.SCP.Models.ScpEntity
public decimal ReceQty { get; set; }
public decimal ReturnQty { get; set; }
public bool IsDeleted { get; set; }
[DisplayName("第一次削减量")]
public decimal? ReductionQtyOne { get; set; }
[DisplayName("第二次削减量")]
public decimal? ReductionQtyTwo { get; set; }
[DisplayName("第三次削减量")]
public decimal? ReductionQtyThree { get; set; }
[DisplayName("第四次削减量")]
public decimal? ReductionQtyFour { get; set; }
[DisplayName("第五次削减量")]
public decimal? ReductionQtyFive { get; set; }
[NotMapped]
[DisplayName("单次削减量")]
public decimal ReductionQty { get; set; } = 0;
[DisplayName("订货量吨(当前)")]
public Decimal OrderQtydNow { get; set; }
[DisplayName("地点")]
public string Site { get; set; }
}
}

8
SCP/SCP.csproj

@ -266,6 +266,7 @@
<Content Include="Views\BasicData\Appliance.aspx" />
<Content Include="Views\BasicData\Appliance_DETAIL.aspx" />
<Content Include="Views\BasicData\BoxType.aspx" />
<Content Include="Views\BasicData\SCP_ToleranceProportion.aspx" />
<Content Include="Views\BasicData\Pinfan.aspx" />
<Content Include="Views\BasicData\Price.aspx" />
<Content Include="Views\BasicData\ProductionLine.aspx" />
@ -5033,6 +5034,13 @@
<Compile Include="Views\BasicData\BoxType.aspx.designer.cs">
<DependentUpon>BoxType.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\SCP_ToleranceProportion.aspx.cs">
<DependentUpon>SCP_ToleranceProportion.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Views\BasicData\SCP_ToleranceProportion.aspx.designer.cs">
<DependentUpon>SCP_ToleranceProportion.aspx</DependentUpon>
</Compile>
<Compile Include="Views\BasicData\Pinfan.aspx.cs">
<DependentUpon>Pinfan.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

2
SCP/Views/BasicData/Part.aspx

@ -22,6 +22,8 @@
</f:Button>
<f:Button ID="btnSave" runat="server" EnablePostBack="True" Text="保存信息" Icon="SystemSave" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="ButtonTemplate" runat ="server" EnablePostBack="true" Text="导出零件容差模板" Icon="PageExcel" OnClick="ButtonTemplate_OnClick" />
<f:Button ID="btnShow" runat="server" Text="显示查询面板" Icon="Find" OnClick="btnShow_OnClick">
</f:Button>
<f:ToolbarSeparator runat="server" />

19
SCP/Views/BasicData/Part.aspx.cs

@ -104,6 +104,7 @@ namespace SCP.BasicData
var ret = SCP_PO_CONTROLLER.EXCEL_PART_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
Alert.Show("导入成功!");
BindData();
}
else
@ -257,5 +258,23 @@ namespace SCP.BasicData
}
}
}
protected void ButtonTemplate_OnClick(object sender, EventArgs e)
{
IQueryable<TA_PART> q = SCPDB.TA_PART;
if (!string.IsNullOrEmpty(txtPartCode.Text))
{
q = q.Where(p => p.PartCode.Contains(txtPartCode.Text));
}
Dictionary<string, string> cellheader = new Dictionary<string, string>
{
{ "PartCode", "零件号" },
{"Site","工厂编码" },
{ "ToleranceProportion", "容差" },
};
string url = EntityListToExcel2003(cellheader, q.ToList(), "零件容差模板");
}
}
}

59
SCP/Views/BasicData/Part.aspx.designer.cs

@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.BasicData {
public partial class Part {
namespace SCP.BasicData
{
public partial class Part
{
/// <summary>
/// form1 控件。
/// </summary>
@ -20,7 +22,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// Panel1 控件。
/// </summary>
@ -29,7 +31,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@ -38,7 +40,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Button3 控件。
/// </summary>
@ -47,7 +49,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// Button2 控件。
/// </summary>
@ -56,7 +58,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button2;
/// <summary>
/// btnSave 控件。
/// </summary>
@ -65,7 +67,16 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSave;
/// <summary>
/// ButtonTemplate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button ButtonTemplate;
/// <summary>
/// btnShow 控件。
/// </summary>
@ -74,7 +85,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnShow;
/// <summary>
/// FileUp 控件。
/// </summary>
@ -83,7 +94,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
@ -92,7 +103,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// gp1 控件。
/// </summary>
@ -101,7 +112,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// txtPartCode 控件。
/// </summary>
@ -110,7 +121,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPartCode;
/// <summary>
/// DPL_Factory 控件。
/// </summary>
@ -119,7 +130,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DPL_Factory;
/// <summary>
/// Button1 控件。
/// </summary>
@ -128,7 +139,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button1;
/// <summary>
/// Grid1 控件。
/// </summary>
@ -137,7 +148,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -146,7 +157,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@ -155,7 +166,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.ToolbarText ToolbarText1;
/// <summary>
/// ddlGridPageSize 控件。
/// </summary>
@ -164,7 +175,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// TXT_QLevel 控件。
/// </summary>
@ -173,7 +184,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox TXT_QLevel;
/// <summary>
/// DDL_ReceivedPort 控件。
/// </summary>
@ -182,7 +193,7 @@ namespace SCP.BasicData {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DropDownList DDL_ReceivedPort;
/// <summary>
/// Window1 控件。
/// </summary>

61
SCP/Views/BasicData/SCP_ToleranceProportion.aspx

@ -0,0 +1,61 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_ToleranceProportion.aspx.cs" Inherits="SCP.Views.BasicData.SCP_ToleranceProportion" %>
<!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 ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox">
<Items>
<f:Toolbar ID="Toolbar1" runat="server">
<Items>
<f:Button ID="Button3" runat="server" EnablePostBack="false" Text="刷新" Icon="Reload" OnClientClick="location.reload();" />
<f:TextBox ID="txtPartCode" runat="server" Label="零件号" Text="">
</f:TextBox>
<f:Button ID="btnSearch" runat="server" Text="快速查找" OnClick="btnSearch_Click" Icon="SystemSearch">
</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>
<f:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" BoxFlex="1" AutoScroll="True"
ShowHeader="False"
AllowPaging="True" PageSize="50" OnPageIndexChange="Grid1_OnPageIndexChange"
ShowBorder="False"
DataKeyNames="PartCode" AllowSorting="true" IsDatabasePaging="true" SortField="PartCode">
<Columns>
<f:BoundField SortField="PartCode" DataField="PartCode" HeaderText="零件号" Width="200px" />
<f:BoundField SortField="PartName" DataField="PartName" HeaderText="零件名称" Width="200px" />
<f:BoundField SortField="VToleranceProportion" DataField="VToleranceProportion" HeaderText="容差" Width="100px" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<script type="text/javascript">
function onReady() {
var grid1 = Ext.getCmp('<%=Grid1.ClientID%>');
var bodySize = Ext.getBody().getSize();
grid1.setHeight(bodySize.height - 27);
}
$(window).bind("load resize", function () {
onReady();
});
</script>
</form>
</body>
</html>

143
SCP/Views/BasicData/SCP_ToleranceProportion.aspx.cs

@ -0,0 +1,143 @@
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 static System.Net.WebRequestMethods;
namespace SCP.Views.BasicData
{
public partial class SCP_ToleranceProportion : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
public void BindData()
{
SearchData((result) => {
Grid1.RecordCount = result.Count();
var list = SortAndPage(result, Grid1);
Grid1.DataSource = list;
Grid1.DataBind();
});
}
public void SearchData(Action<IQueryable<V_TA_ToleranceProportion>> p_action)
{
TA_ToleranceProportion _entity = new TA_ToleranceProportion();
_entity.PartCode = txtPartCode.Text;
SCP_ToleranceProportion_Controller.Get_TA_ToleranceProportion_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
}
});
}
//导出
public void BtnOutPut_OnClick(object sender, EventArgs e)
{
//_list = SCP_TB_VENDER_CONTROLLER.Getlist();
//var list = Sort<TA_VENDER>(_list.AsQueryable(), Grid1).ToList();
//// 2.设置单元格抬头
//// key:实体对象属性名称,可通过反射获取值
//// value:Excel列的名称
//Dictionary<string, string> cellheader = new Dictionary<string, string> {
// { "VendId", "供应商编号" },
// { "VendName", "供应商名称" },
// { "VendAbbCode", "供应商缩写" },
// { "VendType", "供应商类型" },
// { "Country", "国家" },
// { "City", "城市" },
// { "Currency", "币种" },
// { "Address", "地址" },
// { "ZipCode", "邮编" },
// { "Contacter", "联系人" },
// { "Phone", "电话" },
// { "Fax", "传真" },
// { "Email", "电子邮件" },
// { "State", "状态" },
// { "Remark", "备注" },
//};
//string url = EntityListToExcel2003(cellheader, list, "供应商");
}
//查询
protected void btnSearch_OnClick(object sender, EventArgs e)
{
BindData();
}
protected void Grid1_OnPageIndexChange(object sender, GridPageEventArgs e)
{
BindData();
}
protected void btnSearch_Click(object sender, EventArgs e)
{
BindData();
}
/// <summary>
/// 上传文件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnInput_Click(object sender, EventArgs e)
{
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_PART_ToleranceProportion>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_ToleranceProportion_Controller.EXCEL_MOLDSHARING_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{
Alert.Show("导入成功");
BindData();
FileUp.Reset();
}
else
{
Alert.Show(string.Join("<br>", ret.MessageList));
FileUp.Reset();
}
}
}
}

107
SCP/Views/BasicData/SCP_ToleranceProportion.aspx.designer.cs

@ -0,0 +1,107 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace SCP.Views.BasicData
{
public partial class SCP_ToleranceProportion
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Panel Panel1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Toolbar Toolbar1;
/// <summary>
/// Button3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Button3;
/// <summary>
/// txtPartCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.TextBox txtPartCode;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnSearch;
/// <summary>
/// FileUp 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FileUpload FileUp;
/// <summary>
/// btnInput 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button btnInput;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Grid Grid1;
}
}

216
SCP/Views/SupplierData/SCP_ASN_CREATE.aspx.cs

@ -22,7 +22,7 @@ namespace SCP.SupplierData
{
if (!IsPostBack)
{
GetV_TB_POData();
if (Request.QueryString["State"] != null)
{
@ -50,13 +50,14 @@ namespace SCP.SupplierData
private void SetRoleRule()
{
IsPriceVisible(Grid_V_TB_ASK_DETAIL, "价格");
}
public void SearchV_TB_ASK_DETAILData(Action<IQueryable<V_TB_ASK_DETAIL>> p_action)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum = Request["AskBillNum"];
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) => {
SCP_ASK_CONTROLLER.Get_V_TB_ASK_DETAIL_List(_entity, (_ret) =>
{
if (_ret.State == ReturnStatus.Succeed)
{
p_action(_ret.Result);
@ -97,11 +98,12 @@ namespace SCP.SupplierData
}
});
}
public void BindDetail(bool p_state=false)
{
SearchV_TB_ASK_DETAILData((ret) => {
public void BindDetail(bool p_state = false)
{
SearchV_TB_ASK_DETAILData((ret) =>
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count();
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
var list = SortAndPage<V_TB_ASK_DETAIL>(ret, Grid_V_TB_ASK_DETAIL);
var _ls = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(list.ToList());
var _notifyList = new List<string>();
_ls.ForEach(p =>
@ -122,8 +124,8 @@ namespace SCP.SupplierData
{
p.TempQty = 0;
}
}
);
}
);
Grid_V_TB_ASK_DETAIL.DataSource = _ls;
Grid_V_TB_ASK_DETAIL.DataBind();
if (_notifyList.Count > 0)
@ -165,15 +167,15 @@ namespace SCP.SupplierData
List<V_TB_ASK_DETAIL> _askDetaillist = new List<V_TB_ASK_DETAIL>();
protected void btnCreate_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(TXT_AskBillNum.Text) || string.IsNullOrEmpty(TXT_ShipUser.Text) || DP_ReceiveTime.SelectedDate==null || DP_ShipTime.SelectedDate==null)
if (string.IsNullOrEmpty(TXT_AskBillNum.Text) || string.IsNullOrEmpty(TXT_ShipUser.Text) || DP_ReceiveTime.SelectedDate == null || DP_ShipTime.SelectedDate == null)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("要货看板单据编号、发货人、到货时间、收货时间不能为空"));
return;
}
var _model=Session["Ask"] as V_TB_ASK;
var _model = Session["Ask"] as V_TB_ASK;
if (_model == null)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("浏览器缓存丢失,麻烦刷新页面重新操作"));
@ -182,97 +184,98 @@ namespace SCP.SupplierData
if (_model.State != (int)AskState.Confirm && _model.State != (int)AskState.Receive && _model.State != (int)AskState.Ship)
{
Alert.Show("要货看板必须为确认后状态");
return;
return;
}
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_ASK_DETAIL.GetModifiedDict();
for (int i = 0, count = Grid_V_TB_ASK_DETAIL.Rows.Count; i < count; i++)
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.PoBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.ShippedQty = ConvertHelper.To<Decimal>(rowDataKeys[4]);
_entity.ReceivedQty = ConvertHelper.To<Decimal>(rowDataKeys[5]);
_entity.BeginTime = ConvertHelper.To<DateTime>(rowDataKeys[6]);
_entity.EndTime = ConvertHelper.To<DateTime>(rowDataKeys[7]);
_entity.PoUnit = rowDataKeys[8] as string;
_entity.LocUnit = rowDataKeys[9] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[10]);
_entity.Currency = rowDataKeys[11] as string;
_entity.PackQty = ConvertHelper.To<Decimal>(rowDataKeys[12]);
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[13]);
_entity.DockCode = rowDataKeys[14] as string;
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[15]);
_entity.Remark = rowDataKeys[21] as string; //把用户信息传给备注
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[17]);
_entity.CreateUser = rowDataKeys[18] as string;
_entity.UpdateTime = ConvertHelper.To<DateTime?>(rowDataKeys[19]);
_entity.UpdateUser = rowDataKeys[20] as string;
_entity.UpdateInfo = rowDataKeys[21] as string;
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[22]);
_entity.PartDesc1 = rowDataKeys[23] as string;
_entity.CurrencyDesc = rowDataKeys[24] as string;
_entity.Site = rowDataKeys[25] as string;
_entity.SubSite = rowDataKeys[36] as string;
_entity.VendName = rowDataKeys[26] as string;
_entity.PartDesc2 = rowDataKeys[27] as string;
_entity.AskBillNum = rowDataKeys[28] as string;
_entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[29]);
_entity.TempQty = ConvertHelper.To<decimal>(rowDataKeys[30]);
_entity.ReceivedPort = rowDataKeys[31] as string;
_entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[33]);
_entity.ValidityDays = ConvertHelper.To<int>(rowDataKeys[34]);
_entity.Batch = ConvertHelper.To<string>(rowDataKeys[35]);
_entity.Time = ConvertHelper.To<string>(rowDataKeys[36]);
{
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
_entity.PoBillNum = rowDataKeys[1] as string;
_entity.PoLine = ConvertHelper.To<Int32>(rowDataKeys[2]);
_entity.PartCode = rowDataKeys[3] as string;
_entity.ShippedQty = ConvertHelper.To<Decimal>(rowDataKeys[4]);
_entity.ReceivedQty = ConvertHelper.To<Decimal>(rowDataKeys[5]);
_entity.BeginTime = ConvertHelper.To<DateTime>(rowDataKeys[6]);
_entity.EndTime = ConvertHelper.To<DateTime>(rowDataKeys[7]);
_entity.PoUnit = rowDataKeys[8] as string;
_entity.LocUnit = rowDataKeys[9] as string;
_entity.Price = ConvertHelper.To<Decimal>(rowDataKeys[10]);
_entity.Currency = rowDataKeys[11] as string;
_entity.PackQty = ConvertHelper.To<Decimal>(rowDataKeys[12]);
_entity.UnConv = ConvertHelper.To<Decimal>(rowDataKeys[13]);
_entity.DockCode = rowDataKeys[14] as string;
_entity.State = ConvertHelper.To<Int32>(rowDataKeys[15]);
_entity.Remark = rowDataKeys[21] as string; //把用户信息传给备注
_entity.CreateTime = ConvertHelper.To<DateTime>(rowDataKeys[17]);
_entity.CreateUser = rowDataKeys[18] as string;
_entity.UpdateTime = ConvertHelper.To<DateTime?>(rowDataKeys[19]);
_entity.UpdateUser = rowDataKeys[20] as string;
_entity.UpdateInfo = rowDataKeys[21] as string;
_entity.IsDeleted = ConvertHelper.To<Boolean>(rowDataKeys[22]);
_entity.PartDesc1 = rowDataKeys[23] as string;
_entity.CurrencyDesc = rowDataKeys[24] as string;
_entity.Site = rowDataKeys[25] as string;
_entity.SubSite = rowDataKeys[36] as string;
_entity.VendName = rowDataKeys[26] as string;
_entity.PartDesc2 = rowDataKeys[27] as string;
_entity.AskBillNum = rowDataKeys[28] as string;
_entity.AskQty = ConvertHelper.To<Decimal>(rowDataKeys[29]);
_entity.TempQty = ConvertHelper.To<decimal>(rowDataKeys[30]);
_entity.ReceivedPort = rowDataKeys[31] as string;
_entity.ReduceQty = ConvertHelper.To<decimal>(rowDataKeys[33]);
_entity.ValidityDays = ConvertHelper.To<int>(rowDataKeys[34]);
_entity.Batch = ConvertHelper.To<string>(rowDataKeys[35]);
_entity.Time = ConvertHelper.To<string>(rowDataKeys[36]);
_entity.MaxTime = ConvertHelper.To<string>(rowDataKeys[37]);
//_entity.ProduceDate = DateTime.Now;
if (Convert.ToDecimal(_entity.AskQty) == 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("要货看板数量不能为 0"));
return;
}
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference("要货看板数量不能为 0"));
return;
}
if (modifiedDict.Keys.Contains(i))
{
var modifyValue = modifiedDict[i];
var _Qty1 = modifyValue.Keys.Contains("TempQty") ? modifyValue["TempQty"] : _entity.TempQty;
var _Batch1 = modifyValue.Keys.Contains("Batch") ? modifyValue["Batch"] : _entity.Batch;
var _Qty1 = modifyValue.Keys.Contains("TempQty") ? modifyValue["TempQty"] : _entity.TempQty;
var _Batch1 = modifyValue.Keys.Contains("Batch") ? modifyValue["Batch"] : _entity.Batch;
var _VendBatch = modifyValue.Keys.Contains("VendBatch") ? modifyValue["VendBatch"].ToString() : "55";
var _Sheets= modifyValue.Keys.Contains("Sheets") ? modifyValue["Sheets"] : _entity.ReceivedQty;
var _ProduceDate = modifyValue.Keys.Contains("Time") ? modifyValue["Time"].ToString() :"33";
if (_ProduceDate=="33"&& ConvertHelper.To<decimal>(_Qty1) > 0)
var _Sheets = modifyValue.Keys.Contains("Sheets") ? modifyValue["Sheets"] : _entity.ReceivedQty;
var _ProduceDate = modifyValue.Keys.Contains("Time") ? modifyValue["Time"].ToString() : "33";
if (_ProduceDate == "33" && ConvertHelper.To<decimal>(_Qty1) > 0)
{
Alert.Show("生产日期不能为空!");
return;
}
if (string.IsNullOrEmpty(_entity.MaxTime))
{
if (DateTime.Parse(_ProduceDate) > DateTime.Now){
if (DateTime.Parse(_ProduceDate) > DateTime.Now)
{
Alert.Show("生产日期不能大于当前日期");
return;
}
}
if (!string.IsNullOrEmpty(_entity.MaxTime))
if (!string.IsNullOrEmpty(_entity.MaxTime))
{
if (DateTime.Parse(_ProduceDate) < DateTime.Parse(_entity.MaxTime))
{
Alert.Show("生产日期不能小于目前最大生产日期!");
return;
}
if (DateTime.Parse(_ProduceDate) > DateTime.Now&& DateTime.Parse(_ProduceDate) != DateTime.Parse(_entity.MaxTime))
if (DateTime.Parse(_ProduceDate) > DateTime.Now && DateTime.Parse(_ProduceDate) != DateTime.Parse(_entity.MaxTime))
{
Alert.Show("生产日期不能大于当前日期,如果目前最大生产日期已经大于当前日期,请选择最大生产日期进行发货!");
return;
}
}
object _PackQty = 0;
if (modifyValue.Keys.Contains("PackQty"))
{
@ -322,12 +325,12 @@ namespace SCP.SupplierData
// _detail.ReduceQty = 0;
// }
//}
_detail.VendBatch = _VendBatch.ToString();
_detail.VendBatch = _VendBatch.ToString();
_detail.ProduceDate = dt;
_detail.ReceivedQty = decimal.Parse(_Sheets.ToString());
_askDetaillist.Add(_detail);
}
}
}
if (modifyValue.Keys.Contains("Qty2") && modifyValue.Keys.Contains("Batch2"))
{
var _Qty2 = modifyValue["Qty2"];
@ -371,11 +374,11 @@ namespace SCP.SupplierData
// }
//}
_detail.ReceivedQty = decimal.Parse(_Sheets.ToString());
_detail.ProduceDate = DateTime.Parse(_ProduceDate.ToString());
_detail.ProduceDate = DateTime.Parse(_ProduceDate.ToString());
_askDetaillist.Add(_detail);
}
}
}
}
if (modifyValue.Keys.Contains("Qty3") && modifyValue.Keys.Contains("Batch3"))
{
var _Qty3 = modifyValue["Qty3"];
@ -418,48 +421,45 @@ namespace SCP.SupplierData
_detail.ProduceDate = DateTime.Parse(_ProduceDate.ToString());
_askDetaillist.Add(_detail);
}
}
}
if (QtyAll > _entity.AskQty - _entity.ShippedQty - _entity.ReduceQty&&(_entity.DockCode=="WS"|| _entity.DockCode == "WG"))
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "发货数量>可发数量"));
return;
}
if (_VendBatch == "55" && (_entity.DockCode == "YC" || _entity.DockCode == "WT") && QtyAll > 0)
{
Alert.Show("供应商批次不能为空");
return;
}
if (_entity.CreateTime.ToString("MM")=="05"&& _entity.CreateTime.Year.ToString()=="2021")
}
if (_entity.CreateTime.ToString("MM") == "05" && _entity.CreateTime.Year.ToString() == "2021")
{
Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单");
return;
}
if ((_entity.AskQty - _entity.ShippedQty - _entity.ReduceQty).Value <= 0)
//校验是否超发
List<string> message = SCP_ToleranceProportion_Controller.CheckToleranceProportion(_entity,QtyAll);
if (message.Count() > 0)
{
if (QtyAll > 0) {
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "只能超发一次哦"));
Alert.Show(string.Join("<br>", message));
return;
}
}
_entity.ShippedQty = _entity.ShippedQty + QtyAll;
}
else
{
if (_entity.TempQty > 0||_entity.TempQty<0)
if (_entity.TempQty > 0 || _entity.TempQty < 0)
{
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
_entity.Batch = DateTime.Now.ToString("yyMMdd");
_entity.VendBatch = DateTime.Now.ToString("yyMMdd");
_entity.ShippedQty = _entity.TempQty;
_entity.ProduceDate = DateTime.Now;
_entity.PackQty = _entity.PackQty;
_askDetaillist.Add(_detail);
V_TB_ASK_DETAIL _detail = ConvertHelper.GetObjectClone<V_TB_ASK_DETAIL>(_entity);
_entity.Batch = DateTime.Now.ToString("yyMMdd");
_entity.VendBatch = DateTime.Now.ToString("yyMMdd");
_entity.ShippedQty = _entity.TempQty;
_entity.ProduceDate = DateTime.Now;
_entity.PackQty = _entity.PackQty;
_askDetaillist.Add(_detail);
}
}
}
}
_model.ShipTime = DP_ShipTime.SelectedDate;
_model.ShipUser = TXT_ShipUser.Text;
@ -474,25 +474,25 @@ namespace SCP.SupplierData
if (CurrentUser.FactoryList.Count > 0)
{
if (CurrentUser.FactoryList.FirstOrDefault()== "CNS" || CurrentUser.FactoryList.FirstOrDefault() == "BJCIAI")
if (CurrentUser.FactoryList.FirstOrDefault() == "CNS" || CurrentUser.FactoryList.FirstOrDefault() == "BJCIAI")
{
_askDetaillist.ForEach(p =>
{
p.VendBatch = p.Batch;
});
}
}
var vend = _askDetaillist.First();
List<string> errlist = new List<string>();
if (errlist.Count() > 0)
{
string STR = String.Join(";", errlist);
Alert.Show(STR);
return;
}
var ret=SCP_ASK_CONTROLLER.Save_ASK_TO_ASN(_model, _askDetaillist, TXT_PlateNumber.Text, CurrentUser.ChineseName ,CurrentUser.CellPhone);
var ret = SCP_ASK_CONTROLLER.Save_ASK_TO_ASN(_model, _askDetaillist, TXT_PlateNumber.Text, CurrentUser.ChineseName, CurrentUser.CellPhone);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("生成发货单成功!");
@ -500,8 +500,8 @@ namespace SCP.SupplierData
BindDetail();
}
}
private string GetBatch(DateTime dt)
private string GetBatch(DateTime dt)
{
string strResult = "";
@ -543,10 +543,10 @@ namespace SCP.SupplierData
protected void Grid_V_TB_ASK_DETAIL_RowDataBound(object sender, GridRowEventArgs e)
{
//GridRow row = Grid_V_TB_ASK_DETAIL.Rows[e.RowIndex];
//object[] rowDataKeys = Grid_V_TB_ASK_DETAIL.DataKeys[e.RowIndex];
////var TXT_PackQty = (NumberBox)row.FindControl("TXT_PackQty");
////var txtBatch1 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBatch1");
////var txtBatch2 = (System.Web.UI.WebControls.TextBox)row.FindControl("txtBatch2");
@ -559,7 +559,7 @@ namespace SCP.SupplierData
//var a = row.TemplateContainers;
//if (_shippedQty >= _askQty)
//{
// //foreach (GridColumn column in Grid_V_TB_ASK_DETAIL.Columns)
// //{
// // e
@ -569,7 +569,7 @@ namespace SCP.SupplierData
//else
//{
// //txtQty1.Text = "0";
// //txtBatch1.Text = DateTime.Now.ToString("yyMMdd");
//}
}

34
SCP/Views/SupplierData/SCP_ASN_MANYCREATE.aspx.cs

@ -362,24 +362,34 @@ namespace SCP.Views.SupplierData
}
}
if (QtyAll > _entity.AskQty - _entity.ShippedQty - _entity.ReduceQty && (_entity.DockCode == "WS" || _entity.DockCode == "WG"))
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "发货数量>可发数量"));
return;
}
if (_entity.CreateTime.ToString("MM") == "05" && _entity.CreateTime.Year.ToString() == "2021")
{
Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单");
return;
}
if ((_entity.AskQty - _entity.ShippedQty - _entity.ReduceQty).Value <= 0)
//if (QtyAll > _entity.AskQty - _entity.ShippedQty - _entity.ReduceQty && (_entity.DockCode == "WS" || _entity.DockCode == "WG"))
//{
// PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "发货数量>可发数量"));
// return;
//}
//if ((_entity.AskQty - _entity.ShippedQty - _entity.ReduceQty).Value <= 0)
//{
// if (QtyAll > 0)
// {
// PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "只能超发一次哦"));
// return;
// }
//}
//校验是否超发
List<string> message = SCP_ToleranceProportion_Controller.CheckToleranceProportion(_entity, QtyAll);
if (message.Count() > 0)
{
if (QtyAll > 0)
{
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "只能超发一次哦"));
return;
}
Alert.Show(string.Join("<br>", message));
return;
}
_entity.ShippedQty = _entity.ShippedQty + QtyAll;

4
SCP/Views/富维冲压件/SCP_PO_MAX.aspx

@ -46,14 +46,14 @@
<Items>
<f:Form runat="server" >
<Rows>
<f:FormRow runat="server" ID="FormRow_1">
<%--<f:FormRow runat="server" ID="FormRow_1">
<Items>
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="合同月" EmptyText="请选择日期" ID="DP_HTMONTHDate" />
</Items>
</f:FormRow>
</f:FormRow>--%>
<f:FormRow runat="server" ID="FormRow_2">
<Items>
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" />

14
SCP/Views/富维冲压件/SCP_PO_MAX.aspx.cs

@ -243,12 +243,12 @@ namespace SCP.Views.富维冲压件
{
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
if (string.IsNullOrEmpty(DP_HTMONTHDate.SelectedDate.ToString()))
{
Alert.Show("请选择合同月再点击导入!");
return;
}
DateTime month = DateTime.Parse(DP_HTMONTHDate.SelectedDate.ToString());
//if (string.IsNullOrEmpty(DP_HTMONTHDate.SelectedDate.ToString()))
//{
// Alert.Show("请选择合同月再点击导入!");
// return;
//}
DateTime month = DateTime.Now.AddMonths(1);
var time = month.ToString("yyyyMM");
var list = ConvertHelper.ToList<SCP_MAXPO_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> poerr = new List<string>();
@ -309,7 +309,7 @@ namespace SCP.Views.富维冲压件
_dt = ExcelHelper.GetDataTableOfXlsx(_stream);
}
DateTime month = DateTime.Parse(DP_HTMONTHDate.SelectedDate.ToString());
DateTime month = DateTime.Now.AddMonths(1);
var time = month.ToString("yyyyMM");
var list = ConvertHelper.ToList<SCP_MAXPO_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
var ret = SCP_PO_CONTROLLER.EXCEL_PO_MAX(_dt, list, CurrentUser.FactoryList[0], CurrentUser.Name, DateTime.Now, PoState.Open, CurrentUser.SubSiteList[0], CurrentUser.ChineseName, time);

18
SCP/Views/富维冲压件/SCP_PO_MAX.aspx.designer.cs

@ -113,24 +113,6 @@ namespace SCP.Views.富维冲压件
/// </remarks>
protected global::FineUI.GroupPanel gp1;
/// <summary>
/// FormRow_1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.FormRow FormRow_1;
/// <summary>
/// DP_HTMONTHDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.DatePicker DP_HTMONTHDate;
/// <summary>
/// FormRow_2 控件。
/// </summary>

112
SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx

@ -1,87 +1,89 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SCP_PO_MAX_DETAIL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_PO_MAX_DETAIL" %>
<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="SCP_PO_MAX_DETAIL.aspx.cs" Inherits="SCP.Views.富维冲压件.SCP_PO_MAX_DETAIL" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<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" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<f:Panel ID="Panel1" runat="server" Title="" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Start">
<Toolbars>
<f:Toolbar ID="Toolbar2" runat="server">
<Items>
<f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="BTN_SAVE_Click" Hidden="true">
</f:Button>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="作废大订单明细" Icon="CssDelete" OnClick="btnCancel_Click" OnClientClick="if(!confirm('是否要将选中明细'))return false;" Hidden="true">
</f:Button>
<%-- <f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="BTN_SAVE_Click" Hidden="True">
</f:Button>--%>
<f:Button ID="Btn_SaveReductionQty" runat="server" EnablePostBack="True" Text="保存削减" Icon="SystemSave" OnClick="Btn_SaveReductionQty_Click" OnClientClick="if(!confirm('是否要将选中明细进行削减操作'))return false;" >
</f:Button>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="作废大订单明细" Icon="CssDelete" OnClick="btnCancel_Click" OnClientClick="if(!confirm('是否要将选中明细作废'))return false;" Hidden="True">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Grid ID = "Grid_V_TB_PO_SUBDETAIL" Title = "大订单明细" BoxFlex="1" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true"
runat ="server" EnableCheckBoxSelect = "true" PageSize="1000"
DataKeyNames = "UID,PoBillNum,PartCode,Qty,SubQty"
SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc"
AutoScroll="true"
>
<Columns>
<f:BoundField Width = "100px" DataField = "PartCode" DataFormatString = "{0}" HeaderText = "原料物料号" SortField="PartCode"/>
<f:BoundField Width = "100px" DataField = "PartNumber" DataFormatString = "{0}" HeaderText = "零件号" SortField="PartNumber"/>
<f:BoundField Width = "100px" DataField = "PoLine" DataFormatString = "{0}" HeaderText = "行号" SortField="PoLine"/>
<f:BoundField Width = "100px" DataField = "Texture" DataFormatString = "{0}" HeaderText = "材质" SortField="Texture"/>
<f:BoundField Width = "100px" DataField = "Model" DataFormatString = "{0}" HeaderText = "车型" SortField="Model"/>
<f:BoundField Width = "100px" DataField = "Finprspec" DataFormatString = "{0}" HeaderText = "成品规格" SortField="Finprspec"/>
<f:BoundField Width = "100px" DataField = "TechStandard" DataFormatString = "{0}" HeaderText = "技术标准" SortField="TechStandard"/>
<f:BoundField Width = "100px" DataField = "Matermanu" DataFormatString = "{0}" HeaderText = "材料厂家" SortField="Matermanu"/>
<f:TemplateField HeaderText="订货量(吨)" Width="100px" ColumnID="OrderQtyd" MinWidth="100px">
<ItemTemplate>
<asp:TextBox ID="NB_PublishNum" runat="server" Width="90px" Text='<%# Eval("OrderQtyd") %>' ></asp:TextBox>
</ItemTemplate>
</f:TemplateField>
<f:BoundField Width = "100px" DataField = "OrderQtykg" DataFormatString = "{0}" HeaderText = "订货量(千克)" SortField="OrderQtykg"/>
<f:BoundField Width = "100px" DataField = "SurplusQty" DataFormatString = "{0}" HeaderText = "剩余订货量(千克)" SortField="SurplusQty"/>
<f:BoundField Width = "100px" DataField = "OrderNumber" DataFormatString = "{0}" HeaderText = "订货件数" SortField="OrderNumber"/>
<f:BoundField Width = "100px" DataField = "MinordQty" DataFormatString = "{0}" HeaderText = "起订量" SortField="MinordQty"/>
<f:BoundField Width = "100px" DataField = "Singlecon" DataFormatString = "{0}" HeaderText = "单件消耗(千克)" SortField="Singlecon"/>
<f:BoundField Width = "100px" DataField = "forecastone" DataFormatString = "{0}" HeaderText = "" SortField="forecastone" ColumnID="forecastone" />
<f:BoundField Width = "100px" DataField = "forecasttwo" DataFormatString = "{0}" HeaderText = "" SortField="forecasttwo" ColumnID="forecasttwo"/>
<f:BoundField Width = "100px" DataField = "forecastthree" DataFormatString = "{0}" HeaderText = "" SortField="forecastthree" ColumnID="forecastthree"/>
<f:BoundField Width = "100px" DataField = "forecastfour" DataFormatString = "{0}" HeaderText = "" SortField="forecastfour" ColumnID="forecastfour"/>
<f:BoundField Width = "100px" DataField = "forecastfive" DataFormatString = "{0}" HeaderText = "" SortField="forecastfive" ColumnID="forecastfive"/>
<f:BoundField Width = "100px" DataField = "forecastsix" DataFormatString = "{0}" HeaderText = "" SortField="forecastsix" ColumnID="forecastsix"/>
</Columns>
<PageItems>
<f:Grid ID="Grid_V_TB_PO_SUBDETAIL" Title="大订单明细" BoxFlex="1" ShowBorder="True" ShowHeader="True" AllowCellEditing="True" ClicksToEdit="1"
runat="server" PageSize="1000" SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc" AutoScroll="True"
DataKeyNames="UID,PoBillNum,PartCode,Qty,SubQty,ReductionQty,ReductionQtyOne,ReductionQtyTwo,ReductionQtyThree,ReductionQtyFour,ReductionQtyFive" >
<Columns>
<f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="原料物料号" SortField="PartCode" />
<f:BoundField Width="100px" DataField="PartNumber" DataFormatString="{0}" HeaderText="零件号" SortField="PartNumber" />
<f:BoundField Width="100px" DataField="PoLine" DataFormatString="{0}" HeaderText="行号" SortField="PoLine" />
<f:BoundField Width="100px" DataField="Texture" DataFormatString="{0}" HeaderText="材质" SortField="Texture" />
<f:BoundField Width="100px" DataField="Model" DataFormatString="{0}" HeaderText="车型" SortField="Model" />
<f:BoundField Width="100px" DataField="Finprspec" DataFormatString="{0}" HeaderText="成品规格" SortField="Finprspec" />
<f:BoundField Width="100px" DataField="TechStandard" DataFormatString="{0}" HeaderText="技术标准" SortField="TechStandard" />
<f:BoundField Width="100px" DataField="Matermanu" DataFormatString="{0}" HeaderText="材料厂家" SortField="Matermanu" />
<f:BoundField Width="100px" DataField="OrderQtykg" DataFormatString="{0}" HeaderText="订货量(千克)" SortField="OrderQtykg" />
<f:BoundField Width="100px" DataField="SurplusQty" DataFormatString="{0}" HeaderText="剩余订货量(千克)" SortField="SurplusQty" />
<f:BoundField Width="100px" DataField="OrderNumber" DataFormatString="{0}" HeaderText="订货件数" SortField="OrderNumber" />
<f:BoundField Width="100px" DataField="MinordQty" DataFormatString="{0}" HeaderText="起订量" SortField="MinordQty" />
<f:BoundField Width="100px" DataField="Singlecon" DataFormatString="{0}" HeaderText="单件消耗(千克)" SortField="Singlecon" />
<f:BoundField Width="100px" DataField="OrderQtyd" DataFormatString="{0}" HeaderText="订货量吨(初始)" SortField="OrderQtyd" />
<f:BoundField Width="120px" DataField="OrderQtydNow" DataFormatString="{0}" HeaderText="订货量吨(当前)"/>
<f:RenderField Width="100px" ColumnID="ReductionQty" DataField="ReductionQty" FieldType="Float" HeaderText="单次削减量(吨)">
<Editor>
<f:NumberBox ID="NumberBox2" runat="server" MinValue="-99999999" MaxValue="0" DecimalPrecision="5">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:BoundField Width="80px" DataField="ReductionQtyOne" HeaderText="第一次削减量" />
<f:BoundField Width="80px" DataField="ReductionQtyTwo" HeaderText="第二次削减量" />
<f:BoundField Width="80px" DataField="ReductionQtyThree" HeaderText="第三次削减量" />
<f:BoundField Width="80px" DataField="ReductionQtyFour" HeaderText="第四次削减量" />
<f:BoundField Width="80px" DataField="ReductionQtyFive" HeaderText="第五次削减量" />
<f:BoundField Width="100px" DataField="forecastone" DataFormatString="{0}" HeaderText="" SortField="forecastone" ColumnID="forecastone" />
<f:BoundField Width="100px" DataField="forecasttwo" DataFormatString="{0}" HeaderText="" SortField="forecasttwo" ColumnID="forecasttwo" />
<f:BoundField Width="100px" DataField="forecastthree" DataFormatString="{0}" HeaderText="" SortField="forecastthree" ColumnID="forecastthree" />
<f:BoundField Width="100px" DataField="forecastfour" DataFormatString="{0}" HeaderText="" SortField="forecastfour" ColumnID="forecastfour" />
<f:BoundField Width="100px" DataField="forecastfive" DataFormatString="{0}" HeaderText="" SortField="forecastfive" ColumnID="forecastfive" />
<f:BoundField Width="100px" DataField="forecastsix" DataFormatString="{0}" HeaderText="" SortField="forecastsix" ColumnID="forecastsix" />
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
<f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="True" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged"
runat="server">
<f:ListItem Text="200" Value="200" />
<f:ListItem Text="500" Value="500" />
</f:DropDownList>
</PageItems>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window runat="server" ID="Window1" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="840px" Width="700px" />
<f:Window ID="WindowUpload" runat="server" Hidden="True"
WindowPosition="Center" IsModal="true" Title="Popup Window 1" Target="Parent" EnableIFrame="true"
IFrameUrl="about:blank" Height="200px" Width="400px">
</f:Window>
<f:HiddenField runat="server" ID="TXT_ModType"></f:HiddenField>
<f:HiddenField runat="server" ID="TXT_State"></f:HiddenField>
<f:HiddenField runat="server" ID="TXT_ModType"></f:HiddenField>
<f:HiddenField runat="server" ID="TXT_State"></f:HiddenField>
</form>
</body>
</html>

74
SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.cs

@ -20,10 +20,10 @@ namespace SCP.Views.富维冲压件
{
if (CurrentUser.RoleList.Contains("期货合同"))
{
Btn_Save.Hidden = false;
//Btn_Save.Hidden = false;
Button1.Hidden = false;
}
Bind();
Bind();
}
}
@ -34,19 +34,20 @@ namespace SCP.Views.富维冲压件
var _poBillNum = Request["PoBillNum"];
MAXPO.PoBillNum = _poBillNum;
SCP_PO_CONTROLLER.Get_V_TB_MAXPO_DETAIL_List(MAXPO, (rs) => {
SCP_PO_CONTROLLER.Get_V_TB_MAXPO_DETAIL_List(MAXPO, (rs) =>
{
if (rs.State == ReturnStatus.Succeed)
{
var list = SortAndPage<V_TB_MAXPO_DETAIL>(rs.Result, Grid_V_TB_PO_SUBDETAIL);
var _ls = list.ToList();
foreach(var ls in _ls)
foreach (var ls in _ls)
{
if (!string.IsNullOrEmpty(ls.forecastone) )
if (!string.IsNullOrEmpty(ls.forecastone))
{
string[] str= ls.forecastone.Split('/');
string[] str = ls.forecastone.Split('/');
var column1 = Grid_V_TB_PO_SUBDETAIL.FindColumn("forecastone");
column1.HeaderText = str[0];
ls.forecastone= str[1];
ls.forecastone = str[1];
}
if (!string.IsNullOrEmpty(ls.forecasttwo))
{
@ -84,10 +85,9 @@ namespace SCP.Views.富维冲压件
ls.forecastsix = str[1];
}
}
Grid_V_TB_PO_SUBDETAIL.DataSource = _ls;
Grid_V_TB_PO_SUBDETAIL.DataBind();
}
});
@ -121,17 +121,16 @@ namespace SCP.Views.富维冲压件
{
_entity.OrderQtykg = decimal.Parse(_txt.Text) * 1000;
}
_list.Add(_entity);
_list.Add(_entity);
}
}
var ret = SCP_PO_CONTROLLER.Save_TB_MAXPO_DETAIL_QTY(_list);
if (ret.State == ReturnStatus.Succeed)
{
var list = ret.Result;
Alert.Show("保存成功!");
Bind();
@ -171,6 +170,49 @@ namespace SCP.Views.富维冲压件
}
}
protected void Btn_SaveReductionQty_Click(object sender, EventArgs e)
{
List<TB_MAXPO_DETAIL> list = new List<TB_MAXPO_DETAIL>();
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid_V_TB_PO_SUBDETAIL.GetModifiedDict();
if (modifiedDict.Count() == 0)
{
Alert.Show("请修改单次削减量后再进行操作");
return;
}
for (int i = 0, count = Grid_V_TB_PO_SUBDETAIL.Rows.Count; i < count; i++)
{
GridRow row = Grid_V_TB_PO_SUBDETAIL.Rows[i];
TB_MAXPO_DETAIL _entity = new TB_MAXPO_DETAIL();
object[] rowDataKeys = Grid_V_TB_PO_SUBDETAIL.DataKeys[i];
_entity.UID = ConvertHelper.To<Int32>(rowDataKeys[0]);
if (modifiedDict.Keys.Contains(i))
{
if (rowDataKeys[10] != null)
{
Alert.Show("该数据已修改5次削减量,不允许再次修改");
return;
}
var modifyValue = modifiedDict[i];
var _Qty1 = modifyValue.Keys.Contains("ReductionQty") ? modifyValue["ReductionQty"] : 0;
_entity.ReductionQty = _Qty1 != null ? Convert.ToDecimal(_Qty1) : 0;
list.Add(_entity);
}
}
var ret = SCP_PO_CONTROLLER.Save_TB_MAXPO_DETAIL_SaveReductionQty(list);
if (ret.State == ReturnStatus.Succeed)
{
Alert.Show("保存成功!");
Bind();
}
else
{
Alert.Show("保存失败" + string.Join(",", ret.MessageList.ToArray()));
}
}
protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid_V_TB_PO_SUBDETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue);

26
SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx.designer.cs

@ -42,13 +42,13 @@ namespace SCP.Views.富维冲压件
protected global::FineUI.Toolbar Toolbar2;
/// <summary>
/// Btn_Save 控件。
/// Btn_SaveReductionQty 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button Btn_Save;
protected global::FineUI.Button Btn_SaveReductionQty;
/// <summary>
/// Button1 控件。
@ -69,13 +69,13 @@ namespace SCP.Views.富维冲压件
protected global::FineUI.Grid Grid_V_TB_PO_SUBDETAIL;
/// <summary>
/// NB_PublishNum 控件。
/// NumberBox2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox NB_PublishNum;
protected global::FineUI.NumberBox NumberBox2;
/// <summary>
/// ToolbarSeparator1 控件。
@ -104,24 +104,6 @@ namespace SCP.Views.富维冲压件
/// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window Window1;
/// <summary>
/// WindowUpload 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Window WindowUpload;
/// <summary>
/// TXT_ModType 控件。
/// </summary>

18
UniApiGroup/Controller/OdbcApiQadController.cs

@ -814,8 +814,8 @@ namespace CK.SCP.GrupUniApi.Controller
var wmsAskList = new List<TB_ASK>();
var wmsAskDetailList = new List<TB_ASK_DETAIL>();
var xxMaxbath = new List<xxDiMaxes_Po>();
var Dlist = list.Where(p => p.ctype == "D");
var Ilist = list.Where(p => p.ctype != "D");
var Dlist = list.Where(p => p.DI_OPERTYPE == "D");
var Ilist = list.Where(p => p.DI_OPERTYPE != "D");
//var _li = Dlist.GroupBy(p => p.purDocNO);
foreach (var _lii in Dlist)
{
@ -1588,7 +1588,7 @@ namespace CK.SCP.GrupUniApi.Controller
var FATCTORY = wdb.TB_FACTORY.FirstOrDefault();
DataTable b = QmStockController.GetInvBatchStock(item.MaxdibatchNO, a, FATCTORY.FactoryId);
List<MMRSENDMTLDATA> list = ChangKeTec.Utils.ListHelper.DataTableToList<MMRSENDMTLDATA>(b);
List<TA_ToleranceProportion> proportionList = new List<TA_ToleranceProportion>();
var wmsDataList = new List<TA_PART>();
var xxMaxbath = new List<xxDiMaxes>();
foreach (var qadData in list)
@ -1620,6 +1620,17 @@ namespace CK.SCP.GrupUniApi.Controller
wmsData.State = !string.IsNullOrEmpty(qadData.SpMtlStatus) ? qadData.SpMtlStatus.ToUpper() : "A";
wmsData.Site = qadData.plant;
wmsDataList.Add(wmsData);
var toleranceProportion = wdb.TA_ToleranceProportion.FirstOrDefault(p => p.PartCode == qadData.MTLNO);
if (toleranceProportion == null)
{
toleranceProportion = new TA_ToleranceProportion();
toleranceProportion.PartCode = qadData.MTLNO;
toleranceProportion.Site = qadData.plant;
toleranceProportion.ToleranceProportion = 0.20M;
toleranceProportion.CreateUser = "QAD";
toleranceProportion.CreateTime = DateTime.Now.ToString();
proportionList.Add(toleranceProportion);
}
}
if (wmsDataList.Count == 0)
@ -1631,6 +1642,7 @@ namespace CK.SCP.GrupUniApi.Controller
item.MaxdibatchNO = item.MaxdibatchNO + list.Count;
idb.xxDiMaxes.AddOrUpdate(xxMaxbath.ToArray());
wdb.TA_PART.AddOrUpdate(p => new { p.PartCode, p.Site }, wmsDataList.ToArray());
wdb.TA_ToleranceProportion.AddOrUpdate(proportionList.ToArray());
Console.WriteLine($"¸üРÁã¼þÐÅÏ¢ Êý¾Ý£º{list.Count}");
}

1
UniApiGroup/Controller/PoBillNumcontroller.cs

@ -41,6 +41,7 @@ namespace CK.SCP.UniApi.Controller
public string purDocItemCtg { get; set; }
public string plant { get; set; }
public string purOrg { get; set; }
public string DI_OPERTYPE { get; set; }
public string companyCode { get; set; }
public string mtlNO { get; set; }
public string shortText { get; set; }

Loading…
Cancel
Save