Browse Source

容差加期货合同

SCP_CYJ
钱峰 2 months ago
parent
commit
eafd4aeac9
  1. 1
      Controller/CK.SCP.Controller.csproj
  2. 19
      Controller/SCP_ASK_CONTROLLER.cs
  3. 504
      Controller/SCP_PO_CONTROLLER.cs
  4. 330
      Controller/SCP_ToleranceProportion_Controller.cs
  5. 5
      Models/CK.SCP.Models.csproj
  6. 17
      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. 15
      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. 24
      SCP/Views/SupplierData/SCP_ASN_CREATE.aspx.cs
  21. 30
      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. 48
      SCP/Views/富维冲压件/SCP_PO_MAX_DETAIL.aspx
  26. 50
      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_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_FORECAST_CONTROLLER.cs" />
<Compile Include="SCP_ToleranceProportion_Controller.cs" />
<Compile Include="SCP_MoldSharing_Controller.cs" /> <Compile Include="SCP_MoldSharing_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" />

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 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) , string p_buyer, string p_buyerPhone)
{ {
@ -1844,6 +1852,15 @@ namespace CK.SCP.Controller
} }
return _ret; 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 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) , string p_buyer, string p_buyerPhone)
{ {

504
Controller/SCP_PO_CONTROLLER.cs

@ -229,153 +229,6 @@ namespace CK.SCP.Controller
} }
return p_list; return p_list;
} }
public static ResultObject<bool> Save_TB_MAXPO_DETAIL_QTY(List<TB_MAXPO_DETAIL> p_entitys)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
foreach (var itm in p_entitys)
{
var _entity = db.TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
if(itm.OrderQtykg <_entity.OrderQtykg- _entity.AsnQty)
{
_ret.MessageList.Add("零件号"+_entity.PartCode+"剩余可消耗订货量不足!");
}
if( itm.OrderQtykg == 0)
{
_ret.MessageList.Add("订货量不能修改为0!");
}
else
{
_entity.SurplusQty = itm.OrderQtykg - _entity.OrderQtykg + _entity.SurplusQty;
_entity.AsnQty=itm.OrderQtykg - _entity.OrderQtykg + _entity.AsnQty;
_entity.OrderQtykg = itm.OrderQtykg;
_entity.OrderQtyd = itm.OrderQtykg / 1000;
db.TB_MAXPO_DETAIL.AddOrUpdate(p => p.UID, _entity);
TS_UNI_API maxuni = new TS_UNI_API();
maxuni.BillNum = _entity.PoBillNum;
maxuni.InterfaceType = "MaxPobillnum";
maxuni.TableName = "TS_UNI_API";
maxuni.BillType = 701;
maxuni.SubBillType = 0;
maxuni.PartCode = _entity.PartCode;
maxuni.VendId = _entity.VendId;//供应商编号
if (string.IsNullOrEmpty(_entity.Texture))
{
maxuni.Batch = "";
}
else
{
maxuni.Batch = _entity.Texture;//材质
}
maxuni.Qty = _entity.OrderNumber;
maxuni.State = 1;
maxuni.CreateOper = _entity.CreateUser;//创建者
maxuni.CreateTime =DateTime.Now;
maxuni.PutTime = DateTime.Now;
maxuni.Extend1 = _entity.PartNumber;
maxuni.PackQty = _entity.MinordQty;
maxuni.Price = _entity.OrderQtyd;
maxuni.VendBatch = _entity.ContractMonth;//合同月
maxuni.Currency = _entity.Model;
maxuni.Buyer = _entity.TechStandard;
maxuni.BuyerPhone =_entity.Finprspec;//规格
maxuni.Tax = 0;
maxuni.PoUnit = _entity.forecastone;//预测1
maxuni.LocUnit = _entity.forecasttwo;//预测2
maxuni.Attn =_entity.forecastthree;//预测3
maxuni.Receiver = _entity.forecastfour;//预测4
maxuni.ModType = _entity.forecastfive;//预测5
maxuni.SubSite = _entity.forecastsix;//预测6
maxuni.Site = _entity.Site;
maxuni.Extend2 = _entity.Matermanu;
maxuni.TaxAmt = _entity.Singlecon;//单件消耗
maxuni.ValidDate = DateTime.Now;
maxuni.ErpLineNum = _entity.PoLine;
maxuni.Domain = _entity.Site;
maxuni.Extend3 = "U";
db.TS_UNI_API.AddOrUpdate(maxuni);
}
}
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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
return _ret;
}
public static List<V_TB_PO_DETAIL> LOAD_PO_DETAIL_SUM(List<V_TB_PO_DETAIL> p_list) public static List<V_TB_PO_DETAIL> LOAD_PO_DETAIL_SUM(List<V_TB_PO_DETAIL> p_list)
{ {
using (ScpEntities db = EntitiesFactory.CreateScpInstance()) using (ScpEntities db = EntitiesFactory.CreateScpInstance())
@ -1997,7 +1850,8 @@ namespace CK.SCP.Controller
private static List<string> CheckExcelMode_Po(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel) private static List<string> CheckExcelMode_Po(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel)
{ {
List<string> ErrorList = new List<string>(); List<string> ErrorList = new List<string>();
if (!string.IsNullOrEmpty(p_excel.)) { if (!string.IsNullOrEmpty(p_excel.))
{
var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel. && p.VendID == p_excel.); var _count = db.TA_Appliance.Count(p => p.PartNumber == p_excel. && p.VendID == p_excel.);
if (_count == 0) if (_count == 0)
{ {
@ -2517,7 +2371,8 @@ namespace CK.SCP.Controller
private static List<string> CheckExcelMode_Multicomponent(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel, bool wmsweb) private static List<string> CheckExcelMode_Multicomponent(ScpEntities db, SCP_PO_EXPORT_IMPORT_MODEL p_excel, bool wmsweb)
{ {
List<string> ErrorList = new List<string>(); List<string> ErrorList = new List<string>();
if (wmsweb == false) { if (wmsweb == false)
{
BomList.JsonService bomVersionRe = new BomList.JsonService(); BomList.JsonService bomVersionRe = new BomList.JsonService();
var _ReturnRelust = bomVersionRe.GetBomsByVer(p_excel., p_excel.BOM版本); var _ReturnRelust = bomVersionRe.GetBomsByVer(p_excel., p_excel.BOM版本);
if (!_ReturnRelust.Contains("Qty")) if (!_ReturnRelust.Contains("Qty"))
@ -2669,7 +2524,6 @@ namespace CK.SCP.Controller
ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.)); ErrorList.Add(string.Format("供应商编号{0}不正确!", p_excel.));
} }
} }
BomList1.JsonService bomVersionRe = new BomList1.JsonService(); BomList1.JsonService bomVersionRe = new BomList1.JsonService();
var _ReturnRelust = bomVersionRe.GetBom(p_excel., p_excel.); var _ReturnRelust = bomVersionRe.GetBom(p_excel., p_excel.);
if (_ReturnRelust == "[null]") if (_ReturnRelust == "[null]")
@ -5229,7 +5083,7 @@ namespace CK.SCP.Controller
} }
else else
{ {
var _MaxpoList = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.SurplusQty > 0 && t.VendId == _ls.UpdateInfo).OrderBy(t => t.ContractMonth).ToList(); var _MaxpoList = db.TB_MAXPO_DETAIL.Where(t => t.PartCode == _ls.PartCode && t.SurplusQty > 0 && t.VendId == _ls.UpdateInfo).OrderBy(t => t.PoBillNum).ToList();
foreach (var _maxpo in _MaxpoList) foreach (var _maxpo in _MaxpoList)
{ {
if (_maxpo.SurplusQty > _PlanQTY) if (_maxpo.SurplusQty > _PlanQTY)
@ -6160,7 +6014,7 @@ namespace CK.SCP.Controller
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message); LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_PO_CONTROLLER), "EXCEL_PO_MOD", e.Message);
_ret.Result = false; _ret.Result = false;
_ret.ErrorList.Add(e); _ret.ErrorList.Add(e);
throw e; _ret.MessageList.Add(e.Message);
} }
return _ret; return _ret;
} }
@ -6283,7 +6137,8 @@ namespace CK.SCP.Controller
unii.ForEach(t => unii.ForEach(t =>
{ {
var uniii = t.ToList(); var uniii = t.ToList();
uniii.ForEach(r => { uniii.ForEach(r =>
{
r.ErpLineNum = cntTS_detail; r.ErpLineNum = cntTS_detail;
}); });
cntTS_detail++; cntTS_detail++;
@ -6301,7 +6156,8 @@ namespace CK.SCP.Controller
poii.ForEach(t => poii.ForEach(t =>
{ {
var poiii = t.ToList(); var poiii = t.ToList();
poiii.ForEach(r => { poiii.ForEach(r =>
{
r.PoLine = cntTS_detail; r.PoLine = cntTS_detail;
}); });
poSub_detail++; poSub_detail++;
@ -7326,7 +7182,8 @@ namespace CK.SCP.Controller
{ {
uni.Barcode = "CY01"; uni.Barcode = "CY01";
} }
else{ else
{
uni.Barcode = "FB03"; uni.Barcode = "FB03";
} }
@ -9431,6 +9288,343 @@ namespace CK.SCP.Controller
return p_list; return p_list;
} }
#endregion #endregion
public static ResultObject<bool> Save_TB_MAXPO_DETAIL_QTY(List<TB_MAXPO_DETAIL> p_entitys)
{
ResultObject<bool> _ret = new ResultObject<bool>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
foreach (var itm in p_entitys)
{
var _entity = db.TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
if (itm.OrderQtykg < _entity.OrderQtykg - _entity.AsnQty)
{
_ret.MessageList.Add("零件号" + _entity.PartCode + "剩余可消耗订货量不足!");
}
if (itm.OrderQtykg == 0)
{
_ret.MessageList.Add("订货量不能修改为0!");
}
else
{
_entity.SurplusQty = itm.OrderQtykg - _entity.OrderQtykg + _entity.SurplusQty;
_entity.AsnQty = itm.OrderQtykg - _entity.OrderQtykg + _entity.AsnQty;
_entity.OrderQtykg = itm.OrderQtykg;
_entity.OrderQtyd = itm.OrderQtykg / 1000;
db.TB_MAXPO_DETAIL.AddOrUpdate(p => p.UID, _entity);
TS_UNI_API maxuni = new TS_UNI_API();
maxuni.BillNum = _entity.PoBillNum;
maxuni.InterfaceType = "MaxPobillnum";
maxuni.TableName = "TS_UNI_API";
maxuni.BillType = 701;
maxuni.SubBillType = 0;
maxuni.PartCode = _entity.PartCode;
maxuni.VendId = _entity.VendId;//供应商编号
if (string.IsNullOrEmpty(_entity.Texture))
{
maxuni.Batch = "";
}
else
{
maxuni.Batch = _entity.Texture;//材质
}
maxuni.Qty = _entity.OrderNumber;
maxuni.State = 1;
maxuni.CreateOper = _entity.CreateUser;//创建者
maxuni.CreateTime = DateTime.Now;
maxuni.PutTime = DateTime.Now;
maxuni.Extend1 = _entity.PartNumber;
maxuni.PackQty = _entity.MinordQty;
maxuni.Price = _entity.OrderQtyd;
maxuni.VendBatch = _entity.ContractMonth;//合同月
maxuni.Currency = _entity.Model;
maxuni.Buyer = _entity.TechStandard;
maxuni.BuyerPhone = _entity.Finprspec;//规格
maxuni.Tax = 0;
maxuni.PoUnit = _entity.forecastone;//预测1
maxuni.LocUnit = _entity.forecasttwo;//预测2
maxuni.Attn = _entity.forecastthree;//预测3
maxuni.Receiver = _entity.forecastfour;//预测4
maxuni.ModType = _entity.forecastfive;//预测5
maxuni.SubSite = _entity.forecastsix;//预测6
maxuni.Site = _entity.Site;
maxuni.Extend2 = _entity.Matermanu;
maxuni.TaxAmt = _entity.Singlecon;//单件消耗
maxuni.ValidDate = DateTime.Now;
maxuni.ErpLineNum = _entity.PoLine;
maxuni.Domain = _entity.Site;
maxuni.Extend3 = "U";
db.TS_UNI_API.AddOrUpdate(maxuni);
}
}
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;
}
}
}
#region
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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", 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_ASK_CONTROLLER), "Save_TB_ASK_DETAIL_LIER", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
throw e;
}
#endregion
return _ret;
}
/// <summary>
/// 保存削减量
/// </summary>
/// <param name="p_entitys"></param>
/// <returns></returns>
public static ResultObject<bool> Save_TB_MAXPO_DETAIL_SaveReductionQty(List<TB_MAXPO_DETAIL> p_entitys)
{
ResultObject<bool> _ret = new ResultObject<bool>();
List<TB_MAXPO_DETAIL> list = new List<TB_MAXPO_DETAIL>();
List<TS_UNI_API> apilist = new List<TS_UNI_API>();
try
{
using (ScpEntities db = EntitiesFactory.CreateScpInstance())
{
foreach (var itm in p_entitys)
{
var _entity = db.V_TB_MAXPO_DETAIL.Where(p => p.UID == itm.UID).FirstOrDefault();
if (Math.Abs( (itm.ReductionQty * 1000).Value) < _entity.SurplusQty)
{
_ret.MessageList.Add("零件号" + _entity.PartCode + "单次削减量不能大于剩余订货量(千克)");
}
if (((_entity.OrderQtydNow + itm.ReductionQty) * 1000) < _entity.OrderQtykg - _entity.AsnQty)
{
_ret.MessageList.Add("零件号" + _entity.PartCode + "剩余可消耗订货量不足");
}
if ((_entity.OrderQtydNow + itm.ReductionQty) < 0)
{
_ret.MessageList.Add("削减失败,零件号" + _entity.PartCode + "本次填写的削减量过大,将会使得订货量小于0!");
}
if (itm.ReductionQty == 0)
{
_ret.MessageList.Add("削减量不能修改为0!");
}
else
{
var detail = db.TB_MAXPO_DETAIL.First(p => p.UID == itm.UID);
if (detail.ReductionQtyOne == null)
{
detail.ReductionQtyOne = itm.ReductionQty;
}
else if (detail.ReductionQtyTwo == null)
{
detail.ReductionQtyTwo = itm.ReductionQty;
}
else if (detail.ReductionQtyThree == null)
{
detail.ReductionQtyThree = itm.ReductionQty;
}
else if (detail.ReductionQtyFour == null)
{
detail.ReductionQtyFour = itm.ReductionQty;
}
else if (detail.ReductionQtyFive == null)
{
detail.ReductionQtyFive = itm.ReductionQty;
}
list.Add(detail);
}
_entity.OrderQtykg = (_entity.OrderQtydNow + itm.ReductionQty).Value * 1000;
_entity.AsnQty = (itm.ReductionQty * 1000 + _entity.AsnQty).Value;
_entity.SurplusQty = (itm.ReductionQty * 1000 + _entity.SurplusQty).Value;
// 修改数据
TS_UNI_API maxuni = new TS_UNI_API();
maxuni.BillNum = _entity.PoBillNum;
maxuni.InterfaceType = "MaxPobillnum";
maxuni.TableName = "TS_UNI_API";
maxuni.BillType = 701;
maxuni.SubBillType = 0;
maxuni.PartCode = _entity.PartCode;
maxuni.VendId = _entity.VendId;//供应商编号
if (string.IsNullOrEmpty(_entity.Texture))
{
maxuni.Batch = "";
}
else
{
maxuni.Batch = _entity.Texture;//材质
}
maxuni.Qty = _entity.OrderNumber;
maxuni.State = 1;
maxuni.CreateOper = _entity.CreateUser;//创建者
maxuni.CreateTime = DateTime.Now;
maxuni.PutTime = DateTime.Now;
maxuni.Extend1 = _entity.PartNumber;
maxuni.PackQty = _entity.OrderQtykg/1000;
maxuni.Price = _entity.OrderQtydNow;
maxuni.VendBatch = _entity.ContractMonth;//合同月
maxuni.Currency = _entity.Model;
maxuni.Buyer = _entity.TechStandard;
maxuni.BuyerPhone = _entity.Finprspec;//规格
maxuni.Tax = 0;
maxuni.PoUnit = _entity.forecastone;//预测1
maxuni.LocUnit = _entity.forecasttwo;//预测2
maxuni.Attn = _entity.forecastthree;//预测3
maxuni.Receiver = _entity.forecastfour;//预测4
maxuni.ModType = _entity.forecastfive;//预测5
maxuni.SubSite = _entity.forecastsix;//预测6
maxuni.Site = _entity.Site;
maxuni.Extend2 = _entity.Matermanu;
maxuni.TaxAmt = _entity.Singlecon;//单件消耗
maxuni.ValidDate = DateTime.Now;
maxuni.ErpLineNum = _entity.PoLine;
maxuni.Domain = _entity.Site;
maxuni.Extend3 = "U";
apilist.Add(maxuni);
}
if (_ret.MessageList.Count == 0)
{
db.TB_MAXPO_DETAIL.AddOrUpdate(p => p.UID, list.ToArray());
db.TS_UNI_API.AddOrUpdate(apilist.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;
return _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.Result = false;
_ret.ErrorList.Add(dbEx);
LogHelper.Writlog(LogHelper.LogType.Error, typeof(SCP_ASK_CONTROLLER), "Save_TB_MAXPO_DETAIL_SaveReductionQty", 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_ASK_CONTROLLER), "Save_TB_MAXPO_DETAIL_SaveReductionQty", 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_ASK_CONTROLLER), "Save_TB_MAXPO_DETAIL_SaveReductionQty", 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_ASK_CONTROLLER), "Save_TB_MAXPO_DETAIL_SaveReductionQty", e.Message);
_ret.Result = false;
_ret.ErrorList.Add(e);
}
return _ret;
}
} }
} }

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_MOLDSHARING_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_OTD_REPORT_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_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_PART_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_PRICE_EXPORT.cs" />
<Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" /> <Compile Include="ScpEntity\ExcelExportEnttity\SCP_VENDER_EXPORT.cs" />
@ -360,6 +361,9 @@
<Compile Include="ScpEntity\TA_CarModel.cs" /> <Compile Include="ScpEntity\TA_CarModel.cs" />
<Compile Include="ScpEntity\TA_MoldSharing.cs" /> <Compile Include="ScpEntity\TA_MoldSharing.cs" />
<Compile Include="ScpEntity\TA_MOLDSHARING_INVOICE.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_MPO_PRINT.cs" />
<Compile Include="ScpEntity\V_TB_MPO_DETAIL.cs" /> <Compile Include="ScpEntity\V_TB_MPO_DETAIL.cs" />
<Compile Include="ScpEntity\TB_MATERIALORDERS_DETAIL.cs" /> <Compile Include="ScpEntity\TB_MATERIALORDERS_DETAIL.cs" />
@ -430,7 +434,6 @@
<Compile Include="ScpEntity\TB_FACTORY.cs" /> <Compile Include="ScpEntity\TB_FACTORY.cs" />
<Compile Include="ScpEntity\TA_INFO.cs" /> <Compile Include="ScpEntity\TA_INFO.cs" />
<Compile Include="ScpEntity\TA_LANGUAGE.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_REVICE_PORT.cs" />
<Compile Include="ScpEntity\TA_VEND_USER.cs" /> <Compile Include="ScpEntity\TA_VEND_USER.cs" />
<Compile Include="ScpEntity\TB_ASK.cs" /> <Compile Include="ScpEntity\TB_ASK.cs" />

17
Models/ScpEntities.cs

@ -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> V_TB_MPO { get; set; }
public virtual DbSet<V_TB_MPO_DETAIL> V_TB_MPO_DETAIL { 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<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) protected override void OnModelCreating(DbModelBuilder modelBuilder)
{ {
modelBuilder.Entity<TA_MOLDSHARING>() modelBuilder.Entity<TA_MOLDSHARING>()
@ -345,6 +347,21 @@ namespace CK.SCP.Models
modelBuilder.Entity<TB_MAXPO_CONSUME>() modelBuilder.Entity<TB_MAXPO_CONSUME>()
.Property(e => e.PoQty) .Property(e => e.PoQty)
.HasPrecision(18, 6); .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] [NotMapped]
public string ReceivedPort_Desc => ScpCache.GetRevicePort(ReceivePort); 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
@ -54,5 +55,17 @@ namespace CK.SCP.Models.ScpEntity
public decimal ReceQty { get; set; } public decimal ReceQty { get; set; }
public bool IsDeleted { get; set; } public bool IsDeleted { get; set; }
public decimal ReturnQty { 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
@ -59,6 +60,23 @@ namespace CK.SCP.Models.ScpEntity
public decimal ReceQty { get; set; } public decimal ReceQty { get; set; }
public decimal ReturnQty { get; set; } public decimal ReturnQty { get; set; }
public bool IsDeleted { 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.aspx" />
<Content Include="Views\BasicData\Appliance_DETAIL.aspx" /> <Content Include="Views\BasicData\Appliance_DETAIL.aspx" />
<Content Include="Views\BasicData\BoxType.aspx" /> <Content Include="Views\BasicData\BoxType.aspx" />
<Content Include="Views\BasicData\SCP_ToleranceProportion.aspx" />
<Content Include="Views\BasicData\Pinfan.aspx" /> <Content Include="Views\BasicData\Pinfan.aspx" />
<Content Include="Views\BasicData\Price.aspx" /> <Content Include="Views\BasicData\Price.aspx" />
<Content Include="Views\BasicData\ProductionLine.aspx" /> <Content Include="Views\BasicData\ProductionLine.aspx" />
@ -5033,6 +5034,13 @@
<Compile Include="Views\BasicData\BoxType.aspx.designer.cs"> <Compile Include="Views\BasicData\BoxType.aspx.designer.cs">
<DependentUpon>BoxType.aspx</DependentUpon> <DependentUpon>BoxType.aspx</DependentUpon>
</Compile> </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"> <Compile Include="Views\BasicData\Pinfan.aspx.cs">
<DependentUpon>Pinfan.aspx</DependentUpon> <DependentUpon>Pinfan.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

2
SCP/Views/BasicData/Part.aspx

@ -22,6 +22,8 @@
</f:Button> </f:Button>
<f:Button ID="btnSave" runat="server" EnablePostBack="True" Text="保存信息" Icon="SystemSave" OnClick="btnSave_Click"> <f:Button ID="btnSave" runat="server" EnablePostBack="True" Text="保存信息" Icon="SystemSave" OnClick="btnSave_Click">
</f:Button> </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 ID="btnShow" runat="server" Text="显示查询面板" Icon="Find" OnClick="btnShow_OnClick">
</f:Button> </f:Button>
<f:ToolbarSeparator runat="server" /> <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); var ret = SCP_PO_CONTROLLER.EXCEL_PART_MOD(list, CurrentUser.FactoryList[0], CurrentUser.Name);
if (ret.State == ReturnStatus.Succeed && ret.Result == true) if (ret.State == ReturnStatus.Succeed && ret.Result == true)
{ {
Alert.Show("导入成功!");
BindData(); BindData();
} }
else 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(), "零件容差模板");
}
} }
} }

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

@ -7,10 +7,12 @@
// </自动生成> // </自动生成>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace SCP.BasicData { namespace SCP.BasicData
{
public partial class Part { public partial class Part
{
/// <summary> /// <summary>
/// form1 控件。 /// form1 控件。
@ -66,6 +68,15 @@ namespace SCP.BasicData {
/// </remarks> /// </remarks>
protected global::FineUI.Button btnSave; protected global::FineUI.Button btnSave;
/// <summary>
/// ButtonTemplate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUI.Button ButtonTemplate;
/// <summary> /// <summary>
/// btnShow 控件。 /// btnShow 控件。
/// </summary> /// </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;
}
}

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

@ -56,7 +56,8 @@ namespace SCP.SupplierData
{ {
V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL(); V_TB_ASK_DETAIL _entity = new V_TB_ASK_DETAIL();
_entity.AskBillNum = Request["AskBillNum"]; _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) if (_ret.State == ReturnStatus.Succeed)
{ {
p_action(_ret.Result); p_action(_ret.Result);
@ -99,7 +100,8 @@ namespace SCP.SupplierData
} }
public void BindDetail(bool p_state = false) public void BindDetail(bool p_state = false)
{ {
SearchV_TB_ASK_DETAILData((ret) => { SearchV_TB_ASK_DETAILData((ret) =>
{
Grid_V_TB_ASK_DETAIL.RecordCount = ret.Count(); 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 _ls = SCP_ASK_CONTROLLER.Get_CAN_SHIPQTY(list.ToList());
@ -254,7 +256,8 @@ namespace SCP.SupplierData
} }
if (string.IsNullOrEmpty(_entity.MaxTime)) if (string.IsNullOrEmpty(_entity.MaxTime))
{ {
if (DateTime.Parse(_ProduceDate) > DateTime.Now){ if (DateTime.Parse(_ProduceDate) > DateTime.Now)
{
Alert.Show("生产日期不能大于当前日期"); Alert.Show("生产日期不能大于当前日期");
return; return;
} }
@ -422,11 +425,7 @@ namespace SCP.SupplierData
} }
} }
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) if (_VendBatch == "55" && (_entity.DockCode == "YC" || _entity.DockCode == "WT") && QtyAll > 0)
{ {
Alert.Show("供应商批次不能为空"); Alert.Show("供应商批次不能为空");
@ -437,13 +436,14 @@ namespace SCP.SupplierData
Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单"); Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单");
return; 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) { Alert.Show(string.Join("<br>", message));
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "只能超发一次哦"));
return; return;
} }
}
_entity.ShippedQty = _entity.ShippedQty + QtyAll; _entity.ShippedQty = _entity.ShippedQty + QtyAll;
} }

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

@ -362,25 +362,35 @@ 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") if (_entity.CreateTime.ToString("MM") == "05" && _entity.CreateTime.Year.ToString() == "2021")
{ {
Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单"); Alert.Show("五月份的订单不能发货,如订单不够请联系对应计划员下新订单");
return; return;
} }
if ((_entity.AskQty - _entity.ShippedQty - _entity.ReduceQty).Value <= 0) //if (QtyAll > _entity.AskQty - _entity.ShippedQty - _entity.ReduceQty && (_entity.DockCode == "WS" || _entity.DockCode == "WG"))
{ //{
if (QtyAll > 0) // 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)
{ {
PageContext.RegisterStartupScript(Alert.GetShowInTopReference(_entity.PartCode + "只能超发一次哦")); Alert.Show(string.Join("<br>", message));
return; return;
} }
}
_entity.ShippedQty = _entity.ShippedQty + QtyAll; _entity.ShippedQty = _entity.ShippedQty + QtyAll;
} }

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

@ -46,14 +46,14 @@
<Items> <Items>
<f:Form runat="server" > <f:Form runat="server" >
<Rows> <Rows>
<f:FormRow runat="server" ID="FormRow_1"> <%--<f:FormRow runat="server" ID="FormRow_1">
<Items> <Items>
<f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="合同月" EmptyText="请选择日期" ID="DP_HTMONTHDate" /> <f:DatePicker runat="server" Required ="true" DateFormatString="yyyy-MM-dd" Label="合同月" EmptyText="请选择日期" ID="DP_HTMONTHDate" />
</Items> </Items>
</f:FormRow> </f:FormRow>--%>
<f:FormRow runat="server" ID="FormRow_2"> <f:FormRow runat="server" ID="FormRow_2">
<Items> <Items>
<f:TextBox runat = "server" Label = "订单编号" EmptyText = "" ID = "TXT_BillNo" /> <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); _dt = ExcelHelper.GetDataTableOfXlsx(_stream);
} }
if (string.IsNullOrEmpty(DP_HTMONTHDate.SelectedDate.ToString())) //if (string.IsNullOrEmpty(DP_HTMONTHDate.SelectedDate.ToString()))
{ //{
Alert.Show("请选择合同月再点击导入!"); // Alert.Show("请选择合同月再点击导入!");
return; // return;
} //}
DateTime month = DateTime.Parse(DP_HTMONTHDate.SelectedDate.ToString()); DateTime month = DateTime.Now.AddMonths(1);
var time = month.ToString("yyyyMM"); var time = month.ToString("yyyyMM");
var list = ConvertHelper.ToList<SCP_MAXPO_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); var list = ConvertHelper.ToList<SCP_MAXPO_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList();
List<string> poerr = new List<string>(); List<string> poerr = new List<string>();
@ -309,7 +309,7 @@ namespace SCP.Views.富维冲压件
_dt = ExcelHelper.GetDataTableOfXlsx(_stream); _dt = ExcelHelper.GetDataTableOfXlsx(_stream);
} }
DateTime month = DateTime.Parse(DP_HTMONTHDate.SelectedDate.ToString()); DateTime month = DateTime.Now.AddMonths(1);
var time = month.ToString("yyyyMM"); var time = month.ToString("yyyyMM");
var list = ConvertHelper.ToList<SCP_MAXPO_EXPORT>(ExcelHelper.RemoveEmpty(_dt)).ToList(); 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); 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> /// </remarks>
protected global::FineUI.GroupPanel gp1; 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> /// <summary>
/// FormRow_2 控件。 /// FormRow_2 控件。
/// </summary> /// </summary>

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

@ -1,4 +1,4 @@
<%@ 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> <!DOCTYPE html>
@ -11,24 +11,23 @@
<body> <body>
<form id="form1" runat="server"> <form id="form1" runat="server">
<f:PageManager runat="server" AutoSizePanelID="Panel1" /> <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> <Toolbars>
<f:Toolbar ID="Toolbar2" runat="server"> <f:Toolbar ID="Toolbar2" runat="server">
<Items> <Items>
<f:Button ID="Btn_Save" runat="server" EnablePostBack="True" Text="保存" Icon="SystemSave" OnClick="BTN_SAVE_Click" Hidden="true"> <%-- <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>
<f:Button ID="Button1" runat="server" EnablePostBack="True" Text="作废大订单明细" Icon="CssDelete" OnClick="btnCancel_Click" OnClientClick="if(!confirm('是否要将选中明细'))return false;" Hidden="true"> <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>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
<Items> <Items>
<f:Grid ID = "Grid_V_TB_PO_SUBDETAIL" Title = "大订单明细" BoxFlex="1" EnableCollapse = "true" ShowBorder = "true" ShowHeader = "true" <f:Grid ID="Grid_V_TB_PO_SUBDETAIL" Title="大订单明细" BoxFlex="1" ShowBorder="True" ShowHeader="True" AllowCellEditing="True" ClicksToEdit="1"
runat ="server" EnableCheckBoxSelect = "true" PageSize="1000" runat="server" PageSize="1000" SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc" AutoScroll="True"
DataKeyNames = "UID,PoBillNum,PartCode,Qty,SubQty" DataKeyNames="UID,PoBillNum,PartCode,Qty,SubQty,ReductionQty,ReductionQtyOne,ReductionQtyTwo,ReductionQtyThree,ReductionQtyFour,ReductionQtyFive" >
SortField="UID" IsDatabasePaging="True" AllowPaging="True" SortDirection="Desc"
AutoScroll="true"
>
<Columns> <Columns>
<f:BoundField Width="100px" DataField="PartCode" DataFormatString="{0}" HeaderText="原料物料号" SortField="PartCode" /> <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="PartNumber" DataFormatString="{0}" HeaderText="零件号" SortField="PartNumber" />
@ -39,17 +38,27 @@
<f:BoundField Width="100px" DataField="TechStandard" DataFormatString="{0}" HeaderText="技术标准" SortField="TechStandard" /> <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="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="OrderQtykg" DataFormatString="{0}" HeaderText="订货量(千克)" SortField="OrderQtykg" />
<f:BoundField Width="100px" DataField="SurplusQty" DataFormatString="{0}" HeaderText="剩余订货量(千克)" SortField="SurplusQty" /> <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="OrderNumber" DataFormatString="{0}" HeaderText="订货件数" SortField="OrderNumber" />
<f:BoundField Width="100px" DataField="MinordQty" DataFormatString="{0}" HeaderText="起订量" SortField="MinordQty" /> <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="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="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="forecasttwo" DataFormatString="{0}" HeaderText="" SortField="forecasttwo" ColumnID="forecasttwo" />
@ -64,7 +73,7 @@
</f:ToolbarSeparator> </f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:"> <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText> </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"> runat="server">
<f:ListItem Text="200" Value="200" /> <f:ListItem Text="200" Value="200" />
<f:ListItem Text="500" Value="500" /> <f:ListItem Text="500" Value="500" />
@ -73,13 +82,6 @@
</f:Grid> </f:Grid>
</Items> </Items>
</f:Panel> </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_ModType"></f:HiddenField>
<f:HiddenField runat="server" ID="TXT_State"></f:HiddenField> <f:HiddenField runat="server" ID="TXT_State"></f:HiddenField>
</form> </form>

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

@ -20,7 +20,7 @@ namespace SCP.Views.富维冲压件
{ {
if (CurrentUser.RoleList.Contains("期货合同")) if (CurrentUser.RoleList.Contains("期货合同"))
{ {
Btn_Save.Hidden = false; //Btn_Save.Hidden = false;
Button1.Hidden = false; Button1.Hidden = false;
} }
Bind(); Bind();
@ -34,7 +34,8 @@ namespace SCP.Views.富维冲压件
var _poBillNum = Request["PoBillNum"]; var _poBillNum = Request["PoBillNum"];
MAXPO.PoBillNum = _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) if (rs.State == ReturnStatus.Succeed)
{ {
var list = SortAndPage<V_TB_MAXPO_DETAIL>(rs.Result, Grid_V_TB_PO_SUBDETAIL); var list = SortAndPage<V_TB_MAXPO_DETAIL>(rs.Result, Grid_V_TB_PO_SUBDETAIL);
@ -85,7 +86,6 @@ namespace SCP.Views.富维冲压件
} }
} }
Grid_V_TB_PO_SUBDETAIL.DataSource = _ls; Grid_V_TB_PO_SUBDETAIL.DataSource = _ls;
Grid_V_TB_PO_SUBDETAIL.DataBind(); Grid_V_TB_PO_SUBDETAIL.DataBind();
@ -131,7 +131,6 @@ namespace SCP.Views.富维冲压件
var ret = SCP_PO_CONTROLLER.Save_TB_MAXPO_DETAIL_QTY(_list); var ret = SCP_PO_CONTROLLER.Save_TB_MAXPO_DETAIL_QTY(_list);
if (ret.State == ReturnStatus.Succeed) if (ret.State == ReturnStatus.Succeed)
{ {
var list = ret.Result;
Alert.Show("保存成功!"); Alert.Show("保存成功!");
Bind(); 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) protected void ddlGridPageSize_SelectedIndexChanged(object sender, EventArgs e)
{ {
Grid_V_TB_PO_SUBDETAIL.PageSize = Convert.ToInt32(ddlGridPageSize.SelectedValue); 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; protected global::FineUI.Toolbar Toolbar2;
/// <summary> /// <summary>
/// Btn_Save 控件。 /// Btn_SaveReductionQty 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUI.Button Btn_Save; protected global::FineUI.Button Btn_SaveReductionQty;
/// <summary> /// <summary>
/// Button1 控件。 /// Button1 控件。
@ -69,13 +69,13 @@ namespace SCP.Views.富维冲压件
protected global::FineUI.Grid Grid_V_TB_PO_SUBDETAIL; protected global::FineUI.Grid Grid_V_TB_PO_SUBDETAIL;
/// <summary> /// <summary>
/// NB_PublishNum 控件。 /// NumberBox2 控件。
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// 自动生成的字段。 /// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox NB_PublishNum; protected global::FineUI.NumberBox NumberBox2;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
@ -104,24 +104,6 @@ namespace SCP.Views.富维冲压件
/// </remarks> /// </remarks>
protected global::FineUI.DropDownList ddlGridPageSize; 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> /// <summary>
/// TXT_ModType 控件。 /// TXT_ModType 控件。
/// </summary> /// </summary>

18
UniApiGroup/Controller/OdbcApiQadController.cs

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

Loading…
Cancel
Save